Author Topic: Yitzi patch - save file format - alphax rules  (Read 1839 times)

0 Members and 1 Guest are viewing this topic.

Offline Mart

Yitzi patch - save file format - alphax rules
« on: December 01, 2013, 04:25:30 PM »
Wanted to ask and also discuss about possibility to save game rules in save file.

Maybe it was previously discussed, but at the present moment and patch version 2.4, how does it look? Do we have such capability to have that?
It might not be easy to do, as the game would have to each time when taking a rule from alphax.txt set, refer to data taken from the save file.
Actually, how does it look in the original exe? When loading a game from a save file, does the game loads also whole alphax.txt? It just uses then some variables from it, and some from save file?

Offline Yitzi

Re: Yitzi patch - save file format - alphax rules
« Reply #1 on: December 01, 2013, 08:02:10 PM »
The game loads the whole alphax.txt and copies over the relevant variables.

Having it save the variables in the save file would theoretically be doable, but would be a bit tricky, potentially undesired, and easy to do without (you can always save a separate file as alphax2.txt and just switch the filename for the game you want.)

Offline Mart

Re: Yitzi patch - save file format - alphax rules
« Reply #2 on: December 02, 2013, 08:05:29 AM »
The idea is, that the ruleset, that game generating person uses, is then unchangeable. In singleplayer that may be unwanted, but in multiplayer it is useful feature, as even by mistake some player can unknowingly use alphax.txt with different rules. That once happened to me, and I loaded multiplayer game, while having alphax.txt with changes for a mod. I had to reload and explain myself. The change was visible, I had 4 move points per road. But I think on many occasions, one would not notice other changes.
Has anyone thought of having different exe version for singleplayer and multiplayer? Or maybe, there is something like, when loading multiplayer save in singleplayer mode, there is a message "you cannot load multiplayer game in singleplayer ..." So there possibly are different procedures in these two cases, but to what extent?

Offline Yitzi

Re: Yitzi patch - save file format - alphax rules
« Reply #3 on: December 02, 2013, 02:49:07 PM »
The idea is, that the ruleset, that game generating person uses, is then unchangeable. In singleplayer that may be unwanted, but in multiplayer it is useful feature, as even by mistake some player can unknowingly use alphax.txt with different rules. That once happened to me, and I loaded multiplayer game, while having alphax.txt with changes for a mod. I had to reload and explain myself. The change was visible, I had 4 move points per road. But I think on many occasions, one would not notice other changes.
Has anyone thought of having different exe version for singleplayer and multiplayer? Or maybe, there is something like, when loading multiplayer save in singleplayer mode, there is a message "you cannot load multiplayer game in singleplayer ..." So there possibly are different procedures in these two cases, but to what extent?

I suppose that would be a useful feature, but would still be a not-insignificant amount of work, and I think there are higher priorities.

What I can do, though, fairly easily, is make a separate exe that loads from a different file (so terranMP would load from alphaMP instead of alphax.  So if you'd like that, just tell me what name you want for the exe and for the txt file(s) it will load from (note that it's limited to 7 characters per filename for everything except the exe), and I can do that.)

Offline Mart

Re: Yitzi patch - save file format - alphax rules
« Reply #4 on: December 02, 2013, 04:21:47 PM »
Let me think about it. I would gladly read opinions of others regarding this matter.
We have right now a feature in the exe, that can load alphax.txt from a location that can be different depending on a scenario setting. You probably saw that in the exe. There must some "if" or "switch" statement, that can load alphax from scenario folder if specified in the save and present there.
Such additional file would be maybe easier  to use but maybe to some people making the whole thing more complicated.

Offline Yitzi

Re: Yitzi patch - save file format - alphax rules
« Reply #5 on: December 02, 2013, 04:45:31 PM »
Let me think about it. I would gladly read opinions of others regarding this matter.
We have right now a feature in the exe, that can load alphax.txt from a location that can be different depending on a scenario setting. You probably saw that in the exe. There must some "if" or "switch" statement, that can load alphax from scenario folder if specified in the save and present there.
Such additional file would be maybe easier  to use but maybe to some people making the whole thing more complicated.

I believe it always loads preferentially from the same folder as the scenario, or something like that, but that may be part of the Windows "load file" feature and so would not be practically modifiable.  I was thinking of just using a different filename; the filename is hardcoded, but changing hardcoded text is pretty much the easiest thing you can do with .exe modding.

Offline Mart

Re: Yitzi patch - save file format - alphax rules
« Reply #6 on: December 02, 2013, 05:07:37 PM »
Singleplayer save files are not encrypted and they have included scenario path in them, the scenario file location the game was started from. If I remember correctly, by changing that path in save file I could cause the game to load a different alphax.txt file.
For MP that is more difficult since save files are encrypted.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Please don't go. The Drones need you. They look up to you.

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 38.

[Show Queries]