1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Stacks that need re-awakening for each unit

Discussion in 'Bugs and Crashes' started by Koshling, Aug 23, 2011.

  1. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    I recall some (fairly recent) discussion of some isue whereby if you attacked with a stack the first unit attacks then the stack goes to sleep again unless expliciotly re-awakened. I also recall someone saying stacks of workers behaved similarly when given orders.

    I can't locate the original posts to get the details (yeh, yeh, I suck at search), and I can't reproduce any obvious problems in my test games. I have tried stacked workers giving the stack an impovement order, and all members perform it (seems right). I have also tried attacking a city with a large stack (with stack attack option not enabled) and that too behaves as expected (best unit attacks then focus returns to the rest of the stack).

    Can anyone clarify the issue, and what is needed to reproduce it please...?
     
  2. hydezt

    hydezt Chieftain

    Joined:
    Mar 4, 2008
    Messages:
    23
    I never got that by attacking directly, but by ranged warfare or bombard. try put 5 catapult outside any city with <5% defense, then stack bombard it. then you'll see only 1-2 siege correctly bombard but other siege unit sleeps.

    Dunno if that's a feature..
     
  3. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    What happens to me is when I try to attack with a stack only one will attack unless you un-group them and attack with one at a time. Thus when i have to move them from one place to another i have to group them , but once they get there i have to un-group them to attack.
     
  4. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,281
    Gender:
    Male
    Location:
    Canberra, Australia
    It has been reported on the AND forum as well It is fairly new but was in the last two AND betas I think.
     
  5. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    926
    Hmm.. I might have run into this once or twice, but not typically. I think usually when a group is selected to attack, the best one is chosen to strike. But what if that unit has extra moves, but can't attack a second time? Might the AI be trying to use that unit, but since it can't get a second attack, it wants the whole stack to wait another turn?
     
  6. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    It worked fine for me when I used a large stack in attacking a city, so if someone can provide a save game wi a stack that exhibits I'll take a look, otherwise I wont stress over it
     
  7. sharinel

    sharinel Chieftain

    Joined:
    Jun 23, 2007
    Messages:
    20
    Heres one from the version 16. I'm attacking the city of Moscow with a stack, if I kill the first defender with any of my attackers I don't then go to attack the next defender, it sets everyone waiting till the next turn and picks someone else.
     
  8. ThoricFrame

    ThoricFrame Chieftain

    Joined:
    Feb 15, 2011
    Messages:
    73
    Location:
    Australia
    I ran into this last night after never having a problem with it before. I may have stumbled onto the cause though!

    I turned on Quick Combat (Offensive), and now every time a unit survives combat it performs the wait command (like, pressing space) afterwards. Even if it has no movement left it still wants to wait! If your unit is in a stack the whole stack will want to skip the rest of the turn. This happens even if the unit is by itself, it is not a stack issue at all.

    I think the worker and bombard ones are unrelated, I have had workers being strange before but never my military. As soon as I turn that one option on after EVERY combat it happens. In my current game my workers are still being normal. Unrelated I say.

    edit: I should probably add that whilst attacking with a stack, if the units die I can keep attacking as normal. It's only when a unit survives (by winning the combat) that the stack is sent to sleep.
     
  9. BlueGenie

    BlueGenie Chieftain

    Joined:
    Apr 23, 2009
    Messages:
    1,563
    ThoricFrame is correct. Tested it out myself and found it to be the reason why. Now all that's needed to be done is to reverse that problem, so Quick Combat doesn't put a unit or stack to sleep after winning a battle.

    Cheers
     
  10. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Thanks for the save game, and thanks Thoric for spotting the key issue (which I would never have found as I never use that option). With this combination I am easily able to reproduce the issue, and BOY is it weird!!

    Based on the code my first reaction to hearing this happened only with quick offensive combat was 'No way!', but it certainly does happen. As far as I can tell this is a bug in the main game engine, and the DLL was doing everything correctly. Basically there are two code paths involved:

    The first is the response to your initial attack order. If quick moves are on, this evaluates the combat and completes it immediately, telling the game to deselect just the attacking unit. If quick moves are not on, it sets up a multiple sub-battle sequence and extends the number of combat rounds needed to complete the attack (it has resolved the result, but the sub-rounds it sets up will be what plays out the animations and so on). It then tells the game engine how many extra combat rounds are needed to 'play it out' and returns without completing.

    The second is a timer update callback that plays out a sub-round (as set up by the first call). This does nothing at all except count down the sub-round count. On the call that it reaches 0, it completes the combat using EXACTLY the same call sequence the first path does in the quick-combat case. There is NO differecne at all in the actions taken, just in the timing.

    So it seems like the main game engine misintreprets a combat completion on the first call as the stack being done with (even though the DLL code only tells it to deselect a single unit). This seems like a bug in the main game engine to me.

    What I have done is workaround the issue by never completing combat on the first call, and instead setting up a 1-sub-round (with no animations or focus changes) completion. This causes the completion to occur on the first timer callback, so the net effect is quick-as-possible-but-not-theoretically-ulimately-quick combat and the stack focus behaves like it does without quick combat. The delay of 1 sub-round is not, in practise, noticeable, so this technique is at least perceptually a fix.

    I'll be uploading the 'fixed' DLL to the patches thread later today, or possibly tomorrow (I am still testing some other changes I have in my current DLL before I release it, but I'm done apart from an hour or so play-testing as my final test round, so hopefully today)
     
  11. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,439
    Gender:
    Male
    Location:
    MN
    WOW, that is just amazing find and excellent explanation, nice find and hope, great fix.;)
     
  12. sharinel

    sharinel Chieftain

    Joined:
    Jun 23, 2007
    Messages:
    20
    Appreciate you fixing this so quickly Koshling. Isn't it strange though when you find out the way you have set everything up isn't the way that everyone else sets up? I couldn't live without quick combat :p
     
  13. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    I'm a very builder-oriented player, so I tend to indulge in wars quite rarely and maintain a small standing army of higher tech units rather than large numbers, so it all conspires not to make me care much about slow combat. Of course a major late game war might change my opinion ;-)
     
  14. climat

    climat Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    734
    Quick combat / Quick move and no battle zooming reduce play time tremendously. :lol:
     
  15. KingArthur666

    KingArthur666 Chieftain

    Joined:
    Sep 17, 2006
    Messages:
    277
    Location:
    Montana
    @Koshling. Have you got that fix uploaded yet? I just updated my .svn and started a new game and my tracker is still going to sleep after killing something, even if he still has a movement point left.
     
  16. sharinel

    sharinel Chieftain

    Joined:
    Jun 23, 2007
    Messages:
    20
    The DLL is available in the patch thread. From another discussion though I think it hasn't been included in the SVN yet.
     
  17. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Correct. It will be today after I finish testing some other changes also
     

Share This Page