Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Fix The Crypt

Sign in to follow this  


I started on a crypt level yesterday. The Crypt will be one of the few levels that will feature mostly randomized combat and a few items. Since Ancient Galaxy is an RPG, there are times when you want to train up your character, or try out a new weapon or ability, so it's nice to have a place you can go and get guaranteed combat, so we decided to have 2-3 of these levels in the game.

While play-testing the crypt level, I noticed that the small skull that I like to kick around the level was sometimes not responding to my character hitting it all the time, and quickly realized it was failing when a saved game was loaded.

It took a couple of hours to find the obvious bug, which was one of the boolean fields being saved in the wrong sequence. If it didn't double the size of my files, I would be tempted to put a mode in the file saving system where each item saved would have the current file offset saved as well. That way the loading code could assert that the offset was as expected. Come to think of it, I bet that field would compress very well, perhaps I will put that in after all.

Today I put in dynamic costs into the navigation system. Each link between waypoints has a cost of traversal stored with it.
This cost is the distance between the nodes, plus penalties for being near the border of the waypoint graph, and thus fewer neighbors.

With the debug visualization on, I could verify that my character was increasing the cost near where he was. Each object larger than a certain size would give off an increased cost to nearby waypoints. Unfortunately, this had the result of hanging the AI navigation.

Since the AI only searches up to a couple dozen nodes per tick, it calls the a-star routine over and over until it finds a path, gives up, or changes it mind about what to do. Because I was changing the cost function by moving the enemies themselves,
they were getting stuck in an endless loop. So, I took out the dynamic updates for now.

I'm now questioning the need for dynamic cost updates, rather, I'm considering just handling the case of static objects, or dynamic objects that aren't moving lately, that effectively cut off a movement path. A closed door would be one example, but a person who's not moving would be another. When this happens, I can 'cut' some of the neighbor links, perhaps with a temporary array to make undos easy, and then be sure to invalidate any enemy paths when cuts are made or unmade.

Here are some shots of the crypt :

Sign in to follow this  


Recommended Comments

Looks nice, especially with the bump mapping. The only thing I could suggest is making the walls lower. They're currently making the rooms look way too huge, and thus empty because of the relative lack of content in the rooms.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!