Author Topic: Change Proposal: FS2Open to load "mod.ini" directly  (Read 3528 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomo

  • 28
Change Proposal: FS2Open to load "mod.ini" directly
At present, FS2Open actually never looks at the Mod.ini file. Instead, the Launcher parses the mod.ini (if present), and creates a command-line for FS2Open using the contents.

My suggestion is that instead of doing this, the launcher should pass the (relative or absolute) path of mod.ini directly to FS2Open and FRED2Open.

The main advantages are as follows:
  • In the Feature Request: 4th Font thread, Wanderer suggested that a mod.tbl or mod.xml be created to hold mod-specific settings (eg fonts for fiction viewer etc).
    As mod.ini already exists, it would make more sense to include this data here.
  • It has been mentioned several times that it would be useful to be able to 'suppress' Retail data for total conversions, as that way you can use the same executable for all your TCs.
    The mod.ini could include a line specifying No Retail data. (This way round ensures backward compatibility)
  • It means that FS2Open and FRED2Open can have more information about the mod.
    Eg The Pilot Select and Credits screens could show the proper name, credits and logo for the mod.
    FRED can show the currently-selected mod name, and the other mods it relies upon.
  • The folder for all the mods a user has doesn't necessarily have to be a child of the same folder as the executable. (This is good for Win7 and Linux)
    Retail data stays where it is, as that should never be changed.

For backwards-compatibility:
A) Launchers older than the first to support it simply ignore the new options, and pass the old command line.
As FS2Open itself will parse the existing mod.ini, all existing mods behave exactly as before with the new launcher.
- The only danger is 'new' mods using the new options will have these options ignored if started with the old launcher.

B) We use a different command-line switch that tells FS2Open to use the mod.ini directly. This is passed instead of the existing 'mod' switch.
If the existing switch is passed, FS2Open behaves as before.
Unfortunately there is no way at present for FS2Open to determine which of the mod list is the 'main mod', as it could be at the start, end or middle depending on primary and secondary list options.

I'm happy to start and assist with coding this kind of change, but it needs to have a consensus before starting as it relies on changes to the Launcher as well as FS2Open and FRED.
The changes to FS2Open are actually fairly trivial, but unfortunately I'm unable to compile FRED2Open as I do not have MFC.

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Change Proposal: FS2Open to load "mod.ini" directly
I'd rather have a proper mod.tbl than bastardise the mod.ini to do this.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline kkmic

  • 26
Re: Change Proposal: FS2Open to load "mod.ini" directly
How do you intend to point FS2_open to the right ini file?
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I've watched C-beams glitter in the dark near the Tannhäuser Gate. All those... moments will be lost in time... like... tears... in rain. (pause) Time... to die.

wxLauncher 0.9.4 Beta | wxLauncher 2.0 Request for Comments

 

Offline Sushi

  • Art Critic
  • 211
Re: Change Proposal: FS2Open to load "mod.ini" directly
I'd rather have a proper mod.tbl than bastardise the mod.ini to do this.

Agreed. Leave mod.ini how it is, add a mod.tbl or somesuch.

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: Change Proposal: FS2Open to load "mod.ini" directly
I'd rather have a proper mod.tbl than bastardise the mod.ini to do this.

Agreed.

how would you see it being implemented?
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Change Proposal: FS2Open to load "mod.ini" directly
really i dont see why we dont integrate mod support with some kind of pre-load screen. kinda like how id engines have the mod menu.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Tomo

  • 28
Re: Change Proposal: FS2Open to load "mod.ini" directly
I'd rather have a proper mod.tbl than bastardise the mod.ini to do this.
It's not bastardisation - this is exactly what mod.ini is for, it's just used by the Launcher instead of the FS2 Open directly.
Any data that should only be loaded by one mod and no other would go in mod.ini. You cannot use tables for that, because tables are always loaded by everything.

Eg: Someone creates a mod (FOO) relying on a previous modpack (BAR). At initial release, neither mod has a modtable.

In a patch release to BAR, a modtable is added. This now breaks FOO, because the new table gets used by FOO even though the designer of FOO did not want it.

Thus FOO is forced to add a modtable to override BAR's and issue a new patch release.

mod.ini on the other hand is not loaded by everything - only the first mod.ini is ever loaded - and therefore such a change to BAR has no effect on FOO.

This also opens up the possibility of using the data that already exists in mod.ini to enhance the game - like the mod image, the modder's name and credits.
How do you intend to point FS2_open to the right ini file?
That is trivial - exactly the same way basically every other application works, including the browser you're using right now.

Right now, the launcher creates an ini file (or someone makes a link) that contains a section something like the following:
Code: [Select]
-mod foldername#1 foldername#2 foldername#3 foldername#4 foldername#5 foldername#6 foldername#7 foldername#8 foldername#9 foldername#10 ... foldername#n
The actual mod itself could be any of those arguments, as mods relying on assets from other mods must load some of it before their own data and the rest after. (This is what primarylist and secondarylist are)

Instead of doing this, we pass a single switch in that ini or command line switch:
Code: [Select]
-modini 'modfolderpath'(or similar)

modfolderpath can be either a relative path (from the location of the FS2 executable, the default), or an absolute path (from root).
FS2 Open follows that path and opens the mod.ini it finds there.
If there's no mod.ini file there, it opens the folder 'standalone' (including FS2 root vps of course)

FS2 Open then loads everything as it currently does based on that path - essentially building its own modlist.

(Edit for grammar)
« Last Edit: December 14, 2009, 11:52:38 pm by Tomo »

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Change Proposal: FS2Open to load "mod.ini" directly
The changes to FS2Open are actually fairly trivial
:lol:

Right, we don't tend to look kindly at people who say things like that when they clearly have no idea about the type or extent of changes involved.

Sorry, most of the things you suggest make very little sense, and the ones that would be useful (such as displaying the mod name) are already implemented.  I'm afraid we'll have to decline.
« Last Edit: December 14, 2009, 11:58:59 pm by Goober5000 »

 

Offline Tomo

  • 28
Re: Change Proposal: FS2Open to load "mod.ini" directly
Take look at the cmdline section.

I'm away from my main PC now so don't have the actual variable names, but the psuedocode is as follows:

During initial command line switch parsing:

Code: [Select]
if ((commandLineSwitch == 'modini') and (commandlinemodlist is empty))
{
  Open mod.ini file pointed to by modini argument.
  If opened
  {
    Locate Primarylist
    Add contents to commandlinemodlist as done by the for-next loop that's commented with 'this loop is a work of art'
    Add modini clause to commandlinemodlist
    Locate Secondarylist
    Add contents to commandlinemodlist
  }
  else add modini clause to commandlinemodlist
}
Then continue as before.

- Support for 'absolute' paths not in the FS2 Open folder may be harder - I haven't checked the how VP loading algorithm gets its path yet.
« Last Edit: December 15, 2009, 12:18:54 am by Tomo »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Change Proposal: FS2Open to load "mod.ini" directly
Why would we use the mod.ini for this though? Why not simply a new file?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Tomo

  • 28
Re: Change Proposal: FS2Open to load "mod.ini" directly
Main reason being that it's already there, so using that is automatically backwards-compatible with all existing mods.

The mod.ini is a file that is always unique to a given mod and never affects other mods that rely on it.
Therefore any setting that is genuinely mod-specific should go there.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Change Proposal: FS2Open to load "mod.ini" directly
And a lot of ships and weapons are mod-specific.  Should we put those in mod.ini too?

Name one good reason why (for example) additional fonts should go in mod.ini as opposed to fonts.tbl.

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Steam
    • Twitter
    • ModDB Feature
Re: Change Proposal: FS2Open to load "mod.ini" directly
Almost. But if you have data in two MOD ini files that are specific to the mods and Mod FOO needs mod BAR and you have parsing and inheritance set, then settings in BAR are going to take effect and modify FOO.

Maybe it's just me, but I'd like to see mod inheritance myself. In testing BluePlanet SVN and trying to run it with the FSU SVN (to ensure no compatibility issues) doesn't work so well. Makes for one hell of a long command line, because you can not just change the "mediavps" in the bpsvn mod.ini to point at the FSU dir and have it load non-vp subdir data.

Mod specific data should and needs to go into mod specific tbls/tbms. If FOO is getting bad data from BAR that it want's to over-ride, then the maker of FOO should learn to set appropriate over-riding entries in said data for the mod.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Change Proposal: FS2Open to load "mod.ini" directly
Gah! I am sick of example things named Foo and Bar! I don't care who came up with it as a precedent, it's retarded!    :hopping:

 :nervous:

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Change Proposal: FS2Open to load "mod.ini" directly
I think FUBAR disagrees. I know I do.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Change Proposal: FS2Open to load "mod.ini" directly
I tend to agree.  I prefer terms like frotz, zork, blorb, etc.  Or even names: fred, dave, bill.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Change Proposal: FS2Open to load "mod.ini" directly
The FOO and BAR usage even predates my computer lifetime (started in 1980 on an Apple II+).  Goes clear back to the early 70's at least.  Remember seeing it in some of the first stuff I read. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
Re: Change Proposal: FS2Open to load "mod.ini" directly
Considering how quickly programming can go FUBAR, I think the names fit perfectly. :p

 

Offline Tomo

  • 28
Re: Change Proposal: FS2Open to load "mod.ini" directly
First of all - the fonts note was an example. Maybe a bad example, and a fonts table may well be a better place for it.
But please read past that line in the original post!

Right now FS2 Open does not and cannot know which mod was selected.
It does not display the selected mod (only the selected campaign), the credits for the mod or the additional artwork created as a mod 'logo'.

- I wrote a patch a while ago that attempted to display the chosen mod, and found that it was actually impossible.
Instead it could only display the list of mod terms used in order - so the user could know he was running "blueplanet,mediavps" or "fsport-mediavps,fsport,mediavps", but not that he was running "FSPort MediaVPs v3.1.1"

There may be other data that is genuinely mod-specific - and by that I mean should not be automatically inherited by other mods.
The nature of that data is a matter for later discussion, and I am sorry for allowing the thread to become derailed by it.