Blog 11: Tile Generation & UI

10/10/2023

Welcome back to the Integration Hell development blog.

It has come to my attention that it has been about five months since I have made an update to this website. I have been busy and forgot to make development blogs for Integration Hell. I probably will not make updates weekly, since I want to have something to show before I make an update. With that out of the way let's get to what has been developed.

Hotbar - I do not remember if I had this created in the last blog, but the player now has a hotbar for the items in their inventory. The number of items representable on the hotbar is from 1 to 10, with the UI scaling accordingly. Using the scroll wheel changes which item is currently selected. Pictured below is the player hotbar with conveyer belts, tiles, and grass. The black square outlines which item is currently selected.

Place mode - When the player wants to place/remove tiles they need to be in place mode. Pressing the 'E' key on the keyboard will put the player into place mode. Pictured to the right of the hotbar is the place mode square. This red, translucent square will appear over the current tile the player's mouse is above. Left clicking will place the currently selected item into that tile. Right clicking will remove that tile if there is an open inventory space in the player's inventory.

Ore generation - Integration Hell is now capable of procedurally generating ores for gameplay. The way the game does this is using a perlin noise map. Ore will be generated on a tile if the perlin noise value on a given tile is above the threshold for that ore (for example rock has a threshold value of 0.5). If a tile succeeds in having ore, the quantity of ore available is determined by the function ((perlin_value - threshold)/(1 - threshold)) * max_ore_quantity. The order of the ores generating determines which one will be on that tile. More common ores are capable of overwriting a more rare ore. To make the ores appear in different areas, each ore added to the game will have some offset added to the world seed to make each ore have a unique noise map. Below on the left is a graphical representation of a noise map the game can generate. Each pixel is one tile, giving this image a map size of 1920 x 1080 tiles. The picutre on the right is one of these perlin noise maps represented in game. The state of the tile is determined by the amount of ore available on that tile.ย 

That is all I have for this blog. Thanks for reading and I hope to see you in the next blog!

The Checklist:

Tasks:

๐„‚ Give the game an icon

๐„‚ Program pollution/waste

๐„‚ Add item system

๐„‚ define tile behaviors