Campaign Implementation Ideas

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
User avatar
JonCST
Space Squid
Posts: 78
Joined: Sat Dec 15, 2018 4:28 am

Campaign Implementation Ideas

#1 Post by JonCST » Tue Jul 23, 2019 4:14 am

Hi all.

TLDR summary: Been lots of discussion about what a campaign is, but not much about how. My thoughts about the how, without much implementation knowledge.

Summary of "What":

I've spent the last week reading through "campaign" threads, but i probably still missed some. My takeaway is that they address the content of a campaign, rather than how one would create and play one.

Regarding the content, the general consensus as i understand it seems to be that there should be an "official", single-player, campaign, written by the game designers, conforming to the original backstory and implementing a coherent, sequential (though not necessarily consecutive) story as defined and updated in the various threads over the past 15+ years. This story would apparently take place in linked "scenarios".

As i understand it, each scenario would have a pre-defined starting condition, with one or more (possibly hidden) victory conditions. There may be scenario-specific tech, species, etc. There may be some way that "characters" would "interact" with the player. But, basically once the scenario is loaded, the player would just play FreeOrion until reaching a victory condition, or being eliminated.

After completing a scenario, the next scenario could be loaded (possibly affected by the results of the previous, but not necessarily), with its own unique setup. Play would continue until the player lost interest, or reached a terminal condition (hopefully victory) in the final scenario.

That said, there's been nothing written against, and occasionally open support for, multiple independent campaigns, or independent stand-alone scenarios. It seems to me that each random FO game is already an independent stand-alone scenario. Still, more structured independent "story" campaigns were considered desirable, both for the fun of creating them and for allowing the general public to play and enjoy them.


Discussion of "How":

At this point my thoughts are pretty high-level.

There's already a mechanism in place to specify the Initial Scenario Set Up: the game save file. It may be possible that creating a campaign could be as simple as creating a set of game saves (though actually creating a save file probably isn't simple). The player would then load a save file to start the scenario, and just play to the end. The Scenario Unique Tech, Species, etc, could presumably be supplied by a set of scripting (FOCS) files which accompany the save file. So, a campaign could be a directory (folder) which in turn contained the files required for each scenario, possibly in subdirectories (sub-folders) for each scenario.


Actual Creation:

A good approach would seem to be a Free Orion Scenario Editor application. It should probably be in C++ and or Python, since the project is already implemented in those languages. That might also allow some parts of the existing game data structures and/or logic to be included without re-implementation. It would not necessarily have to create save files or .focs.txt files directly: it could use a simplified internally consistent representation. Players could then create scenario files via an export function, or a stand-alone utility could create the scenario files from the editor's data.

A very high-level design would include sections to design empires, species, ships, tech, and possibly planet/star types. Then there would be a map editing section, which would let one:

o Optionally randomly populate a galaxy with stars, starlanes, and possibly planets
and species, based on setable parameters. This would be similar to the current
random initial generation.

o Insert and remove stars at particular locations in the galaxy.

o Delete existing starlanes, and create sttrlanes between arbitrary planets (maybe
not let them cross?).

o Add and remove planets, ships, etc. to particular stars.


Editing an existing planet definition would allow one to add empires, species, buildings, specials, etc.

At each step, lists of the appropriate type containing the previously-defined items would be presented for selection. This could be implemented as a menu, or a scrollable drag/drop list. After an item is added (or anytime afterwards) the applicable values (values, "meters", etc) could be given specified values, or left at a default.

Definition of the victory condition or conditions would be one of the settings for specific object or objects.


Game Play Elements Required:

So, what does the game engine have to implement to allow definition and play of this kind of scenario? (N.B. that i don't know if these capabilities already exist, just that it seems like they're required)

o Ability to load scripts from same directory/folder as save file.
o Scenario loads inherit scripts from default directory, but override with definitions from scenario files.

o Various victory conditions, possibly multiple per scenario. (I'm pretty sure scripting already has most of this covered)
+ Learning a tech
+ Building a type of ship or building
+ Destroying a particular ship
+ Capturing a particular ship or type of ship (capturing isn't implemented yet,
so maybe just go with destroying? Or implement like PsychoDom?)
+ Owning a particular planet
+ Owning all planets in a particular star system
+ Surviving a minimum number of turns
+ Eliminating a species
+ Eliminating all other species
+ Eliminating an empire
+ Eliminating all other empires
+ Gaining a species as a member of your empire
+ Owning all star systems
+ Owning all planets

I'm sure there are more victory conditions i haven't thought of yet.

o "Characters" (optional)? A character is an entity players could "interact"
with to gain knowledge or cause changes. Much of this could be implemented
with scripting effects, though it might be clumsy and/or slow.

+ A character could be scripting on a visible or invisible ship or building
+ A character could be scripting on a planet?
+ Characters need to "speak": scripting via SitRep or Message window?
+ Player needs to "speak" to character? (scripting very difficult or clumsy?)
- maybe focus of planet?
- maybe creation of building/ship?
- maybe attack/destroy building/ship?
- maybe attack/capture planet/star system?
- maybe diplomacy? (currently only war/peace?)
- New implementation to set data for character to test?
+ Player needs to interact with character: mostly same options as for communicate?

o Ability to have victory condition update a data file to be loaded in next scenario (optional?)

Pretty sure that would allow implementation of at least a minimal campaign mode. With an accompanying Scenario editor, creation and playing of multiple campaigns would be possible.

Thoughts?


Caveats:

These were high-level ideas which would need to be refined into a high-level design, cross-checked against implementation difficulties, and then used to create detailed implementation plans.

Full disclosure: i spent about 30 years as a software engineer, so i do have some idea of the difficulties of a big project like this one. But, i haven't done more than skim a single save file, and browse the FOCS manuals. There may be Reasons why this approach isn't currently possible, and there may be even more Important Reasons why modifications to the game engine couldn't be made to allow it.

Thanks for reading.

Jon

User avatar
JonCST
Space Squid
Posts: 78
Joined: Sat Dec 15, 2018 4:28 am

Re: Campaign Implementation Ideas

#2 Post by JonCST » Sat Jul 27, 2019 1:36 am

In a previous message, i wrote:
single-player, campaign
But, would it be possible to not restrict campaigns to single player?

It would be interesting to have multiplayer campaigns where another player could act as an ally, or an antagonist, or even have a separate plot to follow which crosses but doesn't necessarily obstruct other plots.

Seems like it should be possible.

J

o01eg
Programmer
Posts: 428
Joined: Sat Dec 10, 2011 5:46 am

Re: Campaign Implementation Ideas

#3 Post by o01eg » Sat Jul 27, 2019 4:17 am

JonCST wrote:
Sat Jul 27, 2019 1:36 am
In a previous message, i wrote:
single-player, campaign
But, would it be possible to not restrict campaigns to single player?

It would be interesting to have multiplayer campaigns where another player could act as an ally, or an antagonist, or even have a separate plot to follow which crosses but doesn't necessarily obstruct other plots.

Seems like it should be possible.

J
There Wesnoth game with multiplayer campaigns support but I suppose single-player campaigns should be implemented first. Also diplomacy isn't complete enough, there no even predefined teams.
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-30.587d1c0.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
JonCST
Space Squid
Posts: 78
Joined: Sat Dec 15, 2018 4:28 am

Re: Campaign Implementation Ideas

#4 Post by JonCST » Sat Jul 27, 2019 2:53 pm

o01eg wrote:
Sat Jul 27, 2019 4:17 am
JonCST wrote:
Sat Jul 27, 2019 1:36 am

It would be interesting to have multiplayer campaigns where another player could act as an ally, or an antagonist, or even have a separate plot to follow which crosses but doesn't necessarily obstruct other plots.
There Wesnoth game with multiplayer campaigns support but I suppose single-player campaigns should be implemented first. Also diplomacy isn't complete enough, there no even predefined teams.
While better developed diplomacy and pre-defined relationships would simplify the campaign setup, i don't think it would prevent multi-player campaigns. If an alliance was required by the plot, it could be added as a requirement in the victory conditions. Then it would be up to the players to decide if they want to win the campaign or not. Otherwise, it would be up to the players to negotiate whether they allied or not, just as currently.

Thoughts?

J

User avatar
Oberlus
Cosmic Dragon
Posts: 1457
Joined: Mon Apr 10, 2017 4:25 pm

Re: Campaign Implementation Ideas

#5 Post by Oberlus » Sat Jul 27, 2019 6:19 pm

JonCST wrote:
Tue Jul 23, 2019 4:14 am
There's already a mechanism in place to specify the Initial Scenario Set Up: the game save file. It may be possible that creating a campaign could be as simple as creating a set of game saves (though actually creating a save file probably isn't simple).
Problem is save file contain a lot of information that is not relevant to the campaign itself before it's been started, with a file format that changes from time to time and makes previous save files incompatible.
So I'd say it would be better to have a dedicated campaign file format that contains less information and is less subject to eventual reformatting.
Free Orion Scenario Editor application
I think that should be the first step?
For sure, once it is finished, diplomacy and other related stuff would be more advanced.

o01eg
Programmer
Posts: 428
Joined: Sat Dec 10, 2011 5:46 am

Re: Campaign Implementation Ideas

#6 Post by o01eg » Sat Jul 27, 2019 7:47 pm

Oberlus wrote:
Sat Jul 27, 2019 6:19 pm
JonCST wrote:
Tue Jul 23, 2019 4:14 am
There's already a mechanism in place to specify the Initial Scenario Set Up: the game save file. It may be possible that creating a campaign could be as simple as creating a set of game saves (though actually creating a save file probably isn't simple).
Problem is save file contain a lot of information that is not relevant to the campaign itself before it's been started, with a file format that changes from time to time and makes previous save files incompatible.
So I'd say it would be better to have a dedicated campaign file format that contains less information and is less subject to eventual reformatting.
Free Orion Scenario Editor application
I think that should be the first step?
For sure, once it is finished, diplomacy and other related stuff would be more advanced.
Save game format changes one time per year with new release. I think it enough for any campaign.
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-30.587d1c0.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
JonCST
Space Squid
Posts: 78
Joined: Sat Dec 15, 2018 4:28 am

Re: Campaign Implementation Ideas

#7 Post by JonCST » Sat Jul 27, 2019 8:14 pm

Oberlus responded to my speculation with some reality:
Oberlus wrote:
Sat Jul 27, 2019 6:19 pm
Problem is save file contain a lot of information that is not relevant to the campaign itself before it's been started, with a file format that changes from time to time and makes previous save files incompatible.
So I'd say it would be better to have a dedicated campaign file format that contains less information and is less subject to eventual reformatting.
Free Orion Scenario Editor application
I think that should be the first step?
For sure, once it is finished, diplomacy and other related stuff would be more advanced.
Makes sense to me. So, design and implement a FO Scenario Editor application, which will:

o Base the internal data structures on the existing game structures.
o Base the campaign file on the game save file, with extraneous trimmed and extra added.
o Create new/updated FOCS files to support campaign specific items, capabilities, and victory conditions.

Does that make sense to everybody?

I'm a little worried about the FOCS files, since arbitrary scripting can be hard to address in an authoring system. Maybe the assumption is that the authoring system would do its best, and then the campaign authors would tweak the scripting where required? I always worry about that kind of thing, since manual tweaks could be overwritten or broken if the scenario editor writes out files which have previously been hand-edited.

We could implement it, and then if hand-tweaking is often required, we could add functionality to the editor to paste in hand-tweaked scripting. The editor wouldn't understand what you did, but it would know you did it, and would't overwrite it.

Also: would it make sense to have a simplified UI to represent the galaxy, planets, ships, buildings, techs, etc? Making it look exactly like the game has it's virtues, but so does customizing the UI to suit the authoring process.

o01eg added:
o01eg wrote:
Sat Jul 27, 2019 7:47 pm
Save game format changes one time per year with new release. I think it enough for any campaign.
So, if we base the campaign format on the save file, but don't try to replicate it, that should both insulate the editor from frequent changes, and simplify the campaign loading process. Make sense?

Thanks for giving all this some thought.

Post Reply