Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Showcase / Evolution Simulation (first project)
- - By nicklink483 Date 2014-01-05 07:29 Edited 2014-01-05 07:46
Hey all!  I'm new to Gosu, so please feel free to offer any constructive criticism to anything I've done, but I hope you'll check out and like my little program:

Github source:
Windows distribution via Ocra:

It's a evolution sim that has little teensy tanks that run around and kill each other and have kids whose attributes are slight mutations of their parents.

When a tank has a "child" the child pops up randomly on the screen somewhere.

I haven't put the controls in the game yet, so here they are:

Return (menu) - select menu option
Down (menu) - change menu selection
Up (menu) - change menu seleciton
R - Reset simulation
P - Pause simulation
E - Output data of simulation to console including info on oldest tank, youngest tank, and tank with most kills
Esc - Return to menu
Space - Populate sim with 5 new random tanks
+ (numpad) - (experimental) make tanks larger (up to 5x)
- (numpad) - (experimental) make tanks smaller (down to 1x)

Basically a tank is a set of instructions (turn right, turn left, move forward, fire) and it passes on those instructions to it's children.  A 'child' is born randomly and put somewhere on the screen but inherits behaviors with modification and color.  So if you see a bunch of green tanks on the screen, those tanks have more well-suited "genes" to survival.

I was messing around with nearest-neighbor bitmap scaling, so you can make all tanks bigger or smaller with the plus and minus keys on your numpad.  This has no effect on existing tanks, just new ones spawned after you've pressed + or -.

If you watch for a while you'll begin to notice certain behaviors get selected against, like moving too much.  I didn't impose any kind of equilibrium rate of existing tanks or a death rate, those are emergent properties.

Thoughts? Comments? Bugs? Features?  Let me know!

- Nick
Parent - By jlnr (dev) Date 2014-01-19 19:37
Hmm, interesting! :)

I've noticed that stationary tanks seem to be more successful than the ones that drive around a lot. I think more interesting behaviours could emerge if there were some conditionals in the tanks' code, so that they can actually react to other tanks or bullets.
Up Topic Gosu / Gosu Showcase / Evolution Simulation (first project)

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill