Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Numsgil

Pages: 1 ... 3 4 [5] 6 7 ... 510
61
Darwinbots3 / Re: Bot testbed
« 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.

62
Darwinbots3 / Re: Bot testbed
« 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.

63
Darwinbots3 / Re: Bot testbed
« 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 :)

64
Darwinbots3 / Re: Bot testbed
« 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.

65
Darwinbots3 / Re: Bot testbed
« on: April 08, 2017, 07:29:26 PM »
Oh, I've also uploaded a new version.  Change list and new binary at the top.

66
Darwinbots3 / Re: Bot testbed
« 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.

67
Darwinbots3 / Re: Bot testbed
« on: April 08, 2017, 02:33:36 PM »
Okay, fixed that render crash too.  New version is at the top of the thread.

68
Darwinbots3 / Re: Bot testbed
« 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).

69
Darwinbots3 / Re: Bot testbed
« 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,

70
Darwinbots3 / Re: Bot testbed
« 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).

71
Darwinbots3 / Re: Bot testbed
« 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.

72
Darwinbots3 / Re: Bot testbed
« 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.

73
Darwinbots3 / Re: Bot testbed
« 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.

74
Darwinbots3 / Re: Bot testbed
« 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.

75
Darwinbots3 / Bot testbed
« 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.  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:

  • UI - The UI thread handles button clicks and the like.
  • Simulation - The simulation thread handles running the simulation, running the bot's DNA, etc.
  • Render - The render thread is in charge of drawing the graphics.
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.  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)

Pages: 1 ... 3 4 [5] 6 7 ... 510