Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » Enemy SB can force two allyers to fight each other?
Re: Enemy SB can force two allyers to fight each other? Tue, 22 November 2005 21:06 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

Quote:

3. ALL attacking players must have a lower player number than the player number of the player with the defending starbase. If one attacking player is a higher player number the bug doesn't trigger.


I will re-check the test and verify then I will update the post.


Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: Enemy SB can force two allyers to fight each other? Tue, 22 November 2005 23:07 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

Note that this problem gets wierder the more tests that are done. Defending ships can be in the battle and the allies still kill each other. Additionally, I haven't been able to get a ship set to freind of all the races on the battle board.

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: Enemy SB can force two allyers to fight each other? Fri, 02 December 2005 19:38 Go to previous messageGo to next message
XyliGUN is currently offline XyliGUN

 
Ensign
Stars! V.I.P


Messages: 325
Registered: July 2004
Location: Russia, St.Petersburg

Looks like we can't find the exact bug description (or it's too complex and there are several ways to catch it)? But what about to describe such behavour somwhere in the bug area ...


"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
Robert A. Heinlein, Time Enough For Love

Report message to a moderator

Re: Enemy SB can force two allyers to fight each other? Fri, 16 December 2005 04:10 Go to previous messageGo to next message
Micha

 

Messages: 2342
Registered: November 2002
Location: Belgium GMT +1
I've added Ptolemy's description to the Bug section,

mch,
modaw

Report message to a moderator

Re: Enemy SB can force two allyers to fight each other? Fri, 05 June 2009 12:58 Go to previous messageGo to next message
wasp

 
Crewman 2nd Class

Messages: 16
Registered: January 2008
Location: Finland
XyliGUN wrote on Sat, 19 November 2005 05:00

According to Starbase FAQ:
Quote:

Another weird situation is that if race B shows up and everyone has set everyone to friend but your default order is to "attack everyone" (which matters for your starbase) than the two friends will shoot each other while your starbase (again none of your ships present) sits back and watches ...

There is a situation where SB can force two allyers to attack each other.



I think I have nailed this one down. Cool Somewhere in the target selection algorithm ther must be code that looks something like

int who = battle_plans[starbase_owner][0].attack_who;

switch(who) {
    case NOBODY:
       break;
    case ENEMIES:
    case FRIENDS_ENEMIES:
       /* skipped, these work correctly */
       break;
    case EVERYONE: /* BUG!! */
       targets[fleet_owner] |= ~(1 << starbase_owner);
       break;
    default: /* BUG!! */
       targets[fleet_owner] |= 1 << (who - 4);
}


fleet_owner is uninitialized at this point, and starbase_owner should be used instead. It appears that fleet_value usually contains a valid race number from a previous call to this function leading to the behaviour observed by Ptolemy.

However, in unfortunate cases
(for example, try it with every fleet in the galaxy in the same battle), fleet_owner is garbage, resulting in a buffer overrun and the game crashing or worse. Note that setting the default battle plan to either attack everyone or a single race will trigger this bug.

Luckily a small patch to the binary is enough to fix this. Very Happy I put up a fixed version of JRC4 on my site.


[Updated on: Fri, 05 June 2009 12:59]




Elen sila lumenn' omentielvo

Report message to a moderator

Re: Enemy SB can force two allyers to fight each other? Mon, 29 June 2009 09:43 Go to previous messageGo to next message
magic9mushroom is currently offline magic9mushroom

 
Commander

Messages: 1361
Registered: May 2008
wasp wrote on Sat, 06 June 2009 02:58

XyliGUN wrote on Sat, 19 November 2005 05:00

According to Starbase FAQ:
Quote:

Another weird situation is that if race B shows up and everyone has set everyone to friend but your default order is to "attack everyone" (which matters for your starbase) than the two friends will shoot each other while your starbase (again none of your ships present) sits back and watches ...

There is a situation where SB can force two allyers to attack each other.



I think I have nailed this one down. Cool Somewhere in the target selection algorithm ther must be code that looks something like

int who = battle_plans[starbase_owner][0].attack_who;

switch(who) {
    case NOBODY:
       break;
    case ENEMIES:
    case FRIENDS_ENEMIES:
       /* skipped, these work correctly */
       break;
    case EVERYONE: /* BUG!! */
       targets[fleet_owner] |= ~(1 << starbase_owner);
       break;
    default: /* BUG!! */
       targets[fleet_owner] |= 1 << (who - 4);
}


fleet_owner is uninitialized at this point, and starbase_owner should be used instead. It appears that fleet_value usually contains a valid race number from a previous call to this function leading to the behaviour observed by Ptolemy.

However, in unfortunate cases
(for example, try it with every fleet in the galaxy in the same battle), fleet_owner is garbage, resulting in a buffer overrun and the game crashing or worse. Note that setting the default battle plan to either attack everyone or a single race will trigger this bug.

Luckily a small patch to the binary is enough to fix this. Very Happy I put up a fixed version of JRC4 on my site.


Oh my, now that's dedication.

Be sure to tell the FreeStars people.

Report message to a moderator

Re: Enemy SB can force two allyers to fight each other? Mon, 29 June 2009 18:56 Go to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
wasp wrote on Fri, 05 June 2009 18:58

Luckily a small patch to the binary is enough to fix this. Very Happy I put up a fixed version of JRC4 on my site.

Small indeed. Cool Can you explain exactly what the fix does? Deal



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: What's the difference???
Next Topic: exploding minefields
Goto Forum:
  


Current Time: Sun May 05 07:56:46 EDT 2024