glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] IRC (freenode problems)


From: Stéphane Magnenat
Subject: Re: [glob2-devel] IRC (freenode problems)
Date: Fri, 18 Nov 2005 15:20:04 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Hi Andrew,

Explorer damage (see earlier messages for background).  Previously,
explorers' ground attacks would hit every square of an attacked
building.  This means that a 3x3 building would be hit 9 times in a
single attack, and the explorer hitting it would get 9 times the
experience points.  This means that explorers increase in levels
extremely quickly, and can easily do over 100 points of damage to a
building in a single attack.  I've now added a little code to make sure
that each explorer attack hits each building only once.  I've done this
by storing previously-hit buildings in a std::set, because we need to
store a small (but variable) number of building IDs in a way optimised
for quick searching.

Warning ! std::set do not behave the same on all computer, and thus are not network game safe.

The inn bug (see earlier messages for background).  Previously, globs
would subscribe to an inn if it had any free slots, then some time later
be accepted or rejected.  If the inn was nearly full of wheat, but could
still take more fruit, any number of globs could subscribe to the inn,
then be rejected when it turned out they weren't near fruit.  At which
point, they'd idle for a moment before re-applying.  As a quick fix,
I've set the globs only to apply to the inn if they have a chance of
being accepted.  Although they can still spend some time being
unnecessarily idle, the bug is essentially fixed.  To offset any
potential slowdown this causes in the game, I've optimised a related bit
of code in the function that accepts/rejects globs - the function now
does exactly the same thing, just a bit quicker.

Nice, thanks !

Bye the way, optimisation levels shouldn't be hardcoded in the configure but either enabled by an option, or, easier, set by setting CXXFLAGS to -O2 when compiling. I think the debian package scripts do this.

Thanks a lot,

Steph




reply via email to

[Prev in Thread] Current Thread [Next in Thread]