Last Man Standing – Updated


I’ve uploaded a new version of the source and binaries to Codeplex if you’re interested.

The new version includes

  • Improved the dungeon generation time
  • Increased the field of view and torch radius
  • Added more AI players
  • Removed current threats window
  • Increased size of competitors window
  • Changed game to use full screen and adjust to current resolution
  • Removed field of view checks from AI threat detection

I invested about 4 hours to implement the above changes and I feel the game plays a lot better now. Don’t get too excited though, it is and always will be, a simple game. It’s purpose was to try out some ideas and learn some lessons. In the end, I feel that I got what I needed from the exercise.

There were some elements that I could not easily implement and I will be focusing on these for my next project.

The game started to run noticeably slower when I added a few more actors. I will need to do some profiling to track down the problem, but I expect it to be the A* path finding. I will be doing some investigation on alternative techniques which are hopefully not so computationally intensive.

Generally the codebase needs a bit of refactoring and I hope to go through a few revisions before the next project. I will look at encapsulating game logic, engine logic and UI logic. I will also add all the unit tests for those that are interested.

I wanted to add the ability for actors to be aware of sounds e.g. doors opening, combat, etc. but could not see a simple way to include it in the current design. To implement the feature shouldn’t be hard and I propose to make use of a technique similar to sonar.

Each time an actor completes an action the engine would send out a ping to simulate the sound. The strength of the ping, loudness and fall-off of volume would be determined by the action, racial characteristics of the actor, distance and terrain. My first implementation will probably only cater for distance and terrain but that should be enough to provide a good indication of the impact on game play. I probably won’t even use a ping (modified shadowcasting or raytracing) but would just evaluate the direct line between the actor and each of the other actors (why look for them when the engine knows where they are).

Advertisements

5 thoughts on “Last Man Standing – Updated

  1. I created a class to replace AStarPathFinding with a wrapper that uses TCOD’s internal pathfinding function. There is a noticeable speed improvement when replacing the HunterBrain pathFinder. I’ve uploaded a copy to http://rjohnson.uninformed.org/TcodPathFinding.cs

    Both of these functions are expensive and should probably only be used when you know you need a precise path to a visible or known target. I’m working on an alternate to HunterBrain that navigates by what it can see: player, other monsters, door/room exit, etc). This reduces the path finding cost substantially since distance will never be further than current line of sight.

    Thank you for your excellent code, I plan to use your class structure as a starting point for a full game.

  2. Hey man I downloaded the binaries and the source and neither of them will work, i keep getting

    System.BadImageFormatException and it mentions libtcod-net.dll

    • I have changed the way TCOD initializes itself.

      Please download the latest source or binary from the codeplex site.

      It should work now…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s