Mar 16, 2014

Road map

Fallen has huge world. That's it.
When I was choosing the platform, I have mobile and PC on my table.
Mobile is cool! It is potentially the strongest 'marketing' decision, but it has it's own limitations.
Big computer, from other hand, has 'gift of power'. The simplest notebook has overwhelming resources for the roguelike game.
Last year I weight all pro and contra and take the side of big computers.
From this point, I found that it is rather silly to use PC as platform and fight for every kilobyte, because it is 'great tradition of roguelike development'.
Yeah, yeah. One of that, I hate so ugly.
Of course, we can battle the level design and make game, that wouldn't take more that couple of megabytes of the memory and be so proud of it.
Who cares, lol.
Players want to play game. Run it on their computer and have fun. Nobody cares, how many gigabytes of operative memory would stay empty and hollowed, while he or she plays the game.
That's why I decided to use PC and utilize it's vast resources. Game eats up about one gigabyte of the operative memory. It simply keeps everything in memory an has huge maps. All world are in play, every second.
It gives great possibilities, I'll wrote about them, but has its drawbacks.
One of them – pathfinding.
If one creature tries to find path from point a to point b, when the range between them is about 200 tiles, it is no problem.
It would be done on fly.
But, if the group of 100 creatures wants to take a million tiles long stroll?
Heh. Easy. I shouldn't reinvent the bicycle. It has been done thousands of times before Fallen.
First of all.
They move as unit. It means that unit does all long-distance checks, when single creature looks for the path to units position or its position in formation.
Part two, until player stays close, they don't literally move using standard algorithm.
Unit just pull out all its creatures like carrot and replant somewhere else in a bulk.

And the last, but not the least – the road map.
When map has been generated, the game creates the road map – highly abstract copy of actual map at 20x1 or 30x1 scale. Tiles of this map aren't complicate. They are just true or false, can go or not.
Unit looks for its goal on this map and select closest tiles block, where it would tell it's creatures to go. It isn't a strict order. Creatures is going to follow it, if they don't have anything important at their hands, like fighting. It means, that guards patrol will help you to fight this monsters, but wouldn't stay there forever and will go away. You can follow them for your safety, but it is your choice.
Heh. That's the story. This routines are useless and burdening if you have small maps, of course.
Road map in Fallen, you ask?
Finished and correct.
Now I have to test pathfinding and let creatures' groups to move all over the world of Fallen!

No comments:

Post a Comment