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

Built from Ruins: Blog 1


nick.ace

2,061 views

 Share

So, I'm creating a blog to show how I'm approaching certain things (maybe this will be helpful to some people?).

 

 

Stealth:

 

This is a set of features that I wanted to go all out on, so that's what I'm doing right now.

 

Shadows: Someone asked about how to implement shadows, and Josh gave a simple answer (kind of made me feel dumb lol). Anyway, the implementation for my game works for directional lights (the sun) right now, but it should be easy to extend to other lights if I choose to. Anyway, the way I calculated whether a point is in a shadow is by performing a raycast to the a vector generated by the light's rotation and scaled so that there would virtually be no building tall enough to evade the raycast.

 

Crouch: This was pretty simple. The character controller needs to be changed using SetInput(), and the camera height needs to be changed while in crouch mode. That's it.

 

Cover (Bushes): This was simple as well. I just performed a distance calculation to check if the player is near the center of the bush.

 

Distractions (Rock): The AI doesn't actually "hear" the sound. Basically, each time the rock makes a sound, the rock the location of that sound is recorded and if it's close to enemy, the enemy will follow it.

 

Buildings:

 

I'm not sure how exactly I want to handle navigation due to building placement. I saw that there are recast commands accessible via C++, but I like to use Lua so hopefully these will be exposed through Lua in the future :D. But for now, these buildings have physics attached to them that scale as the building is constructed.

 

Sounds:

 

I sort of organized this like how a radio plays. When one ambient track finishes, another picks up. The way a randomly select the next track is by using the player's position data, but I found a way to change this in the future by using the system's milliseconds instead, but I don't know what to use!

 

Day/Night:

 

I wrote my own Day/Night script (I tried to use Shadmar's implementation, which is much better than mine, but I my weird lighting preferences made the colors of everything mess up). Anyway, it's simply a directional light that changes as time changes. Also, the ambient light changes as well so that the night becomes VERY dark! So, you must use your flashlight or find light!

  • Upvote 4
 Share

2 Comments


Recommended Comments

The building/farming animations/models look good.

I also like where you are going with the stealth.

A suggestion I have is you could make a threat level for your enemies. So instead of entering/leaving stealth automatically you instead increase/decrease your enemies threat level when you are in/not in a stealth area. Once their threat hits 0 they stop attacking. Once their threat hits a certain number they start attacking. I think something like that would make stealth really fun, especially if you had a detection meter to show when something is gaining/losing threat.

 

Looking forward to more updates!

  • Upvote 1
Link to comment

Thanks for the suggestions Hayden! I wasn't too sure how I wanted to approach this, whether it would be with some sort of indicator or if it would be automatic, but I guess either an audio or a visual indicator would be good to add since it would add a little more fairness. :)

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...