Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Evolution, simulate a creature of muscle and bones  (Read 3028 times)

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Evolution, simulate a creature of muscle and bones
« on: January 15, 2018, 08:58:45 am »

Stumbled upon this project:

https://keiwan.itch.io/evolution



You build your 2d creature out of bones, joints and muscles, then let the AI evolve in a simulation. There are some scenario (running, climbing, etc) but no goal or game per se, beyond making the most improbable skeletons and watch them go

gif collection by the game creator: http://keiwando.com/evolution-gifs.html
« Last Edit: January 15, 2018, 10:49:44 am by LoSboccacc »
Logged

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #1 on: January 15, 2018, 04:04:02 pm »

This is also on Android for those that want to take a quick look. I haven't really tried it much yet, but I quite like evolution Sims. Would love a proper boxcar2d (just like the web one, ported to not be flash, maybe html5 or a proper Android app).  There's clones, but they're always missing something.
« Last Edit: January 16, 2018, 02:38:44 pm by sambojin »
Logged
It's a game. Have fun.

Starver

  • Bay Watcher
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #2 on: January 15, 2018, 06:14:56 pm »

gif collection by the game creator: http://keiwando.com/evolution-gifs.html
Haven't seen the live interface yet, just the anigifs, but reminds me of the old flash game (without evolution) from 15-20 years ago that had me entertained far too much in trying to create (or adapt from stock templates, one being titled Dirk Diggler) various constructions to jiggle or wobble or stride or roll from one side of the construction area to the other (or, usually, jiggle, wobble, stride or roll back and forth basically in the same spot.

Consider this a PTW, until I get time to spare to try out the evolutionary aspects. (It was always something I was hoping for in that other game, especially as I was actually vely playing with Darwinian Poetry at around the same time. Or at least within half a decade.)
Logged

sambojin

  • Bay Watcher
  • Three seconds to catsplosion and counting.......
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #3 on: January 16, 2018, 02:30:45 pm »

Some of them are a bit "iffy". I tried kangaroos on the stair climb, and it was more of a case of who wouldn't tumble down the stairs at ever increasing speeds (they were *excellent* at that), so with largely negative patterning to evolve from, it was hard to see any positives after 10 generations. They're also hopeless at going forward, and at jumping.

No doubt eventually they'd get the basics (you can luck out, on one try I had a kangaroo that faceplanted, flipped, and then used its head as a jumping foot to go for miles on the flat run within a few generations), but I never bothered waiting long enough for the more difficult ones. It's also kind of boring to watch them take on the singular goals.

That's why I like boxcar2d. There might only be a handful of really good designs for any particular wheel number, but seeing them get there is far more entertaining, with certain hard parts to overcome, with it only ever really becoming impossible at far greater distances.

I guess Evolution shows promise, but some more interesting challenges would be nice. The complexity of the system makes this difficult though (boxcars tend to regularly have wheels and can go forward a bit, evolution sticks don't necessarily have any chance for locomotion, with even slight changes to a working design). It's also much easier to see why a particular boxcar didn't work, whereas with evo sticks, I have no idea other than "bones and muscles and brain must be rigged funny", which accounts for all of them.

Evolution probably does give a better idea of the complexity of some neural networks and machine learning outcomes these days though. Possibly even thoughts on biological evolution.
"So how and why does it work, compared to the others? "
*waves arms, looks a bit frantic, says big words*
« Last Edit: January 16, 2018, 02:44:23 pm by sambojin »
Logged
It's a game. Have fun.

Starver

  • Bay Watcher
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #4 on: January 16, 2018, 03:24:42 pm »

Having tried it, I found the evolution method a little lacking. I've seen some happenchance good solutions leap ahead (literally and/or figuratively) in one generation, but because of the "recombine and start afresh with the new generation" whatever spark of genius there was gets lost in the next generation. Maybe the key bits were either side of the 'splice point', however it stores its 'code' for operation, and without one bit now working to support the other and vice-versa (or actively acting to sabotage the combined effort) you get offspring more dud than either of the parents.

If not too dud, then maybe the children survive to pass on the extremities of their parental Brains to the next generation, with recombination up the line of generations melding them both together again (with mid-Brain info being a mix of influences as other lines carry through via the jumping resplicing points) but it's a bit disappointing.

Many creatures IRL stick around to compete (beyond any parental duties their species commits to) with their offspring and produce further generations too, so their line isn't lost if their first kids turn out to be unfit (especially compared with themselves), at least as long as old age and bad luck hold off their icy hands of post-mortality.


For the Darwinian Poetry evolver, the scheme was that Gen0s (unrelated randomised constructs) started out the competition, with the most favoured 'poems' being bred amongst themselves for Gen1 offspring (which was also done with splicing, but it was multiple splices1) which were then added to the population.  As the population grew, culling (removal from the active pool, still viewable) was enacted upon the consistently bad performers (who may or may not have descendents by this point) without any reference to age.

In fact, there was no compulsory senility/die-off. And no bar at all to (currently) successful entities from different generations breeding (GenX+GenY => two complimentary Gen{max(X, Y)+1} offspring, for recording purposes). If a Gen0 had turned out to be a masterpiece, already, it would have competed its way to sire offspring for as long as the 'environment' didn't just get bored of seeing it and voted it down just 'because'.

I wonder if I still have a readable archive of my population scrapes, anywhere?  Probably not, but I'll check some old CD-Rs that have doubtless deteriorated and needn't take up space on my shelves any more.


Anyway, this was with a working population (at any given time) far in excess of ten. Hundreds. Maybe thousands. Could be beyond this Evolving Stick-Things' capacity, having to also simulate them all to test their capabilities.  But culling the worst half then breeding up enough replacements (needs multiple-of-four constructs at a time? - or just adjust the 'half to cull' one way or another to make it an even number swapped out and created in their place) might have been my approach. (In fact, it has been, indifferent little toys I have made myself, for my own interest.)



Forgot to add: Gen0s are always going to be overwhelmingly failures (i.e. lucky if they don't fail badly, virtually unknown that a positive outcome arises from the initial RNG Creator), and ten generations (of a constant ten 'breed then die' populous, with no way of looking for sort-of-alike similarities between parents and just the one switchover splicing point, for all the reasons give above) just isn't going to be enough for anything complicated. The challenge for Running seems to be barely susceptible to serendipitous selection of a decent hobbling (minimalist) creature. I haven't checked jumping - that might be easier to get good at (just synchronise things to get a good 'launch'). The stairs look lethal.

And wouldn't it be evolutionarily interesting to also vary (by mutation, at first, then inheritance) the body geometry. Shift the joints around slightly, for differing bone lengths and initial inter-bone angles. Even adjust the muscles from equidistant stretch and shorten to a centre-offset range.  Adds complexity, but adds potential. Like getting the length/range of limb your stair-climber deserves, rather than the one you designed it with, without having to restart after watching the failure to improve and moving the joints around yourself with very nearly as little expertise, then starting the evolving from scratch again.  An option? Probably already suggested over on that site's forum, but prior to my going there I thought I'd unload here.


1 The same number per parent, but with independent placement on each parent, so the first two words of one parent might swap with the first four of the other, and so on, changing poem lengths. I think this was revised later, but it allowed Selection to favour longer or shorter poems, and (a couple of generations down the line, or more) repeated phrases to creep in. Obviously for a static-sized 'Brain' (one assumes it's a rigidly templated NN, with a fixed depth and a given width of possible connections between each layer betwixt sensory and motor node layers - doubtless explained somewhere on the forums for the thing, which I must look at later) you'd just generate the single set of multiple splice'n'switch points and keep the data the same size. But it gives the possibility of a good sensory cortex (one end of the layers) and a good motor cortex (the other end of the layers) to inherit from the other side of its parentage a novel mid-brain 'remixer', etc.
« Last Edit: January 16, 2018, 03:40:52 pm by Starver »
Logged

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #5 on: January 16, 2018, 04:35:33 pm »

I'm not sure about all that but it was amusing making a living ball with little legs all over it.  In the running test it managed to move forward an entire body length before apparently forgetting how it's legs work.  Or maybe simply not having enough strength in the legs touching the ground to move it's heavy ass. One of the two.

In the climbing test it saw astounding movement abilities however!  Moving so quickly that the camera even failed to keep up with it.  Shame it was the wrong direction and completely uncontrolled.
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #6 on: January 16, 2018, 04:52:18 pm »

I also tried making a wheel-thing, and it did manage to fling itself quite far after a few generations. The problem was that it seemed to be quite averse to actually flipping over in a cyclical fashion, and so tried to "wobble" back to a starting position to take another such leap.

One problem I've found with legged designs is that they quite often seem to like doing the splits. Since part of the body (the frontmost foot/leg) is farther ahead of the other flopped failures, they get crowned champion and the next generation is all a bunch of critters trying to flatten themselves as much as possible. The next few generations are an incredibly dull limbo contest.


An early design I tried out was some sort of one-legged hopping thing with a claw hand and a tail to help balance. I was trying to create something nominally humanoid, but figured it needed the tail to help as a counterweight.

It actually ended up doing remarkably well, considering my abysmal grasp of anatomy... But as it turns out, its main mode of locomotion was to lean over, hunker down to the ground, and then rapidly swing its tail forward in order to make use of the momentum and gain a new foothold farther along. It was... Remarkably disturbing to watch.

etgfrog

  • Bay Watcher
  • delete & NULL;
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #7 on: January 16, 2018, 05:15:24 pm »

Spoiler: Frog (click to show/hide)
It actually adapted to jumping on gen 1.
Logged
"How dare you get angry after being scammed."

Starver

  • Bay Watcher
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #8 on: January 16, 2018, 05:50:10 pm »

My first design was a simple biped (demiquadraped).  Guessing that the fewer variables to have to 'think' about (whilst still being viable for the task) the less we end up going down blind-alleys.  (Subsequent experimentation proves that to be true.)

A single bone spine (doesn't need bracing by adding triangles) with the leg at each end being a <-shape or >-shape so as to tuck under the spine1 with four muscles: from spine to each upper diagonal and each upper diagonal to the corresponding lower one.  Adjust the angles to be neither too cowering in 'zero position' nor so high that it is likely to attract a rogue flight of snow-speeders to grapple its legs together.

(Similar design to that Frog I've just been ninjaed by, but with out the third element to the rear limb and slightly differently angled as for the rest. Yes, mine got to jumping, but it was obvious that changing the limb-spread would probably aid power-distribution during the intended left-kicking propulsion.)

You can get something that looks like it might bound off into the east in each generation, almost from the start. But still many recombination failures.


Just tried a wheel.

A hexagonal rim (turned to a more rollable dodecagon by triangulating each edge) with a small central triangle of bones linked only to the outer hexagon by muscles. The idea being that a phased cycle of muscle distortions might be discovered to move the hub 'weight' perpetually forward of the rim centre. Without having distorted it so much.

I didn't get that, though.  Marvelously explosive. The "muscle-only" link defies expected connectivity and ends up (in most of the Best Of The Last Generation postviews) just flinging the centre around (for the whole 30 seconds of my revised test-period) like a chameleon's sucker-tongue, assuming the chameleon is completely bladdered due to it being his stag-night and having had one or two too many vodka chasers.

(It wasn't just the 'fling' that got the distance, though, the rogue hub does seem to drag the rim along after it. Most generations.)


1 Though going >>,  << or <> gives interesting characteristics if you complicate the body to add neck/tail anchors, counterweights to the anchors, perhaps the means to wag the tail or nod the neck to add the capability for useful oscillations... but that's starting to be a different beast.
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: Evolution, simulate a creature of muscle and bones
« Reply #9 on: January 16, 2018, 06:04:02 pm »

there's definitely some wonkiness to it. for example three muscle on a wheel should be able to rotate it, eventually, but it seems there are constraints depending on the initial position/angle of bones and muscles
Logged