Code center > Bugs and fixes

Problems with 2.44f

(1/3) > >>

Numsgil:
1.  Veggies don't seem to respawn.

2.  I was having weird issues with custom costs not "sticking" on the costs form.

3.  Internet population stats add the species to the species list, even when they're not on your computer.  When you restart, you get a "what the heck file is this?" message.

4.  Something is seriously wrong with shots.  The returned energy shots' vectors are screwed up.  Two dogfighting bots will leave a trail of white shots.  That's a clear indicator that something with the vectors is screwy.  This might be a long standing issue that I'm just now noticing.  I'm fairly certain that 2.37 was working correctly in this regard, though I can't test it for some reason (2.37 isn't running, I probably need to set up a seperate install location for it.)

5. Doesn't seem to be forward compatible with 2.43.  Try running 2.43 and you get some odd "type mismatch' error.  I think it has to do with the internet settings file, but I don't know for sure.

EricL:

--- Quote from: Numsgil ---1.  Veggies don't seem to respawn.
--- End quote ---
Whoops.  I ANDed where I should have ORed in the veggy repop routine.  I had to add code to exclude non-native veggies (I.e. teleported in from another sim) for repopulation since the DNA file may not be handy.   Wasn't checkign nativeness right, which in fact would impact non-internet sims without teleporters. Someday we shoudl perhaps include the DNA file in the dbo and auto-add ...   Fixed in 2.43g


--- Quote from: Numsgil ---2.  I was having weird issues with custom costs not "sticking" on the costs form.
--- End quote ---
I'm using the species structure to store runtime stuff now like the population totals for the species.  This means I have to copy runtime info into the tmpopts structure when the options dialog is opened.  Beleive it or not, each value in simopts is copied to tmpopts explicity.   Long history predating my arrival.  in the last buddy, I tried to clean this up to copy the whole structure, but its complicated.  There are some really strange repaint issues with the Options dialog.  DispSettings gets called when the form repaints after the Costs dialog gets closed, which was putting the simOpts values back into the TmpOpts struct everytime the dialog painted, which was erasing changes made in the costs dialog.  I should probably do this right and dig into the whole way options dialog stuff gets loaded and what window messages occur when, but I'm too lazy.   I've handled the issues with the costs and repainting by backing out my whole struct copy and copying the values I need explicitly jus tlike it has always been done.  Ugly, but works.   Fixed in 2.43g.


--- Quote from: Numsgil ---3.  Internet population stats add the species to the species list, even when they're not on your computer.  When you restart, you get a "what the heck file is this?" message.
--- End quote ---
As above, I need a species struct for every species in the sim whether it is native or not.   Right now I'm showing all the species everywhere and then catching it when you try to do something on a species (like insert one) for which a local DNA file does not exist.  I've cleaned this up a little now for sim restart - you only get one "what the heck" common dialog per species now independent of how many you wanted to insert when you restart the sim.  Additionally I silently try the Robots directory as well as whatever the path on the origianl bot that caused the species entry to be created says is in an attempt to find a DNA file for bots that may be non-native  to yoru machine but for which a local file exists on yoru machine (just in a different main install point) but we still have this higher level issue of dbos not containing the DNA file so you will still get this when you restart from settings (but not from a saved sim) for bots for which you don't have a DNA file.
   To be clear, it's not the internet stats per se but rather when a bot of a new species gets teleported into the sim that it gets added to the species list.  The internet stats graph will show the totals for bots  that never make it to your local sim - say they get introduced into another connected sim then die off before being teleported to yours.  You will see a chart entry for them, but not an entry in the species list.   Only when a bot of a novel species actually makes it to your sim do I add a new species instance.   You can save sims with such bots and they will run fine but if you save settings (including restarting from the last settings) well, without the DNA file, what can I do?


--- Quote from: Numsgil ---4.  Something is seriously wrong with shots.  The returned energy shots' vectors are screwed up.  Two dogfighting bots will leave a trail of white shots.  That's a clear indicator that something with the vectors is screwy.  This might be a long standing issue that I'm just now noticing.  I'm fairly certain that 2.37 was working correctly in this regard, though I can't test it for some reason (2.37 isn't running, I probably need to set up a seperate install location for it.)
--- End quote ---
Indeed, this is a long standing issue.  The return shot velocity is half the velocity of the shot that caused it (relative to the impacted bot).  This means that if two dogfighting bots are shooting at each other while moving quickly sideways, as many velocity matchign genes do, the return shots trail behind them, impacting neither.  There was a long discussion on this whole topic maybe 10 months ago.  Happy to make whatever changes people want to see here.  (Also a reason I think shots should be visible)


--- Quote from: Numsgil ---5. Doesn't seem to be forward compatible with 2.43.  Try running 2.43 and you get some odd "type mismatch' error.  I think it has to do with the internet settings file, but I don't know for sure.
--- End quote ---
Yea, I screwed up the internet settings a little.  It's a text file, not a binary file, so the type mismatch was due to older versions trying to read in a integer saved as a string only the dummy string I was using wasn't a number....  Fixed in 2.43g in a backward compatable manner. l

Numsgil:

--- Quote from: EricL ---
--- Quote from: Numsgil ---...well, without the DNA file, what can I do?
--- End quote ---

--- End quote ---

I see two options.  You could either "extract" the DNA from an imported dbo and save it in some sort of directory somewhere, or go through the code and find everywhere where an imported species needs to be in the species list and work in some new logic for an "imported species" list.

Also, while you were poking around in loading routines, did you change the way bots are loaded so that the DNA file is only read in once?  This was a long standing (and rather silly) issue with large sims being started fresh.  It would take 5 or 6 seconds reading a DNA file 1000 times.


--- Quote ---
--- Quote from: Numsgil ---4.  Something is seriously wrong with shots.  The returned energy shots' vectors are screwed up.  Two dogfighting bots will leave a trail of white shots.  That's a clear indicator that something with the vectors is screwy.  This might be a long standing issue that I'm just now noticing.  I'm fairly certain that 2.37 was working correctly in this regard, though I can't test it for some reason (2.37 isn't running, I probably need to set up a seperate install location for it.)
--- End quote ---
Indeed, this is a long standing issue.  The return shot velocity is half the velocity of the shot that caused it (relative to the impacted bot).  This means that if two dogfighting bots are shooting at each other while moving quickly sideways, as many velocity matchign genes do, the return shots trail behind them, impacting neither.  There was a long discussion on this whole topic maybe 10 months ago.  Happy to make whatever changes people want to see here.  (Also a reason I think shots should be visible)

--- End quote ---

There was a time when this was working right.  I've managed to get 2.37 running (ugh) and it was definately working right then.  The code was this:

--- Code: ---vx = (Shots(t).vx - rob(n).vx) / -2 + rob(n).vx
vy = (Shots(t).vy - rob(n).vy) / -2 + rob(n).vy
--- End code ---

If that's still the code, the other idea I have is that it might have to do with when the robots' velocities are updated relative to when shot impacts are done.  The two might be out of sync.  You might try using the robot's old velocity, for instance.

It should be immediately apparent if it's working right or not.  Just load up two animal minimalis based bots and watch them duke it out.

EricL:

--- Quote from: Numsgil ---I see two options.  You could either "extract" the DNA from an imported dbo and save it in some sort of directory somewhere, or go through the code and find everywhere where an imported species needs to be in the species list and work in some new logic for an "imported species" list.
--- End quote ---
The problem with the first is mutations and our definition of species.  Extracting the DNA from the dbo only works if there have been no mutations (and no viruses).   The second is essentially what I have done.

 
--- Quote from: Numsgil ---Also, while you were poking around in loading routines, did you change the way bots are loaded so that the DNA file is only read in once?  This was a long standing (and rather silly) issue with large sims being started fresh.  It would take 5 or 6 seconds reading a DNA file 1000 times.
--- End quote ---
It still reads in separatly for each bot.  Not sure this is high priority since it only impacts the start up of a brand new simulation with large numbers of bots but I'll take a look and if I see an easy fix, I'll take care of it.


--- Quote from: Numsgil ---There was a time when this was working right.  I've managed to get 2.37 running (ugh) and it was definately working right then.  The code was this:

--- Code: ---vx = (Shots(t).vx - rob(n).vx) / -2 + rob(n).vx
vy = (Shots(t).vy - rob(n).vy) / -2 + rob(n).vy
--- End code ---

--- End quote ---
It's done with vectors now, but that the current code is equivalent to the above.


--- Quote from: Numsgil ---If that's still the code, the other idea I have is that it might have to do with when the robots' velocities are updated relative to when shot impacts are done.  The two might be out of sync.  You might try using the robot's old velocity, for instance.
--- End quote ---

Right idea.  I think what is happening is that my new (I.e. last year) shot collision routine has showed up some flaws in the whole return shot paradym.   Last year, I rewrote the shot collision routine for performance and other reasons.  As a side effect, it got a lot more accurate.  It now figures out exactly when in the cycle the collision occurs and exactly where and I use this information in computing the return trajectory, starting point and timing of the returned shot.   I.e. shots impact on the impacted bot's edge (not somewhere inside as before) and return shots start on their return journey exactly when and where the impact occurs.  That is, a return shot will already have traveled some distance on it's way back by the end of the cycle in which the impact that casued it occurred.  This was essentially free to do as a necessary side effect of figuring out if a collision occurred is learning when and where it occurred.  Before, the point of impact was calculated as the position where the shot would be at the end of the cycle instead of assumign imapcts occurr at bot edges.  Similarly, the time at which return shots began their return trajectory was always on cycle boundaries.   Additionally, the point of origin of any returned shot was taken to be the impacted bot's center.   These artifacts had the effect of delaying the effective time the return shot was generated by up to a full cycle, giving it a boost in the direction the impacted bot was traveling (since it was shot from the center and not the edge).  These things combined to "carry" return shots along with the impacted bot for up to several cycles (depending upon when in the cycle the shot impacted and the impacted bot radius).

If our paradym is that a returned nrg shot is a piece of the bot shot off from the edge, then I like my code better even though it reduces the collision probability in certain cases, like bot movement lateral to the direction of shooting.  If we are to do anything, I'd prefer speeding up return shots to changing the above aspects of where and when return shots orginate...

EricL:
I've been playing with return shots.  2.43h will have some tweaks which shoudl improve things.

Navigation

[0] Message Index

[#] Next page

Go to full version