A downloadable game

I'm sitting right now with a half made project on my computer, and I don't really have more time to work on it. So I'm going to submit an idea and a technical analysis of how it would be done. The actual difficult of the project has already been created (the import and run code from the user) but getting it into a playable will still take a few more hours. I don't really feel like not submitting anything, so I wanted to at least present this idea. So here is what I have:

Basic gameplay

Here is the main loop: 

see level and path for paddle -> write script to play the level -> test, if success go forth, if failed go back to write script -> get a new level and go back to step 1

It's very simple, but could be quite interesting for the player. 

Technicals

Lua is a great language to do this in because you can literally take a file and "generate" code on the fly. What I did (this part was actually developed) was to import the file using loadfile() and then error checking literally everything using pcall(). With that I could tell the player what errors happened in the code instead of the errors ending up in the console or the game just not working. The code that the player would write would return "up", "down" or "stay" to determine where the paddle should move. That's the actually difficult part. The rest is just programming ball movements and paddle movements and setting up UI that explains how to edit the code to the player, as well as showing the player when errors occur. 

Evaluation

Generally I would say this is a pretty good and a clear enough idea. The main issue is the way that players interact with the game, having to open up a text editor is a bit of a pain, and the fact that (almost) all programming games I've seen use blocks instead of text just makes me more sure about that. Blocks is also better since the player can see all their options, instead of having to look up the lua manual to figure out how to do an if statement. 

Comments

Log in with itch.io to leave a comment.

(+1)

I love the idea! You could probably take 2 different routes with this:

Either its a deterministic scenario, you can only hardcode the behavior for a certain level and the player code would need to be limited in a way that they cant write an ai that just wins every level, maybe each level has different amount of blocks of each type or something, like one level doesnt have an 'if' statement at all or something like that.

Alternatively you can freely program a pong ai that can dynamically react to the current situation and each level introduces some completely new mechanic that requires a completely new pong ai, like multiple balls, zones you are not allowed to hit with the ball or paddle, etc. In that case the scenario could be randomized so you cant just hardcode the paddle behavior.

I really like the first idea! I’m putting that in my pile of “to explore” prototypes, so I’ll have to try that out sooner or later. Thanks for checking in!