The Power Grid Game
- 8 Devlogs
- 15 Total hours
I'm building a game about managing a power grid where you balance supply and demand in real time, keep the grid stable and buy new power plants to expand as demand grows.
I'm building a game about managing a power grid where you balance supply and demand in real time, keep the grid stable and buy new power plants to expand as demand grows.
I think it’s ready to ship - I added a screen that triggers when your grid isn’t stable enough for a few seconds, so the game actually has an ending if you’re not paying attention.
As seen in the picture below, I added an upgrade system (visuals are still glitched sometimes), so you can take a power plant from 80 kW max to basically infinite if you want to. If you want to try the game out, check out the releases on GitHub!
As you can see in the picture, I finally added a title screen and made a super early version of the settings panel, where for now the only option is to change the fullscreen mode 🤣. I also added a simple spark as the game icon. The full release is on GitHub - feel free to check it out!
Today I worked on building a release for the game that you can try out.
If you want, you can check it out by visiting the releases page and downloading the latest .exe.
I had to embed the pictures directly into an array so that no installation is needed - just download and run. I also finally added support for saving and loading the game, so you don’t have to start all over again every time.
Now power plants like coal and nuclear have sliders to control energy output more precisely, though due to their high reaction time, it takes a while for them to adjust the power. The next thing I added was a money system that gives the player income based on power delivery and grid stability. While testing, I noticed I sometimes couldn’t buy a plant, and after digging into it, I found out that the shop button and the buy plant button could overlap, triggering both at once and causing a freeze.
I added a visualization for the current time (down left), where the sun (and moon at night) moves along the arc. This took a bit of trial and error to get working. On the other hand, the menu I added was much simpler, since it’s just a copy of the shop screen with different buttons 🤣🤣
I added bars to help visualize the charged capacity and the power produced, and added a graph that shows power demand and production in real time. I also fixed a bug where power production could only ramp up, not down - I was catching disabled plants early with an if statement, so the ramp code was never reached.
I’m working on a 2D Power Grid Game, coded in C with a graphical interface using raylib.
I spent the last day building the core mechanics, and simulation.c is already getting pretty crowded. My brain will probably explode if I keep adding more power mechanics to it.
One funny bug I ran into: when I set a battery to charge, it started drawing power that didn’t actually exist -free energy from nowhere. Pretty funny bug, less funny to debug, but could use it in real life probably.