This post will contain gamedev tips, some concerning Godot, after my depressing rant. I'll pound the area around the rant with some octothorpes.
### ### ### ###
Shortly after the corona virus restrictions went into place, my laptop died. First the HD, after I replaced that the wireless and memory failed. In the end my HP laptop fully failed and I lost most of my files. Thankfully, I had backed up the most important files.
I pieced together a desktop running windows 7 for now. I don't have the money to get internet access where I live, and last I checked I don't get service here anyway. I live in a dead zone and have to choose specific phones and services to even get a small signal. After using my phone at a WI-fi hot spot in town to gather drivers and service packs, I was able to run the godot engine and play some games. During some gameplay on my cousin's Xbone, we discovered his phone gets signal in my room, in a very specific area. I'm now connected to a hot spot that isn't much better than dial up.
I'm going to gather my files and try working on games again soon, but with my more limited resources, I'll have some difficulties uploading updates until I can either get better internet or a laptop. It doesn't help that my focus seems to cause delayed chest pains. Since I have no idea how to avoid that, I must fight my own coping methods, ignore the pain, and push myself. While not the best idea, I haven't many other options.
Aggression is great for forward momentum. More dangerous and stimulating than coffee.
### ### ### ###
Since I'm slightly depressed I guess, not feeling myself, I'm going to take a break from
Little One and fiddle around with Godot some. I'm interested in procedurally generated maps, mostly 2D tile maps. There are great
tutorials on using noise to make these maps, mostly.
I found using the help search in the script section of the editor rather useful. Mainly I just generated a flat map that sets either dirt or stone based on the height. This is slightly randomized and doesn't use noise, but noise could be used. I've got a function that makes noise for the caves and removes tiles based on the value when I get the 2d noise of an area. It has seriously reduced the amount of code I need and the map looks better.
For ores I'll be using different noise, choosing an area, and setting ores by height. Overlapping the ore heights will make things look more natural. I'll mostly be replacing solid blocks in chosen areas, with numerous areas randomly sampled or sampled through another method. Once I have the noise modified the way I want, I'll use different noise to shape the hills.
The map will be in three layers; land, fluids, and backgrounds. Fluids will be randomly placed and filled, but will also rely on the land map for placement and flow. Trees and plants might be on the BG area. I'm not concerned with good-looking details, and much of the gameplay will be a mix of minecraft (water,trees), starbound (mining, tools) and terraria (combat, weapons) with some mechanics from interesting mods and myself thrown in (tool modifiers, bombs).
For falling blocks (sand, gravel) I'll most likely remove the tile and add a kinematic object that becomes a tile again once it stops falling. Liquids will be handled as closely to minecraft as possible. Block placing will remove liquids and infinite pools will be planned. Mostly this is because I'm lazy and I don't think godot has fluid dynamics.
There are ideas and plans for this project, but for now it's just me tinkering. Now for some tips.
The noise seed can either be randomized, or you can use a specific world seed.
Write different noise functions to generate noise for different parts of map generation.
Creating functions to generate noise based on parameters will allow easy modification.
Tile Maps can use kinematic physics, or the parent node's physics. This should allow an area to be used for the liquids.
A tile map's tile set can be changed or modified during game play.
Swap a tile and nobody cares, swap a sprite in the tile set and the whole map updates.
"invx128y32" Use similar keys in a dictionary of inventories to keep track of chests at almost any position. I just hope some player doesn't try filling the world with chests. X & Y should correspond with the chest's position.
If the map is modified by the player (mining, bombs) write a function to check surrounding tiles for any actions they need to take (flowing, falling).
Liquids should try flowing down first, then sideways. I'll most likely place iquid tiles below and flow tiles to the side
Create dictionaries and lookup tables to keep track of tiles and what can affect them.
And finally:
Map generation can take some time with all the loops and actions. Rendering the map as it is generated can cause even more lag and freezes.
Set the tile map's visibility to false before generating the map, then back to true after. The map generates far faster with no visuals.