Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Strategic combat

Since this is a part of the game that is quite hard to investigate due to all the internal variables - even if you figure out how the code itself works you can't read stack variables during the process - here is a trick I'm using :
First locate any desired part of the strategic combat code which you want to investigate (to find bugs or just to see if your modding has the desired effect). Delete whatever you find directly afterward - or place a jump - and insert this code by assembler and hex editor to run next.
What this does is, it loads all the strategic combat variables into the human player's historian data and freezes the game immediately. If you connect to the game with the Tweaker at that time, you can then read all the data and know exactly what numbers are in the variables, meaning you can measure how and why an army wins or loses a strategic battle. (and you even see the actual stats used on the units in "battle units" as though it was normal combat so you can know what got converted into those army stats)

H stands for high word of the variable, and L stands for low since many of these are dwords.
DEF, ATK and RAN are the three main stats used in the battle, the total army ranged, melee and durability rating.
Mana is the amount the wizard can spent at most for the battle. Skill per turn is now much of that is spend each strategic combat round - chances are the battle will last long enough for all mana to get used.
The three types of magic bonus are how much ATK, how much % of the ATK, and how much DEF spending 5? mana crystals adds to the army.

Not sure if anyone will ever need this but might as well post just in case since modding strategic combat without seeing "inside" the variables is pretty much impossible as you can't tell what went wrong even if you somehow spot the outcome of the battle being different from expected despite all the random rolls going on making it hard to predict in the first place.
Code:
;0
mov ax,[bp-14h] ; DEF attacker H          
mov [-5DD4h],ax
;2
mov ax,[bp-16h] ; DEF attacker L        
mov [-5DD2h],ax
;4
mov ax,[bp-20h] ; RAN attacker H          
mov [-5DD0h],ax
;6
mov ax,[bp-22h] ; RAN attacker L        
mov [-5DCEh],ax
;8
mov ax,[bp-1Ch] ; ATK attacker H        
mov [-5DCCh],ax
;10
mov ax,[bp-1Eh] ; ATK attacker L      
mov [-5DCAh],ax
;12
mov ax,[bp-3Ch] ; Total HP attacker      
mov [-5DC8h],ax
;14
mov ax,[bp-18h] ; DEF defender H          
mov [-5DC6h],ax
;16
mov ax,[bp-1Ah] ; DEF defender L      
mov [-5DC4h],ax
;18
mov ax,[bp-2Ch] ; RAN defender H      
mov [-5DC2h],ax
;20
mov ax,[bp-2Eh] ; RAN defender L        
mov [-5DC0h],ax
;22
mov ax,[bp-28h] ; ATK defender H        
mov [-5DBEh],ax
;24
mov ax,[bp-2Ah] ; ATK defender L
mov [-5DBCh],ax
;26
mov ax,[bp-3Eh] ; Total HP defender      
mov [-5DBAh],ax
;28
mov ax,[bp-48h] ; Mana available on attacker      
mov [-5DB8h],ax
;30
mov ax,[bp-58h] ; SKILL PER TURN, attacker        
mov [-5DB6h],ax
;32
mov ax,[bp-4Ch] ; Magic attack bonus, attacker    
mov [-5DB4h],ax
;34
mov ax,[bp-50h] ; Magic % attack bonus, attacker  
mov [-5DB2h],ax
;36
mov ax,[bp-54h] ; Magic defense bonus, attacker  
mov [-5DB0h],ax
;38
mov ax,[bp-4Ah] ; Mana available on defender      
mov [-5DAEh],ax
;40
mov ax,[bp-5Ah] ; SKILL PER TURN, defender        
mov [-5DACh],ax
;42
mov ax,[bp-4Eh] ; Magic attack bonus, defender    
mov [-5DAAh],ax
;44
mov ax,[bp-52h] ; Magic % attack bonus, defender    
mov [-5DA8h],ax
;46
mov ax,[bp-56h] ; Magic defense bonus, defender    
mov [-5DA6h],ax

self:
jmp self
Reply

I know you posted it somewhere, but for the life of me I can't find it.

Could you repost the strategic combat formula please?
Reply



Forum Jump: