Author Topic: Bot testbed  (Read 41878 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Bot testbed
« Reply #45 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?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Bot testbed
« Reply #46 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.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Bot testbed
« Reply #47 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.



Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Bot testbed
« Reply #48 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

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Bot testbed
« Reply #49 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",
        },
    },
}
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Bot testbed
« Reply #50 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

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Bot testbed
« Reply #51 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.

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Bot testbed
« Reply #52 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

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Bot testbed
« Reply #53 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.

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Bot testbed
« Reply #54 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.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Bot testbed
« Reply #55 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.

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Bot testbed
« Reply #56 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..

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Bot testbed
« Reply #57 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.

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Bot testbed
« Reply #58 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.

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Bot testbed
« Reply #59 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
« Last Edit: November 12, 2017, 06:40:53 PM by Shadowgod2 »