Blog 2 - GUI and Item Placement
Not too much in terms of visible gameplay has been accomplished (a lot of backend stuff and still doing level design ).
Anyway, the game is starting to take shape in terms of setting up for more gameplay. The level design is important to me because the patrol routes of enemies and such need to be calculated in order to provide sufficient coverage so that it isn't too easy to grab items.
Respawning:
Items respawn using a region based system. Different regions will respawn after a certain amount of time, as demonstrated in the video. It's kind of cool seeing the items react to the physics as well as they respawn, but you won't see them actually respawn because it's partially distance based. This means that if you are too close to a region, nothing in that region will respawn. Also, items can't double spawn. I want to also randomize what gets spawned (so unlike in the video, the pickaxe might be a different tool). This is trivial, but requires a bunch of planning with item codes and such. I'll probably make this sort of level based.
Enemy patrols:
The way I implemented this was by creating child pivots attached to enemy meshes. Basically, these pivot values are stored in a table on start up and then iterated through so that the enemies can walk in a loop. If they break their loop to follow the player or something, they will return to it once the player is out of range.
GUI:
The last few days have been mostly doing this. I need a GUI to work for crafting. Right now, text displays over items so I know what they are, but these will likely be replaced by pictures. Also, you can drop items, but they won't be in the game world anymore (I think I'll change this, at least for tools).
Inventory:
So I unfortunately just missed Aggror's wonderful series on this kind of stuff, but I sort of created my own implementation, for anyone who is interested. Basically I have 3 Lua tables: one for an unorganized pile of items, one for grouped items (basically item and quantity), and the last one for item names (it maps item codes to names). The reason for the last table is to prevent issues with naming mistakes, such as if I make an item called "bricks" and another one names "brick." Instead, there is a number string that is associated with it.
Interactive environment:
Now you can chop trees to get wood, although this isn't very exciting. I think I need to redo this system because it's pretty poorly implemented. This will probably be one of the very few materials you can get from the wild.
- 5
7 Comments
Recommended Comments