Page 1 of 1

GetTeamResources "received" value buggy?

Posted: 12 Feb 2007, 17:40
by TheFatController
After two buggy games (both on Tropical if that matters) where my metalmaker AI wasn't responding to received energy from allies I did a lot of poking at my code trying to figure out why and eventually gave up after finding nothing that would cause it to ignore all energy received. I then got sent a replay by another player where the same thing happens so being determined to fix it I started outputting every variable I was tracking to find out which was reporting the wrong value...

It turned out the value being returned by GetTeamResources for received energy was always 0 despite him receiving energy from his allies, here's the replay:

http://pw3n.net/070211-VallesMarineris_v4-0.74b3.sdf

The player you want to watch is Ohmegaherz (Black), his received energy is never anything but 0 despite his allies hitting their share limits many times and his drain exceeding his output while full energy...

(you can spy on his received energy with a simple lua script)

Posted: 23 Mar 2007, 14:55
by TheFatController
Bump.

Posted: 28 May 2007, 18:54
by TheFatController
Okay I have this bug identified now :)

Here's a widget that demonstrates the bug: http://pw3n.net/rec_spy.lua

It watches received energy and spams the value received if it's greater than zero, to highlight what's going wrong all you have to do is spectate any game or replay (I've tested four or five now) and watch the player on any team with the highest number by their name on the info list.

Their reported energy received is always 0 so the widget will be silent (as opposed to occasionally spammy with other players)


My guess is theres a loop or counter or something in the spring code thats too short and missing the last teammate.

Posted: 28 May 2007, 22:14
by Lippy
Nice spot, I would recommend reporting this to mantis, where hopefully some dev will sort it, although test it with the latest SVN, as it may already be sorted with the better implementation of lua. (unfortunately that will be harder as you can't use replays for 74b3 :()