[WIP] Diplomacy OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: [WIP] Diplomacy OXP

Post by Svengali » Tue Nov 13, 2018 8:24 pm

This all sounds really intriguing. I'll have to try it .-)

Just a quick note - probably it's better to use GNN instead of Snoopers. Snoopers stalled already and it's time to get rid of CCL, OXPConfig and Hyperradio. Library offers better functionality and flexibility and if something is missing let me know.

User avatar
Day
---- E L I T E ----
---- E L I T E ----
Posts: 518
Joined: Tue Mar 03, 2015 11:35 am
Location: Paris

Re: [WIP] Diplomacy OXP

Post by Day » Tue Nov 13, 2018 9:09 pm

Svengali wrote:
Tue Nov 13, 2018 8:24 pm
This all sounds really intriguing. I'll have to try it .-)

Just a quick note - probably it's better to use GNN instead of Snoopers. Snoopers stalled already and it's time to get rid of CCL, OXPConfig and Hyperradio. Library offers better functionality and flexibility and if something is missing let me know.
Thank you :p
Nethertheless, it's far from being finished.

Well yes, I've just read the 2018 threads and it seems you did some good work :mrgreen:

I'll convert from Snoopers to GNN soon. As my WIP oxp is in the package manager, I thought I'd wait for Library to be in it before switching to it. Am I wrong?

Edit: I've just seen you've obtained the rights to the manager and will upload those oxps. Yummy!

User avatar
Day
---- E L I T E ----
---- E L I T E ----
Posts: 518
Joined: Tue Mar 03, 2015 11:35 am
Location: Paris

Re: [WIP] Diplomacy OXP

Post by Day » Sun Mar 03, 2019 12:29 pm

The 0.14 version is in the manager.

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.

=====================================================================

Next version might include:
0.15 The player may acquire a Citizenship in their current system, and choose which one of their citizenships is displayed.
0.16 War declaration generates an immediate gdp growth increase!

=====================================================================

What's currently implemented functionality-wise?

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.

Strategic maps!
New F4 Interface screens: the Wars Map! The Diplomatic Map!

Systems alliances, wars!
Two systems within 7ly of each other may now form an alliance, if they like each other enough.
They may break their alliance, too =-o !
They may wage war to each other, and make peace too :) !
New F4 Interface screen: the Systems History!

News!
Some Snooper news are 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.

==============================
What's currently implemented technically?

The oxp contains Engines which may be accessed through APIs:
- EngineAPI,
- WarEngineAPI,
- HistoryAPI,
- SystemsAPI,
- EconomyEngineAPI.

The APIs are designed to be easy to use by developers to implement interesting galaxy-spanning events.

==============================
Effects on game difficulty

None yet.

==============================
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.

==============================
Compatibility

==============================
Dependencies

- Snoopers OXP

==============================
Instructions

Do not unzip the .oxz file, just move into the AddOns folder of your Oolite installation.

==============================
License

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 me know by sending an e-mail to david at pradier dot info

==============================
Known bugs

None.

==============================
Changelog

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.
0.13 Bugfix: manifest.plist for the oxz manager.
0.12 Bugfix: manifest.plist for the oxz manager.
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.
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.
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.
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.
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.
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.
0.5 Bugfix manifest.plist for the oxz manager.
0.4 Put into the oxz manager.
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.
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.
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.

User avatar
Day
---- E L I T E ----
---- E L I T E ----
Posts: 518
Joined: Tue Mar 03, 2015 11:35 am
Location: Paris

Re: [WIP] Diplomacy OXP

Post by Day » Sun Mar 03, 2019 12:35 pm

For those who'd like to play with the code or build on the included libraries, I've put into the manager a new OXP: Diplomacy Debugger.
It currently allows to add the Advanced Navigational Array to the player ship, and to advance History turn per turn instead of having to go to another planetary system to advance History.

Edit: i didn't put it in the manager by mistake, and finally decided against putting a Debugging in the manager where there is already a lot of packages.
The last version of the debugger is always available here.

User avatar
Day
---- E L I T E ----
---- E L I T E ----
Posts: 518
Joined: Tue Mar 03, 2015 11:35 am
Location: Paris

Re: [WIP] Diplomacy OXP

Post by Day » Wed Mar 06, 2019 9:36 pm

The 0.15 version is in the manager! Now available today!:

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.

==============================

What's currently implemented functionality-wise?

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.

Strategic maps!
New F4 Interface screens: the Wars Map! The Diplomatic Map!

Systems alliances, wars!
Two systems within 7ly of each other may now form an alliance, if they like each other enough.
They may break their alliance, too =-o !
They may wage war to each other, and make peace too :) !
New F4 Interface screen: the Systems History!

News!
Some Snooper news are 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.

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.

==============================
What's currently implemented technically?

The oxp contains Engines which may be use by developers to implement interesting galaxy-spanning events:
- Engine,
- War,
- History,
- Systems,
- Economy,
- Citizenships.

==============================
Effects on game difficulty

None yet.

==============================
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.

==============================
Compatibility

==============================
Dependencies

- Snoopers OXP

==============================
Instructions

Do not unzip the .oxz file, just move into the AddOns folder of your Oolite installation.

==============================
License

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 me know by sending an e-mail to david at pradier dot info

==============================
Known bugs

None.

==============================
Changelog

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!
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.
0.13 Bugfix: manifest.plist for the oxz manager.
0.12 Bugfix: manifest.plist for the oxz manager.
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.
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.
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.
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.
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.
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.
0.5 Bugfix manifest.plist for the oxz manager.
0.4 Put into the oxz manager.
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.
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.
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.

User avatar
Day
---- E L I T E ----
---- E L I T E ----
Posts: 518
Joined: Tue Mar 03, 2015 11:35 am
Location: Paris

Re: [WIP] Diplomacy OXP

Post by Day » Wed Apr 10, 2019 6:49 pm

The 0.16 version is in the manager! Now available today!

What's new?

Strategic maps!
Showing the warring systems, and the diplomatic relationships!

News!
GNN news now replace Snoopers news.
Some GNN news are 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.

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 and have no embassy district.
The player may buy days of visa in the Embassy district in a neighbouring, non-enemy from the destination, system.
Corporate systems, dictatorships and communists refuse docking to the player when stateless and visaless.


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.


Dependencies
- GNN OXP
- Anarchies OXP


==============================
Apart from this, what's currently implemented functionality-wise?

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.

Systems alliances, wars!
Two systems within 7ly of each other may now form an alliance, if they like each other enough.
They may break their alliance, too =-o !
They may wage war to each other, and make peace too :) !
New F4 Interface screen: the Systems History!

==============================
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 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.

==============================
Compatibility

==============================
Dependencies

- GNN OXP
- Anarchies OXP

==============================
Instructions

Do not unzip the .oxz file, just move into the AddOns folder of your Oolite installation.

==============================
License

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 me know by sending an e-mail to david at pradier dot info

==============================
Known bugs

None.

==============================
Changelog

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.
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!
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.
0.13 Bugfix: manifest.plist for the oxz manager.
0.12 Bugfix: manifest.plist for the oxz manager.
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.
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.
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.
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.
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.
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.
0.5 Bugfix manifest.plist for the oxz manager.
0.4 Put into the oxz manager.
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.
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.
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.

Post Reply