Diplomancy OXP

From Elite Wiki
Revision as of 09:48, 17 April 2026 by Cholmondely (talk | contribs) (Added Day's roadmap for his OXP)
IconGNN.png
The additions to the F4 ship-station interface screen (with ANA installed)

Overview

The new Embassy District on the Orbital Station
The Star Wars screens (need ANA installed)
Toggles between Wars Map/Diplomancy Map/Warring Systems Map.
This one is the Warring Systems Map: red cross means that the system is at war with somebody, no idea who!
legend for Star Wars screen
The Wars Map
Red line = war, Green line = alliance
Qubeen is at war with Soorbi, Onlema & Xexeti. She is allied with Arraesso.
To the West, Usanat is at peace with both Geerra and Soladies - no wars with them and no alliances either
The Diplomacy Map
Red = hate, Green = love, Yellow = love/hate,
Orange = dislike, Blue = like, Grey = neutral

Feudal Qubeen and anarchic Xexeti have a love/hate relationship. Commie Usanat hates Democratic Geerra despite being at peace with it
System History screen
Note the yellow "Love+Hate" line between Qubeen and Xexeti on the "Diplomacy Map" above

This OXP effects three major changes in the game:

  • It creates an inter-galactic politics with systems declaring war on each other, forming alliances and signing peace deals.
  • It allows purchase of citizenship of a system (with resulting tax liabilities & refugee status in systems at war with one's own)
  • It requires visas for travel to some government types. Not all surrounding systems will sell them (depending on wars or on being anarchies)!

Not to be confused with Home System OXP which allows investment in systems.

Citizenships

The player may acquire, or renounce, a system citizenship when visiting this system, for the right price. They may choose which one of their citizenships is announced as the flag of their ship.

  • The player is considered fugitive when in systems warring with their flag.
  • Anarchies provide no citizenship. They also have no embassy district (for buying visas for neighbouring systems).
  • The player may buy several days of visa in the Embassy district in a neighbouring state, which is not an enemy to the destination system.
Corporate systems, dictatorships and communists refuse docking to players when stateless and visaless.
  • Citizenship leads to Income Tax!

Systems' alliances, wars

  • GNN news: GNN news is now displayed when an alliance is formed or broken between two systems, or when a war starts or ends between two systems, and the player is in one of those systems.
  • Strategic maps showing the warring systems, and the diplomatic relationships!
These need the ANA to be installed to show on the F4 station-interface screen.
  • Two systems within 7ly of each other may now form an alliance, if they like each other enough.
  • They may break their alliance, too!
  • They may wage war to each other, and make peace too!
  • New F4 Interface screens: the Embassy District & the System's History!

Systems' treasury

  • Wars require money, and countries are defeated either by battles or by bankruptcy, sometimes the latter producing the former.
  • The Treasury and Tax levels are displayed in the F7 system information.
  • Each system treasury is increased through taxation each player jump, depending on the time past since the last jump.

What's currently implemented technically?

The oxp contains Engines which may be use by developers to implement interesting galaxy-spanning events:

  • (main) Engine,
  • War,
  • History,
  • Systems,
  • Economy,
  • Citizenships.

Effects on game

Effects on game difficulty

  • The player is considered fugitive when in systems warring with their flag.
  • The player is refused docking in some stations when they have not the requisite visa or passport.
  • Some new ways to spend money: passports, visas.

Effects on game performance

  • This .oxp works only when the player is docked, so there is no impact during the flight time. During the docking, it works once every ten frames, the effect on player experience should be negligible.

If it isn't negligible, tell me and I'll put in the ability to choose the number of frames.

Even if the effect is negligible on the player, it uses lots of CPU, so it might not be negligible on the battery.

Tips

  • One now needs to keep abreast of developments in the systems one is about to visit. This can be done using the new F4 choices while docked. And it can also be done using the F7 screen - and if one's route has been plotted using the ANA, one can view the different systems along the route in F7 using the left/right arrow keys.
  • If one is approaching a set of systems needing a visa from an anarchy, if a rock hermit can be found in the first system needing a visa, once can dock there and then a visa for the second system can be purchased there.

Instructions

  • For OXZ's, the Expansions Manager download is fine.
  • For OXPs, do not unzip the .oxz file, just move into the AddOns folder of your Oolite installation.

Dependencies

Known bugs

None.

License

  • Diplomancy was created by Commander Day‎, from the home of diplomancy (think of Talleyrand & Richelieu!).
  • This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 4.0.
  • If you are re-using any piece of this OXP, please let him know by sending an e-mail to david at pradier dot info

Versions history

  • v.0.19

Bugfix: breaking alliances and making peace now works again.

  • v.0.18

Improvement, user-friendliness: the visa system in-game explanation is clearerer.

  • v.0.17

Improvement, user-friendliness: the visa system in-game explanation is clearer.

  • v.0.16
Improvement, flavor: the player is considered fugitive when in systems warring with their flag.
Improvement, flavor: no "Embassy district" in anarchies, no citizenship in an Anarchy
Improvement, flavor: the player may buy days of visa (cost: productivity / population / 365 per day) in the embassy district in a neighbouring, non-enemy from the destination system.
Improvement, flavor: the first time the Diplomacy OXP is used, if a visa is needed in the current system, we give the player a 1-day visa.
Improvement, flavor: a GNN news introduces the Visa Law.
Improvement, flavor: when stateless, docking is refused in corporates, dictatorships and communists without having a visa.
Improvement, flavor: maps are centered and zoomed. Possibility to center on the target system, or on the whole trajectory. Possibility to display the short/quick trajectory, or no trajectory at all.
Improvement, performance: the API are removed in favor of JsDoc.
Improvement, code quality: the Snoopers dependency, which is deprecated, is replaced by the GNN dependency. Oolite minimal required version is now 1.88, because of this.
Improvement, code quality: moved the GNN connection to external script.
Improvement, code quality: tax level and treasury are now displayed through mission.addMessageText rather than through a modification of the system description.
Improvement, tweaking: the alliance threshold between systems is lowered.
Bugfix: the initActions wasn't set as it should be. In particular, initActionsByType wasn't set when adding an initAction, and initActions was set with an ActorType as key instead of an ActionId.
  • v.0.15
Improvement, flavor: the player may acquire or renounce the citizenship of the system they are in.
Improvement, flavor: the player may display one of their citizenships as the flag of their ship.
Improvement, dev func: other scripts may subscribe to be informed of a citizenship change of the player.
Improvement, dev func: citizenships prices are dynamic and available to other scripts.
Improvement, dev func: other scripts may inquire if the player has a particular citizenship.
Improvement, code quality: introduced JsDoc comments, including some allowing to document the Oolite javascript hooks!
  • v.0.14
Improvement, flavor: War declaration! Peace! Snooper news about them!
Improvement, flavor: Wars map!
Improvement, dev func: the war threshold and the alliance threshold are scriptable through the WarEngineAPI.
Improvement, dev func: new F4 interface making History happen for debug purposes.
Improvement, code consistency: Alliances scripts become War scripts.
  • v.0.13 Bugfix: manifest.plist for the oxz manager.
  • v.0.12 Bugfix: manifest.plist for the oxz manager.
  • v.0.11
Improvement, flavor: added a F4 Alliances Map, showing alliances between systems.
Improvement, flavor: having only Snooper news for the player current system.
Improvement, flavor: fixed Diziet Sma citation
Improvement, code consistency: the tax script becomes the economy script.
Improvement, code consistency: removed the TechnicalPrinciples.txt file, as its content is now mainly in the new OXP Performance thread.
Improvement, dev func: added a beginning of Economy Engine API.
Improvement, dev func: added a _debug flag in the Engine to start as if you just spent a turn and entered the station; ie, events are processing.
  • v.0.10
Improvement, flavor: added a F4 System history, showing the F7-selected system events history. The displayed text depends on a formatting function definable through API per event.
Improvement, flavor: the alliance and alliance break events are now displayed in the history.
Improvement, dev func: the EngineAPI provides the events, and the events by actor.
Improvement, dev func: the EngineAPI allows now to store a variable in the saved state with the other saved variables of the oxp.
Improvement, dev func: introduced a Systems API and a History API. The systems API provides the system actors indexed by galaxyID and systemID.
  • v.0.9
Improvement, flavor: the score given to a system by another depend on who they are allied to.
Improvement, flavor: systems may now break their alliances.
Bugfix: systems within 7 ly of any of both systems in the alliance are now informed of the alliance.
Improvement, dev func: introduced an Alliance API.
  • v.0.8
Improvement, flavor: Two systems within 7ly of each other may now form an alliance, depending on their relation quality. Currently, each must have a score for the other of at least +0.5.
Improvement, flavor: some Snooper news are now displayed when an alliance is formed between two systems, and the player is within 7ly of one of the allied systems.
New, oxp dev func: introduced a functional Event system.
  • v.0.7
Improvement, flavor: added a F4 Strategic Map, showing links between systems nearer than 7. The relation between systems is currently based on their government.
  • v.0.6
Improvement, flavor: tax amount depends on the time spent since the last taxation.
Improvement, speed: major refactor to remove closures, dereferences, JSON (de)serialization special functions.
  • v.0.5 Bugfix manifest.plist for the oxz manager.
  • v.0.41 Put into the oxz manager.
  • v.0.3
New, oxp dev func: delivered DiplomacyEngineAPI for oxp developers, provided a dedicated readme file.
New, doc: provided a dedicated file DiplomacyRoadmap.txt
Improvement, code consistency: the Systems and Tax js script now use the API rather than the native engine calls.
Improvement, speed: optimized the loops in the engine
Improvement, logic: when starting, the player is docked, so we should process the saved actions.
Bugfix: solved a bug in the Tax script recurrent tax task after a savefile load.
Bugfix: the init action using the api wasn't working after a restore from the savefile.
Cleaning: log cleaning, file cleaning.
  • v.0.2 The actions are made progressively, one every 10 frames when docked, so as not to need more execution time than allowed at the same time, and to avoid slowdowns during the game.
  • v.0.1 First version of the Diplomacy engine. Systems are introduced as a type of "Actor". "SELFTAX" is introduced as an event for systems. Tax level and treasury are displayed on the F7 screen.

Associated OXPs

Rexebe Citizen

Digebiti Subject

Quick Visa

  • Quick-Visa provides horrendously expensive "Visa purchasing options" on arrival at the Witchpoint Beacon (for those forgetting to get a visa at the previous system)

WarZone.oxp.hide

Hidden away inside the newer versions of Diplomancy.oxz. Look away people. Nothing to see here.


Musings

Library's PAD (Personal Assistance Device) showing player's origin

This section contains musings by Cholmondely and Cdr Day's 2021 roadmap for his OXP. Expand it to read!


Cholmondely writes: this is one of my favourite OXPs adding a good dash of realism to my game. And it makes visiting other places difficult just as real, life does! If anybody ever manages to introduce real wars into Oolite, this will help provide a realistic background to them (Montana05 has created an "invasion oxp" which is currently in alpha stage).

There are a number of things which still need doing/thinking about.

  • One should be able to choose one's first citizenship without paying - ideally it should be linked to the self-chosen system of "origin" on Library's PAD.
  • It seems unlikely that there would be Embassy Districts on Rock Hermits! But it might well be possible to buy over-priced visas through the Black Market there (as eg installed by Smugglers oxp) - and especially for the same system that the RH is in!
  • The decision not to install Embassy Districts on the local orbital station in an anarchy needs thinking through. The Lore is that the anarchy does not provide any finance for the orbital, meaning that GalCop has to pay for all of the costs. Hence GalCop runs the orbital, not the anarchy. And thus the lack of an "Embassy" with (inexistent) anarchic "governments" would seem to be irrelevant to the presence of some sort of visa-issuing body on the station. Even if the second system were at war with the anarchy. This can of course all be handwaved away by referring to GalCop regulations, but still, it should be thought through!

Day's "Diplomacy roadmap" (2021)

Next versions might include:

0.19 - more expensive visa to go planetSide, costs slashed planetSide (90% custom rebate ?...)

- citizenships may be acquired planetSide only

0.20 player taxation depending on the number of citizenships (CreditDiff / timeInDaysSinceLastSystemVisit * n * (n - 1))

0.21 War declaration generates an immediate gdp growth increase!


Conditions for version 1.0 to be declared:

- filesave format stabilized,
- performance considered to be ok,
- all core engine functionalities implemented, remaining ones:
- actor/event/response/function/initAction/recurrentAction disabling/removal,
- 'act next turn' functionality.
- APIs stabilized
- I18n ok
- L10n ok for english
- Documentation in .md format
- all major events implemented, remaining ones:
- DEFENSE_PREPARATION
- ATTACK_PREPARATION
- ATTACK
- LOSS
- VICTORY
- BANKRUPTCY
- BREAK (Alliance)
- ALLY (Alliance)
- SPLIT
- COMBINE
- TAX (Alliance)
- SUBSIDIZE

Conditions for 2.0 to be declared:

- Wiki pages, including APIs
- perfectperf FIXMEs,
- perfectfunc FIXMEs,
- perfectstyle FIXMEs

FIXME 0.f explain that the total number of credits in the Ooniverse is always the same through a Raxxla adventure
FIXME 0.f make the tax level evolve ?
FIXME 0.f How do we know the real productivity? Is there an OMC? Black work wouldn't be reported, nor taxed. Yet another time Raxxla?
FIXME 0.f productivity could slowly converge towards a value depending on space scarcity
FIXME 0.f use Fuel tweaks oxp depending on state of war, recently attacked system, and player home system :p
FIXME 0.f tweakability / configurability / by player / by other oxps
FIXME 0.f equipment/commodities prices vary depending on war/system richness
FIXME 0.f identifying player as citizen from some system (Citizenship), consequences
FIXME 0.f player taxation
FIXME 0.f the strategic map should be available through an equipment, or a role (commander ;) ); through the oxp :GalacticRegistry (Galcop maps)?
FIXME 0.f provide Diplomacy lore (the deep comments in the code) to the player through other oxps. GNN army? Spacebars? The oxp from which you're the hero?
FIXME 0.n manage versioning of savefiles (last step before 1.0)
FIXME 0.perfectperf use tco to avoid recursion: http://www.integralist.co.uk/posts/js-recursion.html
FIXME 0.perfectperf minify, https://jscompress.com/, https://github.com/mishoo/UglifyJS2
FIXME 0.perfectperf benchmark with lazy regexps
FIXME 0.z make a story/scenario generator?
FIXME 0.z passengers are taxed too; maybe player may pay less depending on passenger home system? why would passenger allow that?
FIXME 0.z some systems could have their citizens not taxed? free passage? by some chosen systems? vassal systems?
FIXME 0.z "Troll wars" (noble Troll specie against human cultural trolls)
FIXME 0.z "Trumble wars" (trumbles are used as weapons to disrupt blockades)
FIXME 0.z "Day of the Tentacle"
FIXME 0.z the events history could be visualized through GNN
FIXME 0.z the events history could be visualized through a map
FIXME 0.z: implement scoring of relations between systems
  • goodwill low depending on history:
if they have attacked that turn,
polarization? if the system has several neighbours, it dislikes better one of them
if they have attacked that turn a member of the alliance,
if they prepare for attack (even an enemy?),
if they're from an opposite economy,
if they're from a different alliance (enemy alliance?)
if they currently got a bad economy?
if the other currently has a bad economy?
if they're from a disliked race
polarization? if the system has several neighbours, it dislikes better one of them
if they harbor an enemy faction
polarization: if they have enough money to attack and the other not enough to defend
  • goodwill high:
if they have helped in the past,
if they are member of the alliance,
if they prepare for defense,
if they're from a comparable economy
if they're next to a common enemy
if they're on a commercial road?
if they're from a liked race
polarization? if the system has several neighbours, it likes better one of them
if they harbor an ally faction
polarization: if they have enough money to defend and the other not enough to attack
  • What's an enemy?
initial scoring + eventsScoring losing 10% each turn (year?) + current turn eventStoring
initialScore = economy comparison + ideology comparison + commercial road
who should we score? a system scores those systems it is observing?
staticScore[observerId][observedId] = {
economyComparison:,
ideologyComparison:,
sameCommercialRoad:,
}
dynamicScore[observerId][observedId] = {
nextToCommonEnemy:,
preparingForDefense:,
harboursEnemyFaction:,
}
ally to alliance if avg(systemsScores) > threshold
attack if systemMoney > targetProductivity * targetPopulation, divided by constant


WAR

prepare_fight if:
- treasury > fightPreparationThreshold => war_treasury
Is this really needed?
Fight may be prepared at all times
- attacked => lowers drastically score
- ally attacked => lowers (less) drastically score
attack or finance_ally if:
- score < attackThreshold ?
- war_declared
- roi > roi_threshold && war_treasury > attack_budget (depending on attacker culture? [0,30% of war_treasury?])
An attack may remove from the attacked:
pib -= [5%,,5%]*pib
treasury -= attack_budget * 100 * [100%,1%]
war_treasury -= attack_budget * 10 * [100%,1%]
An attack may from the attacker:
war_treasury += attack_budget * [-100%,100%]
depending on the success [100%,0%]
success repartition must be a gauss curve
what of ROI? hmm, economy size might change depending on battles?
So an increase in economy size is a one-year increase to be compared to the cost of the attack
what about using a zero-sum game principle? like economy size decrease goes to neigbors?
or declaring war weakens some economic relations between systems and strengthens others?
or wars are decided by hidden interests, not by global economy? per good type? per 2 types only agro and industrial?
I like the idea that the exchange depends on prices differences * size of economy
but should the exchange be imbalanced? how is that impacting the economy growth?
what are the coefficient on each good? what of forbidden goods?
the number of tons entering a system is equal to the number of tons exiting. Nope. the max number only, but it's theoretical.
the max number 128 is administrative? why is it everywhere, then?
not to be considered, as it would imply a very small spatial exchange between systems, very inferior to systems economy size
We need spatial ascensors, so as to have a low cost from planet to station,
which is needed not to have prohibitively expensive food and other things.
Or cheap anti-gravity =o
=> big exchanges between systems
Let's say that we think in terms of %age of total GDP, and not in GDP
Let's say that the evolution of total GDP due to productivity increase is small in Ooniverse, compared to the variation due to the wars.
In that case, we can think we are in a zero-sum game, in terms of %age of total GDP.
Each loss of GDP %age is gained by the others.
We can (it is a game shortcut) reattribute the lost gdp to some others
=> normal way is to add depending on their own current gdp, in the galaxy.
=> another way is to consider it goes to near systems (neighors?).
=> another way is to consider it goes to systems depending on their distance (squared)
=> this way is nice but expensive to calculate
(needs the distance between each systems, and the sum of these distances)
=> another way is to consider that neighbors in fact taxes the money,
and that systems other than neighbors earn a negligible increase
=> money goes to neighbors, coefficiented on inverse distance squared
=> attack ROI depends on the attacked distance
=> financed attack ROI depends on the attacked distance
=> finance ROI should always be better than attack ROI?
then finance is preferable to attack when it is possible
=> how to ensure that 2 allies in war with a third system won't only finance each other instead of attacking?
there must be an incentive to finish the other
=> spoils of war: combat_budget+, war_treasury+, treasury+, total gdp appropriation this turn (no neighbours),
greater portion of gdp (40% of attacked gdp * coeff depending on attacker gdp
(representing the ability to process the attacked gdp)), attacked forced peace
What if 2 allies finish a system at the same time? It isn't possible to have a "at the same time" event.
Well maybe, events concurrency.
FIXME 0.f use station in fire when a system has been beaten http://aegidian.org/bb/viewtopic.php?t=3460&start=154


FIXME 0.f PEACE

FIXME 0.z have an indicator "Ongoing war" per system
FIXME 0.z have a notion of "war zone"
FIXME 0.z have a notion of galaxy, station, traveller as actors
FIXME 0.z tax evasion
FIXME 0.z factions?
FIXME 0.z news, depending on player current system, player citizenship system, propaganda?
maybe the right way is to generate LOTS of news and let the player register to those they want?
GNN, citizenship news company
FIXME 0.z blockades
FIXME 0.z each turn, a system has an event card: a sun explodes, or a native singer becomes famous, which changes taxes, or alliances, or fights, or... Use some mega bomb for a supernova style event
FIXME 0.z what about the story of a war writing itself?
FIXME 0.z war cargoes
FIXME 0.z player's greed is the key
FIXME 0.z "OXP that adds another eight galaxies" !!
FIXME 0.z what happens if the player lands on an enemy planet?
FIXME 0.z ideology and richness change in a system after a victory/defeat
FIXME extract the main engine into its own OXP

Day's Musings

Space is big. But the space we are interested in is the space around planetary systems :)
What about ships localization detection and declaration?
On our old earth, we have transponders onto every (naval) ship and plane. We even have control towers.
We have radars too, and the chinese have recently made a quantum radar (so no evasion through deflecting the wave like the B-2 stealth bomber do).
We could have mandatory transponders in corporate systems, optional transponders in, say, feudal systems, useless transponders in anarchy systems.
That way, ships are declared, and space content is better known.
We could have (gravitic?) radars which results are shared ad-hoc (like wifi) by law-abiding pilots ^^
That way, ships are detected, and space content is better known.
Using these, from the point of view of the ship commander, space isn't empty or big anymore; it's crowded and interaction are possibly frequent.

FIXME 0.z citizenship could be linked to a corporation instead of to a system (Cyberpunk meme)
FIXME 0.z obligations may weight on the player depending on their citizenship (missions, battles...)
FIXME 0.z the player may acquire a citizenship through missions, falsified papers, stolen papers from a captured pilot, marriage with a crew member, another pilot or an inhabitant
FIXME 0.z the player may lose their citizenship through lack of system visit per year, treason, attack on the local army, simultaneous citizenship with an enemy system
FIXME 0.z the player, citizen of a warring system, may be taxed, enroled into battles, or be given missions
FIXME show enemy planets on the main map, allied planets, needs a visa planet ; new script enemies: war+citizenship
FIXME 0.z manage supernovas
FIXME convoys oxp to have convoys + military oxp to have military ships, to create battles...

Asked by Cholmondeley

If you added: "Extend the Zaonce visa at a cost of 2.1cr/day"...

and if you could show the total of bought days on the screen...

The slightly different cost of the extension helps add emphasis.
I notice that the F8 page totals change as one buys and sells...
Also, one can often extend the visa within the country itself.
(One might have to go down to the planet surface on a shuttle...
But another visa to use the shuttle... etc. ad nauseum...
Or join a lo-o-o-ong queue on the orbital station (or pay someone else to do it)...
I've only just dipped my toes into your modification, but the only thing I'd like to see added so far (other than the change of text above) would be some graphics for the Embassy district and the System History Section. Easier said than done, alas!
If there was a GalCop logo, maybe that on a flag for the Embassy district (I've only seen ones so far are for the Galactic Police & Army).
Or how about a pair of white gloves, a pith helmet and a glass of bubbly? Or a visa stamp in a passport...
Or some of Phantorgorth's species icons? Or some of the F6 system government icons (anarchy etc)?...
We could do with a decent GalCop logo anyway for the GalCop wiki page
How about a picture of the planet (it need not revolve) for the System History F4 page?
To what extent does buying citizenship of a system link in with Home System.oxp's inner workings?
There you buy Home System Privileges for 15,000cr a pop, which leads to what seems to be a sort of super-citizenship.
Should it automatically grant Diplomancy.oxp style citizenship as well?

Links

New version

  • oolite.oxp.Day.Diplomacy.oxz (Phkb 2023: v.0.19 Bugfix: Process of making peace and breaking alliances were spamming the system events and not changing anything.)

Gameplay and Balance Indicator

Tag-colour-orange.png
Levelindicator1.png
1-{{{2}}}

Diplomancy makes things a bit more difficult - you need to pay for a visa to visit some of the systems - or get fined! And you can't buy the visas just anywhere either - sometimes you can't even buy them at all!