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.8 to 2.42.9. 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.8a.
If you have feature requests or bug reports for this version, please report those as separate topics.
1) When a sim file is loaded, it's path is now displayed in the main MDI window title bar.
2) The name of a sim file (no path, just the file name - the file is assumed to be in the \saves directory) can now be passed on the command line when the DB exe is invoked. If such is passed, the info screen is bypassed and the program loads and starts the sim.
3) PERF. PROFILE. Netforces() is no longer called for fixed bots. There is no reason to calculate all the forces for fixed bots. To allow this, the mass calculation routines are now invoked directly from UpdateBots() before Netforces() is called.
4) PERF. PROFILE. Tweak to the random angle calculation in BrownianForces() to avoid some unecessary calculation.
5) Tweaked the default Orange to 220, 150, 60 RGB
6) PERF. PROFILE. DoObostacleCollisions was being called unnecessarily in the case where the sim contained no obstacles.
7) PERF. PROFILE. GateForces() was being called unnecessarily in the case where internet connections were not being used.
PERF. PROFILE. UpdatePosition was unecessarily calculating a bot's mass. Mass calculation is handled by CalcMass() in UpdateBots().
9) Virus insertion bug. AddGene had an off-by-one error in determining where to insert a gene from a virus. Now 1 is added to the return value from NextStop().
10) PERF. PROFILE. UpdateShots() was calling DoShotObstacleCollisions() unnecessarily in the case where the sim contained no obstacles.
11) PERF. PROFILE. Quick exit from VoluntaryForces() in the case where the movement sysvars are all 0. Should help significantly for sims with lots of veggies which tend not to move on their own.
12) PERF. PROFILE. BorderCols() now short circuits when the bot being considered isn't withn the bot's radius of the field border.
13) PERF. PROFILE. CheckTeleporters() was calling TeleportCollision() unnecessarily for inbound teleporters.
14) PERF. PROFILE. AddedMass calculation was moved to its own loop which only executes if density is non zero.
2.42.8a Buddy Drop Download15) Shapes are now saved in sim files.
16) Bug with shape collision detection introduced by 6 above was fixed. Shape collision detection must happen before NetForces() or the vector doesn't get added. The call to DoObstacleCollisions() was moved up one line to happen before NetForces().
17) Tweak to field border collision so that collisions with the edge of the field don't add velocity. Can you say Flubber?
18) Missed the case in #9 above where the virus was being inserted at the end of the genome. Should work now.
2.42.8b Buddy Drop Download19) The TotBorn and TotRunTime counters were getting overwritten when TmpOpts was copied back into SimOpts when the Change button was pressed on the options dialog. Now I copy them into TmpOpts when the dialog is opened so the right values get put back.
20) Removed the With Shots(t) statement in UpdateShots() in an attempt to squash the array locked bug. Time will tell if this makes a difference.
21) Added a new Cost Reinstatement threshold. Basically, when the population falls below the zero cost threshold, the cost multipler gets set to 0 and the old one gets saved. If you are you are using dynamic costs, this will be the CostX number. If not, this will be 1. When the population comes back up and crosses the new reinstatement threshold, the old cost multiplier will be re-instated. This can help stem population explosions following bottlenecks when using dynamic costs.
22) Fixed a serious bug in shape blocking which could cause bots in certain positions in the sim to be blind in a sim that is using shapes. Bascially I had a pos.X where I should have had a pos.Y in the up front perf check that looks to see whether both bots are below the bottom of the shape.
23) Changed the Age cost log(age) option so that it is now log (age - cost start). In this way, the cost will start ramping up at the age at which it compences. Seems more intuitive.
24) Added linear increase option to the age cost.
2.42.8c Buddy Drop Download25) Incremented the costs control array loop in the load routine for the costs dialog so that the new linear age cost fraction control gets initialized correctly.
26) PERF. I'm pretty sure #20 has addressed the locked array bug. So, where before the shots array was grown in huge jumps to avoid the redimension bug, now the shots array is increased by only 10% when it fills up. This keeps the UpdateShots() loop from having to deal with a super sparse array. Similarly, I now reduce the size of the array when the number of shots drops below 70% of the array size. The array is reduced to 10% above the actual number of shots or 100, whichever is higher.
27) The display of shot impacts can now be turned on and off via a menu item on the Robots menu.
28) Fixed a small bug with 26 above where when the number of shots was below 100, the compact routine would erroniously get called and vaporise a lot of shots that should not have been destroyed.
29) The acceleration vector in VoluntaryForces() was being clipped to 40 for overflow protection. Now it's clipped at SimOpts.MaxVelocity.
30) Implemented Movement Vectors, a display artifact which can help show how bots are using the movement sysvars.
31) Changed the local variable 'value' in RobShoot() to a Single from a Long. VB was rounding certain calculations when assigned to the Long variable, resulting in 0 valued nrg shots when .nrg was below 50 as well as several other realted bugs when venom and waste were very low.
32) Implemented Resource Guages, a display artifact which graphically displays the nrg and body for every bot.
33) Added the Teleport Hetertrophs option to the teleporters dialog.
34) Had to tweak #3 above. Apparently, we still need to call bordercols for fixed bots since fixed veggies can be pushed outside the world by the birth tie (I think).
35) Another issue with 26 above. Forgot to deal with stored shots when compacting the shots array. Now if the shot is stored, I update .virusshot on the parent bot accordingly.
36) Added Inbound Teleporter options for number of cycles between polls and number of bots per poll. Reworked Teleporter properties dialog accordingly.
2.42.8d Buddy Drop Download37) Messed up the inbound teleporter poll loop. Was setting it to the number of bots per poll. Fixed now.
38) Added an option to only preserve the last 10 autosaved best bots in the Recording portion of the options dialog.
39) The line to calculate the new random location for intrasim teleporters in CheckTeleporters()was inside the display off check. Thus if the display was off, intrasim teleporters would send any bots they encounterred to location 0,0. Moved the line outside the check.
40) A few profrolactic conversions to Longs in CheckTeleporters() and Respawn() to try and address a position calculation overflow problem with (I think) intrasim teleporters.
41) Removed reliance on sysvars.txt. All the sysvars are now loaded within the exe in LoadSysvars(). This is one step towards makign the first time experience simple.
42) More issues related to the 26 above. Stored virus shots were not getting deleted when the parent bot died nor was .virusshot or .vtimer getting zeroed when new bots came into being. If the parent bot dies and the shots array gets shrunk while the bot does not exist then a new bot resuses that slot in the rob array, the shot referenced by the bot could reference an invalid location in the shots array causing a subscript out of range crash when the vtimer goes off. Now stored shots are deleted when bots die. .vtimer and .virusshot are also zeroed when new bots are created. Additionally, .virusshot is now zeroed when the virus shot is actually fired. Also fixed a bug in CompactShots() where the shot was being destroyed in the case where the new slot and the old slot for the shot were the same. Also in cases where MakeVirus() fails in BotDNAManipulation() because the gene can't be copied into the shot (can happen often in mutated bots), I now zero out the bot's .Vtimer and .virusshot.
2.42.8e Buddy Drop Download43) Fixed a couple of typos/capitialization errors in 41.
44) SysvarTok() is now case insensitive w.r.t. sysvars in bot txt files. The sysvar string is LCase'd before comparing to the internal sysvar table.
45) PERF. Corpses were releasing 0 power nrg shots in respose to nrg feeding shots even though their nrg was 0. Changed a check in ReleaseNrg() from <0 to <=0 so that this no longer happens. Should reduce the number of shots and speed things up a tad in sims that have stupid bots whioch try to nrg feed on corpses.
46) Misc tweaks and clean up to allow the exe to stand alone for first time installs. If the settings directory is not found, the program will now prompt to create it. If lastexit.sim can't be found, the program now uses reasonable internal defalts. The goal here is for things to work well for the first time user who has nothing but the naked exe adn to avoid the need to have performed a prvious setup with an older version.
47) Per #2 above, if there is a command line argument, it is assumed to be a sim and the sim is loaded. If the command line argument contains a quoted string, as it will when the path to a sim file is passed by windows when the sim file extension is manually assoicated with the darwinbots exe, the quotes are stripped so that the file can be opened by the Open statement (which for some reason won't accept quoted paths). So now, if you manually assoicate the sim file extension with DB and double click the sim file, DB will load the sim no matter where it resides. If the command line string contains no "\" character, the command lien argument is assumed to be the filename (no path) of a sim residing in the \Saves directory off the DB maindir. If it does contain a "\", it is assumed to be a fully qualified path.
48) Added overflow protection into createshot and fixed a bug in releasenrg where very powerful shots could end up with .nrg/0.9, causing an overflow when the power was assinged to the integer shot value. It shoud have been .nrg * 0.9.
2.42.8f Buddy Drop Download49) TieHooke is now called directly from UpdatesBots and not from NetForces since it must still be called for fixed bots as this is where the code is for tie hardening and for tie length checking. Moving shapes can casue fixed bots to move and thus we need to check tie lengths even for fixed bots.
2.42.8g Buddy Drop Download50) Changed SphereDragForces() so that it exits in the case that the if the magnitude of the drag vector is non-zero but really tiny as it can caused VectorInvMagnitude() to underflow.
51) Fixed a major bug with angular momentum and ties. Bascially, the changes to .aim made by TieTorque() were being overwritten by SetAimFunc() later in the cycle with the result that no angular momentum was being transferred to tied bots through ties or from tie operations such as .fixang! This fix has a pronounced impact on the visual physics and behavior of ties, hopefully much improved.
2.42.8h Buddy Drop Download52) Now that angular momentum is working, there were cases where the call to the Circle method to draw the bot focus circle could cause an invalid precedure call crash as the hi and low arguments coudl exceed 2 * PI. Now the arguments are reduced by 2PI until they are 0 < x < 2PI before the method is called.
53) TmpOpts.Daytime was not being set in the energy dialog when day/night cycles were disabled. Thus if the user disabled day/night cycles while it was night, the sun would never come up.
54) Added code to SphereDragForces to slow down angular momentum due to fluid friction.
55) Added code to FrictionForces to slow down angular momentum due to surface friction.