Darwinbots Forum
Code center => Bugs and fixes => Topic started by: Elite on May 09, 2006, 11:12:15 AM
-
Here you can see a fixed bot shot feeding
(http://img413.imageshack.us/img413/3572/bug13re.th.jpg) (http://img413.imageshack.us/my.php?image=bug13re.jpg)- It seems to have a non-integer amount of energy, body and waste. This is weird in itself
- Even though it just sits there feeding it isn't actually gaining any energy at all
There seems to be a strange violation of conservation of energy here
Some other strange things also happen, like a bot dying suddenly
I belive PY noticed that bots were not gaining energy from feeding and were dying suddenly
-
The non integer amounts of waste, etc. are correct. The way it works is that the engine maintains internal decimal quantities for all these things and rounds them to integers for the bot when they are put into the bot's memory. But it is these internal values whcih are actually used by the engine for most calculations. Most small bots will have mass < 1 for example, which will round to 0 often as far as the bot knows, but that bot still has mass, enertia, etc. as far as the engine is concerned. What I did in this release was simply to remove the rounding for these values as displayed in the robot properties dialog. In the next release, I'll cut off all but perhaps two places past the decimal point to make them more readable.
The energy thing may very well be a bug. I have not had a chance to investigate this since PY noticed it. One thing I have noticed which may be to blame is that since bots in 2.4 change size and an energy return shot has to actually hit the bot for the energy to be received, small/young bots can be at a huge disadvantage and exhibit what you see I.e. shooting, but loosing energy every shot cause the return shots miss them.
Anyway, it's probably still a real bug. I'll investigate for sure, but probably not until this weekend. Need a few days away from the code.
-
I get this one, too.
Bot fire shots at vegs (and receive white shots), but their energylevels don't rise.
and sometimes -1 shots hit vegs but no energy comes back at all. (see screenshot)
[a href=\"http://img297.imageshack.us/my.php?image=dbbug8uh.jpg\" target=\"_blank\"]
-
I'd be interested in knowing whether you can see the white energy shots coming back and actually hitting the bot or whether they miss and whether you can tell whether this has any impact on whether the bot receives energy or not....
-
I'd be interested in knowing whether you can see the white energy shots coming back and actually hitting the bot or whether they miss and whether you can tell whether this has any impact on whether the bot receives energy or not....
AHA! Got it!
The -2 shots that come back have a limited range! So they just dissapear before they hit the bot!
However, there might be an entirely seperate bug that's causing the shots not to appear at all.
(ie. in Henk's screenshot)
-
I notice that in Henk's screenshot, the -1 shots are hitting the very edge of a fat veggie. I think there might be an upper limit to the diameter of the bot which will send back -2 shots. At least that was what I found when I first introduced variable robot size in 2.36. maybe this is more of the same but more pronounced since robot size is so much more variable.
Personally I think there is too mauch size variation but that is just an opinion and not a technical issue.
-
This seems to be is a combination of three issues:
1) -2 shots don't have a great enough range to hit the bots they're supposed to be feeding
2) There might be an upper limit to the diameter of the bot which will send back -2 shots, so you might not get back energy if you shoot a fat veg with a glancing hit
3) With my combat bots, sometimes energy shots are missing because the bots are too small and by the time the shot reaches them they have moved
On the topic of sizes:
Hey, you couldn't include the option to turn dynamic sizes on and off could you?
-
Hey, I bet shot ranges don't take into consideration a bot's radius! I bet they are calculated from the bots center, so the bigger the bot, the more shots exists soley inside the bot where other bots can't get at them. Making collision detection work probably exberated this issue in 2.4 since now bots can't get inside other bots where the energy shots mostly are!!!! This is why this is becoming more apparent now. Energy shots also decay over time so even when they do get outside the bog bot, they have less energy!
I'll take a look at size restrictions and I'll make shot range take bot radius into consideration for sure. I think it's probably pretty easy to expose setting limits on maximum and minimum bot radius though I will have to take a look.
-
There is some vector fun with shots to bots collision detection that has screwed me up so many times in the past. It's basically a line to circle collision detection. That could be suspect.
-
Hey, I bet shot ranges don't take into consideration a bot's radius! I bet they are calculated from the bots center, so the bigger the bot, the more shots exists soley inside the bot where other bots can't get at them.
I bet you are right.
We had this problem to a lesser degree in 2.36.
I think shots are generated at 'bot center' but collisions are detected at 'bot perimeter'
Returned shots should be set to the same range as incoming shots but with a small bot shooting a big bot that might not be enough.
-
I bet you are right.
We had this problem to a lesser degree in 2.36.
I think shots are generated at 'bot center' but collisions are detected at 'bot perimeter'
Returned shots should be set to the same range as incoming shots but with a small bot shooting a big bot that might not be enough.
So you can't feed on a bot that's bigger than you? No wonder so many bots were dying
-
I was looking at this code last night and I think it may be more complex then my initial guess. From a quick look at the code, it does appear that shots do infact take bot radius into consideration to some extent. Whether it does so correctly however, will require a few hours of analysis. There is a bunch of vector math in this area and I will need to step through things line by line to get my head around it.
One thing I did notice is that a surprising amount of waste can be generated when bots consume high energy shots which can lead to altzheimers which can lead to them suddenly and seemingly inexplicitly going poof as PY and others have reported. This may or may not be the explanation for what people have seen. One of the several things that governs the energy in a return shot is the mass of the bots involved and for higher mass bots, the result of consuming a single energy shot can generate waste of 50 or more from a single shot!
I'll be offline for the next few days (going to camp with my son and 120 other 5th graders. Oh joy.) But digging into this area is top O the list for the next drop.
-
So you can't feed on a bot that's bigger than you? No wonder so many bots were dying
Well you can but possibly not if the difference is really big.
Remember that the strength and range of a bot's shots are somewhat dependent on his body points.
-
power is linearally based on body, range is logarithmically based on body.