Home » PLAYER'S HQ 1.13 » v1.13 Solutions,Tips & Spoilers » What to do about 'Invisible armies'
What to do about 'Invisible armies'[message #343182] Thu, 12 November 2015 15:17 Go to next message
orcam3

 
Messages:90
Registered:August 2011
Location: The Netherlands
My strategic map will tell me that a sector is full of enemies, but in tactical screen there are none, not even with cheats ALT+E (see all) and ALT+O (Kill all enemies). I cannot move away my troops in strategic because it is a 'hostile sector', the only thing i could do is retreat and come back i guess.
Re: What to do about 'Invisible armies'[message #343185 is a reply to message #343182] Thu, 12 November 2015 18:46 Go to previous messageGo to next message
Torres

 
Messages:181
Registered:June 2010
Location: Canary Islands
Happened to me a lot in 7991, I had luck with the following.

1) One time I moved mobile militia in there and the army spawned (the strategic battle event started and since I had mercs in there I was able to take part), both sides spawned, this happened to me as well when the invisible army invaded Drassen but there was no battle, had to get to the tactical view in order for them to spawn and start the fight.

2) So far I've learned that they are possibly "moving" so therefore they are and not are in the sector, I had that happen when attacking a group that was close to my Drassen SAM, I launched a night assault, the strategic map said there were like 60 soldiers in there... there were maybe 20 red shirts, the rest were moving to attack the SAM site. I had to move my mercs to the edge of the map to retreat to see this happen as time passed.

3) As I said in the last quote... well... kill the ones that are in there, retreat via map edge and get back to the same sector, they always respawn for me.

4) One time IF I remember it right, I just had to switch from strategic to tactical but I'm having no luck replicating that.
Re: What to do about 'Invisible armies'[message #344278 is a reply to message #343185] Mon, 29 February 2016 09:59 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
Same thing is happening to me, using the latest stable version(confirmed by pressing V in-game).
I find it quite gamebreaking for a supposed stable version.
On two seperate games, on two seperate computers, I've taken Drassen and - while I'm doctorin', repairing and waiting for Bobby Ray's shipment - I inevitably get attacked by a small force. The trouble is, they don't actually show up once the battle begin. I have to fast forward 3-4 hours, while periodically checking the map every 30 minutes, and THEN the enemy will suddenly appear. However, when they actually spawn, they spawn as if they are the ones defending Drassen. I.e. around the helicopter and plane, right behind my defensive line, and next to the two guard houses and the barriers.
Meanwhile my merc's are falling asleep on their feet due to being locked in combat for so long.

If anyone has any solutions for this bug, I'd greatly appreciate it.
Re: What to do about 'Invisible armies'[message #344284 is a reply to message #343182] Mon, 29 February 2016 18:58 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1570
Registered:March 2009
Location: Broadwurschd-City
could be a verrrrrrrrrrrrrrrrry old bug


sollution was: throw a grenade (or lightstick or stone)

throw means throw not toss away not sure



I don't like users who edit posts after they've gotten an answer.

A lot of people start panicing when told to use their brains

Commander in Croc, OFBA

Founder and Leader of the GDTS
Re: What to do about 'Invisible armies'[message #344285 is a reply to message #344278] Mon, 29 February 2016 19:46 Go to previous messageGo to next message
tais

 
Messages:812
Registered:February 2008
Location: NL
Sekthet wrote on Mon, 29 February 2016 08:59
Same thing is happening to me, using the latest stable version(confirmed by pressing V in-game).
I find it quite gamebreaking for a supposed stable version.
On two seperate games, on two seperate computers, I've taken Drassen and - while I'm doctorin', repairing and waiting for Bobby Ray's shipment - I inevitably get attacked by a small force. The trouble is, they don't actually show up once the battle begin. I have to fast forward 3-4 hours, while periodically checking the map every 30 minutes, and THEN the enemy will suddenly appear. However, when they actually spawn, they spawn as if they are the ones defending Drassen. I.e. around the helicopter and plane, right behind my defensive line, and next to the two guard houses and the barriers.
Meanwhile my merc's are falling asleep on their feet due to being locked in combat for so long.

If anyone has any solutions for this bug, I'd greatly appreciate it.

Try saving and loading, same effect though, the enemy is all over the map, so be ready to fight at the spot



IRC, pretty much the place to be! | Now also on Discord!


Re: What to do about 'Invisible armies'[message #344289 is a reply to message #344284] Mon, 29 February 2016 21:52 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
Gorro der Grüne wrote on Mon, 29 February 2016 17:58
could be a verrrrrrrrrrrrrrrrry old bug


sollution was: throw a grenade (or lightstick or stone)

throw means throw not toss away not sure

You're telling me the solution is to sacrifice a grenade every single time I'm under attack for the rest of the game?
Even if it worked (which I doubt it does), it's the start of the game and I don't have a single grenade or flare yet. :/
Closest thing I got is a grenade launcher. Firing it did nothing.
Re: What to do about 'Invisible armies'[message #344290 is a reply to message #344289] Mon, 29 February 2016 22:28 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1570
Registered:March 2009
Location: Broadwurschd-City
no

I said

IFF it is that bug You sacrifice ONE and the bug is gone

not forever but UNTILL you get the bug again - which normally means for several hundred Arulco days



I don't like users who edit posts after they've gotten an answer.

A lot of people start panicing when told to use their brains

Commander in Croc, OFBA

Founder and Leader of the GDTS
Re: What to do about 'Invisible armies'[message #344296 is a reply to message #344290] Tue, 01 March 2016 09:19 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
Sorry if I came off needlessly rude, I was just hoping someone knew of a way to fix this bug. :/
Re: What to do about 'Invisible armies'[message #344309 is a reply to message #344296] Tue, 01 March 2016 20:58 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1570
Registered:March 2009
Location: Broadwurschd-City
if it was that bug this is the "fix" or better workaround,

no coder ever thought it important ennough to kill it.



I don't like users who edit posts after they've gotten an answer.

A lot of people start panicing when told to use their brains

Commander in Croc, OFBA

Founder and Leader of the GDTS
Re: What to do about 'Invisible armies'[message #344535 is a reply to message #344309] Mon, 14 March 2016 15:01 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
Does nobody really have a fix for this? I'm finding it impossible to defend cities as the enemy will always spawn as if they're the ones defending.
The enemy only ever seems to spawn correctly(i.e. coming from the side of the map) when there is militia present - but it's not possible to always have militia on your side, especially when trying to take a new town and getting counter-attacked before any militia are trained.
Re: What to do about 'Invisible armies'[message #344537 is a reply to message #344535] Mon, 14 March 2016 15:56 Go to previous messageGo to next message
tais

 
Messages:812
Registered:February 2008
Location: NL
Well I have also had this happen in drassen airport with a full garrison of militia active, so it's not really related to the militia being in the sector, you are however right that the enemies are in their normal defensive positions, around the airplane for example



IRC, pretty much the place to be! | Now also on Discord!


Re: What to do about 'Invisible armies'[message #344538 is a reply to message #344537] Mon, 14 March 2016 16:05 Go to previous messageGo to next message
edmortimer

 
Messages:856
Registered:January 2015
Location: Home Free
Yes, this is a most frustrating bug -- a game breaker.




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: What to do about 'Invisible armies'[message #344542 is a reply to message #344538] Mon, 14 March 2016 20:48 Go to previous messageGo to next message
Flugente

 
Messages:3165
Registered:April 2009
Location: Germany
Well, with a savegame prior to this bug (so before an attack with this issue happens) one could try to find this bug. Preferably with stock 1.13.



Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: What to do about 'Invisible armies'[message #344543 is a reply to message #344542] Mon, 14 March 2016 22:23 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1570
Registered:March 2009
Location: Broadwurschd-City
in my experience it normally happens not in cities and without ANY warning




I don't like users who edit posts after they've gotten an answer.

A lot of people start panicing when told to use their brains

Commander in Croc, OFBA

Founder and Leader of the GDTS
Re: What to do about 'Invisible armies'[message #344553 is a reply to message #344543] Tue, 15 March 2016 18:48 Go to previous messageGo to next message
edmortimer

 
Messages:856
Registered:January 2015
Location: Home Free
Is somebody going to post a savegame for Flugente? Or do I have to start a game of stock 1.13 r7609?




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: What to do about 'Invisible armies'[message #344554 is a reply to message #344553] Tue, 15 March 2016 19:03 Go to previous messageGo to next message
Gorro der Grüne

 
Messages:1570
Registered:March 2009
Location: Broadwurschd-City
that bug is older than 1.13



I don't like users who edit posts after they've gotten an answer.

A lot of people start panicing when told to use their brains

Commander in Croc, OFBA

Founder and Leader of the GDTS
Re: What to do about 'Invisible armies'[message #344555 is a reply to message #344554] Tue, 15 March 2016 19:04 Go to previous messageGo to next message
edmortimer

 
Messages:856
Registered:January 2015
Location: Home Free
Yes, but Flugente wants a savegame from stock 1.13.




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: What to do about 'Invisible armies'[message #344567 is a reply to message #344555] Wed, 16 March 2016 19:55 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
I can get a savegame for Flugente next time I play the game.
Re: What to do about 'Invisible armies'[message #344568 is a reply to message #344567] Wed, 16 March 2016 20:07 Go to previous messageGo to next message
edmortimer

 
Messages:856
Registered:January 2015
Location: Home Free
Cool. I have started a game, but I could go all the way through without ever encountering the bug . . .




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: What to do about 'Invisible armies'[message #344589 is a reply to message #344568] Thu, 17 March 2016 19:58 Go to previous messageGo to next message
tais

 
Messages:812
Registered:February 2008
Location: NL
Well maybe tweaking some ini settings to the ones you might be using with the mod could help triggering it, Flug wont mind debugging a savegame that comes with one or two ini files.
I will also try to reproduce this issue in vanilla 1.13 in the weekend



IRC, pretty much the place to be! | Now also on Discord!


Re: What to do about 'Invisible armies'[message #344705 is a reply to message #343182] Sat, 26 March 2016 01:03 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
I finally got around to playing this game again.
Start a new game and, sure enough, first defensive battle bugs out. speechless

Save starts at 16:00. Attack on Drassen airport commences at around 17:32.

Can't seem to upload the file here. Got any recommendations as to where I can upload it?
Re: What to do about 'Invisible armies'[message #344709 is a reply to message #344705] Sat, 26 March 2016 11:48 Go to previous messageGo to next message
tais

 
Messages:812
Registered:February 2008
Location: NL
Share it via dropbox or google drive?
Just post the link or if you're not allowed something that looks like the link here.

Else join us on IRC and we can always be of assistance

[Updated on: Sat, 26 March 2016 11:50]




IRC, pretty much the place to be! | Now also on Discord!


Re: What to do about 'Invisible armies'[message #344728 is a reply to message #344709] Sat, 26 March 2016 20:52 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
Alright, here's a link to the savegame. That's all that's needed, right?
xxx.dropbox.com/s/tqsgiuzteohqetn/SaveGame12.sav?dl=0
I dit some edits to the options.ini as well. Don't know if it'd make any difference, but here it is anyway.
xxx.dropbox.com/s/s4msxiwsnna6eek/Ja2_Options.INI?dl=0
Just replace x's with w's.

Edit
One more:
xxx.dropbox.com/s/22tzp7b6z4bspod/SaveGame13.sav?dl=0

[Updated on: Sat, 26 March 2016 23:11]

Re: What to do about 'Invisible armies'[message #344732 is a reply to message #344728] Sun, 27 March 2016 00:06 Go to previous messageGo to next message
tais

 
Messages:812
Registered:February 2008
Location: NL
WOW! right on the spot!
I can reproduce the invisible soldiers on your savegame!
Running on a 8072 exe I start at the bottom corner fence at the airport, nobody shows for a while after the sector turns hostile.
I save the game in a new slot and load that save again and poof there's the enemies!

I think this should be gold for Flugente or silversurfer to debug!

[Updated on: Sun, 27 March 2016 00:07]




IRC, pretty much the place to be! | Now also on Discord!


Re: What to do about 'Invisible armies'[message #344786 is a reply to message #344732] Mon, 28 March 2016 20:33 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
I didn't have much time to analyze this issue but what I could see doesn't make sense to me. I used SaveGame12.sav for testing as well as your JA2_Options.ini.

- After some time forwarding a group of 4 regulars tried to enter sector B13 from the south (Drassen C13).
- Now the game checks how many are invading to display that on the pre-battle interface. The display is correct, it shows the 4 soldiers. The number is calculated in function "NumMobileEnemiesInSector".
- Then I clicked "Go to sector" and the game sets B13 as the current world sector (in function "SetCurrentWorldSector").
- In that function the game calls function "PrepareEnemyForSectorBattle". At that point we already have the group of 4 regulars stored in "gpBattleGroup".
- The first thing that is done in "PrepareEnemyForSectorBattle" is to call "HandleArrivalOfReinforcements( gpBattleGroup )". This calls function "AddPossiblePendingEnemiesToBattle" which checks if we are allowed to add these "reinforcements". We are not allowed to add them yet because there is a minimum delay for reinforcements. Errr, why do we look at reinforcements here? This is our main attack force! Ok, maybe the main force is added later...
- For now we just store the number of enemies in sector B13 as "pSector->bLastKnownEnemies = 4" which is correct.
- Next thing in function "PrepareEnemyForSectorBattle" is to check if reinforcements are allowed at all and since they are allowed we calculate the possible invasion source sectors and store them in "pusMoveDir". After that we check all of the possible 4 directions if a group of enemies is coming in from such sector. The problem is that our little group IS already in sector B13 so "NumMobileEnemiesInSector" returns that there is no match!
- We then validate if our non-existing enemy soldiers have weapons and return from the function.

Great! We have just added 0 enemies to the battlefield...

I'm not sure if this is actually the spot where the bug is or if our battle group shouldn't have B13 as current sector coordinates yet. I also don't understand why we first check for reinforcements when we didn't even deploy the main force yet.
I guess Flugente has more insight in troop deployment code and could have an idea how it should work.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #344788 is a reply to message #344786] Tue, 29 March 2016 00:21 Go to previous messageGo to next message
Flugente

 
Messages:3165
Registered:April 2009
Location: Germany
Oh boy. This is confusing.
First of all, that these soldiers are treated as reinforcements is ok. Any force attacking a sector from the outside is treated as 'reinforcements', so far so good.
  • At 17:32: 4 dudes invade from the south. As silversurfer says, PrepareEnemyForSectorBattle calls HandleArrivalOfReinforcements calls AddPossiblePendingEnemiesToBattle.
  • Because MIN_DELAY_ENEMY_REINFORCEMENTS is 5 (Sekthet's ini), we now DELAY these reinforcements. Which is technically correct but will be disastreous. We set the delay in
    guiReinforceTurn = guiTurnCnt + gGameExternalOptions.sMinDelayEnemyReinforcements + Random(gGameExternalOptions.sRndDelayEnemyReinforcements+1);// first possible reinforcement
    

    which also adds a random penalty the delay.
  • The intention, it seems, it that the game now updates its turn counter and then at some point decides to add the reinforcements. This is indeed what happens if you set all that reinforcement stuff to 0 in the ini.
    This should happen in HandleTacticalEndTurn(), where the turn counter guiTurnCnt can be increased, and where AddPossiblePendingEnemiesToBattle is called.
  • First really, really bad stuff: This does not happen. Because HandleStrategicTurn does not call HandleTacticalEndTurn. Why is that?
    void HandleStrategicTurn( )
    {
    	UINT32	uiTime;
    	UINT32	uiCheckTime;
    
    	// OK, DO THIS CHECK EVERY ONCE AND A WHILE...
    	if ( COUNTERDONE( STRATEGIC_OVERHEAD ) )
    	{
    		RESETCOUNTER( STRATEGIC_OVERHEAD );
    
    		// if the game is paused, or we're in mapscreen and time is not being compressed
    		if( ( GamePaused() == TRUE ) ||
    				( ( guiCurrentScreen == MAP_SCREEN ) && !IsTimeBeingCompressed() ) )
    		{
    			// don't do any of this
    			return;
    		}
    ...
    

    We already break in there... because the game is paused. Why? I don't know. There are each about 30 to 50 calls of PauseGame and UnPauseGame. I guess we somehow skipped the last UnPauseGame(). I don't know how or where.
  • With the unholy power granted to me by the powerful artifact that is the debugger, I set the pause state to false. We get to HandleTacticalEndTurn and this part:
    if(gGameExternalOptions.gfAllowReinforcements)//dnl ch68 100913
    {
    	((gTacticalStatus.Team[ENEMY_TEAM].bTeamActive || gTacticalStatus.Team[MILITIA_TEAM].bTeamActive) ? (guiTurnCnt++) : (guiTurnCnt = 0));
    	//Check for enemy pooling (add enemies if there happens to be more than the max in the
    	//current battle.	If one or more slots have freed up, we can add them now.
    	AddPossiblePendingEnemiesToBattle();
    	AddPossiblePendingMilitiaToBattle();
    }
    

    What should happen is that guiTurnCnt is increased. But it doesn't. We have no militia here, so gTacticalStatus.Team[MILITIA_TEAM].bTeamActive is FALSE, and the enemy isn't here yet (remember, we delayed them in the first place), so gTacticalStatus.Team[ENEMY_TEAM].bTeamActive is also FALSE.
    Thus guiTurnCnt is always set to 0.

    This means that, in this case, reinforcements not being here prevents reinforcements from arriving. suprised
  • Luckily, we also know whether reinforcements are pending, so we can fix that:
    if(gGameExternalOptions.gfAllowReinforcements)//dnl ch68 100913
    {
    	if ( gTacticalStatus.Team[ENEMY_TEAM].bTeamActive || gfPendingNonPlayerTeam[ENEMY_TEAM] || 
    	     gTacticalStatus.Team[MILITIA_TEAM].bTeamActive || gfPendingNonPlayerTeam[MILITIA_TEAM] )
    		++guiTurnCnt;
    	else
    		guiTurnCnt = 0;
    
    	//Check for enemy pooling (add enemies if there happens to be more than the max in the
    	//current battle.	If one or more slots have freed up, we can add them now.
    	AddPossiblePendingEnemiesToBattle();
    	AddPossiblePendingMilitiaToBattle();
    }
    

    With this change, the turn counter increases as it should. After 6 turns, reinforcements arrive. Hooray! aww

    We could also ask ourselves whey we don't simply increase guiTurnCnt all the time, like we do in void EndTurn( UINT8 ubNextTeam ). But not now, I'm tired.
  • I've committed the above fix in r8130.
  • If you have an older exe and don't want to upgrade (or rather, don't want to wait for the next SCI cheeky ), set MIN_DELAY_ENEMY_REINFORCEMENTS and RND_DELAY_ENEMY_REINFORCEMENTS to 0 in JA2_Options.ini. This should stop the reinforcements from being delayed in the first place.
  • This does not address the weird state from above, where the game was paused even though it shouldn't. With luck, this was a consequence of me messing with the debugger (and running several pre-features alongside). Otherwise, well, shit.
  • Side note: We seem to reroll the delay times during the load routine:
    if(guiReinforceTurn)
    	guiReinforceTurn = guiTurnCnt + gGameExternalOptions.sMinDelayEnemyReinforcements/2 + Random(gGameExternalOptions.sRndDelayEnemyReinforcements+1);
    if(guiMilitiaReinforceTurn)
    	guiMilitiaReinforceTurn = guiTurnCnt + gGameExternalOptions.sMinDelayMilitiaReinforcements/2 + Random(gGameExternalOptions.sRndDelayMilitiaReinforcements+1);
    

    It seems to me we should rather store them in the savegame itself.
Me go sleep now.

[Updated on: Tue, 29 March 2016 00:29]




Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: What to do about 'Invisible armies'[message #344789 is a reply to message #344788] Tue, 29 March 2016 01:18 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
Wow. I have no idea what you just said, but it sounded complicated. big grin
Thank you for looking into this issue, really appreciate it.
Now I can finally fully enjoy this awesome mod. happy
Re: What to do about 'Invisible armies'[message #344790 is a reply to message #344788] Tue, 29 March 2016 01:52 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
Thanks for looking into this. Please take your time to fix this as the current fix doesn't work without pausing/unpausing the game manually.

Also I would propose that we allow those "reinforcements" to appear without delay if there are no other troops present at the moment. It's a bit strange for the player when he is told that the enemy is attacking but there is nobody there until the delay timer runs out. If someone sets the delay to 10+ turns or something he can wait quite a while before soldiers show up. This might be a good thing but I'm not sure. It could give the player some time to get his mercs into cover.

If we rather go for immediate deployment of the first troops there are certain difficulties. Let's assume that two enemy groups are attacking at the same time. If we'd allow the first group to ignore the minimum delay because gTacticalStatus.Team[ENEMY_TEAM].bTeamActive is still FALSE the group would appear right away but this would also set gTacticalStatus.Team[ENEMY_TEAM].bTeamActive to TRUE as soon as the first soldier is added to the team in function "AddManToTeam" in Overhead.cpp. Because of that the second group would probably have to wait. Not exactly a good solution but we need to keep this in mind to solve the issue properly.

I'm also catching some sleep now. Good night.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #344793 is a reply to message #344790] Tue, 29 March 2016 13:20 Go to previous messageGo to next message
Flugente

 
Messages:3165
Registered:April 2009
Location: Germany
If the pause issue indeed persists, one would have to unpause the game by hand. I'm not at the code for now, not sure if this even is the kind of pause that one can set by key commands. I guess the easiest way to unforce it would be to cause any explosion or combat. 'If in doubt, shoot someone' is after all tried and true problem solving strategy aww

I agree with you, silversurfer - the delay seems mighty odd if the entire enemy force is delayed (and could cause a lot of trouble if we manage to then load a different sector). Perhaps a simple check would be enough - if no hostile force is currently present, lower delay or sth like that.

What confuses me after sleeping over it - if we don't allow reinforcements... how would this attack even start? I'll have to read the code this evening. I hope I didn't misinterpret it and initial attacks aren't treated as reinforcements but something in between. It's complicated enough already.



Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: What to do about 'Invisible armies'[message #344795 is a reply to message #344793] Tue, 29 March 2016 15:13 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
If we don't allow reinforcements it doesn't matter. "HandleArrivalOfReinforcements( gpBattleGroup )" is called before the check.

I was thinking about a possible fix for the initial delay. What if we just increment "guiTurnCnt" by "guiReinforceTurn" as long as there are no enemies on the map? This would make sure that the next turn spawns the enemy forces. The real reinforcement functionality wouldn't be affected because for real reinforcements there has to be an enemy force present on the map already which is not the case in an invasion scenario.

In "AddPossiblePendingEnemiesToBattle()":
if(gGameExternalOptions.sMinDelayEnemyReinforcements)//dnl ch68 080913
{
	if(gTacticalStatus.Team[ENEMY_TEAM].bAwareOfOpposition == TRUE)
	{
		if(guiReinforceTurn == 0)
		{
			guiReinforceTurn = guiTurnCnt + gGameExternalOptions.sMinDelayEnemyReinforcements + Random(gGameExternalOptions.sRndDelayEnemyReinforcements+1);// first possible reinforcement
			ubSlots = 0;
			// silversurfer: If there are no enemy troops in the sector yet we will spawn the incoming troops without delay. In this case they are not reinforcements but the initial attack group.
			if( !gTacticalStatus.Team[ENEMY_TEAM].bTeamActive )
				guiTurnCnt += guiReinforceTurn;
		}
		else if(guiTurnCnt >= guiReinforceTurn)
		{


Now I need to find out where this pause happens in order to terminate it.

edit:
Ok, "PauseGame()" is called in function "PrepareForPreBattleInterface" which is ok. We need to stop the clock here before presenting the pre-battle interface.
Unfortunately the pause is not terminated once we enter the tactical screen and the player doesn't know that the game is still paused. So now where best to place the "UnPauseGame()"...

[Updated on: Tue, 29 March 2016 15:29]




Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #344796 is a reply to message #344795] Tue, 29 March 2016 15:49 Go to previous messageGo to next message
Flugente

 
Messages:3165
Registered:April 2009
Location: Germany
silversurfer wrote on Tue, 29 March 2016 12:13
If we don't allow reinforcements it doesn't matter. "HandleArrivalOfReinforcements( gpBattleGroup )" is called before the check.

Phew. Good to know.

silversurfer wrote on Tue, 29 March 2016 12:13

I was thinking about a possible fix for the initial delay. What if we just increment "guiTurnCnt" by "guiReinforceTurn" as long as there are no enemies on the map? This would make sure that the next turn spawns the enemy forces. The real reinforcement functionality wouldn't be affected because for real reinforcements there has to be an enemy force present on the map already which is not the case in an invasion scenario.

In "AddPossiblePendingEnemiesToBattle()":
if(gGameExternalOptions.sMinDelayEnemyReinforcements)//dnl ch68 080913
{
	if(gTacticalStatus.Team[ENEMY_TEAM].bAwareOfOpposition == TRUE)
	{
		if(guiReinforceTurn == 0)
		{
			guiReinforceTurn = guiTurnCnt + gGameExternalOptions.sMinDelayEnemyReinforcements + Random(gGameExternalOptions.sRndDelayEnemyReinforcements+1);// first possible reinforcement
			ubSlots = 0;
			// silversurfer: If there are no enemy troops in the sector yet we will spawn the incoming troops without delay. In this case they are not reinforcements but the initial attack group.
			if( !gTacticalStatus.Team[ENEMY_TEAM].bTeamActive )
				guiTurnCnt += guiReinforceTurn;
		}
		else if(guiTurnCnt >= guiReinforceTurn)
		{


But... guiReinforceTurn isn't 0, so your fix won't run, won't it?
silversurfer wrote on Tue, 29 March 2016 12:13

Now I need to find out where this pause happens in order to terminate it.

edit:
Ok, "PauseGame()" is called in function "PrepareForPreBattleInterface" which is ok. We need to stop the clock here before presenting the pre-battle interface.
Unfortunately the pause is not terminated once we enter the tactical screen and the player doesn't know that the game is still paused. So now where best to place the "UnPauseGame()"...

It's likely the Unpause exists at the right place but we just miss it. You could perhaps see whether an enemy attack elsewhere correctly unpauses the game (might have to break in PauseGame and UnpauseGame for that).



Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: What to do about 'Invisible armies'[message #344797 is a reply to message #344796] Tue, 29 March 2016 16:36 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
edit: Stupid me. I guess easiest solution to the initial attack problem was too obvious:
// silversurfer: Only if there are enemy troops in the sector already we can talk about "reinforcements". If no troops are there we will spawn the incoming troops without delay.
if( gGameExternalOptions.sMinDelayEnemyReinforcements && gTacticalStatus.Team[ENEMY_TEAM].bTeamActive )//dnl ch68 080913
{
	if(gTacticalStatus.Team[ENEMY_TEAM].bAwareOfOpposition == TRUE)
	{
		if(guiReinforceTurn == 0)
		{
			guiReinforceTurn = guiTurnCnt + gGameExternalOptions.sMinDelayEnemyReinforcements + Random(gGameExternalOptions.sRndDelayEnemyReinforcements+1);// first possible reinforcement
			ubSlots = 0;
		}
		else if(guiTurnCnt >= guiReinforceTurn)
		{

Why bother with minimum delay timers for reinforcements if we don't even have one enemy unit in the sector? Simply use the default code that runs if the minimum delay is 0!


For the pause issue I probably found the perfect spot to put the unpause command. In mapscreen.cpp function "EndMapScreen" there is the spot where we enter tactical. There we already set time compression to 1x but I think the unpause was missing all the time so I added it there.

// if going to tactical next
if ( guiPendingScreen == GAME_SCREEN )
{
	// set compressed mode to Normal (X1)
	SetGameTimeCompressionLevel( TIME_COMPRESS_X1 );
	UnPauseGame();
}

[Updated on: Tue, 29 March 2016 16:48]




Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #344798 is a reply to message #344797] Tue, 29 March 2016 16:58 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
I committed my changes in revision 8131. Feel free to test, especially with multiple attack groups at once.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #345029 is a reply to message #344798] Tue, 12 April 2016 17:49 Go to previous messageGo to next message
Sekthet

 
Messages:11
Registered:February 2016
silversurfer wrote on Tue, 29 March 2016 15:58
I committed my changes in revision 8131. Feel free to test, especially with multiple attack groups at once.

Where and how would one go about testing this revision? Had a look around, but couldn't find any links to anything newer than the 2014 release. The links in the FAQ are dead.
Re: What to do about 'Invisible armies'[message #345032 is a reply to message #345029] Tue, 12 April 2016 18:13 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
You could compile your own exe or wait for one of Depri's SCIs that has the proper version. His latest SCI seems to be revision 8131 with GameDir 2310.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #346905 is a reply to message #345032] Wed, 14 September 2016 22:17 Go to previous messageGo to next message
Panzer

 
Messages:82
Registered:February 2016
Location: Altis, Sometimes Tanoa
Doubtful and probably insane question, but say I don't want to change the way my game handles reinforcements, and cannot upgrade due to Mod compatibility, would it be possible to "Inject" the fix into my 7609?



I have no Wife, Children, or real Job. This also means I have 24 hours a day and 7 days a week to think of a rebuttal. You have been warned.

"I got another problem: I am being overrun by Dinosaur Nazis on Hoverboards!" -Ravenhugger

"Before you judge a man, walk a mile in his shoes. After that who cares? He's a mile away - and you've got his shoes!" - Unknown Criminal
Re: What to do about 'Invisible armies'[message #346907 is a reply to message #346905] Wed, 14 September 2016 23:40 Go to previous messageGo to next message
silversurfer

 
Messages:2190
Registered:May 2009
I could almost bet that Sevenfm's experimental 7609 exe has this fix too so you can try that. Currently latest one can be found here.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Re: What to do about 'Invisible armies'[message #346909 is a reply to message #346907] Thu, 15 September 2016 03:19 Go to previous message
Panzer

 
Messages:82
Registered:February 2016
Location: Altis, Sometimes Tanoa
had trouble getting that one working, but ill try it again I suppose.
Got it working just fine now, didn't fix it. yay, fixed issues I cant experience. It's like bugfixing a game you cant play. hahaha. I guess ill change the INI information and see if someone finds a way.
Well, I have no clue what's going on, after changing all of this, I can't tell why it isn't working. Only thing I can think of is maybe it's my save game.

[Updated on: Thu, 15 September 2016 12:06]




I have no Wife, Children, or real Job. This also means I have 24 hours a day and 7 days a week to think of a rebuttal. You have been warned.

"I got another problem: I am being overrun by Dinosaur Nazis on Hoverboards!" -Ravenhugger

"Before you judge a man, walk a mile in his shoes. After that who cares? He's a mile away - and you've got his shoes!" - Unknown Criminal
Previous Topic: how to make militia follow my mercs?
Next Topic: How to GET/MOD a new and FULL installation of Jagged Alliance 2 v1.13?
Goto Forum:
  


Current Time: Wed Nov 22 09:20:11 EET 2017

Total time taken to generate the page: 0.01380 seconds