Author Topic: My DB2 non-optional changes, what do people think?  (Read 10943 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
My DB2 non-optional changes, what do people think?
« on: November 27, 2010, 12:38:57 PM »
Here are my 5 non-optional changes:

randomization seed:

Added An Input box so users can set the randomization seed manually on program startup, by default the timer is used as the seed but you can set it as well.
This makes the program easier to debug.
If you click display seed, in the chart form, the seed will be set as part of the chart forms name and the MDIforms name, this is done so if you are running two or more instances of Darwin Bots you will know what chart belongs to what instance.

Find Best:

The new findbest works by calculating which robot family has the most energy, instead of the most population.

Time limits on mutation:

The mutation system was heavily modified to stop mutating after a 4 seconds, this way if a robot has huge DNA you don't have to wait a long time for it to mutate.

MDIform form size is fixed: PLAN A
The reason I fixed the MDIform size is if you run the same simulation on a wide-screen the screen dimensions are different. The size I am using is something in-between wide screen and regular.

save mutation rates and load mutation rates:

Added save mutation rates and load mutation rates buttons to the mutation menu they are stored in a file "mutationrates.txt" in the same folder as the program .
Now you can give any robot the costume mutation parameters found by the program.

What do people think? I will start implementing them starting Monday after school but I need your opinions because I actually want these to be implemented in the next revision of DarwinBots2. I'll code them myself. I practicaly already did, I just have to recode them for DB2.45. I just realized how good my timing is (as usual.  :() Apparently Panda is doing a major revision of the program too. Shall I wait for him to get done, or should I go for it?
« Last Edit: December 02, 2010, 04:08:12 PM by Botsareus »

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #1 on: November 27, 2010, 04:16:51 PM »
Shasta is doing a bit, wait for him and then have a go.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #2 on: November 28, 2010, 09:23:31 AM »
Numsgil do you like my updates so far???

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #3 on: November 29, 2010, 12:02:12 AM »
Here are my 5 non-optional changes:

randomization seed:

Added An Input box so users can set the randomization seed manually on program startup, by default the timer is used as the seed but you can set it as well.

There should be an option for this already in the options panel.

Quote
The new findbest works by calculating which robot family has the most energy, instead of the most population.

Yeah, this is a long overdo change.

Quote
Time limits on mutation:

The mutation system was heavily modified to stop mutating after a 4 seconds, this way if a robot has huge DNA you don't have to wait a long time for it to mutate.

Wouldn't it make more sense to just have a lower mutation rate?

Quote
MDIform form size is fixed:

The reason I fixed the MDIform size is if you run the same simulation on a wide-screen the screen dimensions are different. The size I am using is something in-between wide screen and regular.

There are some graphics bugs dealing with aspect ration, but they should be fixed instead of patched.

Quote
save mutation rates and load mutation rates:

Added save mutation rates and load mutation rates buttons to the mutation menu they are stored in a file "mutationrates.txt" in the same folder as the program .
Now you can give any robot the costume mutation parameters found by the program.

Sure, but wouldn't it make more sense to save and load user-named files?

Offline ikke

  • Bot Destroyer
  • ***
  • Posts: 300
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #4 on: November 29, 2010, 12:53:08 PM »

Time limits on mutation:

The mutation system was heavily modified to stop mutating after a 4 seconds, this way if a robot has huge DNA you don't have to wait a long time for it to mutate.

Wouldn't it make more sense to just have a lower mutation rate?
Yes please. I usally set mutations to 1/32 x after adding a 0 to all default rates for a total of 1/320 x

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #5 on: November 29, 2010, 04:29:19 PM »
Quote
There should be an option for this already in the options panel.
Can't find it...
Quote
Wouldn't it make more sense to just have a lower mutation rate?

Numsgil I have a new system in place where my mutation rates change ALOT. It is a proven system that gave me good results (It is one of my "optional" changes, yes I know, the program is complex as it is blablaba, do not care, I do not want to port my changes every time a new virsion is released...)

Quote
There are some graphics bugs dealing with aspect ration, but they should be fixed instead of patched.
Tell me how , or patch it! please! We need to figure out our screen ratio...


Quote
Sure, but wouldn't it make more sense to save and load user-named files?
That can be done, good one there.

P.S.

I got six more "optional” changes coming called "Global Special Settings" when you click the "globals" button.  ;)
« Last Edit: November 29, 2010, 04:36:47 PM by Botsareus »

Offline Shasta

  • Administrator
  • Bot Destroyer
  • *****
  • Posts: 231
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #6 on: November 29, 2010, 04:46:14 PM »
Can't find it...
It is under Options(Menu)->General(Tab)->Random Numbers(Section)->"Enable User Seed" + "Seed Value"

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #7 on: November 29, 2010, 04:49:44 PM »
Quote
It is under Options(Menu)->General(Tab)->Random Numbers(Section)->"Enable User Seed" + "Seed Value"

ok, so the only change I am making is that the "Enable User Seed" is always enabled. And the seed value is pregenerated. Sweet, no need for no inputbox!!!
I seen this work, I use the timer as the pregenerated seed.

Now this only leaves the screen ratio, any ideas what it should be and how to fix it?

Oh, nm, I remembered why I need it as InputBox in the first place. Let's say someone loads a simulation w/o even going into settings, If I want my sim to load with a costume seed I need a prompt. Any ideas? Should a user go to the settings first and that will be treated by the program as "Enable User Seed" ? good one?
« Last Edit: November 29, 2010, 05:09:01 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #8 on: November 30, 2010, 02:13:53 AM »
Now this only leaves the screen ratio, any ideas what it should be and how to fix it?

Bleh...  the whole graphics system is sort of hacked together.  I think if someone sat down and thought things through a little better in terms of setting up Viewports and Cameras (similar to how the graphics in DB3 is set up) the problem would automagically fix itself.

Quote
Let's say someone loads a simulation w/o even going into settings, If I want my sim to load with a costume seed I need a prompt. Any ideas? Should a user go to the settings first and that will be treated by the program as "Enable User Seed" ? good one?

Seeds are saved in the sims.

But here's an interesting problem: when you load a sim, it's not going to simulate the same as if you never saved and reloaded it, because you're resetting the random number generator.  What we really want to do is serialize out the random number generator in a saved sim, instead of just the seed.  But I don't really know how to do that in VB6.

Offline Shasta

  • Administrator
  • Bot Destroyer
  • *****
  • Posts: 231
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #9 on: November 30, 2010, 02:32:17 AM »
Well, one (bad) way you could do it would be to store the number of random calls, and then call random an equal number of times on load. Really bad way actually.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #10 on: November 30, 2010, 02:51:46 AM »
Actually that's probably a reasonable enough idea.  You should be able to power through millions of random calls in no more than a second or two, and it's easy enough to wrap calls to rand inside a wrapper.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #11 on: November 30, 2010, 03:35:37 PM »
Seeds:

Cool, but here is a par of problems:

I guess in the simulation structure we will also need to add a pointer of what is the current random number...

1.) What if you do not want the sim to continue in the same way?

2.) What if your sim is running long enough that we run out of random numbers? If you can give me about how much 200 hours of simulation time (10 day limit) doubles it will take,  and how much ram we are consuming, then we go for it. Remember think big bc a robot with lots of dna will consume more 'randomizeddoubles' (new word  :P) when it mutates.

My idea is to save a sim every minute. Then restart the sim knowing the seed if there is a crash or you need to turn off the PC. This may take a while but, If within that first minute the sim crashes then bingo: I know the seed and I can debug the sim for that minute through vb.

View point or Cameras: PLAN B
Nice, but we need a fix now, so everyone is running the same simulation across all resolution ratios, especially if we go with the new randomizer idea.

How about this: The mdiforms size will not be permanently fixed, instead it will fetch its current size and if it is maximized. Then the system will temporarily resize to the size I set for my "fix." Then after the simulation starts it will resize back to the size set by the user  and a user can zoom-in if needed.
« Last Edit: December 02, 2010, 04:08:37 PM by Botsareus »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #12 on: November 30, 2010, 05:01:38 PM »
Quote
What if your sim is running long enough that we run out of random numbers?

Hey, Numsgil I just did a pritty sweet proof of consept:

Private Sub Form_Load()
Randomize 10 'initial seed
Dim randob(50) As Double 'only 50 for proof of cosept
For e = 1 To 50
randob(e) = Rnd(randob(e - 1))
Next
For e = 0 To 50
Debug.Print randob(e)
Next
'reloop consept (should be endless) a.k.a. next 50
randob(0) = randob(50)
For e = 1 To 50
randob(e) = Rnd(randob(e - 1))
Next
For e = 0 To 50
Debug.Print randob(e) & " is next"
Next
End Sub

All the wait time will be only when the simulation starts, and when we have like 500000 doubles instead of my 50...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #13 on: December 01, 2010, 01:11:10 AM »
1.) What if you do not want the sim to continue in the same way?

Then you load the sim and change the seed.  If you really want to have a way to override the saved seed, maybe we can play with command line options?

Quote
2.) What if your sim is running long enough that we run out of random numbers? If you can give me about how much 200 hours of simulation time (10 day limit) doubles it will take,  and how much ram we are consuming, then we go for it. Remember think big bc a robot with lots of dna will consume more 'randomizeddoubles' (new word  :P) when it mutates.

You can't run out of random numbers.  Random number generators just end up repeating if you go too long (known as the random number generator's "period").

I don't have performance specs, but random numbers are simple enough that I imagine you can generate tens of thousands to millions per second.  Since you'd only have to do that when you load the sim, I imagine it shouldn't add more than a second or two to load times.  Might be a reasonable way to get something working, anyway.

Quote
My idea is to save a sim every minute. Then restart the sim knowing the seed if there is a crash or you need to turn off the PC. This may take a while but, If within that first minute the sim crashes then bingo: I know the seed and I can debug the sim for that minute through vb.

Sure, a reasonable enough goal.

Quote
View point or Cameras:

Nice, but we need a fix now, so everyone is running the same simulation across all resolution ratios, especially if we go with the new randomizer idea.

The aspect ratio is a display bug only; it shouldn't affect the simulation at all.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #14 on: December 01, 2010, 05:39:24 PM »
Quote
The aspect ratio is a display bug only; it shouldn't affect the simulation at all.

It will not affect a simulation.

It will affect "the" simulation when you start a new one...

 :sleepin:
And I thought college will be the thing that will tire me out this week.