Debug mode

ZergMazter

Prince
Joined
Apr 7, 2012
Messages
510
Location
US, Florida
I thought I had resolved every issue in my mod and began playing a normal game with no debug. My game crashed in the early modern age unexpectedly. Is there a way I could turn my current normal game into a debug session?

I really wish I could tackle the problem right now that it's happening, but without debug it's impossible. Any way to cheat at least to reveal the map?

Thanks
 
I've read other posts and it seems people are using debug mode, making changes, then playing the same game with the new changes until it doesn't crash. Can anyone show me how that is done? As far as I know debug is a viewing mode. You can see the last unit moved before a crash, but all you can do is guess what went wrong.

What is the approach to solve a bug? Am I supposed to guess and try the duplicate the crash on a new game to then try to solve it, or can I directly do it on the played map?

The previous bugs I fixed I was lucky enough that I actually solved them because I read about similar issue somewhere in here about 'wheeled' units. This one however is a plain crash. It says my civ stopped working and that it was gonna close, and I have no clue what's the approach to this.

I'm stuck because I have been unable to give debug more to a normal save which crashes the following turn. I have no way of duplicating my bug if I cannot see whats happening :/

Can anyone help me?
 
While I wait for a reply from my previous question I decided to go ahead and use the little bit of gold I had and my couple of airports to cheat-transport to something I found while using spies and stealing maps of 1 civ at a time.

I found out:

-It's Japan's turn to move
-Japan is at war with Korea
-The very last unit they are moving is that army. This is why it is on top of the stack.
-It seems to be heading to their captured city of Choybalsan
-There is a Korean spy on the way. In my games spies are invisible and hidden nationals.
-The very last thing before the crash is an attempt by the Japanese army to make it to Choybalsan, but as a results collides with an invisible spy. I think...

Now if that's whats happening we got a very weird scenario that does not exist in vanilla. An army is basically attempting to enter combat with a hidden offensive ground unit by accident. It looks like it could make sense I don't know.

If this is the case I rather change the battle created unit. I love how my spies are working :/

I'm unable to make changes and keep playing, so I'll need an opinion. Does this sound like it could make sense when you look at the picture?

Edit:
Or I guess I could recreate this scenario in a new map lol.

Edit again:

Confirmed. That's been plaguing my games for the longest and I had no clue. It's a good day. Take notes guys. When making invisible ground units make sure you change 'army' flagged units that produce after combat, so if they collide it does not crash.

I don't know how I am gonna change this. I need an unit that will run back to base like an army, but that's not an army, so that if it collides there won't be a crash, and then upgrade to the actual army inside a city for 0 gold.
 

Attachments

  • Crash.jpg
    Crash.jpg
    239.4 KB · Views: 152
When making invisible ground units make sure you change 'army' flagged units that produce after combat, so if they collide it does not crash.

I don't know how I am gonna change this. I need an unit that will run back to base like an army, but that's not an army, so that if it collides there won't be a crash, and then upgrade to the actual army inside a city for 0 gold.
Glad you've narrowed down the problem, but not sure I understand about the details of the units involved. It's a unit flagged as an army but can hold zero units? Other than the hidden nationality & invisibility flags is anything different about the spy -other flags, unusual combat values, etc. ?
 
Ok this is what happens:

This bug is very easy to duplicate. In normal conquest when an elite ground unit kills, it has a chance to produce a leader. I noticed the AI was using leaders to only rush buildings/projects, and I wanted it to build an army instead. I ended up replacing the combat produced unit to the regular army instead of the leader.

No problems yet, but the problem occurs when you add invisible ground units to the game. There is a chance that the human or AI player will be victorious in combat and create an army while there is an invisible unit on a nearby tile. Why a problem? Because normally if you move an army that's not been loaded yet in the direction of a unit the game will not let you attack because it has no offensive value. However with an invisible unit in the way when you try to step on that tile unknowingly, combat will be forced and the game is not coded to work that way.

An army can be attacked and it dies, but the game has a safe guard to keep you from attacking with an empty army. It just wont let you. The devs forgot to safeguard that unit the same way when accidentally stepping on invisible units, forcing a combat initiated by the army, making the game crash as it is impossible to happen.

I tried giving an empty army a combat value using Quintillus editor, and confirmed this even further. An empty army can't ever be the aggressor or it will crash the game. An army with an attack value of 1 and defense 1, cannot attempt to kill another unit, as the game is not coded to work that way. It creates a fatal error and it crashes. Even if the army has no combat value, stepping on an invis unit will force combat causing all kinds of errors.
 
Thank you! Great explanation - a lot of detailed info, but easy to follow.



Just speculating, don't know that this is possible:

Leaders don't crash the game next to the invisible unit, correct? Is it possible to make a unit that can upgrade to an army, but not do the other things a leader can? Assign it values that could handle being next to the invisible unit. You wouldn't instantly have an army (have to run to a city to upgrade), but maybe it wouldn't crash the game & you'd get basically what you want.
 
That's just what I was thinking since the AI will use the leader to build an improvement. I thought making a 'Leader' unit flagged with the 'King' strategy, and an upgrade to an army would force the AI to run to a city to upgrade.

The only problem with this is that the city in which they decide to upgrade must have a building which allows them to build an army as it will also allow them to upgrade to an army. I could easily get around this by giving the AI an unobtainable unit in each era which they could upgrade to in case they did not have a building which allowed them to upgrade to an army. This will allow them to get an 'Army' whether they have the required building or not.
 
What I meant was to make a layered unit with 3 stages:

Stage 1 = King created after combat

Stage 2 = Upgrade in a normal barracks (This is the just in case unit) (Not army flagged)

Stage 3 = Upgrade in an army barracks (Army flagged)

They'll be chained to upgrade in that corresponding order (1-2-3), so that if stage 3 is not possible, then the unit upgrades to stage 2, and if stage 3 is possible, then the unit skips stage 2 and upgrades to the real deal and not the 'just in case' unit.

The 'just in case' unit will mimic a loaded army in stats even though it's not really an army, but it's better than no army at all for the AI.
 
No lol this is post fix after I found my problem, which was that I set up my game to produce armies from a combat victory instead of a leader, and armies accidentally forcing combat on invis units.

What I was talking about in my previous post was about replacing the problematic armies with a non-army unit that would upgrade to an army and stop the game from crashing due to forced combat on an empty army, but in a way that helps the AI upgrade.

An unloaded army will always make the game crash if u step on an invisible unit, but my fix does not allow empty armies to be wandering around since they will again always start in cities as in the original game via 'build army' or build list.

Basically all that happened was in vanilla the AI never used leaders to build an army, and I created a fix by allowing them to get an army right away after combat victory, but I did not foresee empty armies crashing the game if they initiate combat. I returned back to the vanilla way, but changed how the leader works instead, so they dont waste it, but instead upgrade to an army, rather than, 'build army' which they never use anyway. They actually upgrade it and get their army or a replacement army unit if no 'army barracks' is available.
 
Basically all that happened was in vanilla the AI never used leaders to build an army.

One thing you could do if this has been problematic is to allow your Military Academy small wonder equivalent (i.e. the army barracks) to be built regardless of armies on the field or previously victorious armies.

Once it's been built, the AI does then know how to build army units.
 
Back
Top Bottom