bugGlobulation 2 - Bugs: bug #16257, gradient calculation bug

 
 

bug #16257: gradient calculation bug

Submitted by:  Kai Antweiler <snth>
Submitted on:  Mon 03 Apr 2006 08:54:46 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: NoneOperating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 03 Apr 2006 08:54:46 PM UTC, original submission:

listedAddr seems to be initialized with fields which have
different gradient values.
(It could also be the calculation which causes the malfunction
but I don't think so)

I have experienced this with different versions of cvs
including the one from 2. april.
Here is a mail I wrote to Simon which explains it.

> I don't know about all the places which initialize a gradient, but if
> gradients are really initiallized with different values, I think this
> is a bug. (listedAddr would no more be guaranteed to be big enough
> because fields could be listed more than once)


Ok. I now I'm sure.
I have changed Map.cpp to print out errors when former and present g
differ two much.

in updateGlobalGradientVersionSimple:

Uint8 oldg=0;
while ( ... )
{
...
Uint8 g = gradient[(y << wDec) | x] - 1;
if ( (oldg != 0) && (oldg != g) && (oldg != g+1))
std::cerr << "oldg: " << (int) oldg << "g: " << (int) g << std::endl;
oldg = g;
...
}

Then I started A Big Pond with one AI in my team and one in the other,
saved the game and started glob2 again with -nox and this saved game.
After a minute or so I got a lot of output like:

...
oldg: 137g: 138
oldg: 138g: 136
oldg: 136g: 137
...

I attach this change as a patch and copy this mail to the bug tracker.

Kai Antweiler <snth>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #9698:  Map.cpp.patch added by snth (193B - application/octet-stream - This patch prints old g and g to stderr, if they differ to much)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 06 Apr 2006 06:11:46 PM UTCsnthStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Mon 03 Apr 2006 08:54:47 PM UTCsnthAttached File-=>Added Map.cpp.patch, #9698

Back to the top


Powered by Savane 3.1-cleanup1