Pre-defined diplomacy

Information, How-to's, and discussion about mod'ing Master of Orion II.
Posts: 3
Joined: Wed Jan 05, 2011 3:29 am

Pre-defined diplomacy

Postby BBalazs » Wed Jan 05, 2011 3:36 am

Hello folks,
I would like to build scenarios with pre-defined diplomacy (that is, teams). I know that you need savegame editing for this - and so far this is the only problem I've come across.
The closest I could get to modifying the diplomacy settings is via the Moo2 savegame editor, but the diplomacy button seems to be disabled there.

The idea is to create a 4 vs 4 setting on an 8-player map, by linking the players with Alliances. In the case of playing with/against AIs, I know that they might break these Alliances (due to enemy spying, for example), but having the thing pre-forged at least leaves the opportunity to have it so.

I'm not afraid of hex editing either, but I have no clue where to start with, what offsets to look for, how to identify them. All eight players are in their starting phase in turn 1, with no contact, default diplomacy settings whatsoever.

Thanks for your help.

User avatar
Posts: 20
Joined: Fri Apr 29, 2016 3:19 pm

Re: Pre-defined diplomacy

Postby Belix » Sun May 01, 2016 2:47 am

This reply is five years late, but in case you are still around (or anyone else is reading this), I do at least know where in the save files you can find and modify the status of treaties and relations. From my notes...
Each player in the game has their status defined with each other race.
This means it is possible for one player to have an 'alliance' or other
treaties with a player that has neither with them (or is even at war).

Since the value of resource treaties is determined by what turn they were
established, simply setting a Trade or Research treaty 'on' just creates
broken treaties worth 0 science/credits per turn.

NOTE: Races that have not met before and don't have comm will DEFAULT to
NO TREATY when they encounter each other, overwriting what is set here.
To prevent this, make sure races have comm before giving diplo relations.
Unfortunately, this only works to maintain alliances. If not allied, contact
is lost next turn, and they will 'first meet' again once back in touch.
Remember that within the 8 values allocated for each variable for a given race is a slot that refers to the same player number as the race slot you're modifying; no sense telling player 1 to be at war with player 1.

Comm bool[8] (00 = no, 01 = yes) Indicates if two races have contact this turn
Met bool[8] If contact ever existed between these races.
Diplo byte[8] Formal status with that race (alliance/peace/war etc)
TT bool[8] If a Trade Treaty exists with that race [related data is missing]
RT bool[8] If a Research Treaty exists with that race [related data is missing]

Types of Diplomatic status:
00 = No Treaty
01 = Non-Aggression Pact
02 = Alliance
03 = Peace Treaty [war ceased]
04 = Limited War**
05 = War

**unimplemented; judging by unused dialogue, I'd guess this was meant to be a sort of "We'll shoot your ships anywhere we encounter them, but aren't going to assault your territory"
EDIT: I was incorrect - this isn't unimplemented, see Rocco's post below for an explanation.

Code: Select all

Comm Met Diplo TT RT PLAYER 1 1AF92 1B01D 1B035 1B03D 1B048 PLAYER 2 1BE3B 1BEC6 1BEDE 1BEE6 1BEEE PLAYER 3 1CCE4 1CD6F 1CD87 1CD8F 1CD97 PLAYER 4 1DB8D 1DC18 1DC30 1DC38 1DC40 PLAYER 5 1EA36 1EAC1 1EAD9 1EAE1 1EAE9 PLAYER 6 1F8DF 1F96A 1F982 1F98A 1F992 PLAYER 7 20788 20813 2082B 20833 2083B PLAYER 8 21631 216BC 216D4 216DC 216E4
Hope that helps, but like you said, this only establishes initial relations. To ensure a proper team game from start to finish, the code that alters race relations might need to be disabled in the exe. If anyone is interested in messing with those, some values related to race relations are located here:

Code: Select all

Relationship status (two byte[8] arrays at each address] PLAYER 1 1B025 PLAYER 2 1BECE PLAYER 3 1CD77 PLAYER 4 1DC20 PLAYER 5 1EAC9 PLAYER 6 1F972 PLAYER 7 2081B PLAYER 8 216C4
Each of these addresses contains an array of byte[8], followed by a second, similar byte[8] for the same player. I am uncertain exactly what these two blocks influence as far as how the AI makes decisions about breaking alliances or such, but I think the first one influences the liked/disliked meter you see on the diplomacy screen.

It's possible that the default race relations that control how much race A likes race B (e.g. Gnolams hate Elerians by default) may be useful here, but since that is part of the game rules and not part of the game state, that's probably in the .exe or an .lbx file somewhere. Good luck...
Last edited by Belix on Sat May 21, 2016 9:42 pm, edited 1 time in total.

User avatar
Posts: 235
Joined: Sat Mar 29, 2008 9:16 am

Re: Pre-defined diplomacy

Postby Rocco » Mon May 02, 2016 3:24 pm

Good stuff.
The stance "04 = Limited War" is used in the game and can happen between two a.i. players.

Return to “Game Modifications”

Who is online

Users browsing this forum: No registered users and 1 guest