You are browsing as a guest. Sign up (or log in) to start making projects!

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.

Ship #1 Pending review

I made a game about controlling the power grid: buying new plants, upgrading them, and making the customers happy. If you don’t pay attention and you have too much or too little power, your grid could fail within seconds, so you should use plants like the pump or a battery to smooth the generation out. You start with basically nothing, and if your grid is stable and environmentally friendly, the customer number starts to grow. The thing I found most challenging was underestimating how complicated the simulation is: updating and calculating a real life power curve so more power is used in the morning and evening just as in real life, or plants like the battery that have an auto mode. All in all, I really like what I built here, and I hope you enjoy it as well ♥️.

  • 8 devlogs
  • 15h
Try project → See source code →
Open comments for this post

52m 16s logged

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.

0
1
76
Open comments for this post

1h 33m 38s logged

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!

0
1
60
Open comments for this post

1h 15m 20s logged

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.

0
1
99
Open comments for this post

1h 3m 35s logged

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.

0
1
85
Open comments for this post

1h 5m 51s logged

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 🤣🤣

0
1
103
Open comments for this post

1h 12m 14s logged

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.

0
1
123
Open comments for this post

7h 4m 9s logged

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.

0
1
8

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…