I had a lot of fun this Ludum Dare, and I think that of all of my submissions the one I submitted this time is the best.
Here is a link to my submission: Link
There is also a post-compo version available, with more items and levels (as well as a smarter AI).
When I first saw the theme, I wasn’t sure if I should participate. But, I came up with an idea that tied in with some AI research I was doing. The game uses neural networks, which is pretty uncommon. But, it really is the only way to do it in this case. Path-finding and other methods are far too rigid to be able to adapt to arbitrary environments. Also, it is difficult to create a character control system that can predict how to move in the air in order to land on a platform. Path-finding can be complementary to the neural network, but I left it out since it is too processing intensive. I instead just made all levels pretty linear (the AI always moves to the right).
When I started out writing the game, I was pretty sure that the AI would fail miserably. But I at least wanted to try it out. To my surprise, however, it almost immediately (usually in less than 10 generations) was able to comprehend how to jump from platform to platform. However, by the time I got it working, I squandered too much time on YouTube to be able to submit it for the 48 hour compo. So I submitted it for the Jam.
I started out the AI with 25 inputs, arranged in a rectangular grid around the hero. These inputs were set to the corresponding tile values. This acts as vision.
I later added the signed x and y distances of the player from the goal (princess), so it could learn the map better and not be fooled by structures that look the same from its point of view in different locations.
In the post-compo version, I also added the x and y velocities, which improved the behavior significantly.
The outputs of the network are arrow-key controls (left, right, up). To test the physics, I started by having the controls respond to keys, and I then later let the AI control it. If a output is greater than 0.5, then the key was activated. Otherwise, it was left inactive.
The neural network is recurrent, and is evolved using the NEAT (Neuro-Evolution of Augmenting Topologies) technique to evolve connection weights as well as network structure simultaneously. I had the NEAT algorithm coded prior to the competition. It comes with a visualizer, which uses another genetic algorithm to produce images of the networks. Check it out here: Link
The NEAT algorithm itself is very generic, feel free to use it in any of your own projects. The visualizer uses SFML, but you can leave it out if you don’t want it.
Here is an example of what the NEAT visualizer shows. In this image, it learned a XOR gate.
Other than the AI, the game is nothing special.
What went right:
– AI was able to beat levels as intended.
– The training process ran at an acceptable rate.
– The map editing interface was relatively easy to use.
– Sounds were indicative of events (thanks to BFXR).
What went wrong:
– The menu system (there is none).
– The graphics. It was an ugly grid with rectangles with legs as characters. Also, some people got black screens. This was fixed, but perhaps too late.
– The items. There were only 3, which made puzzles repetitive.
– The levels. They were mostly too easy, I ran out of time when making them. Also, there were not enough of them.
– No music.
I might make a post-post-compo version. I kind of like designing puzzles for this game.
Phew, I barely made it this time.
Now that I finished the game, I wish that I would have added more items to make the puzzles more complicated.
They are all super easy right now.
But, it is still fun to watch the neural network AI try to beat your deadly levels (especially when it explodes)!
While programming it, I kept on turning down the number of generations that the evolutionary algorithm ran for since it ran slowly even in release mode in VS2010.
But, when I took it out of the IDE and it performed absolutely no tracking anymore, it ran much faster suddenly. So I could have afforded more generations.
Oh well, the AI is still capable of beating the levels as intended most of the time even with so few generations.
My idea for “You are the villain” is kind of like a backwards version of Mario.
An AI tries to beat levels that you set up traps in (including the bane of all side-scroller heroes: spikes!)
You must prevent the AI from winning.
The AI is actually a neural network, trained by an evolutionary algorithm. I know that these are not exactly popular for games, but it has been working out so far.
As a test, I rewarded them for getting to the top right of the screen. They figured out how to jump on platforms pretty quickly:
(In all likelihood)
This will be my 3rd LD.
Last time I used Java with LWJGL, but the applet thing made it come out all glitchy. I might try the applets again, but I will probably just have people download it this time (not in browser). I will probably not use C++ as in my first LD, since it takes so much longer to develop (undesired in a composition about making games in a very small time frame).
So, Java, with Eclipse.
– Flash (drawings)
– Photoshop (maybe)
– Wolfram Tones (if the license allows)
Phew, that was intense.
I survived my second LD. Hopefully I do better than last time!
Here is my entry:
Java is being a pain… My map editor’s character encoding randomly became all messed up (shows up as Chinese or something in the file), so I cannot make maps.
If anyone knows a fix for this, let me know!
This will be my second LD. Last time I used C++, but people usually do not want to download stuff (I am guilty myself), so this time I will be using LWJGL (java) and posting it as an applet.
I will use a basic framework that I have created for other games in the past.
For the artwork, I will use Flash/Photoshop/Sketchbook.
If I get to doing sound, I will probably use Wolfram Tones and sfxr.
When I first submitted my project, it depended on the VS2010 Runtime Environment. I then re-submitted it using a static compilation (before the deadline), but that caused it to crash on many PCs. So, I am reverting it to the old version that required the VS2010 Runtime Environment so more people can actually play it. I hope this is OK.
These is a kitten in the game…somewhere!
I finished my entry, and I must say I am quite pleased with the result. I saw some small problems with it after I uploaded it, but I am too lazy to change it now