The game I'm trying to make has some unusual functionalities and, with it, some unusual algorithms. I'm not really a programmer, (I'm a physicist, if anyone's curious) so I hope the developers in this forum could shed some light in some problems I'm facing. Also, writing about it helps me think. I'll explain in more detail what I'm doing, if anyone's willing to read it up and give some feedback I'd appreciate it
Feature #1: The game takes place in a randomly generated city. I've studied a few of the existent algorithms and decided that most of them are not suited for games, as they're too slow even for something to be generated only once at the start. So I've come up with my own, very simple, system. It's basically a grid of premade blocks, also with random elements in it. That's good enough for what I have in mind.
Streaming this big city as the player moves is not the big problem. I already have some ideas in mind. The difficulty is making it work with the next feature:
Feature #2: I need A LOT of NPCs. After several tests with the usual AI in games, I realized that even with the dumbest path finding algorithms the computational cost increases dramatically with the number of NPCs. So I decided to use a different algorithm (you can read about it here).
The algorithm can be summarized as follows: Take the whole walkable area and make it a 2d discrete grid. For simplicity, let's consider that every NPC has the same goal, a single tile in this grid. Anyway, the objective of the algorithm is to construct a vector field that defines for every point in space a vector pointing to the direction that minimizes time, distance and whatever we want to the goal tile. This way every NPC, wherever it is on the grid, knows where to move next to get to his goal.
All right! I have this implemented already. It does what it promises, the cost increases almost nothing with the number of NPCs, allowing me to get hundreds of npcs moving, creating lines and all those patterns. However, the cost increases dramatically with the area, obviously! So I have to keep it small.
Phew! you're still reading? thanks! The problem now:
This navigational grid also needs to be streamed. From my current 'guessings', the ideal size for the city blocks are a bit bigger than the maximum size I can get for the navigational grid. I'm already planning on making the whole game with a lot of fog, to facilitate these things lol. But still, I'm staggered with the problem of how to stream the city blocks AND the navigational grid. Maybe I should also break the blocks into smaller pieces, each with its own definition of navigation tiles..
Any ideas? suggestions? About anything related, really. If anyone's working with streamed big worlds, crowds, random content etc, care to share some thoughts on the subject?






