IKE: add PBEM/hotseat multiplayer to any scenario

IKE: add PBEM/hotseat multiplayer to any scenario

Moderator: MOD_Command

musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

Hi everyone — I've created a small code framework called IKE that lets you add PBEM (Play by E-Mail) or Hotseat play to any CMO scenario, allowing you to engage in a turn-based multiplayer game with one or more opponents by exchanging .save files.

If you want to play a PBEM game, simply download the following PBEM SCENARIO PACK: https://github.com/musurca/IKE/releases ... 1.55b2.zip


If you want to create a new PBEM scenario, or convert an existing one, download the SCENARIO AUTHOR PACK: https://github.com/musurca/IKE/releases ... 1.55b2.zip

IKE...
* turns Command: Modern Operations into a WEGO-style multiplayer game in which players give orders in phases, then watch their units execute them.
* keeps track of turn order and length, and stops the scenario automatically when a player’s turn is over.
* provides a summary of any losses sustained or messages received during the last turn.
* supports either fixed turn lengths, or Harpoon-style variable turn lengths (Intermediate vs. Tactical)
* adds an (optional) Setup Phase, allowing players to configure loadouts, missions, and orders before the game begins.
* provides password protection for each player’s turn.
* allows players to either use the scenario’s recommended PBEM settings, or customize them at game start.
* maintains a consistent random seed, to discourage replaying turns for more advantageous results.
* prevents players from cheating by (optionally) disabling the Editor until the scenario has ended.


Moreover, adding IKE to your scenario does not require any advanced coding ability, nor entail any complicated dependencies. All you have to do is paste a block of code into the Lua Script Console, click RUN, and answer a few questions asked by pop-up windows.

I've written a manual (included in the download above) that will get you started quickly if you want to make a new multiplayer scenario, or else convert an existing scenario for multiplayer use. The scenario pack also includes nineteen PBEM scenarios to get you started:

* The Bear and the Eagle, 1987
* Bersama Lima, 2003
* Canary's Cage, 2005
* Duelists, 1989
* En Garde, 2013
* The End of Françafrique, 2021
* First Contact, 1986
* Frozen War, 2014
* Gaddafi's Legacy, 2024
* Helping Brothers, 1990
* Malvinas - The Pincer, 1982
* North Pacific Shootout, 1989
* Operation Soberanía, 1978
* Red/Blue Hawaii, 1985
* Sahel Slugfest, 2021 (Command LIVE DLC required)
* Sakhalin or Karafuto, 2013
* Second Battle of Guadalcanal, 1942
* Shamal, 1991 (cooperative)
* Twin Head Dragon Exercise, 2021

Hope you find it useful!

IMPORTANT: To use IKE, make sure you have Special Messages set to "Raise Pop-up" in your Game Options.

Source code available on GitHub

VERSION HISTORY
v1.55b2 (1/26/2023):
* added: message confirming autosave location at end of turn
* changed: minimum CMO build now 1307.0 (the "War Planner" update)
* changed: newer clients automatically update the save to current build
* changed: updated all scenarios to DB 498a
* changed: En Garde, 2013 - added neutral shipping
* fixed: fatal CMO version check bug in 1307
* fixed: autosave preferences taken into account

v1.55b1 (9/16/2022):
* added: initial support for "Tiny" (minimum build 1276.1)
* added: initial support for Pro users
* added: new action - Change user preferences
* added: new action - Share reference points with allied side
* added: manage creation and auto-deletion of RPs marking events
* added: option to autosave the game at the end of your turn
* changed: upgraded most scenarios to DB v496
* changed: old CMO builds prohibited during scenario creation
* fixed: new contacts from allied AI sides are reported
* fixed: string->number conversions no longer implicit
* removed: special action - Change posture (deprecated)

v1.54 (4/24/2022):
* added: The End of Françafrique, 2021 (@nukkxx)
* changed: updated Gaddafi's Legacy, 2024 (@nukkxx)
* changed: bumped minimum CMO build to 1147.45
* fixed: contact spam from friendy out-of-comms units
* fixed: contacts from friendly sides no longer disappear
* fixed: no delay on Special Messages when paused
* fixed: French and Spanish localization typos (@claudejdev)

v1.53 (3/6/2022):
* changed: bumped minimum CMO build to 1147.42
* changed: updated Gaddafi's Legacy, 2024 (@nukkxx)
* fixed: setup phase overrun
* fixed: turn skipping
* fixed: old action events removed

v1.52 (2/4/2022):
* added: new action - About IKE (for current version info)
* added: Bersama Lima, 2003 (Bridge/@nukkxx)
* added: Gaddafi's Legacy, 2024 (@nukkxx)
* added: Sahel Slugfest, 2021 (WarfareSims/@nukkxx) - DLC required
* fixed: blank scenario when loading game saved during setup phase

v1.51 (1/30/2022):
* added: fratricides from off-turn reported
* added: En Garde, 2013 (Molina/Perez/@nukkxx)
* changed: class of incoming weapon hits only reported if known
* changed: North Pacific Shootout - P-3C on AI-controlled USN side
* changed: North Pacific Shootout - Soviet Union goes first
* fixed: "never-ending-turn" loop in highest time compression
* fixed: fratricide not marked as "successful strike" or "kill"
* fixed: end message when scenario exceeds duration

v1.5 (12/21/2021):
* added: optional variable turn lengths
* added: new action - Offer a Draw
* added: new action - Resign
* added: new action - Change Password
* added: weapon strike report
* added: damage report for ships, subs, and facilities
* added: customizable event handler for end of Setup Phase
* added: Red-Blue Hawaii, 1985
* added: The Bear and the Eagle, 1987 (@Eskild)
* changed: Operation Soberania - added full airbases
* changed: Operation Soberania - Chilean loadouts changed
* fixed: some kills not reported
* fixed: first order phase message displayed correctly
* fixed: limited control in scenarios without a Setup Phase
* fixed: kill & contact records in wrong language (for real this time)
* fixed: Chinese language typos (@cristianwj)
* fixed: First Contact - end condition
* fixed: Operation Soberania - excessive fuel usage on CL Latorre
* removed: Unlimited Orders mode

v1.42 (11/20/2021):
* added: Chinese (Simplified) localization (thanks to @cristianwj!)
* added: Chinese (Simplified) translation of Scenario Author's Manual (thanks to @GolasYH 叶含!)
* added: Twin Head Dragon Exercise 2021 (by @cristianwj)
* changed: explicit message if game build is updated
* changed: various scenarios - Realistic Sub Comms disabled
* changed: various scenarios - civilian collective resp. disabled
* fixed: contact mirroring/register nils during heavy combat
* fixed: kill & contact records in wrong language
* fixed: score fixed after scenario's end
* fixed: order phases disappearing on 30x compression
* fixed: Event_Delete failure on self-destruct

v1.41 (11/7/2021):
* changed: no-editor check earlier in chain
* fixed: enemy contact detection info appearing in log
* fixed: ScenEdit_SpecialMessage behavior reverted
* fixed: exploits related to scenario end
* fixed: typo in French locale

v1.4 (10/30/2021):
* added: final order phase before the end of a turn in Limited Order mode
* added: French localization (thanks to @nukkxx!)
* added: Spanish localization (thanks to Jorge Arraya!)
* change: bumped minimum CMO build to Steam update for Red Tide DLC (1147.34)
* change: all scenarios - DB updated to v491
* change: Canary's Cage - Spanish airbases can be attacked
* fixed: RPs created between limited order phases now preserved & private
* fixed: ScenEdit_SpecialMessage no longer delayed until next frame
* fixed: replaced platform PRNG with pure Lua xorshift32
* fixed: error message reporting build number mismatch
* fixed: North Pacific Shootout - downed pilot names don't repeat
* fixed: various scenarios - weather reports restored
* fixed: various scenarios - critical RPs protected
* fixed: various scenarios - descriptions/briefings reworded
* fixed: various scenarios - late random teleportations

v1.31 (5/5/2021):
* change: host can now upgrade/downgrade CMO build
* change: older CMO clients (before 1147.17) are prohibited
* fixed: between order phases contacts will show correct posture

v1.3 (3/28/2021):
* added: new contacts from off-turn reported
* added: kills made on off-turn reported
* added: immediate and scheduled chat messages
* added: can set turn order for more than 2 playable sides
* added: Second Battle of Guadalcanal
* change: all players must use the same CMO build
* change: optional setup function must be registered
* change: losses show weapon class by which unit was killed
* change: dummy side name
* change: North Pacific Shootout - can pick up enemy pilots
* change: North Pacific Shootout - Soviet side can use sub for SAR
* fixed: contacts sometimes disappear in limited orders
* fixed: IKE wizard removes previous IKE installation
* fixed: scenarios in years 1900-1970 now work properly
* fixed: Shamal - kills give points to correct side

v1.21 (2/18/2021):
* fix: API replacements

v1.2 (2/18/2021):
* added: limited order mode
* added: players can customize scenario settings
* added: option to prevent editor mode
* added: losses marked with RPs
* added: missed messages delivered next turn
* added: special action to change side posture
* added: localization support
* fix: end of setup phase message
* fix: API replacements clean themselves up
* fix: workaround for broken ScenEnded trigger
* fix: set clock precisely to turn boundaries
* fix: special message order hiding IKE messages
* fix: coop kills not reported as losses
* fix: observed losses not reported next turn
* fix: ScenEdit_PlayerSide() in limited order mode
* fix: better random seed

v1.1 (2/1/2021):
* fix: edge case for ScenEdit_SetTime()
* fix: use os.date("!") to format scenario times

v1.0 (1/25/2021):
* initial release
Last edited by musurca on Fri Jan 27, 2023 1:14 am, edited 9 times in total.
temkc5
Posts: 112
Joined: Sun Oct 11, 2015 8:30 pm

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by temkc5 »

Sounds great can't wait to run some tests!
[&o]
Non mihi, Non tibi, Sed nobis

Parel803
Posts: 889
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by Parel803 »

sounds impressive, respect
with regards GJ
User avatar
Patmanaut
Posts: 203
Joined: Sun Jan 20, 2013 7:30 pm

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by Patmanaut »

Sounds great! Thanks for sharing!

May I ask, will this mod modify the current CMO installation and updates?
I run the Steam version.

Thanks again.

musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

May I ask, will this mod modify the current CMO installation and updates?

IKE only modifies the scenario to which it's applied — it doesn't touch your CMO installation at all, so no worries there.
CanofWhoop
Posts: 10
Joined: Fri Jan 29, 2021 6:53 am

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by CanofWhoop »

I ran a test scenario with the one you provided "Nato Surface Group vs Soviet Forces, 1985" playing against myself and I am having a problem with my NATO side/units being deleted. completely poof after time Z04:30:02. I am not getting a message popup warning to save my progress and end my turn. and I do in fact have special messages popups turned on.
the forum is not allowing me to post links yet.
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

I ran a test scenario with the one you provided "Nato Surface Group vs Soviet Forces, 1985" playing against myself and I am having a problem with my NATO side/units being deleted. completely poof after time Z04:30:02. I am not getting a message popup warning to save my progress and end my turn. and I do in fact have special messages popups turned on.
the forum is not allowing me to post links yet.
Hi CanofWhoop-- thanks for the report. Your units SHOULD vanish at the end of a turn, but the game should show you a special message pop-up at Z04:30:00 (end of NATO Turn 1) that pauses the game and tells you to save your progress. A few questions for you to try to solve this:

1) Were you able to play through the NATO & Soviet Setup Phases without an issue? (i.e. did you see the special messages ending those turns?)

2) Which build of CMO are you running? You should see this in the title bar of the CMO window. (And just to make sure: you're running the commercial/Steam edition of CMO, not CMANO or Command PE?)

3) If you load the beginning of NATO Turn 1 again, and run through it at the fastest simulation speed, do your units still disappear after Z04:30:00 without a message?

4) Can you send me the save file after the end of the Soviet setup phase (i.e. the beginning of NATO Turn 1)? You can't post links yet but you should be able to attach a zipped file to a post on this forum by clicking "Click here to upload!" on a new message. If not, feel free to email me at nick.musurca at gmail.com.

Appreciate your help in ironing out the kinks in this release!
CanofWhoop
Posts: 10
Joined: Fri Jan 29, 2021 6:53 am

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by CanofWhoop »

Edit: I sent you a PM. Forum kept blocking me from replying because of the string of CMO version numbers for whatever reason.
Hi CanofWhoop-- thanks for the report. Your units SHOULD vanish at the end of a turn, but the game should show you a special message pop-up at Z04:30:00 (end of NATO Turn 1) that pauses the game and tells you to save your progress. A few questions for you to try to solve this:

1) Were you able to play through the NATO & Soviet Setup Phases without an issue? (i.e. did you see the special messages ending those turns?)
Yes, both times.
2) Which build of CMO are you running? You should see this in the title bar of the CMO window. (And just to make sure: you're running the commercial/Steam edition of CMO, not CMANO or Command PE?)
I'm running Steam CMO v1.02 Build Eleven47.16
3) If you load the beginning of NATO Turn 1 again, and run through it at the fastest simulation speed, do your units still disappear after Z04:30:00 without a message?
Yes
4) Can you send me the save file after the end of the Soviet setup phase (i.e. the beginning of NATO Turn 1)? You can't post links yet but you should be able to attach a zipped file to a post on this forum by clicking "Click here to upload!" on a new message. If not, feel free to email me.

Appreciate your help in ironing out the kinks in this release!

Will do [:)] password for both sides is "test"
File name is named weirdly but it should be NATO's first move after Soviet's setup phase.
Attachments
NATO Surfa.. Turn 1).zip
(80.66 KiB) Downloaded 33 times
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by KnightHawk75 »

Just wanted to say, cool stuff, nice work.

CanofWhoop
Posts: 10
Joined: Fri Jan 29, 2021 6:53 am

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by CanofWhoop »

The new scenario file you pm'ed me appears to work as intended. I went as far as "Nato turn three" with no apparent flaws.
Now i'm looking forward to play with others. Cheers! [:)]
Attachments
UncleMark..ORREAL.zip
(78.13 KiB) Downloaded 29 times
CanofWhoop
Posts: 10
Joined: Fri Jan 29, 2021 6:53 am

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by CanofWhoop »

The new scenario file you pm'ed me appears to work as intended. I went as far as "Nato turn three" with no apparent flaws.
Now i'm looking forward to play with others. Cheers! [:)]
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

I've just updated IKE to v1.1 to fix the bug reported above. Recommend that you convert your scenarios again with the updated code. (Note that the example scenario included with the release has already been converted--all you have to do is a start a new game.)

You can download from the link at the top of the thread.

Big thanks to CanofWhoop and KnightHawk75 for helping me squash this one. And if anyone gets a PBEM game going with this, let me know how it worked out!

(FYI, for anyone who wants to peek at the unminified code: I'll post it to GitHub as soon as I can. Because IKE has to inject its own code into an event action, there's currently a convoluted build process I use to create the releases. I'm working on streamlining that into a shell script.)

musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

Quick update just to say that I've put the unminified source code on GitHub. If anyone's interested in digging in, I'd be happy to merge pull requests with new features or translations of the text into other languages.

(This is just for those interested in tinkering. If you're just interested in creating a PBEM scenario, you only have to download the latest scenario pack—no messing with code required.)
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

Hi everyone -- I've just released a huge new update for IKE. You can download it at the top of this thread.

The major new feature in this release is Limited Order mode, which is a whole new way of playing CMO. Instead of being able to micromanage your units, you have a limited number of "order phases" within your turn. Once you give your orders and start the clock, you will NOT be able to control your units until the next order phase begins. Planning ahead will be crucial! It's a more equitable way to play CMO as a turn-based multiplayer game while also being an interesting abstraction of command delay.

[center]Image[/center]

Of course, if you prefer playing CMO in the traditional way (or Unlimited Order mode), you can do that as well--because another major new feature is the ability to change the settings of the PBEM scenario when the game starts. You can either go with the recommended settings implemented by the scenario author, or you can use your own preferences. Everything from the turn length to the command mode (Unlimited or Limited orders) is configurable.
[center]
Image[/center]

Finally, for competitive PBEM situations, I've implemented the ability to prevent cheating by blocking access to Editor Mode until the scenario has ended. This is an entirely optional feature that relies on new elements in the latest public beta (1147.17). For casual games between friends, I wouldn't recommend it-- but it's great if you're matching wits with some sketchy strangers you've met on the Discord.

Beyond that, I've also squashed a number of bugs, and written an 11-page manual (included with the release) to help scenario authors either create new PBEM scenarios or convert their existing ones for play.

I've been having a great time playtesting on the CMO Discord, and I hope more of you will join! Playing against a human opponent--“a live, vigorous enemy in the next room waiting feverishly to take advantage of any of our mistakes, ever ready to puncture any visionary scheme, to haul us down to earth" (Cpt. William McCarty-Little)--really changes the game completely.

Special thanks to the following people who helped with this release:

* WM2K (suggesting Limited Order mode)
* CanofWhoop (playtesting)
* CluckSalad (playtesting)
* michaelm75au (tireless bug fixing / new features!)
User avatar
BradOrbital
Posts: 323
Joined: Wed Jul 17, 2013 1:12 pm

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by BradOrbital »

This looks fantastic, nice work! Thank you for sharing it. Quick question, is this usable on the CMANO version as well or only the CMO?
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

I only use CMO, so it's hard to give a definitive answer as I'm not sure what the current state of support is for CMANO (in particular, not sure if it gets the new Lua functions/fields that are available in the latest versions of CMO).

So I would guess that IKE is CMO-only, but I could be wrong! However I can only support issues that come up on CMO as I have no way of reproducing them otherwise.
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by Rory Noonan »

If you're sending save files back and forth (sorry I haven't had a chance to try this yet, it does look fascinating though) it won't work between CMANO and CMO as CMO saves can't be read by CMANO.
Image
User avatar
BradOrbital
Posts: 323
Joined: Wed Jul 17, 2013 1:12 pm

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by BradOrbital »

Thanks for the clarification Rory. Noted Musurca, CMO it is. I have both so was just wondering. Great stuff, can't wait to give this a spin in CMO. Thank you!
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by musurca »

Quick update: I've uploaded a new version of the scenario pack to fix some small bugs in the scenario scripting, mostly for Canary's Cage. The official IKE release is okay and remained unchanged (although you'll want to replace the scenario pack that comes with it if you downloaded it before today). Changelist below:

North Pacific Shootout
* fix: radio sounds played for other side

Canary's Cage
* fix: error msg on failed attempt to deploy divers
* fix: NAIL score spread
* fix: NAIL scoring & messages
User avatar
ETF
Posts: 1766
Joined: Thu Sep 16, 2004 12:26 pm
Location: Vancouver, Canada

RE: IKE: add PBEM/hotseat multiplayer to any scenario

Post by ETF »

Where can I donate to this amazing project?
My Top Matrix Games 1) CMO MP?? 2) WITP/AE 3) SOW 4) Combat Mission 5) Armor Brigade

Twitter
https://twitter.com/TacticWargamer
Post Reply

Return to “Multiplayer PBEM - Unofficial”