It's ALIVE! and it thinks (coding DNA and Neural Nets for fun)
August 20, 2010 10:52 AM   Subscribe

Amateur coder looking to make a "toy" Neural Net and also genetic/phenotypic DNA evolution/breeding system for a "virtual pet" game. Any tools that can make this approachable for me, preferably in Python?

I have always been interested in A-life, Genetic Algorithms, Cellular Automatons, Neural Nets, Learning chat-bots etc etc, from a theoretical level. But I am not a programmer as my day job, so I never really studied these things officially.

Even So: I want to make a game that is something like one of those old digimon "pets" that you raise and then fight/run races/compete against other player's pets. I want the pets to have a digital "DNA" so that you can breed them for various balanced traits (Fast but delicate, Slow but strong, Smart but weak etc). Also, they would have neural nets so that the player would have to "train" them to fight. Basically like little digital gladiators.

Is this, even as a toy, hopelessly beyond a layman's capability? Are there some tools that could leap frog me directly into the fun/game part without having to learn tons of esoteric code?

I'll admit I'm not a trained programmer but I learn quick when I have a goal in mind and have impressed myself in the past with the things I can slap together in Python. I also have coded bits of C++ and JAVA, and would be willing to learn other languages if needed... but again, I would not consider myself a "programmer" so the easier the better.

My goal is to make a rough prototype and

1) Congratulate myself for the fun of doing it
2) IF this is not something that has already been done 1,000,000 before see if I can turn it into a real game/iphone app/facebook game/stand alone whatever. But I don't care about this so much at this point.

posted by DetonatedManiac to Technology (7 answers total) 18 users marked this as a favorite
I can recommend AI Application Programming for getting started on this. It is a broad introduction to different AI areas, including NNs, genetic algorithms, and ant algorithms. The book takes the approach of introducing only the very basics of each topic, but does so as a programming project, so you'll be able to get going quick. The source is in C, but it is pretty straightforward and you should be able to convert it to Python. When I was reading the book I wrote some of the code in Java, and I didn't have to do any coding gymnastics. The book doesn't have much depth, but I think it's very suitable for what you want to do.
posted by adahn at 11:03 AM on August 20, 2010

In addition, if you have an interest in ALife I would also recommend looking at NetLogo.
posted by adahn at 11:05 AM on August 20, 2010

pygame is very easy to learn.

pygames tagged with ai

and pyglet is even easier.

oh, and wow. I missed this one in the blue. Easy AI with Python. I was googling for the intro cs python book to see if it had a good section on what you want to learn.
posted by bleary at 11:44 AM on August 20, 2010

Do you want a neural net, or do you want to build one? Because MATLAB has one. I know a computational neuroscience student who was very recently raving to me about how easily you can click through a few menus, load a training set from a file, and get a neural net.
posted by d. z. wang at 11:44 AM on August 20, 2010

Is this, even as a toy, hopelessly beyond a layman's capability? Are there some tools that could leap frog me directly into the fun/game part without having to learn tons of esoteric code?

It's kind of an ambitious project for someone who has never done a real programming poject before. From your description you would need to build out all of the following:

- Graphical UI for training, breeding, etc.
- Fighting system and graphics
- DNA representation, probably with some sort of graphical component for the visual display of the pets, along with a breeding system
- Training system involving AI/machine learning
- Some sort of multiplayer aspect (online?)

Since you haven't made a game before, you'll also have to learn whatever platform you decide to use. All of that will take time and effort. The neural net stuff is actually probably the most likely part that you could get from an AI library of some kind, but as with any programming project you have to do most of the work yourself if you're making something new.

If you want to get some sort of playable game quickly, I would suggest getting one of the parts (fighting, breeding, or training) completed first along with the UI for it, so that you can play that part of it before the whole thing is completed. It's a lot better to work on a project when you always get parts working right away when you write them rather than waiting on until the end of a project to flip the switch and see everything working.
posted by burnmp3s at 11:58 AM on August 20, 2010

Genetic algorithms and neural nets are actually both decidedly on the easy-to-program, hard-to-use end of things.

So, building the modules for them? Should be a snap, honestly.

Figuring out how to use your naked genetic algorithm module for breeding pokemon? Maybe not so much.

(Genetic algorithms, btw, aren't really for things with genetics. It's really just a variation on stochastic programming that allows for setting large numbers of independent and dependent characteristics. In other words, the "genes" part of genetic algorithms are way less important than the "algorithms" part.)
posted by Netzapper at 1:31 PM on August 20, 2010

Response by poster: Thanks all for the ideas so far!

burnmp3s - you are right, I would build the game part first and then apply the neural net/DNA later, but didn't want to spend lots of time on that first part and then run up against an impossible wall with the other parts. But sounds like it is doable.
posted by DetonatedManiac at 9:11 PM on August 20, 2010

« Older How can I get the cable company to ease on down...   |   Minds, How Do They Work? Newer »
This thread is closed to new comments.