Author Topic: Organelles, better multicellular organisms, and more  (Read 10057 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Organelles, better multicellular organisms, and more
« Reply #15 on: April 22, 2013, 02:27:17 PM »
I rather like the idea of some fluid dynamics, it opens quite some possibilities. At the same time I'm afraid it'll take up too much computing time.

What would be the cost of circulation/diffusion? (it seems expensive)

Normally fluid works by using a giant grid and doing operations between neighboring grid cells to propagate velocity, diffusion, etc.  This is called "discretizing the domain" using a "Eulerian" perspective, and is actually entirely impractical for Darwinbots, just because of how big a bot's universe is.

Another method for doing fluid is to use particles to represent properties of the fluid, and have those particles move around and circulate. This is a "Lagrangian" perspective.  "Finite element" methods simulate the fluid as basically a huge number of circles/spheres, which works well for things like water pooring in to a bucket.  But it's still wildly impractical for Darwinbots.

Finally, there's a Lagrangian method that only simulates the "vorticity" of the fluid.  That is, its spin/whirlpoolness.  An unmoving block of fluid has zero vorticity, so it costs 0 memory and CPU cycles if the fluid domain is empty, and then scales from there.  So it's very well suited to something like Darwinbots.  But that's only half the battle.  The other half is preventing the fluid from penetrating a boudnary like a wall or a bot.  Without getting too technical, you can simulate this as a collection of fluid particles that are stuck on to the surface of a boundary and update every cycle to prevent fluid velocity from penetrating the boundary.  If those particles also push on the boundary, you've got the coupling between rigid body physics and fluids basically working.

This is the approach I'm exploring with Darwinbots, except I'm only calculating the boundary particles and ignoring the normal free-floating particles.  It should be approximately as expensive as the calculations for bot vision (which bot can see which other bot).  So expensive, but definitely doable.  Right now I have a simulation with a square spinning and translating through a fluid with 1000 tracer particles in it that runs in 0.5 ms (2000 cycles/sec).  Based on that my guess is that each 50 bots will cost 1ms for fluid simulation.  And that doesn't count speedups that are possible using SSE/AVX or multithreading, so in final Darwinbots if you throw your whole computer at it you might be able to do more like 400 bots' fluid calculations in 1ms (1000 cycles/sec).  And that number might increase 5-10x again if we can get GPGPU working, but that's in the distant future.

Quote
Another question is to what level should the fluid properties be simulated? Should water freeze when it's below freezing point? Should salts have an effect on the freezing point? Should pH have an effect on the salt? How much substances should there be, to what level can they react with each other.

Each additional aspect of fluid increases the computational cost, possibly substantially.  Right now I'm assuming that the fluid is isothermal (doesn't change temperature), inviscid (imagine thick molasses.  Now imagine the exact opposite of that) and incompressible.  It will have density (and so impart momentum on things in it), but that's about it.  Which means things like flocking geese would work, as would squid-like propulsion and undulating fish swimming.  At least in theory :)  I'll know more in a few weeks/months.

Diffusion would have to be simulated using essentially tracer particles (massless particles which float in the fluid), but we'd need a lot of them for it to simulate effectively, and I think it would be too expensive.  But there might be more intelligent tricks you can do to make it more feasible.

Quote
What are the current plans in DB3 to increase diversity within one sim? So that multiple species have a habitat in different places in one sim.

Right now the main driving factor would be size.  I should be able to simulate something like a whale eating plankton.  The tactics a bot would have to use to feed on things larger, similar, and smaller than it are all quite different, so that should open up some interesting niches.

If fluid works out, and you disable the voluntary .up etc. commands, you'd need another bot to move at all, which would encourage multibot cooperation.

I also plan on having shapes in the world that bots can physically dig inside of.  So you can have something like an ant colony, sediment on the bottom of a sim that builds up from stuff going on higher up, etc.  Which should provide different ecological rolls.

And of course chloroplasts encourage one species to become sessile, passive, gigantic and defensive (the plant) and another to become mobile, lean and aggressive.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Organelles, better multicellular organisms, and more
« Reply #16 on: April 22, 2013, 03:25:16 PM »
Thanks for the elaborate explanation. :)

Is the speed based you get on your new monster or my snail. :P

What happens with the normal free-floating particles. If they were just set into speed by a moving bot, would they stop moving if the bot isn't in the boundary anymore?
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Organelles, better multicellular organisms, and more
« Reply #17 on: April 22, 2013, 04:20:48 PM »
Thanks for the elaborate explanation. :)

Is the speed based you get on your new monster or my snail. :P

My beast :)  It's running a Sandy Bridge Intel chip at 4.2 Ghz.  On your 2.4 Ghz chip, expect the time to be double to triple that.

Quote
What happens with the normal free-floating particles. If they were just set into speed by a moving bot, would they stop moving if the bot isn't in the boundary anymore?

If a bot stops moving relative to the fluid, it won't effect it anymore really.  If it's the only thing in the world, basically all the particles stop moving.  For tracer particles anyway.  If I add in the vorticity particles they'll actually induce spin in the fluid on their own, and get moved by the fluid, and produce interesting wake patterns, but they're more expensive to simulate.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Organelles, better multicellular organisms, and more
« Reply #18 on: April 22, 2013, 06:22:35 PM »
Back to organels, I think I would like a organel that converts a (eatable) shape into nrg. :)
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Organelles, better multicellular organisms, and more
« Reply #19 on: April 22, 2013, 06:52:56 PM »
Back to organels, I think I would like a organel that converts a (eatable) shape into nrg. :)

I was thinking more that shapes could be used for things like shell, but directly digesting them could work, too.  That would free up the need for doing anything with diffusion certainly.  Instead of dissolving things in the fluid just have solid chunks of stuff that can float around or fall to the bottom or whatever.  Probably not all shapes are digestible, which would imply a need for different substances for shapes.  Which is an idea I'd like to play with anyway, but I need to be careful to keep the number of different resources to a manageable minimum.

Offline penlu

  • Bot Neophyte
  • *
  • Posts: 1
    • View Profile
Re: Organelles, better multicellular organisms, and more
« Reply #20 on: June 09, 2013, 03:36:42 AM »
I had an idea about organelles that is probably too different from how it is in Darwinbots now.  So this is abstract, but:

Mitochondria or some such:
body -> waste + nrg

Rough ER or something?  What handles this in real cells?
waste + nrg -> body

Chloroplasts, with light:
waste -> body

With corpses floating around, this means conservation of mass.