Jump to content
  • entries
    2
  • comments
    9
  • views
    5,778

Blog 2 - GUI and Item Placement


nick.ace

2,883 views

 Share

 

Not too much in terms of visible gameplay has been accomplished (a lot of backend stuff and still doing level design :D).

 

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.

  • Upvote 5
 Share

7 Comments


Recommended Comments

Some csg painted with the invisible mat and made the parent to the brick model would give you better hit detection so it's not model perfect. I noticed you had to struggle a little to pick the brick model perfectly in order to bring up the hand. Same probably everything in your scene (noticed axe had same issue).

  • Upvote 1
Link to comment

@Thirsty Panther: Thanks! I still need to edit the animations more, there's a DOF issue with the animation as is

 

@Rick: Yep, thats totally true. It was embarrassing when recording because it's hard to pick them up, but an invisible object would be a good idea.

Link to comment

You could also add a radius to the pick, and you would get more of a margin of error. Or add a cross hair on the screen, that makes it a lot easier to tell where the center is.

  • Upvote 1
Link to comment

I didn't even know that a radius pick was a thing! I should probably be looking at the documentation a little more, as I always am surprised by cool features I haven't seen or thought of before that are already in the engine. I think I might go Rick's route though since it should also increase speed a little and should give me more control over how the object is picked.

Link to comment

You could add some height bobbing movement later as now the characters seems more driving a car.

The level looks very good, keep it up.

  • Upvote 1
Link to comment

Give us a option to turn head bobbing off. I don't see/notice head bobbing in real life and in games it makes me nauseous.

  • Upvote 2
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...