Different expansions for different saved games.

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 1255
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Different expansions for different saved games.

Post by ffutures » Sat Dec 27, 2014 11:36 pm

I suspect that this would be a total sod to implement, but I might as well mention it... Is there any way that each saved game could OPTIONALLY disable some of the installed add-ons?

One of the niggles I have with a lot of Oolite expansions is that they apply universally - once they're loaded, they'll be in the background for all the games I play. Which is fine if it's something like a bit of equipment, I can decide whether or not I want to use it, not so good for things like missions and add-ons that add extra threats. For example, I currently have Thargoid Wars and all of the add-on Thargoid ships installed - if I wanted to let my grand nephew (aged 7) play with a chance of surviving I'd have to remove all of them, and that's a pain. Or I might want to play with one of the special ships (e.g. Andromeda) but don't really want them turning up as NPC ships - they're bastards to fight and impossible to run away from.

I have no idea how this could be done, if it can at all, but I think it might occasionally be useful.

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Different expansions for different saved games.

Post by cim » Sun Dec 28, 2014 12:08 am

ffutures wrote:For example, I currently have Thargoid Wars and all of the add-on Thargoid ships installed - if I wanted to let my grand nephew (aged 7) play with a chance of surviving I'd have to remove all of them, and that's a pain.
The OXP restrictions described at [wiki]Scenarios.plist[/wiki] are what you need for this, though it currently only works in nightly builds.

Create a savegame that's got

Code: Select all

<key>scenario_restriction</key>
<string>id:oxp.ffutures.custom-oxp-settings-1</string>
in it (or edit an existing save game to include it)

Then create an OXP folder which only contains a manifest.plist file, which has the id oxp.ffutures.custom-oxp-settings-1, has a requires_oxps section that includes exactly the ID of every OXP you want to include (this might be quite long, potentially).

Then, when you load the save game, the OXPs will be restricted to your custom OXP only ... and whichever OXPs you specified in its requires_oxps list (and anything in their requires_oxps list, so they'll continue to load)

Bonus feature: actually make the edited save game into a scenario as described in the Wiki, so you can start several copies of it from the "Start New Commander" screen.

You could alternatively do this without a custom OXP, by using a longer scenario_restriction in the save game like this

Code: Select all

<key>scenario_restriction</key>
<string>id:oxp.author1.oxp1;id:oxp.author1.oxp2;id:oxp.author2.oxp7;...</string>
but setting up the custom OXP has the advantage that you can update the OXP list without needing to edit the save game again.

In 1.80, the solution is probably to use the multiple user account feature of your operating system to give your grand nephew their own account, install Oolite on that account as well, and only install suitable OXPs.
ffutures wrote:Or I might want to play with one of the special ships (e.g. Andromeda) but don't really want them turning up as NPC ships - they're bastards to fight and impossible to run away from.
This isn't something the core game can handle as the player ship and the NPC ships are usually [1] defined in the same OXP. The easiest solution if you want it as a player ship but not an NPC ship is to edit the shipdata.plist file in the OXP and comment out the NPC variants.

[1] I think this may in fact be "always". Splitting a ship OXP into three parts (common resources, NPC definitions, player ship definitions) is such a pain even with automatic dependency management that I don't recall anyone ever doing it.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2543
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Different expansions for different saved games.

Post by Norby » Sun Dec 28, 2014 1:26 am

cim wrote:Splitting a ship OXP into three parts (common resources, NPC definitions, player ship definitions) is such a pain
My problem is not the pain but my will. Yes, Andromeda is a strong ship but pirate versions are rare (below 1%) and you can outrun it in any ship with more than 250 max.speed so I think better if the official version keep up some stress.

User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 1255
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Re: Different expansions for different saved games.

Post by ffutures » Sun Dec 28, 2014 2:50 pm

I'm thinking more in terms of something that can be done without manually editing files - e.g., something like a built-in saved game editor that gives you a list of the installed add-ons and allows you to disable any of them for that saved game (or for a new pilot) - something between the default "use all add-ons" and the "Strict Elite" settings.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2543
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Different expansions for different saved games.

Post by Norby » Sun Dec 28, 2014 9:56 pm

In Windows everything is in one folder so just copy the whole Oolite folder to a new OoliteForKid folder and remove all unwanted oxp/oxz.
In Linux make another username, install Oolite into the home directory and get the wanted oxps only.

User avatar
Fatleaf
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 1988
Joined: Tue Jun 08, 2010 5:11 am
Location: In analysis mode on Phaelon
Contact:

Re: Different expansions for different saved games.

Post by Fatleaf » Mon Dec 29, 2014 11:07 am

I just have two copies of Oolite installed. One is called Testing the other is just Oolite.
Find out about the early influences of Fatleaf here. Also his OXP's!
Holds the Ooniversal record for "Thread Necromancy"

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Disunited Kingdom
Contact:

Re: Different expansions for different saved games.

Post by Smivs » Mon Dec 29, 2014 12:07 pm

I used to have several 'AddOns' folders for various Commanders, and just moved them in and out as I needed to change them - I'd just drag and drop them into and out of Oolite to/from a store in my Documents folder.
This is still do-able with Managed addOns as well, although it does make extra work if you use both OXZs and OXPs. Perhaps for convenience convert OXZs to OXPs and then you could just use inter-changeable AddOns folders, leaving the Managed AddOns folder un-used.
Commander Smivs, the friendliest Gourd this side of Riedquat.

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: Different expansions for different saved games.

Post by cim » Mon Dec 29, 2014 1:15 pm

Smivs wrote:This is still do-able with Managed addOns as well, although it does make extra work if you use both OXZs and OXPs. Perhaps for convenience convert OXZs to OXPs and then you could just use inter-changeable AddOns folders, leaving the Managed AddOns folder un-used.
You can put OXZs in your AddOns folder.

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Disunited Kingdom
Contact:

Re: Different expansions for different saved games.

Post by Smivs » Mon Dec 29, 2014 2:48 pm

cim wrote:
Smivs wrote:This is still do-able with Managed addOns as well, although it does make extra work if you use both OXZs and OXPs. Perhaps for convenience convert OXZs to OXPs and then you could just use inter-changeable AddOns folders, leaving the Managed AddOns folder un-used.
You can put OXZs in your AddOns folder.
...or do that :oops:
Commander Smivs, the friendliest Gourd this side of Riedquat.

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13652
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Different expansions for different saved games.

Post by Cody » Mon Dec 29, 2014 2:55 pm

Fatleaf wrote:I just have two copies of Oolite installed. One is called Testing the other is just Oolite.
This works! On my old machine, I had three different builds installed (one of which had a choice of .exe).

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5397
Joined: Wed Feb 28, 2007 7:54 am

Re: Different expansions for different saved games.

Post by another_commander » Mon Dec 29, 2014 3:31 pm

My standard multi-version practice is: One game folder, with one AddOns folder, and three or more oolite.app folders below it (each with their own name of course).
Image
In the above shot, I have four versions of the game sharing the same OXPs (1.80, trunk 32 bit, trunk 64 bit and oo64 which is a free-to-experiment version - the others are the git repository copy plus some utility folders). 1.80 contains both the deployment and test release executables. Switching versions is really easy this way.

Now, if I want to have different OXP setups too, I can add other OXP container folders and call them AddOns1, AddOns2 etc. When I want to switch OXP set, I just rename the appropriate folder to AddOns and run the game.

Combining the multi version with the multi AddOns setup can make testing very quick and easy. Maybe it is too much for a casual player, but the possibility is there for whoever would like to try it.

User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 1255
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Re: Different expansions for different saved games.

Post by ffutures » Mon Dec 29, 2014 5:26 pm

It's mostly the casual player I'm thinking of here - I'd guess they're mostly using the OXZ addons that are offered by the game, and installing them is a much less transparent process than OXPs.

User avatar
PhantorGorth
---- E L I T E ----
---- E L I T E ----
Posts: 603
Joined: Wed May 20, 2009 6:48 pm
Location: Somewhere off the top left of Galaxy 1 map

Re: Different expansions for different saved games.

Post by PhantorGorth » Tue Dec 30, 2014 3:17 pm

Another method is the one I used use to switch between different testing set-ups and normal playing.

As a Linux user I can use symbolic links via the "ln -s <source_folder> <new_folder>" command to link a folder to somewhere else at the same time as its true location. You can use this for the Addons folder the Managed Addons folder and the save games folder. To use create sets of these folders under a different folders and then have a script check which one is links and "rotate" the links to the next set.

Here is the script I used for the Addons folder only:

Code: Select all

#!/bin/bash

# MIT License:
#
# Copyright (c) 2011 Paul R. Cooper
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in 
# the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 
# Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 
# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

VAR=`ls -l ~/.Oolite/ | egrep '^l' | gawk '{ print $10 }' | head -n 1`
if [ $VAR = "/usr/lib/Oolite/AddOns" ]; then
	rm ~/.Oolite/AddOns
	ln -s ~/Dev/Oolite/AddOns ~/.Oolite/AddOns
fi

if [ $VAR = "$HOME/Dev/Oolite/AddOns" ]; then
	rm ~/.Oolite/AddOns
	ln -s ~/Dev/Testing/AddOns ~/.Oolite/AddOns
fi

if [ $VAR = "$HOME/Dev/Testing/AddOns" ]; then
	rm ~/.Oolite/AddOns
	ln -s /usr/lib/Oolite/AddOns ~/.Oolite/AddOns
fi

VAR=`ls -l ~/.Oolite/ | egrep '^l' | gawk '{ print $10 }' | head -n 1`
echo Oolite Addons folder now points at $VAR
This script would need to be modified to use your folders, add the other folders in the set if you want to do a swap for the Managed Addons folder and Save Games folders as well, and modify the script to make the cycle match the number of sets you have. (I have three in the above example)

It could also be extended to a launch a menu allowing you to choose the set to use rather than cycle through them, which would also allow you add a call to launch Oolite itself. (Which is not done in my script as I didn't automatically want to launch Oolite for the next folder in the cycle. Though that would be fine for just 2 sets in the cycle.)

As I am using Unix style symbolic links this would probably work on OSX too. Windows would need something that did links in the same way as Shortcuts won't work for this.

Phantor
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.

Phantor's OXPs: [EliteWiki] GalCop Rewards and [EliteWiki] Safe Docking

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Different expansions for different saved games.

Post by Diziet Sma » Mon Jan 05, 2015 3:05 am

another_commander wrote:Now, if I want to have different OXP setups too, I can add other OXP container folders and call them AddOns1, AddOns2 etc. When I want to switch OXP set, I just rename the appropriate folder to AddOns and run the game.
I have something similar on Linux.. with a short Bash script to switch between two AddOns folders.. I just type 'swapaddons' in a terminal, and they switch around. Something similar could probably be done with Windows. Details are here: http://www.aegidian.org/bb/viewtopic.ph ... 75#p193275
PhantorGorth wrote:As I am using Unix style symbolic links this would probably work on OSX too. Windows would need something that did links in the same way as Shortcuts won't work for this.
Windows has had symlinking capabilities ever since Vista. There's a discussion about using them with Oolite here: http://aegidian.org/bb/viewtopic.php?f=8&t=15524
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied

Post Reply