Code center > Darwinbots3

Bot testbed

<< < (2/13) > >>

Shadowgod2:
well this will be a while.. basically learning a proper programing language.. my brain does not compute well  :wacko:.. trying to figure out how to make an ellipse without long handing it... maybe im reaching too high right now and should basically mess with the shape in other ways... if i can make the spindles dependent of each other that would be a good start.

cant wait for evolution to do this for me.. :D jk

Numsgil:
Ellipses are hard, haha, but I managed it.  Set this to 120 segments:


--- Code: ---{rdiv swap div }
{square dup mul }
{gulp 0 store } ' clear out the integer stack by one element
macro rdiv @rdiv
macro square @square
macro gulp @gulp
const a 500
const b 501
const theta 502

' Ellipse equation is
'                         a * b
' ------------------------------------------------
'  sqrt( (b * cos(theta))^2 + (a * sin(theta))^2 )
{ellipse
.b
.a
.theta
*theta cos *b mul square
*theta sin *a mul square
add
sqrt
*a *b mul
9999 mul
30 mul
rdiv
} gulp

120 { dup
9 mul ' Get in range [0, 1080]
' cos 0 max 1000 add ' Not an ellipse but interesting!
5 3 @ellipse
swap store } loop

--- End code ---

There's probably a much simpler way to get an ellipse, but I don't know it!

Note that this will crash the renderer at around 60 bot segments.  I've already made a note of it.

Shadowgod2:
seems to make mine crash from the start :/

spike43884:
Ahh I understand the intentions for simplifying things.
For finite loops, I'm not sure you need code for that, you can just make repetitions of DNA to loop with any checks needed. Then it prevents easy setting up of huge loops, and shows truly how long a bots DNA is.

A few quick questions - Will bots be able to stick to things, like ties do in DB2, and will they be able to stick to "shapes" or such? Also, are shapes going to be reworked at all, perhaps being able to have some extra properties of their own like buoyancy or mass (allowing pushing of shapes by bots)?

Numsgil:

--- Quote from: Shadowgod2 on April 05, 2017, 09:09:24 AM ---seems to make mine crash from the start :/

--- End quote ---

Bleh, mine too.  This seems to have exposed quite a number of different bugs.  Give me a few days or weeks to fix it.  In the mean time, if you go to your Documents folder, and find Darwinbots3, and rename or delete .lastexit.lua, you can sort of "factory reset" things.  Then, if you start the Bot Testbed again, set the number of spindles to 120, and copy+paste the DNA I showed, it should work.


--- Quote ---For finite loops, I'm not sure you need code for that, you can just make repetitions of DNA to loop with any checks needed. Then it prevents easy setting up of huge loops, and shows truly how long a bots DNA is.

--- End quote ---

I'm not sure exactly what you mean.  Do you mean just copy+paste the code over and over and get rid of loops entirely?  Although they come with a lot of baggage, I think allowing some simple looping will make for some interesting evolution.


--- Quote ---Will bots be able to stick to things, like ties do in DB2, and will they be able to stick to "shapes" or such?

--- End quote ---

Yes, eventually, but I don't know how it will work yet.  Probably the vertices of the bot's polygon, the ends of the "spindles", can form anchors against other bots and shapes in the environment.  But I probably won't have springy ties like in DB2.  The bots themselves, since they can change shape, can act as the springs for most multibot type things you'd want to build.


--- Quote ---are shapes going to be reworked at all, perhaps being able to have some extra properties of their own like buoyancy or mass (allowing pushing of shapes by bots)?

--- End quote ---

Yes they'll be reworked.  One of the archetypes I'm working towards is an "ant" bot that can make colonies by digging out shapes.  Probably also, in addition to nrg, bots need some physical substance (ie: nutrients) to grow that they can only get from shapes.  From some light research, it seems a large part of why rain forests are so biodiverse is that they're energy rich but nutrient poor, so I want to be able to simulate that.

I'm not sure of the specifics yet, but my thought is basically that when a dead bot decays, it leaves behind inorganic blobs that can float around in the sim.  Blobs that touch each other stick together, so over time blobs will combine together to form larger and larger shapes.  Something like that.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version