Defensive & Offensive Combat Values

Information, How-to's, and discussion about mod'ing Master of Orion II.
User avatar
Rocco
Posts:242
Joined:Sat Mar 29, 2008 9:16 am
Contact:
Defensive & Offensive Combat Values

Postby Rocco » Sat Aug 29, 2015 6:51 pm

In MOO, a Battlestation gives +10 bonus for defending fleet and the Fortress +20.
That is cool for the beams but also good to increase chance of gaining initiative.

Bonus for the Star Base is 0 however.
Setting a small BA bonus here could be interesting to give initiative to defender in case of a tie.

There is this curious bit of text in Gontzol's guide:
When a Star Base is present, there is no bonus, but when there is a colony or outpost present that has no orbital base, the bonus is +10 BA.
[edit: below testing was done in vdc/ice exe not classic moo2]

Has this supposed +10 BA been 'empirically observed'?
It is not listed in combat.
In any case, I started digging in the fleet offense code.
The bonus for Star Base in that code is explicitly set to 0.
Tweaking the code by replacing that set=0 code with "inc, inc", for a +2 value, results in:
  • Colonies without base and Outposts get a +2 defensive bonus.
    A Star Base however gets +4, that is double the set value.
- Star Base and No Star Base situations are tied somehow, but with a factor 2 delta.
As I was not able to locate the 'factor 2', I have rewritten the entire code block to be able to set any Star Base value.
Setting the Star Base bonus at +2 (any other value can be set) with new code, results in:
  • Star Base, 'No Star Base Colony' and Outpost all get the same +2 bonus.
- The game treats Star Base and No Star Base situations as the same for Beam Offense purposes.

And that is a little mystery to me why suddenly this factor 2 is gone, as I have left all other code around it perfectly intact.


BB97B
Classic code (VDC / ICE) [B9 0A = 10; B9 14 = 20]
3C 04 72 08 76 0E 3C 05 74 11 EB 14 3C 03 75 10 31 C9 EB 0C B9 0A 00 00 00 EB 05 B9 14 00 00 00

Changed 'set=0' to 'Inc, Inc" [41 41 = 1+1 = 2]
3C 04 72 08 76 0E 3C 05 74 11 EB 14 3C 03 75 10 41 41 EB 0C B9 0A 00 00 00 EB 05 B9 14 00 00 00

Code Rewrite; [B9 02 = 2; B9 0A = 10; B9 14 = 20]
3C 03 72 1C B9 02 00 00 00 3C 04 72 13 B9 0A 00 00 00 3C 05 72 0A b9 14 00 00 00 74 03 31 C9 90

Note that this code rewrite is not compatible with OCL.
(OCL will overwrite data in this block)
Last edited by Rocco on Fri Sep 25, 2015 8:04 pm, edited 4 times in total.

User avatar
Darza
Posts:134
Joined:Tue Oct 02, 2012 10:09 am

Re: Star Base Fleet Offensive Bonus

Postby Darza » Sun Aug 30, 2015 4:08 am

Well, many stuff from Gontzol Guide wasnt "empirically observed". Just it was generally good for its time, as also many stuff there was correct, and it generally shined amid various fan "guides" of the time. As it had a good correct\wrong ratio compared to them.

Great stuff as usual, man.

User avatar
Overlord2
Posts:661
Joined:Wed Jun 13, 2007 5:25 pm

Re: Star Base Fleet Offensive Bonus

Postby Overlord2 » Sun Aug 30, 2015 4:34 pm

Few comments on the issue:
#1 There shouldn't be any bonus from Starbase according to ingame logic;
#2 In vanilla outpost was adding +10 beam offense to the owner when he was defending and it was a bug;
#3 It was fixed in VDC by giving correct hull size to the starbase (was cruiser size in regular, should have been Battleship); dunno why, but this change fixed the bug.

User avatar
Rocco
Posts:242
Joined:Sat Mar 29, 2008 9:16 am
Contact:

Re: Star Base Fleet Offensive Bonus

Postby Rocco » Sun Aug 30, 2015 6:36 pm

#3 It was fixed in VDC by giving correct hull size to the starbase (was cruiser size in regular, should have been Battleship); dunno why, but this change fixed the bug.
I see- was not testing in classic, unaware testing in vdc exe might affect the outcome.
Indeed the bug can be seen in classic, both for Outpost and undefended colony.
So Gontzol guide is correct on this point.
Moreover, it explains as follow: In classic SB=2, BS=3, SF=4.
The game must assign #3 for OP and 'Colony without base' somewhere in the code, causing them to get the +10 bonus of Battlestation as result. (verified by changing the +10 bonus)
The bug disappears in vdc fix as now Star Base is set at 3 and that bonus is 0.
Consequently, when I give a bonus with the new formula to a Star Base (which is #3 also in ice), OP also gets this bonus.
Now it is still only a matter of finding where the game sets #3 for OP...
#1 There shouldn't be any bonus from Starbase according to ingame logic;
There shouldn't be vdc or ice according to ingame logic; we are modders and can do whatever we want. :D
On a more serious note; I am more interested in the mechanic of the code than the actual modding of this specific issue.
edit: Admittedly I am tempted to give a SB +5 bonus, but I don't like that OP or undefended colony would get it too.

edit2: As the 'factor 2' issue is not clear to me yet, will keep studying this code.
There is a send-back loop in the code block that might explain [perhaps OP is not sent back up while SB is for some reason]

User avatar
Rocco
Posts:242
Joined:Sat Mar 29, 2008 9:16 am
Contact:

Fighters Offensive Bonus

Postby Rocco » Fri Sep 25, 2015 8:01 pm

Fighters get a base offensive bonus of +50.
Offset:
dos / 140
C362C / C366C: 32 (50)

Fighter BA = Base offensive bonus + best available computer bonus.
Last edited by Rocco on Fri Sep 25, 2015 8:08 pm, edited 2 times in total.

User avatar
Rocco
Posts:242
Joined:Sat Mar 29, 2008 9:16 am
Contact:

Missile Defensive Bonus

Postby Rocco » Fri Sep 25, 2015 8:03 pm

Missiles get a defensive bonus based on missile type:
Offsets
Dos / 140
C36CD / C370D: 0A (-10) Nuclear missile gets a penalty
C36D2 / C3712: 0F (15) Merculite missile
C36D7 / C3717: 28 (40) Pulson missile
C36DC / C371C: 46 (70) Zeon Missile

Missile BD = Missile speed * 5 + defensive bonus.

User avatar
Darza
Posts:134
Joined:Tue Oct 02, 2012 10:09 am

Re: Fighters Offensive Bonus

Postby Darza » Fri Sep 25, 2015 9:22 pm

Fighters get a base offensive bonus of +50.
Fighter BA = Base offensive bonus + best available computer bonus.
What is about defence? No bonus, unlike missiles? And also they get ...+ Racial BA bonus + Weaponry bonus + Fighter leader bonus (both BA & BD).

User avatar
Rocco
Posts:242
Joined:Sat Mar 29, 2008 9:16 am
Contact:

Re: Defensive & Offensive Combat Values

Postby Rocco » Sat Sep 26, 2015 6:25 am

indeed, these other BA boni add to fighters too.
did not find a special defense bonus for fighters in the code.
am trying to localize the "50% chance to avoid self-destruct or warp core breach explosions" that was introduced in version 1.30

User avatar
Overlord2
Posts:661
Joined:Wed Jun 13, 2007 5:25 pm

Re: Defensive & Offensive Combat Values

Postby Overlord2 » Sat Sep 26, 2015 7:46 am

Missile defense bonus finding was a significant one. I wondered why pulsons and lower missiles were so much easier to shoot.
On a side note: how is set the negative sign for nuclear missile? I thought it should be F6 for -10.

User avatar
Rocco
Posts:242
Joined:Sat Mar 29, 2008 9:16 am
Contact:

Re: Defensive & Offensive Combat Values

Postby Rocco » Sat Sep 26, 2015 8:27 am

Nuke was written as a Substract:
83 EA 0A

The others were written as an Add:
83 C2 0F
83 C2 28
83 C2 46


Return to “Game Modifications”

Who is online

Users browsing this forum: No registered users and 34 guests