A Programmer's Game

Posted by ludamad on Aug. 16, 2012, 6:49 p.m.

So it's been discussed time and again, and it's an idea with real potential.

There's already Core Wars which is a game where programs battle it off, however that is accepted to devolve into primarily a rock-paper-scissors type gameplay.

There's real potential in the idea of a game where the primary activity is writing code, even if it purely applied to programmers. The sweet thing about that, I think, is it could potentially be a really fun way to learn programming.

On that note, there's already http://primerlabs.com/codehero , but what I'm thinking of is more Core Wars style where scripts can 'face each other'.

The obvious approach here is to lay out a normal, abstract game, and have players create what are more-or-less AI scripts. I believe if you're careful this would work well.

Problems worth noting:

1.) No one is going to jump in and write a complex script. For a simple RTS, for example, even assuming you gave the player/coder a pathfinding API, it wouldn't help the fact the player would still need to learn a lot to be able to figure out what could be an optimal strategy, before touching the code.

2.) No one is going to jump in and write a long script, either. There should be a variety of sub-goals that give the player satisfaction early and keep them interested.

For this to work well, the gameplay needs a smooth learning curve. For the first few scripts the player writes, the challenge will certainly be overcoming the syntax. What the player wants the script to actually do should be very easy to figure out.

3.) Two computers playing a game like chess, without any randomness, will always play the exact same game. Having the game quite randomized is tolerable here, because you can always have the AI's play X amount of games with no additional effort.

Here's my proposal, I'm interested in your ideas:

A game that takes the form of a trading card game, with playable creatures, cards that perform an action, eg spell cards, and possibly cards that augment your creatures. The game features an 'adventure' mode so to speak, where you program a bot to face increasingly complex challenges.

Game start:

To start out, you'll be presented with a deck full of only a few types of cards, and an AI stub that goes as far as playing a random card. You are then presented with an enemy, that you must beat 3x in a row (after all, its just iteration of a script, it may as well be 10x, but the player may tire of watching).

The script will beat this enemy, purely because of better cards.

Every round of play, you are also scored based on how much you won by, to keep people interested in not just doing the bare minimum.

Game progression:

After that, you must augment the script to play creatures in response to what the other player has done, eg play hard counters based on elemental weaknesses or something like that.

From there on, you will be given options to buy/randomly obtain new cards. You will incorporate whatever cards you want into your deck, and also your script. The nice thing here is, unless you have a good idea how to code usage for a certain card, you can leave it out of your deck for the time being. You can purposely have a simple, but effective strategy.

Script sharing:

So either through some built-in online service, or just some informal passing around, you can share your deck-list + scripts with others.

Cards should probably have a certain cost attached for being included in your deck, and there could be a standard guide-line for what a competitive deck cost is, but generally people playing with over-powered decks but under-powered scripts would be interesting, and allowed for new-comers. Leaderboards would be cool, with tiers possibly based on deck-cost (if it doesnt divide players too much).

Thoughts ? I'm thinking of developing a prototype with lua scripting + text based interface. Any interested C++ programmers are welcome to join in.

Comments

panzercretin 11 years, 7 months ago

I remember a while ago I had an idea for a "Robot Championship" where people could program a robot object in GML. I'd take two .gmk files, merge them, execute the file, and watch them fight each other. Obviously anyone can just program something that makes the opponent's hp instantly drop to zero, but that wouldn't be any fun. It would be more about designing complex and cinematic characters who could host an interesting battle. The idea never caught on because everyone used gm8 and I only had gm7. I finally got gm8 pro sometime last month.

Would anyone be interested in my trying this again? It could be fun, so long as people don't take it too seriously.

ludamad 11 years, 7 months ago

Panzer: Sounds a bit manual. I think if you made it so people would each make, eg, one script file that controlled the bot it'd be a little easier for people to integrate and try out other peoples bots. Just lay out what functions people are allowed to use and it'd be fine.

panzercretin 11 years, 7 months ago

I think people here should be able to handle programming one object (and/or any tie-in objects, like projectiles for example) within the core engine. I'll be the one merging them, for the most part. That'll just be a matter of flipping on the switch in the programming that makes them target the opponent's robot instead of the dummy. Looking at the template now, apparently the parent object automatically did this. Cool.

I found the old blog I made about this. I'm gonna make the necessary changes to the rules to make it a bit more accessible, and also make the core engine run more smoothly. I'll post something about it sometime tomorrow.