Not an interesting title, sure. But all this talk about procedural generation has gotten me back into Lixim, where I face a problem that's been barring me for ages. And only now have I come up with a solution, but I want to see what everyone else has to say first.
Look at each of the bolded problems and think about it for a moment. I have a potential solution for each one. Check the validity of the solution and maybe offer one of your own. I'd just love to see these bars removed or at least remedied.Huge Living WorldLixim's world lives and breathes while you aren't around. It evolves around you as time passes, so climates can change, for example. As such, the world needs to be simulated all at once. But this has the potential to cause major slowdown.Solution?The world is divided into environments, like biomes in Minecraft. I could separate these into similar "chunks", unload the chunk and deactivate it, use a timer to keep track of how long the player has been away, and simulate plant growth and animal movement when the chunk is reloaded.AI Moving About Non-Existing ChunksSo let's say I choose to simulate like this. The AI still gets fucked up once it walks into an unloaded chunk, and simulating it is no small matter. It's hard enough to do it when it's on-screen, let alone when it's in a void. While I could address enemy and animal AI by simply changing its position based on the time the chunk was unloaded, Lixie AI isn't so simple. They dynamically make choices, their bodies deteriorate, they get hungry, they drown, they eat.Solution?This is a tricky one that I still haven't put my thumb on yet, and this is where I need the most help. I've thought about having a system that periodically (once per ten seconds or so) updates the Lixie's position and their stats. The update occurs more often the closer the player is to the unloaded chunk. That's great, but this doesn't accommodate for the environment.Deactivated AI Accommodating for the EnvironmentWhen a Lixie is in an unloaded chunk, its position might be updated once in a while to say it might have moved to another chunk, potentially one that the player's in and is thus loaded. After that, it'd update normally. Simulating AI is hard enough as it is, and environments are dangerous whether you're there or not.Solution?I've considered doing temporary chunk updates that simulate any chunk a Lixie is in for a brief moment. Unfriendly creatures and environmental hazards would be checked against its position, and would update themselves as well, resetting the chunk unload timer.I know this has been kind of a rant, but I need to write out my ideas before they make sense to even me. I know half of you probably won't read this but to those of you who do, I'd like some feedback on how you'd handle AI in a large world, all while avoiding the otherwise inevitable framerate drops.How do the professionals do this anyway? If any of you have played the Creatures franchise, you'll know exactly what I'm talking about. But those games were done back in the 90s, and they were so terribly complex for their time.By the way, separate rooms per biome isn't an option, as you can't simulate objects outside the current room. I've considered replacing that with a set of variables but that simply would be too complex.See my problem yet?tl;dr narwhal
omg narwhal
If the reason you have unloaded chunks is to save on update time then you could do this: When an AI walks into and Unloaded chunk, load the chunk and create a mock version of the chunk then unload the chunk. Then use the mock chunk as a reference for the AI because the mock chunk doesn't need to be updated regularly. Then every now and again reload the chunk so you can update the mock chunk.
Also, Creatures FTW!Is this a top-down game or platformer?
This is a platformer.
Hmn, let me sleep on this.