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

Waypoints

Sign in to follow this  
Stephen R

133 views

I just got started on the waypoints today because I basically played games all weekend. There won't be any real problem integrating it into the editor, most of the possible problems I fixed while doing the tiles part of it. I know what the waypoints will be used for in the game but what I'm trying to figure out is how much flexibility to give them. Once I decide on exactly what they'll be able to do I'll figure out how I'm going to represent them in memory and I can get em coded. I'll figure that stuff out tomorrow. Looking ahead this is the most complicated part of the editor, the rest is just getting the GUI to operate nicely.

I've been using a different naming convention while making this editor. All the code of the editor is completely independant of anything else so I'm free to experement. I'm not quite happy with my current conventions, mostly because of my use of m_ and g_. I usually use CClassName so I tried dropping the C prefix. I think I'll keep the C prefix but I might make it lowercase. I started defining variables likeThis (instead of m_LikeThis) and functions LikeThis as normal. I quite like the way it looks and is still as clear as my previous ones. I'll have to go through the engine changing the names, when I get around to updating it, but since I'm going to be restructuring most of it it shouldn't be that big of a deal.

I also have another update for my engine after this game. I plan on writing a .NET library to encapsulate loading, creating and saving the various file formats I use with the engine. I had to write a sprite loader for this editor so I may as well do it all right once rather than making each of these classes as I need them for various apps.
Sign in to follow this  


2 Comments


Recommended Comments

This may be a little bit random, but I'd suggest you have your editor calculate bottleneck "nodes" on the maps (ie, run you're pathfinding algorithm between random points a bunch of times, and keep track of which squares are used a lot).

That way, you can speed up your pathfinding by storing pre-set routes between nodes on the map (since the nodes are set coordinates) so that when running your pathfinding algorithm, you only need to get from

LOCATION -> NODE -precalculated-> NODE -> DESTINATION

Which will speed up things. Just make sure NOT to use this if the solution doesn't need to go through a node. You can divide up the map into regions to do that.

Yeah, that was random of me. Sorry.

Share this comment


Link to comment
Hey, random is fun [wink].

Anyway, I would use a system like what you are talking about if the game were more complicated than it is. The path finding and such is quite simple, really only allowing entities to follow the paths between nodes. My waypoints are little more than well waypoints that the level designer will place in the world to allow easy control over the NPCs movement patterns.

Thanks for the tip though.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!