March 5th: The Map Is Not The Terrain

Hmm. I’ve been tackling basically every problem I come up against here by making the generated nav map nicer and more streamlined, and at this point it’s probably about as streamlined as it’s going to get. The nav nodes now check whether the nodes they’re close to belong to a platform, and if so they only track the closest node on that platform. For their own platform, they only remember the nodes immediately to their right and left. At this point, all of the nodes each node sees should be relevant, with every relevant node being seen.

There’s a couple of problems left, though. First, while I think navigation should be pretty straightforward now that I’ve cut down the number of nodes, I don’t KNOW, and that sort of thing has caught me flat footed before. I’ll be testing that out tomorrow. Secondly, and more importantly, the calculations necessary to build the nav map are SLOW. On a moderately large and complex level, the calculations seem to take a solid 5 seconds of number crunching on my machine. This is because it needs to find each node, find all the nodes close to those nodes (within 50 tiles, Manhattan distance), and find which of those nodes belong to the same platform as others. It doesn’t take much to make this calculation balloon out of control.

So, either I need to figure out some serious optimizations, at least enough to get it down to under a half second, or I need to save the level nav map data alongside the other level data, the tile map and the detail list. Dunno! I’ll decide on that one a bit later, probably, once I get the pathfinding itself working.

Advertisements

About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

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