Hour 00:20 of the first Jam day (Alice)
So, the theme is TURN IT OFF AND ON AGAIN. It was so unexpected that I and Siolfor immediately decided to use that circuit-switching puzzle game idea we discussed the other day. There were some others (like something that essentially boiled down to Flappy Birds clone) but this puzzle seemed the most interesting to both of us.
The general concept boils down to setting up the game map so that the resulting system ends up turning off the Gizmo (starting in the errored state), then turning in on again (reset to the working state).
The Gizmo, along with other gameplay elements, is attached to an electrical circuit of sorts - after the system is launched, the circuit the Gizmo is a part of should at some point be broken (e.g. by turning off a switch attached to that circuit) then linked back again. All this would be setup by some simplified The Incredible Machine style puzzle, where a bunch of switch particles float around and interact with the switches (no one would have guessed that).
As much as I like the idea, I feel like coding the circuit recognition algorithm is going to be a pain.
Hour 08:00 of the first Jam day (Alice)
I managed to build some rudimentary level editor thing. It went somewhat smoothly; even the circuits building didn't cause me that much problem, despite operating on cell boundaries rather than cell themselves. Of course, it doesn't yet save anything and it misses some functionality, but it's still a good base for later testing.
Also, Siolfor woke up, so we could decide on further actions. I have yet to figure out what sort of graphics style we are going for (I know what style we aren't; the placeholders I made, that is), so I suggested starting with the soundtracks. Like, themed after four Western elements (Earth, Fire, Water, Air), since I figured we could make maps based around that. And maybe also something else...?
Myself, I decided to take a short break, before tackling the circuit recognition thing.
Hour 12:00 of the first Jam day (Alice)
Circuit recognition is a pain.
Well, at least I think I managed to come up with some algorithm that wouldn't be too expensive and am on my way to implement it. It's more that just traversing the circuit graph and culling the dead ends, because there might be two loops connected with a single link or a single node which are actually separate circuits (blame Kirchhoff for that).
What counts as a single circuit "group" for me is a set of nodes and links such that for any two nodes I can build a loop going through both of them which never goes through any node more than once (it's a stronger condition than not going throught any *link* more than once, as that would treat loops connected with a single node as a part of the same circuit).
Well, at least I'm not trying to solve the circuit, with all kinds of resistances and voltages and currents thrown in. As long as there's a working power source within a given closed circuit, it works for me. ^^'
Also, in order not to make too many structures, I came up with some crazy loop stacking scheme. This is the kind of thing I'd rather not increase the big O complexity unnecessarily.
I'd better take some sleep now; coding in this drowsy state is just a waste of time...
Hour 19:00 of the first Jam day (Alice)
Back to the action and ready...
...to implement that complex circuit grouping algorithm...
...without GML-supported structures and inline functions.
Well, this is going to be fu...n.
(at least Siolfor finished the Earth track; pretty sweet, that ^^)
Hour 22:00 of the first Jam day (Alice)
I think I got something implemented? It kinda sorta works, but there are still some odd bugs popping up here and there. Hopefully I'll manage to iron them out.
(the whole thing computes for about 100ms on my machine for the map covered in cables; considering the circuits are usually going to be much smaller and it's not calculated every frame, it's not a bad time)
Hour 23:00 of the first Jam day (Alice)
Oh, for Kirchhoff's sake!
Turns out my crazy loop stacking scheme doesn't handle some corner case properly (a very specific example of two loops joined with a single node). What's worse, I know why it doesn't work, but I can't think of a simple way to rework the algorithm so that it'd handle this case properly.
Circuit recognition is such a pain...
Hour 24:00 of the first Jam day (Alice)
I am not me when I'm hungry. Thank goodness I just had that lunch.
I'm thinking about seriously reworking the algorithm, because with the one I had I just go around in circles. What helps a lot is that I don't even need to find the links that are part of specific circuits - as long as two neighbouring nodes belong to the same circuit and are connected, the link between them is already what I need.
Hour 26:30 of the first Jam day (Alice)
Got the alternative algorithm implemented. It's much simpler and seems to work perfectly fine, and it performs well even for full-map circuits (about 3-4ms time; talk about the improvement). Now to add some interactions with circuit-affecting devices...
Hour 28:00 of the first Jam day (Alice)
Added the changing elements state functionality to editor, like rotating the switch particle launchers or changing initial states of the switches. Also, the basic power sources work now (providing power to whatever circuit they're part of) and switches too (breaking the circuits at specific nodes when in OFF state).
This image demonstrates the circuit recognition working, including the power source (which provides current to the circuit it's a part of and the switches in enabled state (letting the current pass) or disabled state (stopping the current). The loop in the top-right corner is an example of these disjoint circuits, connected with just a single node. These sure were tricky to handle properly...
Hopefully I'll get the core gameplay mechanics done soon...
Hour 29:00 of the first Jam day (Alice)
Maybe I should start logging under the next Jam day now...?