Day 7. Not sure this is the right graphical direction, but I'm going with it.

Let There Be Light

You are in charge of building power lines and sustaining an energy grid to supply cities with energy.  As they receive energy, they grow, and so do their energy demands.  Will you be able to keep up with the growing power use and prevent a catastrophic breakdown of the energy grid?

This is the preferred route.  I recommend Python 3.  I recommend installing the dependencies (Panda3D 1.10 and numpy) via pip, using the command:
pip install -r requirements.txt

Then, just call this to run the game:

If getting Python 3 is inconvenient, you can download binary builds for all major platforms.  Just run the run_game executable.  On macOS, just double-click the .app file; if you get an error about me being an "unidentified developer", go to System Preferences, Security & Privacy, click the lock, and click Open Anyway.

If the game doesn't work, please send me the log file.  You can find it in:
Windows: C:\Users\You\AppData\Local\Let There Be Light\output.log
Linux: /home/you/.share/local/let-there-be-light.log
macOS: /Users/You/Documents/let-there-be-light.log

If you can't run it, please send me the command-line output (or, if you ran the binary build, the log file in the aforementioned location).  You can also always message me as `rdb` on the FreeNode IRC network.

The game appears quite dark on macOS, but it runs for me.  Unfortunately, due to Apple's recent course on deprecating open graphics standards like OpenGL, all bets are off on whether it will work on your machine as well.


The Snap! Crackle! Pop! award
Presented by AnthonyB

The Demonweb Pits Seal of Approval
Presented by wezu

The Power Factory
Presented by gizmo_thunder

Give this entry an award


Ratings (show detail)

Overall: 4
Fun: 3.7
Production: 4.4
Innovation: 3.9

Respondents: 17


File Uploader Date
Final source from GitHub
rdb 2018/10/28 21:08
rdb 2018/10/28 14:41
Windows binary
rdb 2018/10/28 14:13
Linux binary build
rdb 2018/10/28 13:50
Day 7. Not sure this is the right graphical direction, but I'm going with it.
rdb 2018/10/27 21:29
Day 6: now with UI, trees and mountains!
rdb 2018/10/26 19:31
I think this looks even better
rdb 2018/10/25 19:34
Trying a new style
rdb 2018/10/25 15:38
Day 4
rdb 2018/10/24 20:58
Day 1
rdb 2018/10/21 23:24

Diary Entries

It Seems To Be a Game?

Well, with only one day to go, it seems like I might be able to just about make it, if I work hard tomorrow.  I wasn't sure at first whether I'd be able to turn the vague concept I had at the start into something that plays like a game, but it is starting to feel like one.  The goal of the game is to supply cities with power by building an energy grid, but the lines can overheat and break down if the current through them is too great.  As the cities are powered, they also grow in their energy demands, so it gets quite hectic trying to keep the grid functioning.  The game actually properly simulates an electric circuit using Nodal Analysis, so you could even consider it a bit of an edutainment game showing how resistors work.

Right now, the cities grow at a very rapid pace, which I need to reduce if the gameplay is going to last longer than a minute.  I will also need to add some periodic upgrades in order not to make the game impossible after a while.

Tomorrow, I need to work on the progression, and add some sort of scoring system and a currency for upgrades.  The trick will be balancing everything to keep the challenge level just right over a longer play session.  I probably won't have the time to do all the playtesting that will be required for that.

Add a comment

Whew! That was a fun but stressful week.

Whew!  Despite not actually have a lose condition before the last day, and still having to hunt down sound effects in the hour before the challenge ended, I nonetheless managed to submit something in time that can unironically be called a "game".  And I learned lots of cool things on the way, such as how ot do Nodal Analysis in numpy and what a catenary is.

This PyWeek was quite different for me than other ones: this is my first solo entry, I had a lot less time due to not being able to take a week off work, and I had chosen a particularly complex interpretation of the theme.  I will probably choose a simpler game concept next time.  The downside of a simulation is that it's hard to turn it into a game, and keep it balanced so that it stays challenging but not impossible.  But it felt really rewarding to reach the point where it became game-like enough for people from the IRC channel to play my game and share their high scores with me, even beating my own.

Given more time, I would have been able to create a more sustained and balanced experience.  When playing the game for a long time, you may notice that the end-game involves a gigantic mess of wires and running out of space around the generator.  The plan was to make it possible to allow you to build more generators over time, but I just didn't get to that.  I think it reaches a point where it just becomes mathematically impossible to proceed, but I haven't worked out the math.

I would have also improved the long-game performance; it's not bad, but it does currently solve a numpy matrix of a big linear system with Kirchoff's equations every frame, even though I could definitely optimize it to only recompute the voltages on each node when the grid has been altered.  Even in a thread, if needed.  So don't get the impression that it's Panda3D's fault if it runs slowly.

Panda3D had a bit of a reputation in PyWeek due to the difficulty installing, but I think that is history now since it can be easily installed using pip nowadays.  And I'm not using fancy shaders, so no high-end GPU is needed.  I'm not as confident about macOS, because, well, Apple seems to be committed to abandoning open standards like OpenGL.  It seems to be playable on my old Mac Mini but the whole game does appear much darker than it should.

Thanks to all for a fun PyWeek experience!  I'm looking forward to playing the other entries on here.

Add a comment

Post your best score!

I'm curious how far people get with my game.  A friend of mine got the best score I've seen so far, reaching 556.2 GJ at the end of year 14:

Oh, you can use shift+S to save a screenshot in the game folder.

Best score

1 comment

Woah, thanks!

Thanks to everyone who reviewed my entry!  I was quite surprised to see that it was rated so highly among the individual entries, despite the fact that the gameplay still needs quite some work.  There were many other really great entries that I expected to be rated higher.  It feels like quite a boost of confidence for me.

Congratulations to everyone who participated; I know that even completing a game can be quite a challenge in itself that deserves recognition.  I have really enjoyed participating in PyWeek, and in particular the amicable spirit in which people are encouraging and helping each other.  Many thanks to all participants for their involvement, and to @mauve in particular for managing the website.

The game feels as yet not quite complete, as the reviews have rightly pointed out; the mechanics need to be developed out more. Options to consider are allowing more generators to be built, or expanding the network complexity by introducing a distinction between high-voltage and low-voltage wires and allowing distribution stations to be built.  Lots to consider, but I don't know if I'll have the time to continue developing the game.  But I'll probably clean up my code at least before people notice what a terrible mess of hacks I've made. ;-)

I'm happy to see that this time, there were no complaints or issues with the use of Panda3D in my entry.  I guess it has come a long way since the days when it only supported Python 2 and could not yet be installed using pip.  It is encouraging since I think Panda3D is a fantastic tool for prototyping 3D games in Python within a short period of time.

I'm looking forward to the next PyWeek!

PS. As an anecdote, Let There Be Light was not even intended to be the final name for the game, as it no longer really reflects the gameplay very well; it was just a working title as I was thinking of incorporating light into the visual theming more.  But I only remembered that I still had to come up with a permanent title minutes before the deadline, and I did not manage to come up with a new title before the time ran out.  Oh well!

Add a comment