Darwinbots Forum

Code center => Darwinbots3 => Topic started by: Numsgil on April 01, 2017, 11:32:48 AM

Title: Bot testbed
Post by: Numsgil on April 01, 2017, 11:32:48 AM
Okay, at long last, I have completed the first iteration of my bot testbed.

What is it?
A simulation with a single bot in it.  This is a very simple base I'm going to use to build more features on top of.

The single bot is a star shaped polygon (https://en.wikipedia.org/wiki/Star-shaped_polygon).  It has "spindles" arranged around its nucleus.  The bot can control the length of these spindles using its DNA.

So far the only features implemented are the spindles.  It can't reproduce or move or do anything else but change its shape.

Overview
It's multithreaded (to a point) with 3 core threads:

Importantly these three threads are independent.  The simulation can run at 10000 cycles/sec and the graphics can run at 5 FPS.  Or the simulation could run at 10 cycles/sec and the graphics could run at 60 FPS.

If one thread crashes, it should largely not cause problems for the other threads.  The simulation thread can continue running in the background if the render thread crashes (as long as it's not frame locked), and vice versa.

Read the DNA help
The DNA langauge that Darwinbots3 uses ("Sunweaver") is similar but distinct from the language in Darwinbots2.  Make sure you read through the Sunweaver manual under the help menu to understand it.  If you want to suggest changes, the raw text for it is here (http://svn.darwinbots.com/Darwinbots3/Trunk/Modules/Sunweaver/Source/SunweaverManual.txt).  Just send me any changes you make to that file.

Help me out
My mission for you guys, if you're willing, is to mess around with this testbed to create bots that do cool things.  Specifically I'd like some bots that move in a way that looks like they're swimming, because I want to try adding fluid to this testbed next, and I want to see if a swimming motion can produce forward motion.

Also, I want to make sure that there aren't any bugs.  If you find crashing bugs, you will get an exception dialog box.  You can see what it looks like by forcing crashes (look under the 'debug' menu).  Copy+paste the exception dialog text and post it here and I can try and reproduce the issue on my side.  Unless you know why it crashed, of course, and it's not a bug. 

Or if you find the interface weird, or have just general comments, please let me know.

What's next
I'm going to start experimenting with adding fluid to this simple testbed.  I'd like to verify that it's possible for bots to swim by manipulating their shapes.

(Edit: Nov 2017.  New version uploaded)
Title: Re: Bot testbed
Post by: spike43884 on April 03, 2017, 02:08:07 PM
Just partway through reading up that sunweaver manual file... I came up with a few ideas for changes, it'd be pretty sweet if you were able to implement them (if they haven't been yet)

One nice thing would be to include tan in mathematical operators (we currently only have sine and cosine), a 'proportional to' operator, and perhaps some sort of support for percentiles? I'd quite like to also see factorials, perhaps shortcuts for some constants (like pi, the golden ratio, eulers constant and so forth) - Some distinguishing between vector and scalar products would be quite useful too I do think. A couple of probability functions in DNA so we don't have to rely on total randomness...

Finally, and deviating from the maths side of things, a "return to line __" function would be quite nice to force part of the DNA to rerun...
Title: Re: Bot testbed
Post by: Numsgil on April 03, 2017, 05:50:45 PM
One nice thing would be to include tan in mathematical operators (we currently only have sine and cosine), a 'proportional to' operator, and perhaps some sort of support for percentiles? I'd quite like to also see factorials... A couple of probability functions in DNA so we don't have to rely on total randomness.

On purpose I've tried to leave the underlying language with relatively few commands, so it's easier to learn and understand.  It's not meant to be fully featured.  Note you can write codules and set up macros with them, so you have a lot of power to make your own commands and use them the same as if they were natively supported.

So for instance, naively you could define a tangent function as:

(edit: Oops, language is still new to me too.  I've modified this to be right, hopefully).
Code: [Select]
{tan dup cos swap sin div }
macro tan @tan

I say naively because you're just doing integer division, and not using the full range of the integer stack, so the error in the calculation here would be quite large.  Which brings me to point two:

Quote
perhaps shortcuts for some constants (like pi, the golden ratio, eulers constant and so forth) - Some distinguishing between vector and scalar products would be quite useful too I do think.

Sunweaver, like the DNA in Darwinbots2, is entirely integer driven.  Pi doesn't make sense in the language, unless you want it to just be 3 :)  You could arbitrarily decide to store as many digits as you could, but that still might not be appropriate depending on what you're trying to do.  For instance, some sort of numerical calculation involving pi might need 100s of digits.  Or it might be fine approximating it as 3.  There isn't really a one size fits all here.  Note that sin and cos, for instance, don't use radians they use degrees (well, degrees / 3). 

Likewise there's nothing inherently vector or not about anything in the language.  Integers get pushed to the stack, and integers get popped from the stack, and integers get written to memory.  How anything is interpreted in between is a question for the programmer.

Quote
Finally, and deviating from the maths side of things, a "return to line __" function would be quite nice to force part of the DNA to rerun...

This is another case where the restrictions are on purpose.  Like in DB2, the entire DNA gets executed, start to end, every cycle.  In order to prevent infinite loops from causing the program to hang, infinite loops are simply impossible.  If I supported gotos, I can't guarantee that a given DNA program would terminate.  As a compromise note that DNA supports a finite looping mechanism.  So you can basically run a loop over some code 100 times, for instance.  But even here, I'm not sure if this is too generous.  It's possible to make some really gross nested loops that can eat all the CPU cycles and slow the simulation to a crawl.  But I think the loops, along with the branching mechanisms, might be an important tool for evolution so I wanted to include them.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 04, 2017, 02:09:41 PM
Primitive it is... i with i could see the memory similarly to db2 but i do have an idea on a swimmer, just after i figure out how the dna works more hopefully i will get a working swimmer in a few days. Looks good.
Title: Re: Bot testbed
Post by: Numsgil on April 04, 2017, 04:57:40 PM
i with i could see the memory similarly to db2

Yes, on my todo list. :/  If you're really desperate you could save the simulation and inspect the memory in the save file.  The saves are just Lua scripts, and fairly readable.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 05, 2017, 12:43:07 AM
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
Title: Re: Bot testbed
Post by: Numsgil on April 05, 2017, 05:07:27 AM
Ellipses are hard, haha, but I managed it.  Set this to 120 segments:

Code: [Select]
{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

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.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 05, 2017, 09:09:24 AM
seems to make mine crash from the start :/
Title: Re: Bot testbed
Post by: spike43884 on April 05, 2017, 11:59:54 AM
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)?
Title: Re: Bot testbed
Post by: Numsgil on April 05, 2017, 02:22:02 PM
seems to make mine crash from the start :/

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.

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?

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)?

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.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 05, 2017, 09:36:01 PM
well probably same bug as above but it might be easier to find the bugs... idk i'm not a programmer but if you set the seg number to 5 the rendering crashes at 13. seems to only be 13 but you'll have to play with it

macro seg 5
seg 2 div { dup seg 2 div add swap seg add swap store } loop


seg is the number of segments btw... now to figure out how to mirror to the other side

also how do you read the memory of a location like this:

120 { dup (get memory of said location, modify it) swap store } loop
Title: Re: Bot testbed
Post by: Numsgil on April 06, 2017, 04:30:41 AM
also how do you read the memory of a location like this:

120 { dup (get memory of said location, modify it) swap store } loop

You can use the ref command like so:

Code: [Select]
120 { dup ref 5 add swap store } loop

(I'm pretty sure that bot memory is saved between frames, but I saw an issue recently that made me question that assumption.  It was something I tested once a long time ago but haven't tested recently.  If it seems like memory is cleared every frame, let me know).
Title: Re: Bot testbed
Post by: Shadowgod2 on April 06, 2017, 08:56:01 AM
Yea seems to be a bug when you start everything to 0 and try to just add 1 to it, it adds the 1 but seems to stop after that which is why i was confused. Thanks
Title: Re: Bot testbed
Post by: Numsgil on April 06, 2017, 11:35:41 AM
Bleh, sorry, I guess I need some better testing around the high level stuff.  I'm going on vacation soon, which means I'll either get a lot of programming done or none at all, so I'm not sure what sort of timeline for a fix would look like,
Title: Re: Bot testbed
Post by: Shadowgod2 on April 06, 2017, 12:06:39 PM
Alright no problem. I'll still play with the bot dna see what i get. I feel like im getting pretty close to getting what i need to know for a basic swimmer or something allong those lines.. crude but workable.
Title: Re: Bot testbed
Post by: spike43884 on April 06, 2017, 05:28:34 PM
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.

In a rainforest style sim most energy would be stored in the bots, not shapes (I do geography, that premise is part of why deforestation of the rainforest is SO bad as growing it back isn't too easy, when the trees are gone, so are the nutrients). Perhaps considering bots and shapes have a volume, express nutrients within them as a "density/concentration", and then when the decay or are dug out, when volume decreases by x amount one unit of nutrient is released. (E.g. when the concentration of glucose is 1 part per 10, once volume decreases by 1, one glucose will be emitted). That system could allow for multiple nutrients to exist simultaneously if you so wished.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 06, 2017, 06:41:01 PM
as i understand it that would be the case if you so wished it. consider shapes as the decaying bots with all the energy and nutrients in the bot still there but locked up till another bot picks it up. the nutrients might be everywhere but concentrated in the shapes and living bots, where in the open the nutrients can be livable but not necessarily enough to grow much. at the start of a sim that would be a different story but as time went on less so forcing evolution to diversify and keep those nutrients in circulation in the environment.

i have figured out mirroring, now i can work on the waves..

seg = segment numbers:

const seg 120

seg 2 div 1 add { 10 rand swap store } loop

seg 2 div 1 add { dup ref swap neg seg add 2 add store } loop
Title: Re: Bot testbed
Post by: spike43884 on April 07, 2017, 04:18:05 PM
as i understand it that would be the case if you so wished it. consider shapes as the decaying bots with all the energy and nutrients in the bot still there but locked up till another bot picks it up. the nutrients might be everywhere but concentrated in the shapes and living bots, where in the open the nutrients can be livable but not necessarily enough to grow much. at the start of a sim that would be a different story but as time went on less so forcing evolution to diversify and keep those nutrients in circulation in the environment.

Yep, although at the beginning of a sim, the larger proportion of nutrients would be outside of bots (either in shapes or in the general environment). As more life (bots/veggies) exists in a sim, the pool of nutrients is drained (unless an option to periodically add nutrients is added).

That would allow a self-limited mechanism to be able to be implemented as to the amount of bots or veggies that can be sustained by an area, by causing a sim to slowly tend towards a rain-forest style environment if all other conditions are favourable, causing a huge drain on ambient (shape-locked or free) nutrients, allowing for growth to only usually occur as a result of death of other bots or veggies.


I feel it'd also help evolution sims a bit too, as it wouldn't be a case of getting a huge population, but of having a sustainable population and ensuring each bot is effective.
Title: Re: Bot testbed
Post by: Numsgil on April 07, 2017, 05:52:43 PM
I've uploaded a new version at the top of the thread (A01330) that fixes the render thread crashes.  If you notice any more, send them my way (note you can copy+paste from the exception dialog if the repro is awkward).
Title: Re: Bot testbed
Post by: Shadowgod2 on April 08, 2017, 12:14:05 AM
i tried the randomizing mirroring code i had above (which i realized wasn't complete for some reason and had fixed) and the render crashed so here's the log:

Code: [Select]
RootLevelException = {
    Description = "System.Exception",
    Message = "Encountered another boundary edge when building monotone polygon for boundary edge.",
    Source = "Annulus.CSG.StraightSkeletonDecompose",
    Stack Trace = {
        File = "\Modules\Annulus\Annulus\CSG\StraightSkeleton.cs:137:25",
        File = "\Modules\Blacklight\Core\Core\Drawables\Polygon.cs:48:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:200:17",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:101:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:149:17",
    },
    Data = {
        radiiOut = {
            0 = "0.0199909991 //0x3F9478853D64D7A4",
            1 = "0.0109990999 //0x3F8686B23330D729",
            2 = "0.0199909991 //0x3F9478853D64D7A4",
            3 = "0.0199909991 //0x3F9478853D64D7A4",
            4 = "0.0159945995 //0x3F9060E3665F5248",
            5 = "0.0139963996 //0x3F8CAA24F5B91F34",
            6 = "0.0179927993 //0x3F926CB451E214F6",
            7 = "0.0199909991 //0x3F9478853D64D7A4",
            8 = "0.0119981998 //0x3F8892831EB399D7",
            9 = "0.0199909991 //0x3F9478853D64D7A4",
            10 = "0.0119981998 //0x3F8892831EB399D7",
            11 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            12 = "0.0179927993 //0x3F926CB451E214F6",
            13 = "0.0129972997 //0x3F8A9E540A365C85",
            14 = "0.0179927993 //0x3F926CB451E214F6",
            15 = "0.0169936994 //0x3F9166CBDC20B39E",
            16 = "0.0179927993 //0x3F926CB451E214F6",
            17 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            18 = "0.0189918992 //0x3F93729CC7A3764C",
            19 = "0.0169936994 //0x3F9166CBDC20B39E",
            20 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            21 = "0.0169936994 //0x3F9166CBDC20B39E",
            22 = "0.0129972997 //0x3F8A9E540A365C85",
            23 = "0.0129972997 //0x3F8A9E540A365C85",
            24 = "0.0199909991 //0x3F9478853D64D7A4",
            25 = "0.0169936994 //0x3F9166CBDC20B39E",
            26 = "0.0159945995 //0x3F9060E3665F5248",
            27 = "0.0139963996 //0x3F8CAA24F5B91F34",
            28 = "0.0119981998 //0x3F8892831EB399D7",
            29 = "0.0159945995 //0x3F9060E3665F5248",
            30 = "0.0109990999 //0x3F8686B23330D729",
            31 = "0.0109990999 //0x3F8686B23330D729",
            32 = "0.0139963996 //0x3F8CAA24F5B91F34",
            33 = "0.0179927993 //0x3F926CB451E214F6",
            34 = "0.0159945995 //0x3F9060E3665F5248",
            35 = "0.0109990999 //0x3F8686B23330D729",
            36 = "0.0199909991 //0x3F9478853D64D7A4",
            37 = "0.0159945995 //0x3F9060E3665F5248",
            38 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            39 = "0.0129972997 //0x3F8A9E540A365C85",
            40 = "0.0189918992 //0x3F93729CC7A3764C",
            41 = "0.0189918992 //0x3F93729CC7A3764C",
            42 = "0.0139963996 //0x3F8CAA24F5B91F34",
            43 = "0.0169936994 //0x3F9166CBDC20B39E",
            44 = "0.0169936994 //0x3F9166CBDC20B39E",
            45 = "0.0199909991 //0x3F9478853D64D7A4",
            46 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            47 = "0.0119981998 //0x3F8892831EB399D7",
            48 = "0.0139963996 //0x3F8CAA24F5B91F34",
            49 = "0.0129972997 //0x3F8A9E540A365C85",
            50 = "0.0189918992 //0x3F93729CC7A3764C",
            51 = "0.0129972997 //0x3F8A9E540A365C85",
            52 = "0.0139963996 //0x3F8CAA24F5B91F34",
            53 = "0.0119981998 //0x3F8892831EB399D7",
            54 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            55 = "0.0199909991 //0x3F9478853D64D7A4",
            56 = "0.0169936994 //0x3F9166CBDC20B39E",
            57 = "0.0169936994 //0x3F9166CBDC20B39E",
            58 = "0.0139963996 //0x3F8CAA24F5B91F34",
            59 = "0.0189918992 //0x3F93729CC7A3764C",
            60 = "0.0189918992 //0x3F93729CC7A3764C",
            61 = "0.0129972997 //0x3F8A9E540A365C85",
            62 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            63 = "0.0159945995 //0x3F9060E3665F5248",
            64 = "0.0199909991 //0x3F9478853D64D7A4",
            65 = "0.0109990999 //0x3F8686B23330D729",
            66 = "0.0159945995 //0x3F9060E3665F5248",
            67 = "0.0179927993 //0x3F926CB451E214F6",
            68 = "0.0139963996 //0x3F8CAA24F5B91F34",
            69 = "0.0109990999 //0x3F8686B23330D729",
            70 = "0.0109990999 //0x3F8686B23330D729",
            71 = "0.0159945995 //0x3F9060E3665F5248",
            72 = "0.0119981998 //0x3F8892831EB399D7",
            73 = "0.0139963996 //0x3F8CAA24F5B91F34",
            74 = "0.0159945995 //0x3F9060E3665F5248",
            75 = "0.0169936994 //0x3F9166CBDC20B39E",
            76 = "0.0199909991 //0x3F9478853D64D7A4",
            77 = "0.0129972997 //0x3F8A9E540A365C85",
            78 = "0.0129972997 //0x3F8A9E540A365C85",
            79 = "0.0169936994 //0x3F9166CBDC20B39E",
            80 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            81 = "0.0169936994 //0x3F9166CBDC20B39E",
            82 = "0.0189918992 //0x3F93729CC7A3764C",
            83 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            84 = "0.0179927993 //0x3F926CB451E214F6",
            85 = "0.0169936994 //0x3F9166CBDC20B39E",
            86 = "0.0179927993 //0x3F926CB451E214F6",
            87 = "0.0129972997 //0x3F8A9E540A365C85",
            88 = "0.0179927993 //0x3F926CB451E214F6",
            89 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            90 = "0.0119981998 //0x3F8892831EB399D7",
            91 = "0.0199909991 //0x3F9478853D64D7A4",
            92 = "0.0119981998 //0x3F8892831EB399D7",
            93 = "0.0199909991 //0x3F9478853D64D7A4",
            94 = "0.0179927993 //0x3F926CB451E214F6",
            95 = "0.0139963996 //0x3F8CAA24F5B91F34",
            96 = "0.0159945995 //0x3F9060E3665F5248",
            97 = "0.0199909991 //0x3F9478853D64D7A4",
            98 = "0.0199909991 //0x3F9478853D64D7A4",
            99 = "0.0109990999 //0x3F8686B23330D729",
        },
    },
}

hopefully ill get a basic swimmer tonight.. ill edit to here if no one posts like usual..
Title: Re: Bot testbed
Post by: Numsgil on April 08, 2017, 02:33:36 PM
Okay, fixed that render crash too.  New version is at the top of the thread.
Title: Re: Bot testbed
Post by: Botsareus on April 08, 2017, 06:11:11 PM
I like to simply point out that sin and cos use the full integer range in db2 because the result is multiplied by 32000. Therefore if you divide sin by cos you would get some decent but not perfect results.
Title: Re: Bot testbed
Post by: Numsgil on April 08, 2017, 07:20:04 PM
I'm not against changing the range, as long as it's a multiple of 360 (so the mapping to degrees is easy).  How do people feel about mapping [0, 360] degrees to [0, 9720], since the max range of memory is 9999?  I wouldn't want to go higher, even though the stack has 9 digits, since you couldn't store the result easily in memory.
Title: Re: Bot testbed
Post by: Numsgil on April 08, 2017, 07:29:26 PM
Oh, I've also uploaded a new version.  Change list and new binary at the top.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 08, 2017, 10:24:30 PM
i have me a crude swimmer :D finally..
Code: [Select]
const seg 120
const maxh 20
const minh 5
const timer 10
'1 is always maxed
maxh 10 add .1

'wave up if count is 0 and prev seg is not 0ed

seg 2 div 1 add {
 dup 300 add ref sgn abs neg 1 add mul
 dup 1 sub ref minh sub sgn 1 sub sgn 1 add mul
 dup dup ref maxh swap sub 2 div swap ref add 1 add swap store } loop

'wave down if at or above max hight or -1 counter

seg 2 div 1 add {
 dup dup 300 add ref sgn 1 add sgn neg 1 add swap
 ref maxh sub sgn 1 add sgn add sgn mul
 dup dup dup ref swap ref  minh sub 2 div 1 add sub swap store
-1 swap 300 add store } loop

'count down from 3 to 0 when 0ed, 0 starts the wave, -1 is reverse on wave
''set timer to x if 0ed and timer is -1

seg 2 div 1 add {
dup ref minh swap sub sgn 1 add sgn mul
dup 300 add ref sgn 1 add sgn neg 1 add mul
300 add timer swap store } loop

''count down

seg 2 div 1 add {
300 add dup ref sgn 1 sub sgn 1 add mul
dup ref 1 sub swap store } loop

'mirror other side
seg 2 div 1 add { dup ref swap neg seg add 2 add store } loop

basic but good enough to test with.. now lets see if i can get an ellipse as the minh to weigh against for a better looking movement in the waves
Title: Re: Bot testbed
Post by: Shadowgod2 on April 08, 2017, 10:48:52 PM
ok this crash came out of no where while i was messing with the settings on the new bot:
Code: [Select]
RootLevelException = {
    Description = "System.Exception",
    Message = "Encountered another boundary edge when building monotone polygon for boundary edge.",
    Source = "Annulus.CSG.StraightSkeletonDecompose",
    Stack Trace = {
        File = "\Modules\Annulus\Annulus\CSG\StraightSkeleton.cs:137:25",
        File = "\Modules\Blacklight\Core\Core\Drawables\Polygon.cs:48:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:200:17",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:101:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:149:17",
    },
    Data = {
        radiiOut = {
            0 = "0.0889288929 //0x3FB6C40B3EA10505",
            1 = "0.0619531953 //0x3FAFB854478F67F6",
            2 = "0.064950495 //0x3FB0A0987C18BCFC",
            3 = "0.0709450945 //0x3FB229752CBACEFE",
            4 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            5 = "0.1079117912 //0x3FBBA01B6DF79363",
            6 = "0.1049144914 //0x3FBADBAD15A68A62",
            7 = "0.098919892 //0x3FB952D06504785F",
            8 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            9 = "0.0599549955 //0x3FAEB26BD1CE069F",
            10 = "0.0619531953 //0x3FAFB854478F67F6",
            11 = "0.064950495 //0x3FB0A0987C18BCFC",
            12 = "0.0709450945 //0x3FB229752CBACEFE",
            13 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            14 = "0.1079117912 //0x3FBBA01B6DF79363",
            15 = "0.1049144914 //0x3FBADBAD15A68A62",
            16 = "0.098919892 //0x3FB952D06504785F",
            17 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            18 = "0.0599549955 //0x3FAEB26BD1CE069F",
            19 = "0.0619531953 //0x3FAFB854478F67F6",
            20 = "0.064950495 //0x3FB0A0987C18BCFC",
            21 = "0.0709450945 //0x3FB229752CBACEFE",
            22 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            23 = "0.1079117912 //0x3FBBA01B6DF79363",
            24 = "0.1049144914 //0x3FBADBAD15A68A62",
            25 = "0.098919892 //0x3FB952D06504785F",
            26 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            27 = "0.0599549955 //0x3FAEB26BD1CE069F",
            28 = "0.0619531953 //0x3FAFB854478F67F6",
            29 = "0.064950495 //0x3FB0A0987C18BCFC",
            30 = "0.0709450945 //0x3FB229752CBACEFE",
            31 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            32 = "0.1079117912 //0x3FBBA01B6DF79363",
            33 = "0.1049144914 //0x3FBADBAD15A68A62",
            34 = "0.098919892 //0x3FB952D06504785F",
            35 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            36 = "0.0599549955 //0x3FAEB26BD1CE069F",
            37 = "0.0619531953 //0x3FAFB854478F67F6",
            38 = "0.064950495 //0x3FB0A0987C18BCFC",
            39 = "0.0709450945 //0x3FB229752CBACEFE",
            40 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            41 = "0.1079117912 //0x3FBBA01B6DF79363",
            42 = "0.1049144914 //0x3FBADBAD15A68A62",
            43 = "0.098919892 //0x3FB952D06504785F",
            44 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            45 = "0.0599549955 //0x3FAEB26BD1CE069F",
            46 = "0.0619531953 //0x3FAFB854478F67F6",
            47 = "0.064950495 //0x3FB0A0987C18BCFC",
            48 = "0.0709450945 //0x3FB229752CBACEFE",
            49 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            50 = "0.1079117912 //0x3FBBA01B6DF79363",
            51 = "0.1049144914 //0x3FBADBAD15A68A62",
            52 = "0.098919892 //0x3FB952D06504785F",
            53 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            54 = "0.0599549955 //0x3FAEB26BD1CE069F",
            55 = "0.0619531953 //0x3FAFB854478F67F6",
            56 = "0.064950495 //0x3FB0A0987C18BCFC",
            57 = "0.0709450945 //0x3FB229752CBACEFE",
            58 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            59 = "0.1079117912 //0x3FBBA01B6DF79363",
            60 = "0.1049144914 //0x3FBADBAD15A68A62",
            61 = "0.1079117912 //0x3FBBA01B6DF79363",
            62 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            63 = "0.0709450945 //0x3FB229752CBACEFE",
            64 = "0.064950495 //0x3FB0A0987C18BCFC",
            65 = "0.0619531953 //0x3FAFB854478F67F6",
            66 = "0.0599549955 //0x3FAEB26BD1CE069F",
            67 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            68 = "0.098919892 //0x3FB952D06504785F",
            69 = "0.1049144914 //0x3FBADBAD15A68A62",
            70 = "0.1079117912 //0x3FBBA01B6DF79363",
            71 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            72 = "0.0709450945 //0x3FB229752CBACEFE",
            73 = "0.064950495 //0x3FB0A0987C18BCFC",
            74 = "0.0619531953 //0x3FAFB854478F67F6",
            75 = "0.0599549955 //0x3FAEB26BD1CE069F",
            76 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            77 = "0.098919892 //0x3FB952D06504785F",
            78 = "0.1049144914 //0x3FBADBAD15A68A62",
            79 = "0.1079117912 //0x3FBBA01B6DF79363",
            80 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            81 = "0.0709450945 //0x3FB229752CBACEFE",
            82 = "0.064950495 //0x3FB0A0987C18BCFC",
            83 = "0.0619531953 //0x3FAFB854478F67F6",
            84 = "0.0599549955 //0x3FAEB26BD1CE069F",
            85 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            86 = "0.098919892 //0x3FB952D06504785F",
            87 = "0.1049144914 //0x3FBADBAD15A68A62",
            88 = "0.1079117912 //0x3FBBA01B6DF79363",
            89 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            90 = "0.0709450945 //0x3FB229752CBACEFE",
            91 = "0.064950495 //0x3FB0A0987C18BCFC",
            92 = "0.0619531953 //0x3FAFB854478F67F6",
            93 = "0.0599549955 //0x3FAEB26BD1CE069F",
            94 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            95 = "0.098919892 //0x3FB952D06504785F",
            96 = "0.1049144914 //0x3FBADBAD15A68A62",
            97 = "0.1079117912 //0x3FBBA01B6DF79363",
            98 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            99 = "0.0709450945 //0x3FB229752CBACEFE",
            100 = "0.064950495 //0x3FB0A0987C18BCFC",
            101 = "0.0619531953 //0x3FAFB854478F67F6",
            102 = "0.0599549955 //0x3FAEB26BD1CE069F",
            103 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            104 = "0.098919892 //0x3FB952D06504785F",
            105 = "0.1049144914 //0x3FBADBAD15A68A62",
            106 = "0.1079117912 //0x3FBBA01B6DF79363",
            107 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            108 = "0.0709450945 //0x3FB229752CBACEFE",
            109 = "0.064950495 //0x3FB0A0987C18BCFC",
            110 = "0.0619531953 //0x3FAFB854478F67F6",
            111 = "0.0599549955 //0x3FAEB26BD1CE069F",
            112 = "0.0859315932 //0x3FB5FF9CE64FFC05",
            113 = "0.098919892 //0x3FB952D06504785F",
            114 = "0.1049144914 //0x3FBADBAD15A68A62",
            115 = "0.1079117912 //0x3FBBA01B6DF79363",
            116 = "0.0839333933 //0x3FB57CA8AB6F4B59",
            117 = "0.0709450945 //0x3FB229752CBACEFE",
            118 = "0.064950495 //0x3FB0A0987C18BCFC",
            119 = "0.0619531953 //0x3FAFB854478F67F6",
        },
    },
}
Title: Re: Bot testbed
Post by: spike43884 on April 09, 2017, 04:14:37 AM
I'm not against changing the range, as long as it's a multiple of 360 (so the mapping to degrees is easy).  How do people feel about mapping [0, 360] degrees to [0, 9720], since the max range of memory is 9999?  I wouldn't want to go higher, even though the stack has 9 digits, since you couldn't store the result easily in memory.

Do 9900 perhaps as it's a multiple of 180 (which is half of 360) -> 55*180 = 9999

You can't get any closer to 9999 via 90, 45 or 22.5 multiples.
Also, I can't imagine you using 9999 memory locations (though, I may be wrong) so if you then made it so memory locations greater than 9900 (those which can't standardly be selected by cos/sin) as custom memory locations, for people to store their own data in (including epigenetic locations?) - 99 in most cases should be enough.
Title: Re: Bot testbed
Post by: Numsgil on April 09, 2017, 07:57:08 AM
i have me a crude swimmer :D finally..

Ah, it's pretty sweet :)  I haven't started with fluid stuff yet (fixing all the crashes you've been finding), but soon.

Quote from: spike43884
Do 9900 perhaps as it's a multiple of 180 (which is half of 360) -> 55*180 = 9999

Problem is you can't represent 45 degrees if 360->9900 (since 9900 doesn't divide evenly in to 8 parts), and that's a fairly important angle.

Quote
Also, I can't imagine you using 9999 memory locations (though, I may be wrong) so if you then made it so memory locations greater than 9900 (those which can't standardly be selected by cos/sin) as custom memory locations, for people to store their own data in (including epigenetic locations?) - 99 in most cases should be enough.

At the moment there are only 999 memory locations.  I'll probably expand that to 9999 at some point, but point is don't confuse how many memory slots there are (999) with what values they can store ([-9999, 9999]).

At some point I'll reserve a large contiguous memory block for user use.  At the moment I'm not sure how many sysvars I'll need for normal bot stuff yet, so I don't want to jump on to segmenting up the memory just yet.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 09, 2017, 09:17:15 AM
im fine with what ever for the angles but the memlocs as the dna stands now is easy to use up so i would recommend at least 300 being user use, probably more, but we'll cross that bridge when we get to it. one step at a time


 :glare: yet another bug report, why are new programs always so buggy, especially the fun ones:
Code: [Select]
RootLevelException = {
    Description = "System.Exception",
    Message = "Encountered another boundary edge when building monotone polygon for boundary edge.",
    Source = "Annulus.CSG.StraightSkeletonDecompose",
    Stack Trace = {
        File = "\Modules\Annulus\Annulus\CSG\StraightSkeleton.cs:137:25",
        File = "\Modules\Blacklight\Core\Core\Drawables\Polygon.cs:48:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:200:17",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:101:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:149:17",
    },
    Data = {
        radiiOut = {
            0 = "0.0439693969 //0x3FA6832823C2FBE6",
            1 = "0.0599549955 //0x3FAEB26BD1CE069F",
            2 = "0.0299819982 //0x3F9EB399D6F2A50A",
            3 = "0.0329792979 //0x3FA0E2A99C1B6487",
            4 = "0.0289828983 //0x3F9DADB1613143B4",
            5 = "0.0309810981 //0x3F9FB9824CB40660",
            6 = "0.0289828983 //0x3F9DADB1613143B4",
            7 = "0.0489648965 //0x3FA911ED4A266F40",
            8 = "0.0329792979 //0x3FA0E2A99C1B6487",
            9 = "0.0309810981 //0x3F9FB9824CB40660",
            10 = "0.0329792979 //0x3FA0E2A99C1B6487",
            11 = "0.0289828983 //0x3F9DADB1613143B4",
            12 = "0.0299819982 //0x3F9EB399D6F2A50A",
            13 = "0.0559585959 //0x3FACA69AE64B43F0",
            14 = "0.0569576958 //0x3FAD298F212BF49C",
            15 = "0.0549594959 //0x3FAC23A6AB6A9345",
            16 = "0.0289828983 //0x3F9DADB1613143B4",
            17 = "0.0339783978 //0x3FA1659DD6FC1533",
            18 = "0.031980198 //0x3FA05FB5613AB3DC",
            19 = "0.0279837984 //0x3F9CA7C8EB6FE25C",
            20 = "0.0389738974 //0x3FA3F462FD5F888C",
            21 = "0.0299819982 //0x3F9EB399D6F2A50A",
            22 = "0.0309810981 //0x3F9FB9824CB40660",
            23 = "0.0549594959 //0x3FAC23A6AB6A9345",
            24 = "0.0529612961 //0x3FAB1DBE35A931EE",
            25 = "0.053960396 //0x3FABA0B27089E299",
            26 = "0.0439693969 //0x3FA6832823C2FBE6",
            27 = "0.0579567957 //0x3FADAC835C0CA548",
            28 = "0.0309810981 //0x3F9FB9824CB40660",
            29 = "0.0279837984 //0x3F9CA7C8EB6FE25C",
            30 = "0.0299819982 //0x3F9EB399D6F2A50A",
            31 = "0.0329792979 //0x3FA0E2A99C1B6487",
            32 = "0.0349774977 //0x3FA1E89211DCC5DF",
            33 = "0.0329792979 //0x3FA0E2A99C1B6487",
            34 = "0.0309810981 //0x3F9FB9824CB40660",
            35 = "0.0279837984 //0x3F9CA7C8EB6FE25C",
            36 = "0.0289828983 //0x3F9DADB1613143B4",
            37 = "0.0329792979 //0x3FA0E2A99C1B6487",
            38 = "0.0339783978 //0x3FA1659DD6FC1533",
            39 = "0.0309810981 //0x3F9FB9824CB40660",
            40 = "0.0479657966 //0x3FA88EF90F45BE95",
            41 = "0.0449684968 //0x3FA7061C5EA3AC92",
            42 = "0.0379747975 //0x3FA3716EC27ED7E1",
            43 = "0.0299819982 //0x3F9EB399D6F2A50A",
            44 = "0.0289828983 //0x3F9DADB1613143B4",
            45 = "0.0329792979 //0x3FA0E2A99C1B6487",
            46 = "0.0299819982 //0x3F9EB399D6F2A50A",
            47 = "0.031980198 //0x3FA05FB5613AB3DC",
            48 = "0.0299819982 //0x3F9EB399D6F2A50A",
            49 = "0.0309810981 //0x3F9FB9824CB40660",
            50 = "0.0299819982 //0x3F9EB399D6F2A50A",
            51 = "0.0309810981 //0x3F9FB9824CB40660",
            52 = "0.0309810981 //0x3F9FB9824CB40660",
            53 = "0.0379747975 //0x3FA3716EC27ED7E1",
            54 = "0.0299819982 //0x3F9EB399D6F2A50A",
            55 = "0.0329792979 //0x3FA0E2A99C1B6487",
            56 = "0.0369756976 //0x3FA2EE7A879E2736",
            57 = "0.0579567957 //0x3FADAC835C0CA548",
            58 = "0.0569576958 //0x3FAD298F212BF49C",
            59 = "0.0329792979 //0x3FA0E2A99C1B6487",
            60 = "0.0329792979 //0x3FA0E2A99C1B6487",
            61 = "0.0329792979 //0x3FA0E2A99C1B6487",
            62 = "0.0569576958 //0x3FAD298F212BF49C",
            63 = "0.0579567957 //0x3FADAC835C0CA548",
            64 = "0.0369756976 //0x3FA2EE7A879E2736",
            65 = "0.0329792979 //0x3FA0E2A99C1B6487",
            66 = "0.0299819982 //0x3F9EB399D6F2A50A",
            67 = "0.0379747975 //0x3FA3716EC27ED7E1",
            68 = "0.0309810981 //0x3F9FB9824CB40660",
            69 = "0.0309810981 //0x3F9FB9824CB40660",
            70 = "0.0299819982 //0x3F9EB399D6F2A50A",
            71 = "0.0309810981 //0x3F9FB9824CB40660",
            72 = "0.0299819982 //0x3F9EB399D6F2A50A",
            73 = "0.031980198 //0x3FA05FB5613AB3DC",
            74 = "0.0299819982 //0x3F9EB399D6F2A50A",
            75 = "0.0329792979 //0x3FA0E2A99C1B6487",
            76 = "0.0289828983 //0x3F9DADB1613143B4",
            77 = "0.0299819982 //0x3F9EB399D6F2A50A",
            78 = "0.0379747975 //0x3FA3716EC27ED7E1",
            79 = "0.0449684968 //0x3FA7061C5EA3AC92",
            80 = "0.0479657966 //0x3FA88EF90F45BE95",
            81 = "0.0309810981 //0x3F9FB9824CB40660",
            82 = "0.0339783978 //0x3FA1659DD6FC1533",
            83 = "0.0329792979 //0x3FA0E2A99C1B6487",
            84 = "0.0289828983 //0x3F9DADB1613143B4",
            85 = "0.0279837984 //0x3F9CA7C8EB6FE25C",
            86 = "0.0309810981 //0x3F9FB9824CB40660",
            87 = "0.0329792979 //0x3FA0E2A99C1B6487",
            88 = "0.0349774977 //0x3FA1E89211DCC5DF",
            89 = "0.0329792979 //0x3FA0E2A99C1B6487",
            90 = "0.0299819982 //0x3F9EB399D6F2A50A",
            91 = "0.0279837984 //0x3F9CA7C8EB6FE25C",
            92 = "0.0309810981 //0x3F9FB9824CB40660",
            93 = "0.0579567957 //0x3FADAC835C0CA548",
            94 = "0.0439693969 //0x3FA6832823C2FBE6",
            95 = "0.053960396 //0x3FABA0B27089E299",
            96 = "0.0529612961 //0x3FAB1DBE35A931EE",
            97 = "0.0549594959 //0x3FAC23A6AB6A9345",
            98 = "0.0309810981 //0x3F9FB9824CB40660",
            99 = "0.0299819982 //0x3F9EB399D6F2A50A",
            100 = "0.0389738974 //0x3FA3F462FD5F888C",
            101 = "0.0279837984 //0x3F9CA7C8EB6FE25C",
            102 = "0.031980198 //0x3FA05FB5613AB3DC",
            103 = "0.0339783978 //0x3FA1659DD6FC1533",
            104 = "0.0289828983 //0x3F9DADB1613143B4",
            105 = "0.0549594959 //0x3FAC23A6AB6A9345",
            106 = "0.0569576958 //0x3FAD298F212BF49C",
            107 = "0.0559585959 //0x3FACA69AE64B43F0",
            108 = "0.0299819982 //0x3F9EB399D6F2A50A",
            109 = "0.0289828983 //0x3F9DADB1613143B4",
            110 = "0.0329792979 //0x3FA0E2A99C1B6487",
            111 = "0.0309810981 //0x3F9FB9824CB40660",
            112 = "0.0329792979 //0x3FA0E2A99C1B6487",
            113 = "0.0489648965 //0x3FA911ED4A266F40",
            114 = "0.0289828983 //0x3F9DADB1613143B4",
            115 = "0.0309810981 //0x3F9FB9824CB40660",
            116 = "0.0289828983 //0x3F9DADB1613143B4",
            117 = "0.0329792979 //0x3FA0E2A99C1B6487",
            118 = "0.0299819982 //0x3F9EB399D6F2A50A",
            119 = "0.0599549955 //0x3FAEB26BD1CE069F",
        },
    },
}
Title: Re: Bot testbed
Post by: Numsgil on April 09, 2017, 10:15:46 AM
Okay, new binary at the top that fixes all the render crashes you've posted so far.

If it's any consolation, I'm adding all the crashes you find to a big testing framework so each crash you find is some completely novel way of crashing things :)
Title: Re: Bot testbed
Post by: Shadowgod2 on April 09, 2017, 12:53:26 PM
Ok well what should i look for when it crashes so i don't post repeats?
Title: Re: Bot testbed
Post by: Numsgil on April 09, 2017, 02:08:32 PM
I meant because I'm fixing all the crashes you're posting, you end up finding novel ways to break things each time.  Definitely post all your crashes.
Title: Re: Bot testbed
Post by: spike43884 on April 09, 2017, 04:46:30 PM
i have me a crude swimmer :D finally..

Ah, it's pretty sweet :)  I haven't started with fluid stuff yet (fixing all the crashes you've been finding), but soon.

Quote from: spike43884
Do 9900 perhaps as it's a multiple of 180 (which is half of 360) -> 55*180 = 9999

Problem is you can't represent 45 degrees if 360->9900 (since 9900 doesn't divide evenly in to 8 parts), and that's a fairly important angle.

Quote
Also, I can't imagine you using 9999 memory locations (though, I may be wrong) so if you then made it so memory locations greater than 9900 (those which can't standardly be selected by cos/sin) as custom memory locations, for people to store their own data in (including epigenetic locations?) - 99 in most cases should be enough.

At the moment there are only 999 memory locations.  I'll probably expand that to 9999 at some point, but point is don't confuse how many memory slots there are (999) with what values they can store ([-9999, 9999]).

At some point I'll reserve a large contiguous memory block for user use.  At the moment I'm not sure how many sysvars I'll need for normal bot stuff yet, so I don't want to jump on to segmenting up the memory just yet.

Ahh k.
I just think trying to achieve a slightly nicer number to mark the end of sin/cos range might be better, so that people can memorise the division quicker to make coding bots a bit easier.

I can't imagine you needing even 999 memory slots, although expanding early on might be best just to ensure you don't run out, and so it doesn't end up with dedicated free slots sandwiched inbetween slots defined to a sysvar.

Title: Re: Bot testbed
Post by: Shadowgod2 on April 09, 2017, 06:58:47 PM
actually i can see you needing more for some advanced complex bots, especially when you get into some multibots.

ok this bug i know where its coming from, its when i close the lid of my computer with the program still running:
Code: [Select]
RootLevelException = {
    Description = "SharpDX.SharpDXException",
    Message = "Unknown error (HRESULT = 0x88760868)",
    Source = "System.Windows.Forms.ControlMarshaledInvoke",
    Stack Trace = {
        File = "\Modules\Darwinbots3\Bot.Testbed\Main.cs:140:17",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:109:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:149:17",
    },
    Data = {
        radiiOut = {
            0 = "0.031980198 //0x3FA05FB5613AB3DC",
            1 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            2 = "0.0159945995 //0x3F9060E3665F5248",
            3 = "0.0179927993 //0x3F926CB451E214F6",
            4 = "0.0219891989 //0x3F96845628E79A52",
            5 = "0.0289828983 //0x3F9DADB1613143B4",
            6 = "0.0269846985 //0x3F9BA1E075AE8104",
            7 = "0.0229882988 //0x3F978A3E9EA8FBA9",
            8 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            9 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            10 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            11 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            12 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            13 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            14 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            15 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            16 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            17 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            18 = "0.0159945995 //0x3F9060E3665F5248",
            19 = "0.0179927993 //0x3F926CB451E214F6",
            20 = "0.0219891989 //0x3F96845628E79A52",
            21 = "0.0289828983 //0x3F9DADB1613143B4",
            22 = "0.0269846985 //0x3F9BA1E075AE8104",
            23 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            24 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            25 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            26 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            27 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            28 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            29 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            30 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            31 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            32 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            33 = "0.0159945995 //0x3F9060E3665F5248",
            34 = "0.0179927993 //0x3F926CB451E214F6",
            35 = "0.0219891989 //0x3F96845628E79A52",
            36 = "0.0289828983 //0x3F9DADB1613143B4",
            37 = "0.0269846985 //0x3F9BA1E075AE8104",
            38 = "0.0229882988 //0x3F978A3E9EA8FBA9",
            39 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            40 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            41 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            42 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            43 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            44 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            45 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            46 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            47 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            48 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            49 = "0.0159945995 //0x3F9060E3665F5248",
            50 = "0.0179927993 //0x3F926CB451E214F6",
            51 = "0.0219891989 //0x3F96845628E79A52",
            52 = "0.0289828983 //0x3F9DADB1613143B4",
            53 = "0.0269846985 //0x3F9BA1E075AE8104",
            54 = "0.0229882988 //0x3F978A3E9EA8FBA9",
            55 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            56 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            57 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            58 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            59 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            60 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            61 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            62 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            63 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            64 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            65 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            66 = "0.0229882988 //0x3F978A3E9EA8FBA9",
            67 = "0.0269846985 //0x3F9BA1E075AE8104",
            68 = "0.0289828983 //0x3F9DADB1613143B4",
            69 = "0.0219891989 //0x3F96845628E79A52",
            70 = "0.0179927993 //0x3F926CB451E214F6",
            71 = "0.0159945995 //0x3F9060E3665F5248",
            72 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            73 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            74 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            75 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            76 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            77 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            78 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            79 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            80 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            81 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            82 = "0.0229882988 //0x3F978A3E9EA8FBA9",
            83 = "0.0269846985 //0x3F9BA1E075AE8104",
            84 = "0.0289828983 //0x3F9DADB1613143B4",
            85 = "0.0219891989 //0x3F96845628E79A52",
            86 = "0.0179927993 //0x3F926CB451E214F6",
            87 = "0.0159945995 //0x3F9060E3665F5248",
            88 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            89 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            90 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            91 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            92 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            93 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            94 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            95 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            96 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            97 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            98 = "0.0269846985 //0x3F9BA1E075AE8104",
            99 = "0.0289828983 //0x3F9DADB1613143B4",
            100 = "0.0219891989 //0x3F96845628E79A52",
            101 = "0.0179927993 //0x3F926CB451E214F6",
            102 = "0.0159945995 //0x3F9060E3665F5248",
            103 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            104 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            105 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            106 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            107 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            108 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            109 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            110 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            111 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            112 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
            113 = "0.0229882988 //0x3F978A3E9EA8FBA9",
            114 = "0.0269846985 //0x3F9BA1E075AE8104",
            115 = "0.0289828983 //0x3F9DADB1613143B4",
            116 = "0.0219891989 //0x3F96845628E79A52",
            117 = "0.0179927993 //0x3F926CB451E214F6",
            118 = "0.0159945995 //0x3F9060E3665F5248",
            119 = "0.0149954995 //0x3F8EB5F5E13BE1E1",
        },
    },
}
Title: Re: Bot testbed
Post by: spike43884 on April 10, 2017, 04:25:40 AM
I decided to pull out desmos just to try a few sine graphs.
(https://i.gyazo.com/d476d8db97558c62c41ebe6939632fb8.png)
Equation 1 satisfies full wavelengths for 999 and 9990.
Equation 2 satisfies fitting a number of half wavelengths for 999 and 9999.
Equation 3 satisfies fitting a full number of wavelengths for 9999.
Equation 4 satisfies fitting a full number of wavelengths for 999 and 9999.

(https://i.gyazo.com/113fbdbc8876eee7d2acef2d0b9c48e6.png)

In this case 1 wavelength = 999. For that type of equation within a sine function the wavelength = the denominator
Title: Re: Bot testbed
Post by: Numsgil on April 10, 2017, 10:32:29 AM
How about one full circle = 9000 units.  That's 360 degrees * 25, which gives prime factors of 2^3, 3^2, 5^3.  And it's relatively easy to remember.  By comparison, 9720 gives prime factors of 2^3, 3^5, 5.

Another option is 8640, which is 360 * 24, which has prime factors 2^6, 3^3, 5.  Not as easy to remember as 9000, but lets you split the full circle in to 64 equal slices instead of just 8, at the cost of not being able to slice things in to as many 5ths.

Yet another option is 9600.  That's not a multiple of 360 degrees, but it does have a lot of nice dividers.  Its prime factors are 2^7, 3, 5^2.
Title: Re: Bot testbed
Post by: Shadowgod2 on April 10, 2017, 05:28:53 PM
Speaking of sin and cos how exactly do they work? Also im not really ginding any more bugs... at least not yet
Title: Re: Bot testbed
Post by: Numsgil on April 10, 2017, 05:47:23 PM
They take units in whatever forms a full circle (as of this moment, that'd be 1080), and convert them in to degrees (so in this case, divide the values by 3), then run sin/cos on them.  Normally the results of sin and cos are in the range [-1, 1], but they get scaled so it's easier to make use of them, up to [-1080, 1080].

So for example, 90 degrees would be 360 units in Sunweaver.  Sine of 90 degrees is 1.0, so 360 sin would return 1080.
Title: Re: Bot testbed
Post by: spike43884 on April 11, 2017, 08:53:22 AM
How about one full circle = 9000 units.  That's 360 degrees * 25, which gives prime factors of 2^3, 3^2, 5^3.  And it's relatively easy to remember.  By comparison, 9720 gives prime factors of 2^3, 3^5, 5.

Another option is 8640, which is 360 * 24, which has prime factors 2^6, 3^3, 5.  Not as easy to remember as 9000, but lets you split the full circle in to 64 equal slices instead of just 8, at the cost of not being able to slice things in to as many 5ths.

Yet another option is 9600.  That's not a multiple of 360 degrees, but it does have a lot of nice dividers.  Its prime factors are 2^7, 3, 5^2.

Where'd 9600 come from?
Anyway, 9000 seems a pretty nice value.

If you want to get close to 9999 then the following options:
9360 is 360*26 giving 2^4,3^2, 5 and 13.
9720 as you mentioned is 360*27 giving 2^3, 3^5 and 5 however is a bit of a weirder one for remembering.
9900 is 55*180 giving 2^2,3^2, 5^2 and 11. (quite a nice pattern of squares there...)
9990 is 111*90 giving 2, 3^3 , 5 and 37.

I don't think there is really many other sensible alternatives as multiples of 45,90,180 or 360
Title: Re: Bot testbed
Post by: Numsgil on April 12, 2017, 08:03:16 AM
Where'd 9600 come from?
Anyway, 9000 seems a pretty nice value.

Okay, I might just go with 9000, even though I think 9600 is better in a lot of ways, since 9000 is both a round number and evenly divided by 360, which should make math easier for humans.

In terms of where they come from: the prime factors help to determine how many different ways you can divide up the full circle evenly.  3, 4, and 6 are important, since triangles, squares, and hexagons form a full tesselation of the plane, and are the only regular shapes to do so, so you need some multiple of 12 at least (the lowest common multiple of 3, 4, and 6).

If you ever wondered why there's 360 degrees in a circle, it's because it's the closest round number to 365 in base 60 (which was the base the Sumerians used thousands of years ago).  Their number system was base 60 because it makes math easy: 60 divides cleanly in to all sorts of different divisors.  For Darwinbots, we have a similar requirement.  The more ways there are to divide the circle in to even parts, the more different symmetries are possible, or at least easy.  The prime factors show you the raw ingredients to combine to divide the circle up.

2 is an important prime factor, because splitting things in to halves, or quarters, or sixteenths, etc. are very natural ways to break things apart, and can easily mimic the way cells in biology cleave in half during reproduction.  3 is important, but multiple copies of 3 aren't so much: being able to split things in to thirds and being able to represent 30, 45, and 60 degrees is important, but being able to represent 40 degrees or divide things in to 9ths isn't very important.

Sunweaver is sort of built to be base 10, to make math easy for humans, so 5 is an important factor in so far as 10 is.

But 7 isn't an important factor.  It would let you split circles in to 7ths, but there probably isn't much call for that.    As the prime factors get larger, they become less useful.  About the only use 101 would be for is if the bot had 101 segments.  Otherwise there's not much call for splitting a circle evenly in to 101 pieces.

So generally speaking finding a good number is balancing the needs for 2, 3, and 5 as prime factors, taking up as much of the [0,9999] range as possible, and making it easy for humans to do the math.
Title: Re: Bot testbed
Post by: spike43884 on April 13, 2017, 04:45:09 AM
Where'd 9600 come from?
Anyway, 9000 seems a pretty nice value.

Okay, I might just go with 9000, even though I think 9600 is better in a lot of ways, since 9000 is both a round number and evenly divided by 360, which should make math easier for humans.

In terms of where they come from: the prime factors help to determine how many different ways you can divide up the full circle evenly.  3, 4, and 6 are important, since triangles, squares, and hexagons form a full tesselation of the plane, and are the only regular shapes to do so, so you need some multiple of 12 at least (the lowest common multiple of 3, 4, and 6).

If you ever wondered why there's 360 degrees in a circle, it's because it's the closest round number to 365 in base 60 (which was the base the Sumerians used thousands of years ago).  Their number system was base 60 because it makes math easy: 60 divides cleanly in to all sorts of different divisors.  For Darwinbots, we have a similar requirement.  The more ways there are to divide the circle in to even parts, the more different symmetries are possible, or at least easy.  The prime factors show you the raw ingredients to combine to divide the circle up.

2 is an important prime factor, because splitting things in to halves, or quarters, or sixteenths, etc. are very natural ways to break things apart, and can easily mimic the way cells in biology cleave in half during reproduction.  3 is important, but multiple copies of 3 aren't so much: being able to split things in to thirds and being able to represent 30, 45, and 60 degrees is important, but being able to represent 40 degrees or divide things in to 9ths isn't very important.

Sunweaver is sort of built to be base 10, to make math easy for humans, so 5 is an important factor in so far as 10 is.

But 7 isn't an important factor.  It would let you split circles in to 7ths, but there probably isn't much call for that.    As the prime factors get larger, they become less useful.  About the only use 101 would be for is if the bot had 101 segments.  Otherwise there's not much call for splitting a circle evenly in to 101 pieces.

So generally speaking finding a good number is balancing the needs for 2, 3, and 5 as prime factors, taking up as much of the [0,9999] range as possible, and making it easy for humans to do the math.

I knew about prime factors, I just meant the number 9600 as an option in and of itself. It didn't divide cleanly at all into 360 so even as an option for better primes seemed a bit unusual.

I suspect actually having 7 could be a useful prime. Less useful then 2, 3 and 5, however there's still a reasonable chance a bot could have 7 segments, 11 and 13 and 17 being reasonably useful as it's not unimaginable for a bot to have that many segments, and in the case of multi-bots. As you get larger primes less numbers use them, however these are just the first few primes so will crop up regularly.
Title: Re: Bot testbed
Post by: Billy on April 27, 2017, 09:44:36 AM
Nice work, Nums! Took you long enough :P

Here's a quick 'swimmer' I threw together:

Code: [Select]
const myage 360
{ *myage 1 add myage store } call
//{ 0 myage store } call
*numspindles { dup *numspindles 2 div sub abs     *myage *numspindles 2 div mod sub abs 30 mul 100 swap sub 1000 add   swap store } loop

Sometimes it bugs out and you have to uncomment the line and recomment it to make it work.
Title: Re: Bot testbed
Post by: Numsgil on April 27, 2017, 05:29:36 PM
Looks good but I think shadowgod still has you beat :)

If you can figure out under which circumstances it bugs out that would be good.  It's possible it's a bug in the program that I should fix.
Title: Re: Bot testbed
Post by: Billy on April 27, 2017, 06:56:20 PM
Mine is more concise though!

I think it was when I was fiddling with the number on the last line that is now 30, I can't seem to reproduce it now unfortunately.
Title: Re: Bot testbed
Post by: Botsareus on April 28, 2017, 05:50:19 AM
I like the idea of using multiples for memory range, basing it from days in year aka about 360 is not a bad idea. However, we need to consider what other values stuff will return and incorporate the prime numbers from these into it. That is why I prefer to go with large ranges with stuff like this. In my experiments I always go with longs actually even though I do not need them.
Title: Re: Bot testbed
Post by: Botsareus on April 28, 2017, 07:08:09 AM
Also a question, how will sexrepro actually work? (sorry for asking the same question more than one time :)
Basically if you have stuff like { } and loop does the instruction set get decompressed first or is { } and loop treated as symbols to crossover?
Title: Re: Bot testbed
Post by: Numsgil on April 28, 2017, 02:05:30 PM
Also a question, how will sexrepro actually work? (sorry for asking the same question more than one time :)
Basically if you have stuff like { } and loop does the instruction set get decompressed first or is { } and loop treated as symbols to crossover?

{} mark the boundaries of codules.  The codules get matched up based on longest common subsequences, and crossover events happen in the matched up subsequences.  "loop" is just a command so it gets treated the same as other commands.  But there are details that aren't finalized yet here.

And of course, the physics of actually splitting the bots in two is also not really finalized yet.
Title: Re: Bot testbed
Post by: Botsareus on April 28, 2017, 05:13:00 PM
Let me clarify the question, lets say we have:

Robot A:

3 { a b c d } loop

Robot B

4 { a b z d } loop

Here is the first four things it can become:

Robot A Cross B:

3 { a b c d } loop
4 { a b z d } loop
4 { a b c d } loop
3 { a b z d } loop

If we decompress (used loosely so Billy knows what I am talking about) the loops first we get:

a b c d a b c d a b c d
a b z d a b z d a b z d a b z d

That is quite a few crossovers possible, as you can tell.


Title: Re: Bot testbed
Post by: Numsgil on April 28, 2017, 08:20:35 PM
Loops don't get decompressed.  There's no mechanism in the DNA to do it, and even if there were, the loop counter is just an integer on the stack and can't be deduced necessarily from a static analysis of a DNA program.

For your example, there are two codules for robot A:

'Main' codule:
3 1 loop

'Codule 1:
a b c d

Likewise for robot B there are two codules:

'Main' codule:
4 1 loop

'Codule 1:
a b z d

Let's say that the main codules and the ones in slot 1 get matched together.  I've marked where they have subsequences in common with ^:

Code: [Select]
3 1 loop
4 1 loop
  ^ ^

a b c d
a b z d
^ ^   ^

In effect any crossover events here would just swap codules between the two different DNA programs.  So in addition to basically having no effect, it's also possible for it to end effectively as:

4 { a b c d } loop

and

3 { a b z d } loop
Title: Re: Bot testbed
Post by: Billy on April 29, 2017, 08:31:41 AM
Not sure if this is the right place to report it, but I woke my computer from sleep to find this error message:

Code: [Select]
RootLevelException = {
    Description = "SharpDX.SharpDXException",
    Message = "Unknown error (HRESULT = 0x88760868)",
    Source = "System.Windows.Forms.ControlMarshaledInvoke",
    Stack Trace = {
        File = "\Modules\Darwinbots3\Bot.Testbed\Main.cs:140:17",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:109:13",
        File = "\Modules\Darwinbots3\Bot.Testbed\Renderer.cs:149:17",
    },
    Data = {
        radiiOut = {
            0 = "0.6294419442 //0x3FE424636EA17648",
            1 = "0.6594149415 //0x3FE519ED5D06C18A",
            2 = "0.6893879388 //0x3FE60F774B6C0CCB",
            3 = "0.7193609361 //0x3FE7050139D1580D",
            4 = "0.7493339334 //0x3FE7FA8B2836A34E",
            5 = "0.7793069307 //0x3FE8F015169BEE91",
            6 = "0.809279928 //0x3FE9E59F050139D2",
            7 = "0.8392529253 //0x3FEADB28F3668513",
            8 = "0.8692259226 //0x3FEBD0B2E1CBD055",
            9 = "0.8991989199 //0x3FECC63CD0311B96",
            10 = "0.9291719172 //0x3FEDBBC6BE9666D9",
            11 = "0.9591449145 //0x3FEEB150ACFBB21A",
            12 = "0.9891179118 //0x3FEFA6DA9B60FD5B",
            13 = "1.0190909091 //0x3FF04E3244E3244E",
            14 = "1.0490639064 //0x3FF0C8F73C15C9EF",
            15 = "1.0790369037 //0x3FF143BC33486F90",
            16 = "1.109009901 //0x3FF1BE812A7B1531",
            17 = "1.0790369037 //0x3FF143BC33486F90",
            18 = "1.0490639064 //0x3FF0C8F73C15C9EF",
            19 = "1.0190909091 //0x3FF04E3244E3244E",
            20 = "0.9891179118 //0x3FEFA6DA9B60FD5B",
            21 = "0.9591449145 //0x3FEEB150ACFBB21A",
            22 = "0.9291719172 //0x3FEDBBC6BE9666D9",
            23 = "0.8991989199 //0x3FECC63CD0311B96",
            24 = "0.8692259226 //0x3FEBD0B2E1CBD055",
            25 = "0.8392529253 //0x3FEADB28F3668513",
            26 = "0.809279928 //0x3FE9E59F050139D2",
            27 = "0.7793069307 //0x3FE8F015169BEE91",
            28 = "0.7493339334 //0x3FE7FA8B2836A34E",
            29 = "0.7193609361 //0x3FE7050139D1580D",
            30 = "0.6893879388 //0x3FE60F774B6C0CCB",
            31 = "0.6594149415 //0x3FE519ED5D06C18A",
            32 = "0.6294419442 //0x3FE424636EA17648",
            33 = "0.5994689469 //0x3FE32ED9803C2B07",
            34 = "0.5694959496 //0x3FE2394F91D6DFC5",
            35 = "0.5395229523 //0x3FE143C5A3719483",
            36 = "0.509549955 //0x3FE04E3BB50C4941",
            37 = "0.4795769577 //0x3FDEB1638D4DFC00",
            38 = "0.4496039604 //0x3FDCC64FB083657E",
            39 = "0.4196309631 //0x3FDADB3BD3B8CEFA",
            40 = "0.3896579658 //0x3FD8F027F6EE3877",
            41 = "0.3596849685 //0x3FD705141A23A1F3",
            42 = "0.3297119712 //0x3FD51A003D590B70",
            43 = "0.2997389739 //0x3FD32EEC608E74ED",
            44 = "0.2697659766 //0x3FD143D883C3DE6A",
            45 = "0.2997389739 //0x3FD32EEC608E74ED",
            46 = "0.3297119712 //0x3FD51A003D590B70",
            47 = "0.3596849685 //0x3FD705141A23A1F3",
            48 = "0.3896579658 //0x3FD8F027F6EE3877",
            49 = "0.4196309631 //0x3FDADB3BD3B8CEFA",
            50 = "0.4496039604 //0x3FDCC64FB083657E",
            51 = "0.4795769577 //0x3FDEB1638D4DFC00",
            52 = "0.509549955 //0x3FE04E3BB50C4941",
            53 = "0.5395229523 //0x3FE143C5A3719483",
            54 = "0.5694959496 //0x3FE2394F91D6DFC5",
            55 = "0.5994689469 //0x3FE32ED9803C2B07",
            56 = "0.6294419442 //0x3FE424636EA17648",
            57 = "0.6594149415 //0x3FE519ED5D06C18A",
            58 = "0.6893879388 //0x3FE60F774B6C0CCB",
            59 = "0.7193609361 //0x3FE7050139D1580D",
            60 = "0.7493339334 //0x3FE7FA8B2836A34E",
            61 = "0.7793069307 //0x3FE8F015169BEE91",
            62 = "0.809279928 //0x3FE9E59F050139D2",
            63 = "0.8392529253 //0x3FEADB28F3668513",
            64 = "0.8692259226 //0x3FEBD0B2E1CBD055",
            65 = "0.8991989199 //0x3FECC63CD0311B96",
            66 = "0.9291719172 //0x3FEDBBC6BE9666D9",
            67 = "0.9591449145 //0x3FEEB150ACFBB21A",
            68 = "0.9891179118 //0x3FEFA6DA9B60FD5B",
            69 = "1.0190909091 //0x3FF04E3244E3244E",
            70 = "1.0490639064 //0x3FF0C8F73C15C9EF",
            71 = "1.0790369037 //0x3FF143BC33486F90",
            72 = "1.109009901 //0x3FF1BE812A7B1531",
            73 = "1.0790369037 //0x3FF143BC33486F90",
            74 = "1.0490639064 //0x3FF0C8F73C15C9EF",
            75 = "1.0190909091 //0x3FF04E3244E3244E",
            76 = "0.9891179118 //0x3FEFA6DA9B60FD5B",
            77 = "0.9591449145 //0x3FEEB150ACFBB21A",
            78 = "0.9291719172 //0x3FEDBBC6BE9666D9",
            79 = "0.8991989199 //0x3FECC63CD0311B96",
            80 = "0.8692259226 //0x3FEBD0B2E1CBD055",
            81 = "0.8392529253 //0x3FEADB28F3668513",
            82 = "0.809279928 //0x3FE9E59F050139D2",
            83 = "0.7793069307 //0x3FE8F015169BEE91",
            84 = "0.7493339334 //0x3FE7FA8B2836A34E",
            85 = "0.7193609361 //0x3FE7050139D1580D",
            86 = "0.6893879388 //0x3FE60F774B6C0CCB",
            87 = "0.6594149415 //0x3FE519ED5D06C18A",
            88 = "0.6294419442 //0x3FE424636EA17648",
            89 = "0.5994689469 //0x3FE32ED9803C2B07",
            90 = "0.5694959496 //0x3FE2394F91D6DFC5",
        },
    },
}
Title: Re: Bot testbed
Post by: Shadowgod2 on April 29, 2017, 11:22:47 PM
yea it does me too, i posted it earlier but i dont thing num noticed it..

a bit off topic: i haven't been messing with it much lately, been more involved in other things including learning how to program in java.. nothing major..

so let me know when there's something new to play with and maybe brake.. :D
Title: Re: Bot testbed
Post by: Numsgil on April 30, 2017, 12:14:29 PM
Thanks, yeah, it's a bug I know about and on my todo list.  When you resume, the program loses the DirectX context and there's nothing to catch that and reset it.
Title: Re: Bot testbed
Post by: Shadowgod2 on November 02, 2017, 11:31:13 PM
wow nice little warning message while posting this...lol

so how's everything going? i'm thinking about getting into it a little again, try to see if i can get a turning code in
Title: Re: Bot testbed
Post by: Numsgil on November 07, 2017, 08:55:56 AM
I'm taking a break at the moment, but if you're interested I can post my most recent build.  It fixes a number of issues.
Title: Re: Bot testbed
Post by: Shadowgod2 on November 07, 2017, 11:27:17 PM
sure, yea i kinda got side tracked day after i started the new bot... but in the next few days i should have a good turning bot, after which i'll be working on speed as well and more.
Title: Re: Bot testbed
Post by: Numsgil on November 09, 2017, 05:53:58 AM
I've uploaded a new version at the top of the thread.

DNA changes:
Upgraded the integer stack to handle 15 digits.
Changed unit angles from 1080 to 9000 to give more room within the domain of a bot's memory [-9999, 9999].

Crashes:
Fixed a crash that occurs if the UI takes too long to start up.
If DirectX version is too low starts up with the null renderer instead of crashing.
Fixed crash when the directX context was lost (because of shutting a laptop lid, for instance).
Fixed an issue with how DNA is parsed that caused a crash if users used a bad metatag.

New features:
Added a watch window for DNA.  You can enter arbitrary DNA snippets in the watch window and it will evaluate them and show the results.  You can also enter numbers to view the memory contents at that memloc.
Added an autos window for DNA to show which memlocs were modifieid in the last cycle.

Minor tweaks:
The undo stack is cleared when loading from a save.
Fixed issue with render and UI not updating the first cycle after loading a save.
Opening the save or load dialogs pauses the simulation now.  Loading a simulation loads it in a paused state.
Title: Re: Bot testbed
Post by: Shadowgod2 on November 10, 2017, 01:10:22 AM
dang that's a bit... i've decided to almost completely redo the bot sense i need to get back into it and re learn the code, i'll be adding a speed modifier in as well in this next update just as soon as i know how i'm going to do so..

also have you figured out exactly how you will do repro? reason i ask is because i think instead of repro being a sysvar it's an action, 2 spindles at some point are 0ed and that makes the bot repro. with that, the 2 spindles that are 0ed can be what determines the size and pos of the child from the parent. of cores that brings a few issues of it's self such as grater than 2 0ed spindles, which is the parent in the split, ect

for multiple 0ed spindles we could either allow it and have multiple children or disallow it and only repro when exactly 2 spindles 0ed. for the which is the parent issue i'd say the obvious choice would be the larger of the 2(or more if you decide down that path). now to prevent accidental or spam repro events body could be the min height of the spindles except for when 0ed which is reset right after repro so the bot has to re 0 the spindles again. after that i can't think of any specific issues that would be big...

i personally like the ability of multiple children because that opens up the most possibilities but the feature alone even with just 2 could make things like cani bots more sustainable on the smaller end to being able to make things like linings(skin, stomachs, and more) easier and better to form on the larger scale. even tough the sysvar way would likely be easier and maybe better at the start while getting other things down first maybe, i think this might be worth the effort, but i'm not the programmer so idk. what do you think?

looks good so far and keep up the good work. hope you get back to it soon but till then enjoy your break, getting too burnt out suck so better in moderation than forced all out war type completion..
Title: Re: Bot testbed
Post by: Numsgil on November 10, 2017, 07:02:00 AM
Yes, I was thinking along the same lines.  There are two issues to think about:

If you pinch a bot, are the two resulting shapes valid bots?  You have to take the points on the perimeter of the original bot that formed the endpoints for its spindles and map those to the spindles of the new daughter bots.  Even if you try to make the nucleus of the daughter bots as close to the nucleus of the original bot as possible, they can't exactly overlap, since spindles have a minimum length so the nuclei have to be 2x that minimum distance apart.  We could just disallow reproduction until the two resulting daughter bots would be valid, but that's maybe a bit finicky.  We could let them split in an invalid configuration and just softly correct it over a few frames, but that has implications for physics.

Second, if bots reproduce by pinching, that means they need a mechanism for adding more spindles.  Again, the spindles are a uniform angular distance apart, so adding 1 more spindle to a bot changes where the end points of the spindles are.  For bots with lots of spindles that's not that big of a deal but if your bot had like 7 spindles, the difference is pretty obvious.  Do you snap it in to the correct place, or move it slowly over multiple cycles?  Either way has strong implications for either physics or DNA control.

Alternatively you could have bots only be able to double, triple, etc. the number of spindles they have.  That would let the new spindles appear between the existing ones and not have to change the geometry at all.  But it does limit the behavior of bots somewhat.

These aren't insurmountable issues, but I don't have clean answers to them yet, either.
Title: Re: Bot testbed
Post by: Shadowgod2 on November 10, 2017, 04:56:31 PM
Hmm definitely something to think about... i have a few ideas but i need paint to test and show so i might be able to get back to you later tonight... maybe tomorrow.
Title: Re: Bot testbed
Post by: Shadowgod2 on November 12, 2017, 06:38:48 PM
ok here's my idea:

first i think they when repro should be forced into a circle at the moment they repro. they shouldn't just let the spindles snap into place but be more like a spring pushing the bots out and away, locking into place when they reach their pos. as they they move they have a height tolerance say of 20 in height to be adjustable so the spindles can get underneath and get into place faster. all the while the bot would be unable to move until all spindles are in their places. all this should solve the physics and control during the repro stage.

for manipulating the number of spindles i think it should be both according to body and bot dna storing as a range. say every 20 body gained the minimum spindles would increase by 1, it could have a maximum of 20 or double the minimum spindles that the bot, after repro, could use a store command to get to so it could use a desired spindle number. the reason i say have a minimum and max spindles is because i don't think you would want a bot that has a lot of body and be really large and only have 3 spindles or the other way around and have spindles it doesn't need. if the number of spindles is connected to body them so should the spindle minimum length of the spindles to match.

the pic is very crude but should help with the visuals of it
Title: Re: Bot testbed
Post by: Numsgil on November 13, 2017, 07:24:40 AM
Yeah, that might work.  We can maybe even do pinching to reproduce still, and use the same idea of relaxing the spindle angles slowly over time.