

CodingGame – An idea for a real time strategy game for programmers - cwinter
https://codinggame.wordpress.com/2015/04/23/codinggame-a-real-time-strategy-game-for-programmers/

======
AndrewOMartin
This game is at the "not even mocked up" stage. There's no ideas in the
article, except for vacuous phrases that amount to "good for everyone, simple,
and fun".

If you ever find yourself in this position, or if you are the author, please,
please, please, knock a bunch of rules together using tools no more technical
than pens, paper, whiteboard etc. and play test it to ruddy heck before you so
much as create a software project.

~~~
cwinter
You raise a really good point about thinking through the game mechanics before
diving into the coding. As it happens, I have actually spent a lot of time on
this and even implemented something similar some years ago. I probably could
made that clearer in the blogpost, but I mainly wanted to give a concise
overview my goals and plans for this project. My next updates should have a
bit more substance :)

~~~
AndrewOMartin
I will enthusiastically read and consider any progress you post.

Even if I think there's a low probability that the project will be completed
as you describe, don't be discouraged. Any progress made in any direction will
be valuable experience, and enjoyable. I have started more than one project
that I couldn't finish and I've never regretted any of them in hindsight.

Don't be afraid to fail publicly, by which I mean post about absolutely
everything you've done, no matter how unfinished it is, it'll help everyone
keep enthusiastic and engaged. If you complete the project, you'll have a
valuable log, if not you'll be able to see both 1) what went wrong and 2) the
sub-victories you had on the way.

Good luck.

------
fearface
I'm sure it will feature dragons ...
[https://www.reddit.com/r/gaming/comments/p1ssv](https://www.reddit.com/r/gaming/comments/p1ssv)

~~~
bottled_poe
Pretty much.

------
ElijahLynn
Misleading title...How does this get voted up?

Change the title to "An idea for a real time strategy game for programmers"

~~~
M8
Agreed, ideas are cheap, title is misleading.

------
RankingMember
The title should be "CodingGame - An IDEA for a real time strategy game for
programmers".

~~~
cwinter
Hmm, that actually is a bit more accurate, considering it links to a blogpost.
Thank you for the suggestion.

@mods: could you change the title on hn as well?

~~~
sctb
Thanks, we updated the title.

------
TeMPOraL
Since we're talking about coding and games - hey 'elptacek, 'tptacek and
'patio11, how's Starfighter going? ;). It's been a long time since any kind of
update and I just can't wait to start playing!

~~~
tptacek
(a) Thank you, very much, really.

(b) It has actually been not at all a long time since our last update. It's a
dev project. It's proceeding like dev projects do. :)

(c) Erin's got an update coming soon, but she's also ferociously debugging an
emulator that is sucking up a lot of her cycles.

(d) We'd be using the term "game" in a much much looser sense than this story
is. :) If you haven't already gotten through Microcorruption.com (our first
"game" like this), and you're impatient for Starfighter, well, Microcorruption
is good too!

~~~
tom_b
Hey, are you guys sending emails or a reading list out yet? I'm also in the
list of eagerly-waiting test subjects . . .

~~~
tptacek
We have not. We had planned the first email to be a sort of short study guide
for the concepts we're playing with in Chapter 1 of Starfighter, but then I
had the traditional Rev 1 Weeks From Shipping freak-out and relitigated every
concept from Chapter 1 and Patrick had to fly all the way to Chicago from
Japan to help Erin talk me down and so now we've settled back into a solid
plan for what the first ~20 levels look like and long story short update
coming soon.

------
fragmede
BWAPI, the StarCraft: Brood Wars API has been used as the foundation for
several AI programming tournaments, which may be if interest here.
[https://github.com/bwapi/bwapi](https://github.com/bwapi/bwapi)

------
craftit
It would be great to be able to remotely connect to the world, so plays can
use the language of their choice. Personally I like web sockets and JSON, as
they are well supported by most programming languages. In any case it would
set it apart from some the other online AI arena's I've seen so far.

~~~
pmlamotte
When I was at Michigan Tech I was part of the group that would create an
annual version of this, and we were actually running all AI in the same Java
process (somewhat sandboxed) which of course led to scalability problems and
limited you to JVM languages. For us it didn't matter so much since our target
audience was new comp sci students at a school where the starting and most
used language was Java.

Our other restriction was that we wanted to support hundreds of units per
team, and we wanted tens of thousands of computed turns, but be able to
compute that within 3-5 minutes.

We did learn from that naive approach though and the next year I believe it
was done with a text based API. If performance were an issue, it could be done
with protobuffers, since most popular languages have at least some
implementation of them. The year we did the java implementation we had replays
the size of 250mb+ due to how much data we had, even with deltas, compression,
and other pruning. The text API was only feasible due to a massive reduction
in the amount of game entities and turns.

The key thing was when you want to offer API commands. We wanted starting
freshman to be able to compete, and that required offering things like
pathfinding, predefined list filters, etc. This also mattered since it was run
like TopCoder where they only knew about the game the day of the competition
and had 8 hours to code an AI for it. The least buggy way to support that in
multiple languages is to have the API computation happen on the server, then
your language specific APIs are just wrappers around the API calls and data
and much easier to change as your game changes.

~~~
craftit
It is a fair point, if you want to keep the playing field level and you want
to compete on the basis of coding skill then you need to manage the code on
the server. Otherwise simple network latency to the server could skew the
playing field, assuming it is real-time.

I must admit I just want to experiment with different AI algorithms like deep
learning, genetic programming, rule induction and see how they do. I have much
of the code already but I am unlikely to get the time to rewrite it, even if
could get it to fit within the game environment. Especially as some of the
training is best done on a GPU.

~~~
pmlamotte
You bring up the real-time component, which is something we didn't do and from
what I can tell the OP does not plan to do either. Real time is an entirely
different beast and something I haven't seen in these types of competitions
yet. I'd love to see one that does do it though.

Another cool competition is MIT's Battlecode, which actually gives you a
bytecode limit. If your code executes past the bytecode limit, your AI is
paused and will actually resume on the next turn, without notification. Thus
you'll be continuing with possibly old/dirty data. That pretty much prevents
you from using any standard libraries and doing bytecode level optimizations,
as well as manually yielding if you know it will take too long.

Your robots also can only talk to each other through a radio API that has
limited bandwidth and possible corruption if I recall correctly. It's a
complete opposite of what I worked on, where we focused more on strategy
rather than code optimization.

------
corv
Easily confused with [http://codingame.com](http://codingame.com)

------
gelisam
I implemented version of this several years ago, except against human players
instead of against an AI, and with randomly-generated levels instead of a
succession of harder and harder levels.

It was a semester project where we had to hand in a game satisfying a few
basic requirements, and since we were done early we were allowed to add as
many extra features as we wanted. One of those features is that whenever you
clicked on a unit and ordered it to do something, a log message would show you
a ruby command which would do the same. You could then open the console and
control your units using arbitrary ruby code, and you could also attach AI
scripts to your units.

This was before the era of github, so the source may or may not have been lost
to history. I'll update this comment if I manage to find it.

------
linsomniac
I had a great time doing the "Planet Wars" version of the "AI Challenge" a few
years ago. I kind of wish there were more of them going on.
[http://aichallenge.org/](http://aichallenge.org/)

------
dsjoerg
Have you seen [http://www.battlecode.org/](http://www.battlecode.org/) and
[http://bwapi.github.io/](http://bwapi.github.io/) ?

------
tne
Related: Screeps [https://screeps.com/](https://screeps.com/)

------
S4M
Looks good, looking forward to it!

One question:

> My implementation uses Scala, so the API will initially be for Scala/Java
> only, but I want it to be possible to write wrappers for other languages as
> well.

Why isn't Clojure supported?

~~~
cwinter
> Looks good, looking forward to it!

Thank you :)

> Why isn't Clojure supported?

I have never used Clojure myself, so I don't know too much about it. Can it
easily call into Java libraries? In that case, Clojure should work as well.

~~~
S4M
> Can it easily call into Java libraries?

Yes, see [0]. If you need help making it available in Clojure, please ping me
and I'll be happy to give you a hand.

[0] [http://clojure.org/java_interop](http://clojure.org/java_interop)

------
captn3m0
Isn't [http://codecombat.com/](http://codecombat.com/) exactly this?

~~~
cwinter
CodeCombat is aimed at people with no, or very little, programming experience.
My game will be targeted towards people who already have at least basic
programming knowledge, and are looking for a less restrictive environment. In
that respect, it will resemble CodeCombat's zero sum mode[1]. I am hoping that
the focus on slightly more experienced programmers will allow me to create a
game with more strategic depth.

[1] [http://codecombat.com/play/ladder/zero-
sum](http://codecombat.com/play/ladder/zero-sum)

------
acbart
Worth checking out: [http://codespells.org/](http://codespells.org/)

------
CraneWorm
so... [https://robotgame.net/](https://robotgame.net/) ?

------
RoundCube
I actually had this exact same idea a couple months ago

