Author Topic: 2.42.8 Changes  (Read 3981 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.42.8 Changes
« on: July 03, 2006, 12:11:32 PM »
This topic is just a place for me to keep track of the changes I make from one version to another, in this case from 2.42.7 to 2.42.8. It is not the complete list of stuff in the next drop (yet) just the stuff I have completed to date. I will edit this post as I complete changes and start a new topic for each new release.

If there is a zipped exe attached to this topic, it is a stable buddy drop which you are more than welcome to try. Such 'between release' exes will have letters following the release version e.g. 2.42.7a.

If you have feature requests or bug reports for this version, please report those as separate topics.

1) The Trash Compactor 'Maze" was stopping after one compaction cycle.  Now it continues endlessly.
2) Changed maxShotArray and several other integer-valued varables used to index into the shots array to Longs so as lay the groundwork for having more than 2^15 shots in a sim.
3) Fixed a bug having to do with shapes absorbing shots.  The test for shot inclusion in a shape was in the wrong place.  Now if the option is enabled, shapes will absorb shots in the case where the shot is inside the shape, not just when it crosses an edge.
4) Tweaked shot/border collision detection.  Shots fired parallel to the border were allowed to remain outside the field where in no shot decay mode, they would gather and slow the sim down.  Now I set the shot position to the field edge in such cases when the field is not a torid as well as set the velocity correctly.  This should keep shots in the field and allow for the possibility of bot impact at some point.
5) Drifting shapes kept their velocity after vertical or horizontal drift (or both) is disabled.  Now shapes are stopped in their tracks (along the apporpriate axis) when drift is disabled.
6) Tienum now gets set to 0 after each cycle.
7) Added two new modes for incoming energy thresholds.  Described Here.
8) Shape velocity was not getting zeroed when a new shape is created.  Now it is.
9) Fixed an error in FrictionForces().  If Impulse < 0.00001 Then Impulse = 0 was actually If Impulse > 0.00001 Then Impulse = 0.  Whoops.

2.42.7a Buddy Drop Download

10) Fixed a minor bug with shot impact dots.  An impact dot was being erronously displayed when an attempt to create a virus shot failed, resulting in mysterious cyan dots.   I now correctly destory the half created virus shot in such cases without an impact dot.
11) MAJOR change in the way simulations are saved and loaded.  SaveSimulation() was calling SaveRobotBody() for all bots in the bot array (5000 slots), saving a ton of data for every slot, even when most bots did not exist.  This was totally bloating simulations files, making even the smallest of saved sims huge because they would contain 5000 bots, most of which .exist = false.  This could also result in overflow bugs depending on the timing of when the autosave timer invokved SaveSimulation().  I've now changed it so that only existing bots are saved.  This entailed changes to the "MaxRobs" value stored in the sim file (it now reflects the actual number of bots stored, not the size of the array) and also necessitated remapping tie numbers to the new numbers after bots are loaded.  A new routine for doign the remapping - RemapAllTies() - was written and is now called during simulation loading.   This routine needed the old bot number, which is now stred as part of the saved bot portion of the sim file.  This change should prevent the timing related overflow crash but more interestingly, should make all sim files dramtically smaller for both manual and automatic saves.
12) In Vshoot(), the *shot* cost of making a virus shot was being multiplied by the vshoot value instead of subtracted.   The virus cost should scale with the virus size, and .vhsoot shoudl and does cost energy relative to its value, but the actual act of shooting the virus should only cost the shot cost and not be multiplied by the vshoot value!
13) The mouse pointer now changes to an hourglass while sims are being saved or loaded.
14) Completed #2 above.  Lots of additional Integer-> Long changes now allow essentially infinite numder of shots in a sim.  Have tested to above 50000 shots.  Should be no reason now other than perf and memory that it can't go to 50 million...  
15) Shots array is now redimed 5000 at a time.  Should help with the "array locked" bug.
16) Teleporter stuff enabled.

2.42.7b Buddy Drop Download

17) Fixed a crashing overflow in CompareRobots2().  The Long valued var eyevalue could overflow when very very small bots were viewed.  Now eyevalue is a Single and all is well.
18) Perf - shotpointer is now allowed to float.  New slot searches for insertions in the shots array now starts from where the last insertion occurred.

2.42.7c Buddy Drop Download

19) KillOrganism() was setting nopoff back to True!!!!!  This had the effect of turning poffs back on whenever a multi-celled organism was killed, such as when it got teleported.  Now the nopoff state is preserved and set back to what it was.
20) Initial size of the shots array is now 50.  For sims such as null evo sims, which have few or no shots and few or no bot deaths, this should keep the perf impact from the UpdateShots() loop minimal.

2.42.7d Buddy Drop Download

21) Intrasim teleportation lines were being drawn when the display was off.  Now the line drawing obeys the no video option (though not the draw every 10 cycles option.  Implementing this will be more difficult (and not save any perf).
22) Fixed a bug with 11 above.  MaxRobs was getting set to MaxRobArray during sim load.  This meant that the UpdateBots() routine was looping through all 5000 bot slots even though only a subset existed.

2.42.7f Buddy Drop Download

23) More Integer-> Long changes in rob().virusshoot and VShoot().  Previous buddy drops can overflow if the virus shot is > 2^15.
24) Another one in AddGene.
25) PERFORMANCE - A bug in KillRobot was preventing the rob array from shrinking when the bot population in a sim shrinks.  In the case where the last bot in the array dies, the array size was supposed to get dropped to the size of the next extant bot, but the loop to check this was looping one too many times and checking the last bot in the array, which still existed, thus preventing the array size from ever dropping.  Now, the loop counts backwards from the end of the array.  The array will shrink over time as designed as bots at the end die, which should have a significant impact on long run perf over time, reducing the number of iterations of the bot loops.
25) OVERFLOW - SonNumber in the bot structure is now capped at 32000 in the Reproduce routine.  There are several Integer valued elements of this structure - such as Mutations - which should be changed to Longs.  Not trivial, this will entail modifications to the bot save and load routines...
26) Slight tweak to shape collision detection to help prevent small bots from moving through them.
27) Fixed a typo bug in takenrg().  A small amount of an nrg shot should go to body.  It was going to nrg instead.
« Last Edit: August 05, 2006, 01:44:29 PM by EricL »
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.42.8 Changes
« Reply #1 on: July 17, 2006, 03:08:58 PM »
Bump.

New 2.42.7b buddy drop released.

Teleporters are all about running multiple, interconnected instances of DB on a single computer or on multiple computers on a LAN.  This is a really cool and very powerful feature that allows for running much much larger sims (limited only by the number and power of CPUs at your disposal) with a much greater diversity of environments within that uber sim. I.e. each connected DB instance can have its own physics, costs, etc.

Teleporters connect running instances of DB.  You can create inbound, outbound or intrasim teleporters:  
Outbound teleporters save bots they encounter as dbo files at the path specified.
Inbound teleporters load the dbo files they find at the path specified.
Intrasim teleporters teleport bots within a single sim without using an intermediate file system location.

You can use teleporters to connect sims together, be they on the same machine or on different machines in various tolpologies from ring to star.  There shouldn't be any issues with multple outbounds going to the same location or vice versa.  Note that there are some rare cases where bots can be duplicated.

Again, this feature should allow those with multiple CPU machines or multiple machines on a network to take full advantage of them and to run effectively larger simulations, spread out amoung multiple, interconnected sims, each potentially with a different local environment, different costs, different physics, etc.

All of the core functionality should be working.  Give it a try!

Also in this buddy drop, I made a major change to sim file formats.  Before, a bot record was stored for each of the 5000 posible bots in a sim, even when most of those slots where not used.  This made the sim file for even the smallest of sims huge.  Now I only store those bots that actually exist in the sim.  Simple, but requires some gymnastics such as re-mapping ties when sims are loaded since bot numbers can change.   This plus the addition of teleporters being saved in sims means I am soliciting feedback on saved sims.  If you encounter any issues saving or loading new or old sims with this buddy release, please let me know.

Additionally, sims can now have huge numers of shots, well beyond 32000.

An "official" 2.42.8 drop is coming in a week or two.  I have a few more features to complete on both teleporters and shapes including saving shapes to sim files.
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
2.42.8 Changes
« Reply #2 on: September 14, 2006, 04:07:41 PM »
Where are you Eric! I'm bored!!  
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
2.42.8 Changes
« Reply #3 on: September 14, 2006, 11:11:27 PM »
I say he's gone AWOL.  Shackle him to the wall and whip him till he codes for us again!

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.42.8 Changes
« Reply #4 on: September 25, 2006, 12:05:45 PM »
I did go AWOL.  Lots of somewhat unexpectr traveling and other things keeping me away from my computer.  I'm back home now.  Let me catch up with all the posts and if people are still interested, I'll finish 2.42.8 and release it.
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
2.42.8 Changes
« Reply #5 on: September 25, 2006, 02:12:02 PM »
Great to have you back again, Eric!    Started a new sim a couple of days ago with Nums fix for bots staying too tiny, I guess that whould be the fix number 27 in your list then? Nothing has happend in my sim so I can as well start a new one with this version.   Starting now!
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
2.42.8 Changes
« Reply #6 on: September 25, 2006, 02:51:06 PM »
Yay for new versions.

I have a new laptop I use for everything except games now, so I think I can run some longterm sims too.  Ex Nihilo!