Config UI

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Post Reply
Message
Author
Magnate
Space Dragon
Posts: 425
Joined: Sat Nov 08, 2014 3:44 pm

Config UI

#1 Post by Magnate »

Hi all,

I've been working with o01eg to build and run my own persistent MP server (what he calls "longturn" - where you can connect and disconnect as many times as you want, and the turn will advance after a set period, say 24h or 48h, or earlier if everyone's turns are in). First I should say a huge thankyou to o01eg for his help with getting this working - it now does. I'm pleased to contribute a small pull request (to enable the auth.py script to cope better with ssl and non-ssl mail servers).

This has made me very interested in the configuration of MP games. I'm going to use two different terms, "settings" and "rules". Settings are the things you can currently configure in the multiplayer lobby UI - number of stars, galaxy age, natives, monsters, specials, AI aggressiveness etc. etc. etc. You can of course configure these for single player games too. Rules are the things you can configure in the single player setup UI but not in the MP lobby - things like ship and building cost factors, number of combat rounds, experimentors, super-testers etc. etc.

I have a number of questions about these things:

1. There are two config files in my freeorion directory: config.xml and persistent_config.xml. What's the difference?

2. Where is the best place to configure rules for an MP game? One of those two files?

3. The config files have a section called <rules> and a subsection called <server-locked>, with each rule duplicated in the subsection. What is the difference, if a rule is enabled in one but disabled in the other?

4. The setting <star><count> seems to differ between SP and MP. In SP it seems to be the total number of stars in the galaxy, but in MP it is the number of stars per player. Is this correct?

I have more questions but that'll do for now. Thanks!

Magnate
Space Dragon
Posts: 425
Joined: Sat Nov 08, 2014 3:44 pm

Re: Config UI

#2 Post by Magnate »

5. Can the rules be changed during a game, or are they read from the savefile? (Debugging much easier if they can be changed during a game ...)

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

Re: Config UI

#3 Post by o01eg »

Magnate wrote: Sat Oct 26, 2019 11:38 am I have a number of questions about these things:

1. There are two config files in my freeorion directory: config.xml and persistent_config.xml. What's the difference?
https://freeorion.org/index.php/Config.xml
Magnate wrote: Sat Oct 26, 2019 11:38 am 2. Where is the best place to configure rules for an MP game? One of those two files?
All configuration options made outside the game should be written in persistent_config.xml. This way it preserves options between updates.
Magnate wrote: Sat Oct 26, 2019 11:38 am 3. The config files have a section called <rules> and a subsection called <server-locked>, with each rule duplicated in the subsection. What is the difference, if a rule is enabled in one but disabled in the other?
<server-locked> subsection means client cannot change value of the rule. Technically it could be done if someone alters his client to send another set of rules into multiplayer lobby.
Magnate wrote: Sat Oct 26, 2019 11:38 am 4. The setting <star><count> seems to differ between SP and MP. In SP it seems to be the total number of stars in the galaxy, but in MP it is the number of stars per player. Is this correct?
It's a custom change I made to don't change star count each time new player added. Vanilla multiplayer server treats it as total number of stars in the galaxy.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-07.15cf063.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Config UI

#4 Post by o01eg »

Magnate wrote: Sat Oct 26, 2019 2:05 pm 5. Can the rules be changed during a game, or are they read from the savefile? (Debugging much easier if they can be changed during a game ...)
Rules are read from savefile and cannot be changed during a game. Hard way is to edit savefile but it have a terrible format to do it.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-07.15cf063.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Magnate
Space Dragon
Posts: 425
Joined: Sat Nov 08, 2014 3:44 pm

Re: Config UI

#5 Post by Magnate »

o01eg wrote: Sat Oct 26, 2019 5:51 pm
Magnate wrote: Sat Oct 26, 2019 2:05 pm 5. Can the rules be changed during a game, or are they read from the savefile? (Debugging much easier if they can be changed during a game ...)
Rules are read from savefile and cannot be changed during a game. Hard way is to edit savefile but it have a terrible format to do it.
Is this true in the case of the server-locked rules in persistent_config? In the MP game I'm playing with my friends, we're trying to debug the RULE_AGGRESSIVE_SHIPS_COMBAT_VISIBLE, and I'm seeing different behaviour after reloading the savefile and changing the rule in persistent_config. So either you can change the rule that way, or the bug is really inconsistent!

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

Re: Config UI

#6 Post by o01eg »

Magnate wrote: Sat Oct 26, 2019 6:08 pm
o01eg wrote: Sat Oct 26, 2019 5:51 pm
Magnate wrote: Sat Oct 26, 2019 2:05 pm 5. Can the rules be changed during a game, or are they read from the savefile? (Debugging much easier if they can be changed during a game ...)
Rules are read from savefile and cannot be changed during a game. Hard way is to edit savefile but it have a terrible format to do it.
Is this true in the case of the server-locked rules in persistent_config? In the MP game I'm playing with my friends, we're trying to debug the RULE_AGGRESSIVE_SHIPS_COMBAT_VISIBLE, and I'm seeing different behaviour after reloading the savefile and changing the rule in persistent_config. So either you can change the rule that way, or the bug is really inconsistent!
It possible default values doesn't save into savegame and when you change defaults via options value in the game changes as well. I didn't test it with save and loading games.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-07.15cf063.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Magnate
Space Dragon
Posts: 425
Joined: Sat Nov 08, 2014 3:44 pm

Re: Config UI

#7 Post by Magnate »

Ok. I'm pretty sure that the behaviour I'm seeing is because the rule has changed, which means you're right that defaults are not written into the savefile.

For testing it would be a lot easier if persistent_config.xml contained a section to override rules in the savefile ...

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Config UI

#8 Post by Geoff the Medio »

Magnate wrote: Sat Oct 26, 2019 7:51 pmFor testing it would be a lot easier if persistent_config.xml contained a section to override rules in the savefile ...
A alternative might be to add an interface in moderator mode to allow changing of the rules in the current game.

Post Reply