Code center > Bug reports

trefnrg returning 0

(1/2) > >>

Trafalgar:
The problem is that one of these two tied bots is seeing 0 for trefnrg. The other is seeing a correct value. Both bots have energy, aren't corpses, are more than 2 cycles old, etc etc.

Screenshot (I added the yellow arrows to point out the important numbers): http://screencast.com/t/s0xj0fz9iq

The selected robot is the one whose robot dialog is open. (I noticed after I took the screenshot and closed the windows that I had the left bot's console on the right and the right bot's console on the left, oops)

Saved sim: attached to this post

(This is with 2.43.1k)

EricL:
This is more of a design issue/question than a bug.

The way the code works now, the trefvars are populated for a single cycle for the bot that creates a tie without it having to set .readtie.  But they are not populated for the tied bot.  The tied bot has to set .reatie to *.tiepres in order to populate the trefvars based on the bot at the other end of that tie.  

The logic behind this is that the target bot may be in the process of doing it's own thing with it's own ties, setting .readtie and so on and it's trefvars shouldn't suddenly change to reflect a tie it didn't create or even know about (it only discovers the tie exists on the cycle following it's creation when *.tiepres changes)  whereas the bot creating the tie presumedly meant to create the tie, knows the tie was created last cycle and is therefor aware that the trefvars will reflect the target on the cycle after the tie is created.

I'm not really inclined to change this behaivour, but as always I'm open to all arguments...





Trafalgar:
Hmm. Tienum is supposed to work too, right? I have it setting that, never ever used readtie (so I'd be pretty confused if neither bot was supposed to have working trefvars).

Maybe there's a mistake in the DNA somewhere. (At the end of the bots DNA is a command to store the value of tienum into memory location 988. They check this again next cycle and compare it to tiepres. I'm looking at the bot which has trefnrg showing as 0, and its tiepres (1) is equal to memory location 988 (also 1), indicating that it had already set tienum to 1. However - it appears that I have it not setting 988 if tienum is 0. As for why it wouldn't be setting tienum...)

The bot is also doing *.tiepres .deltie store (and tiepres was 1), but it is not deleting the tie for some reason. (Maybe that requires tienum to be set also?)

Edit: If I set readtie=1, will it automatically be changed when I set tienum, or when I tie to something? The wiki is extremely vague.

gymsum:
The easiest way to read all ties constantly, unless you want the bot to focus, is to use the following gene:

cond
*.......
start
*.timer mod *.numties *.tiepres add .readtie store
stop

It takes the timer (an infitely expanding number and wraps it around the number of ties a bot has), that means every cycle a new tie is read.

Trafalgar:

--- Quote from: gymsum ---It takes the timer (an infitely expanding number and wraps it around the number of ties a bot has), that means every cycle a new tie is read.
--- End quote ---

That is most definitely NOT what I want that bot to do.

I want it to always read the last tie to tie to it, basically, since if it IS another bot tying to it, it needs to be able to see if it's friendly and if not, delete the tie before the other bot can do anything nasty (like setting shootval to 31999).

Navigation

[0] Message Index

[#] Next page

Go to full version