As usual after finishing a game jam there's loads of stuff that I learned that can help me to make better games. Going back to a work in progress now feels really difficult because so much of the existing code looks ugly and inefficient.
I think I'm going to strip back a lot of the work I've done on V1936 so far and rework it.
Here's the new structure I want to implement:
Before, fog of war, level generation and agent management were all direct elements of the main loop. What this meant was that if I wanted to restart the game or load a new level it was best to reboot the main loop (restart the game), but this has quite high overheads all of its own.
During the making of "The Hole" I implemented a level manager, a container for the level and all agents etc... contained within it. I could pause the level, or reload it or do anything with it, without affecting the main loop. This made it great for adding cutscenes, or menus such as the inventory. It also mad transitioning from one area (level) to another almost instant. It also made transitions very clean. The player was destroyed and remade along with the level so no hangovers fro previous areas.
Another area I want to improve is agent states. In the past I've been putting a lot of the agent's behavior code in the states, but I've found it better just to put calls to agent behavior which is then stored in the agent. Then different states can be used with different agents, a single move state which calls move() on the agent, rather than a different move state being written for every agent type.
I think I'm going to strip back a lot of the work I've done on V1936 so far and rework it.
Here's the new structure I want to implement:
Before, fog of war, level generation and agent management were all direct elements of the main loop. What this meant was that if I wanted to restart the game or load a new level it was best to reboot the main loop (restart the game), but this has quite high overheads all of its own.
During the making of "The Hole" I implemented a level manager, a container for the level and all agents etc... contained within it. I could pause the level, or reload it or do anything with it, without affecting the main loop. This made it great for adding cutscenes, or menus such as the inventory. It also mad transitioning from one area (level) to another almost instant. It also made transitions very clean. The player was destroyed and remade along with the level so no hangovers fro previous areas.
Another area I want to improve is agent states. In the past I've been putting a lot of the agent's behavior code in the states, but I've found it better just to put calls to agent behavior which is then stored in the agent. Then different states can be used with different agents, a single move state which calls move() on the agent, rather than a different move state being written for every agent type.
Comments
Post a Comment