ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Tue Dec 12, 2017 2:40 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Nov 01, 2012 6:31 pm 
Offline
Uruivellas

Joined: Thu Nov 18, 2010 6:42 pm
Posts: 744
I recently installed SVN (v 5757) to start updating two addons for beta 43. After running the program with a new character to make sure the install was OK, I enabled my tooltip addon (very simple) to make sure it was compatible with the SVN. My test character no longer appeared on the save character list with no explanation as to why. I then created a new character and it loaded and saved fine. I disabled my addon to start "debugging" it, but it was loaded again with my second test character. My first test character (still on disk) never reappeared on the load screen. Afterwards, I found out from the SVN development history that this is a new feature of the upcoming B43.

This kind of program behavior will most likely produce player frustration and complaints. It will also very much hurt addon development because it's not safe to try out addons. That is, if a player is in the middle of a game and an interesting addon comes out, it's either impossible to use the addon without starting a new game, or there is no going back once the addon is installed. I'm not sure why, exactly, this new feature has been added, besides an obvious concern about compatibility between the main game and various addons. Is there a concern about some kind of cheating that may be facilitated by players turning on and off addons during play? I think these issues need to be addressed before B43 is released.

Addressing compatibility and debugging control, I see the following priorities for this system:

Transparency:
Always list all save files and complete addon info in the save file summary at the load screen. Each save file in the list should either be shown as compatible or should list exactly why it is not. (Missing required addon, incompatible game version, etc.) It should, as a minimum, be possible for the player to be able to delete old/incompatible saved games from the game load screen. This is step towards enabling compatibility of save files from older game versions.

Flexibility:
Save files with no addons attached should always be loadable. That is, saving a character from an unmodified game should always be safe.

Most save files will not really require any specific addons and should be able to load without them. (My tooltip addon, for example, makes no changes to gameplay, and the game will run just as well with or without it.) It's probably safe enough just to warn the player of possible incompatibility issues whenever a game is loaded without its associated addons available. This is far better than just automatically throwing away a saved game and leaving the player to scratch his or her head in frustration.

Always load the addons attached to the save file unless they are disabled. If the addon profile (ie. the list of addons enabled) of a save file does not match the installed/enabled addons in the game, give the player the option to select/deselect each addon, with an appropriate warning if the addon profile is changed. Attach the addons as specified.

Allow any save file to be loaded in debug mode. This is required if an addon developer is trying to track down a bug in his software with a save file that uses addons he may not have.

Tracking:
Mark in the save file if the game previously used an addon that is no longer installed. For example:

save w/no addons --> game.__mod_info.addons[AddonName] == nil
save w/ addon attached --> game.__mod_info.addons[AddonName].ver == "vxx.xx"
save w/o previous addon --> game.__mod_info.addons[AddonName].ver == "disabled"

Print this "history" in the game log when loading a game, to help identify corrupted save files for debugging purposes. This will be most helpful in analyzing a saved game that is running without addons when a bug is reported but that had been run with (disabled or no longer installed) addons previously.

Some more involved options:
If previously attached addons are disabled for a game, do a thorough consistenty check of game variables to ensure stability. (Could most likely be limited to the variable space for an unmodified game, in which case a fairly straightforward routine could be developed, something like checking a table containing the allowed range of each variable.)

Possibly provide some more info to the init file that allows the addon developer to specify weather a saved game actually requires the addon or not and enforce this when loading a saved game. Most cosmetic addons can safely specify no requirement, while those expanding content (new classes, zones, etc.) would probably specify that they must be loaded with an associated saved game.

Edit: After testing a few more saves, the previously hidden save files are now visible in the load game screen. There may be a bug involved here, but at least I can see all of my saved games now. Anyone have any similar experience?

_________________
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 10:34 pm 
Offline
Wyrmic

Joined: Wed Aug 22, 2012 12:16 am
Posts: 200
Sounds like something went sideways in this instance. I know the load screen doesn't display saves for the wrong ToME 4 version, i.e. b42 saves won't show up on the b43 load screen (at least that was my previous experience), but I've never seen version-valid saves left out.

Hachem_Muche wrote:
Transparency:
... snip ...
The required addons are listed in the load screen's right panel (module name at the top, version number below, then "Required addons" just under that), available addons in green, missing addons in red.

Hachem_Muche wrote:
Flexibility:
... snip ...
Only the addons associated with a given save are loaded, so a vanilla ToME 4 save should always load just fine even if you've got a pile of extras.

Changing a save's addons can't be done in-game, but the addons field in a save folder's desc.lua file can easily be changed by hand. Not as convenient, but how often does a non-developer fiddle with their addons configuration?

Most of the rest of your ideas sound like bookkeeping that would only occasionally benefit addon developers. I don't know that it should be the game's job to track the entire history of addon lineup changes for every save. If you disagree, well... you could probably make an addon that would do it for you.

In summary: it sounds like you may have found a bug; a lot of your ideas describe how it already works or, bugs squashed, is supposed to work.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 10:54 pm 
Offline
Uruivellas

Joined: Thu Nov 18, 2010 6:42 pm
Posts: 744
It's much better now that the <hopefully> temporary anomalies that showed up right after I installed the SVN have ceased. Some file initialization problems, perhaps.

Quote:
Most of the rest of your ideas sound like bookkeeping that would only occasionally benefit addon developers. I don't know that it should be the game's job to track the entire history of addon lineup changes for every save. If you disagree, well... you could probably make an addon that would do it for you.

I think that it would be pretty common for a non-developer to install an addon, try it out for a while, and then perhaps remove it. The question is really whether they should have to start a whole new game every time the addon list is changed. If the game is going the more flexible route, there should probably be some kind of a "dirty" flag like I've suggested to keep track of what addons have been used in a given game. I don't think this can be implemented as an addon because the appropriate code is executed before addons are loaded.

_________________
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 11:17 pm 
Offline
Wyrmic

Joined: Wed Aug 22, 2012 12:16 am
Posts: 200
Hachem_Muche wrote:
I think that it would be pretty common for a non-developer to install an addon, try it out for a while, and then perhaps remove it. The question is really whether they should have to start a whole new game every time the addon list is changed. If the game is going the more flexible route, there should probably be some kind of a "dirty" flag like I've suggested to keep track of what addons have been used in a given game. I don't think this can be implemented as an addon because the appropriate code is executed before addons are loaded.

Yes, I see. I don't think any extra effort with the saves is necessary so much as two simpler changes:
  1. Add a new "Manual: force" mode to the addon management screen. It would load an addon with any save, regardless of the save's addon list.
  2. Add a warning/continue prompt when trying to load saves with disabled/missing addons.

This would be far less effort and would work just as well, unless I'm missing something.


Top
 Profile  
 
PostPosted: Fri Nov 02, 2012 3:36 am 
Offline
Uruivellas

Joined: Thu Nov 18, 2010 6:42 pm
Posts: 744
We're talking about almost the same thing. I'd just move the addon manual force mode selection to the load screen and update it (once) as needed for each save file when it's loaded.

Unless there's more to this than I'm seeing, the additional effort would mostly be an extra prompt to select which addon's to associate with the save file. The existing addon variables would be used.

Your idea would also work, but the player would have to visit the addon screen any time he switched between games that needed different addon sets, rather than have the game remember it. This probably wouldn't happen all that often, though.

_________________
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.


Top
 Profile  
 
PostPosted: Fri Nov 02, 2012 11:46 pm 
Offline
Wyrmic

Joined: Wed Aug 22, 2012 12:16 am
Posts: 200
Hachem_Muche wrote:
Your idea would also work, but the player would have to visit the addon screen any time he switched between games that needed different addon sets, rather than have the game remember it. This probably wouldn't happen all that often, though.

My idea is based on the assumption that the currently used addon list is always saved with the game. Because it already loads only those addons specified in the save, different games already have different addon lists. The only time the player need do extra work is when inserting (forcing) or removing an addon to or from an existing save. If you made the manual force setting a one time thing, it'd add it to the addon list of the next played game and you'd be done with it.


Top
 Profile  
 
PostPosted: Sat Nov 03, 2012 4:55 pm 
Offline
Uruivellas

Joined: Thu Nov 18, 2010 6:42 pm
Posts: 744
Yes, I think this would accomplish what is needed.

The only concern left is weather the current behavior (after the initial problems that I saw) is a bug.

From http://git.develz.org/?p=tome.git;a=com ... 042e270ab1
Quote:
Savefiles are now bound to the addons that created them, they forceload only those, and cant load if they do not exist

I'd like to know what DG's intent is on this.

_________________
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group