r/programminggames • • 2d ago

Ghost Commit: fix broken robots' code, then optimize it for gold. Free demo, 0.4.0

it's a programming puzzle game where people from a hot port town bring you their broken robots. a vacuum that chases the cat, an awning that opens halfway at noon, a wok that serves each customer the bowl of the one behind them

you read the code (python-ish), step through it, set breakpoints, watch it run in a little 3d diorama and fix it. passing the tests is bronze. silver and gold are for doing it in fewer ticks, and a card after each run shows which commands ate your ticks

demo is chapter 1, 11 robots, free in the browser or on windows/linux/mac (donation optional). solo dev, built with claude code

mostly want to know if the gold marks feel fair, and which robot you got stuck on

https://tuxx42.itch.io/ghost-commit

19 Upvotes

14 comments sorted by

2

u/fthinteractive 2d ago

The graphics look really nice.

1

u/TuXx1 2d ago

thank youu!! :D

2

u/captcha_bot 2d ago

Well if I got gold on SHADE-2 the way it was intended, then I don't think the gold mark is fair at all to the customer. It's asking for 56 ticks across three days, each day should be checking the temp every half hour and adjusting the awning, which means at least 22 ticks just from looping every half hour. So the only way I figured you could get lower would be to take it out of the loop and code for each specific test case. I got to 55 ticks this way, but it is not a generalized solution that will work for any day's weather, only for the specific conditions of the test days and any coincidentally conforming days. Feel like a huge rip off to get paid extra for this crappy solution.

Maybe I just didn't consider a better way to do this, so please let me know if it's not true that the best solutions will be poorly coded sequential control flow scripts rather than elegant code that solves all cases.

2

u/TuXx1 2d ago

fair complaint, and the 55 is on me, a script built around the test days shouldn't beat gold

but the intended gold is a plain loop, no hardcoding:

open to 50 once and leave it there, weak sun doesn't need it closed. only go to 100 while the sun is over 70. and when the sun is 50 or less, wait(60) instead of wait(30), since it doesn't climb from 50 to over 70 in an hour

that gets 56 on all three days and works on any day where the sun moves gradually. checking every half hour all day is what doesn't fit, 24 checks a day Γ— 3 is already over 56

thanks for digging this far into it

1

u/captcha_bot 2d ago

Ah thanks for the info, I don't remember sun power speed in the information so assuming we'd never see +20 power in an hour based on the test days would feel like cheating in the same way (not that I thought of it).

I'm at 28/27 ticks on KITE also cheesing the days, so it's probably another one you might want to look at. The others ones I've done so far DUSTY-4 and the stairs one I had no issues with.

1

u/AssignmentSad7160 1d ago

Distribute it through Steam so I know it’s safe

1

u/TuXx1 1d ago

heyy!, you can play it on browser and its the same experience if you dont want to download anything

1

u/captcha_bot 18h ago

Okay after completing the demo, here is my feedback.

Overall I really like this game. Doing little fixes for robots is fun because there's a real-world impact and we can visually see the execution of the code. It's the same feeling as The Farmer Was Replaced, except you get to do more than just farming tasks, which is very cool. Music, graphics, ease of use was all good, no complaints really.

For the store and rent over-story, everything except the bench that lets you take on an extra client seemed unimportant. I bee-lined for the bench and then just bought everything else except coding helpers because I had plenty of cash (I thought). It would have been nice to know my clients were going to dry up after Wednesday, I spent my money assuming I'd get three customers every day, which would have been more than enough to pay rent on Friday (I was 34 credits short). All-in-all this part of the game didn't seem very meaningful, but it's kind of just background noise anyway.

For the meat of the game, I really liked all the different things you were able to let us make robots do. Some cases were stronger than others as far as clarity, but they were all charming in their way. The medaling was hit or miss for me. I felt like the ones I got gold on were easy and my first or second idea worked. Also one of them I beat gold by a tick (AIRE-12), so might want to look at that one.

Of the four I didn't get gold on, two were one tick away from gold and the other two were a few away. The ones I'm one tick away from, KITE and MARLIN-5, I truly don't see a way to save another tick and I spent a good amount of time pondering them. Perhaps there's a clever trick I'm missing, but they really seem too straightforward for any further refinement. That's fine, except the game doesn't show me the gold solution and there's no histogram showing my ticks vs other players, so it leaves a bad taste in my mouth because I can't be sure it's me that was wrong.

For the other silvers, SENTRY-2 and HIDRA-3, that bad feeling from the previous silvers I had spent time on made me not put too much effort into optimizing these ones. Especially HIDRA-3, which was the last case and was after I'd already failed to make rent the previous day, so motivation was low. At a glance I thought I saw ways to improve both, but didn't want to go through the effort.

In conclusion, I think it's a really fun game but I would make a small change to the medalling system. Instead of gold starting at the very fewest ticks possible, give a 10-15% buffer instead so 1-2 ticks away still gets gold, but show what the optimal solution's ticks are so the player is rewarded but still has aspirations for refinement. Ideally when you get a lot players you could have the histogram showing where we stack up against others' solutions.

Nice job on this, looking forward to the full release!

1

u/TuXx1 13h ago

thanks a lot for playing the whole thing and writing all this up, most useful feedback i've gotten so far

went and checked the two you were one tick off on and i'm pretty sure it wasn't you. KITE's gold only works if the drone carries more than the 12 kg the manual says it can (the game never checks it), and MARLIN-5's needs you to skip the wrap on the trimmings order, which the job card never says is ok. so both golds lean on stuff the game doesn't tell you. my bad, fixing both

and yeah i'm taking your medal idea, gold with a bit of slack and the best known ticks shown next to it so there's still something to chase. AIRE-12 is the same thing from the other side, gold there was never the real minimum. histogram i want too but it needs more players first

the clients thing is fair too. there's only 11 in the demo and the bench just gets you through them faster, the game should tell you that before you spend

which cases felt unclear to you? glad you liked it! :D

1

u/captcha_bot 6h ago

Ah the wrappings, that makes sense actually haha. Those little details are good, can give players that "aha" moment. I can't go back into the cases from the end of the demo without starting a new game so I don't remember the exact wording, but maybe just changing the trimmings part to something like "if giving the fish, wrap it first" so you can still save that tick on the trimmings test.

For KITE I was thinking a cool way to save the tick would be to have two of the packages on one of the multiple package days have the same address so you could save a tick by dropping two at once without flying in between. I'm pretty curious what your generalized solution for this one looks like, by the way, because it seemed like way too much effort to build a package loading optimizer. I didn't test if we have access to array functions, lambda, map(), etc. I tried defining a function in the beginning and when it wasn't allowed I stuck to what's in the manual after that.

As far as which cases were unclear, I can only go off memory since I can't get back into them, but MARLIN-5 for sure, I thought we were cutting off steaks and slices for the customers just from reading the job. A lot of them I think just didn't say certain things and you could only know by running a test. That was the case for AIRE-12, since it didn't explicitly say we needed to put the heat on at any specific temp I just didn't bother with the heater at all. That sort of ambiguity I think is fair, it lets the player discover some rules on their own. SENTRY-2 was confusing because it didn't mention that you only have to patrol while the night guard was on shift (inferred from existing code and on_shift() in the manual). That's all I can remember off hand.

Good job responding to feedback by the way, I see you're responding here and on the itch page. Hope you get everything ironed out before you launch the full game. Let me know if you ever need a playtest on something!

2

u/TuXx1 5h ago

the wrap fix is pretty much what i had in mind, telling you on the card instead of making you guess. and i like the same-address idea for KITE a lot. dropping two at once without flying in between feels like a real trick, not a loophole

about the "generalized solution": there's no optimizer, the gold was dumb on purpose. load every package, then deliver them in reverse because drop_package() lets go of the last one you loaded, then fly home once. that's exactly why it was broken, the first day weighs 14 kg and it just takes everything. the honest version only needs one more variable to keep a running total of the weight: keep loading while it fits, deliver that batch backwards, go home, repeat. no lists needed

and you read the language right, there's no def, lambda, lists or map. it's ifs, loops, variables, and print/len/range/str/int/abs plus whatever is in each robot's manual. the game should say that up front so nobody wastes time trying

thanks for the unclear ones, that's really useful. MARLIN-5 reads like you're cutting for each customer, and SENTRY-2 never says the patrol is only during the guard's shift, you had to dig that out of the old code and on_shift(). i'm fine with AIRE-12 leaving you rules to find by testing, but those two shouldn't depend on a guess. also not being able to reopen cases after the end of the demo without a new game is a bug on my side, fixing that too

and yes i'll take you up on the playtest when the medal changes are in :D

2

u/captcha_bot 4h ago

about the "generalized solution": there's no optimizer, the gold was dumb on purpose. load every package, then deliver them in reverse because drop_package() lets go of the last one you loaded, then fly home once. that's exactly why it was broken, the first day weighs 14 kg and it just takes everything. the honest version only needs one more variable to keep a running total of the weight: keep loading while it fits, deliver that batch backwards, go home, repeat. no lists needed

I don't think it's quite that simple. Running total requires look ahead logic already, but the real challenge is going in order won't always produce fewest trips. Imagine five packages with weights 8, 7, 6, 5, 3. Going in order would make four trips (8, 7, 6+5, 3) but you could deliver these in three trips optimally. If you also want to account for same addresses, it could be possible that 8+3 is more efficient than 7+3, or vice versa (or 7+5).

Anyway, that's how I was thinking it could get real complicated and I'd want access to some more firepower in that case haha.

2

u/TuXx1 3h ago

yeah you're right, i oversold it. going in order with a running total isn't optimal in general, your 8 7 6 5 3 example is exactly it (8+3, 7+5, 6 is three trips). that's bin packing, and without lists you couldn't even write the real thing

what saves it in the demo is that ticks count actions, not distance, so the only thing that matters is the number of trips. and the cases are small enough that loading in order already gets the fewest. day one is 2, 8, 3, 1: 2+8 and 3+1, two trips, same as the best you can do. the "look ahead" there is just checking weight(i) before you take it

but your point is a good rule for me going forward: the gold always has to be reachable with the tools the game gives you. if a later robot really needs smarter packing, it should come with the firepower for it, not ask you to fake it with nested loops

good catch btw, you clearly know your stuff :P