Ticket #44105

Server setting for AI level

Open Date: 2022-03-14 18:59 Last Update: 2022-04-11 14:44

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
3

Details

Split from https://www.hostedredmine.com/issues/858206 : Jacob Nevins wants regular server setting for AI level of the newly created players. Unlike the dedicated level setting commands, this setting would not affect existing AIs.

Ticket History (3/12 Histories)

2022-03-14 18:59 Updated by: cazfi
  • New Ticket "Server setting for AI level" created
2022-03-23 16:34 Updated by: cazfi
Comment

This depends on #44164 to make it possible to handle "Experimental" AI level value saved by debug build when loading game to non-debug build.

2022-03-24 15:18 Updated by: cazfi
Comment

This will also need adjustments to savegame format as the default AI level gets saved among the settings, obsoleting current savegame field for it. The old field needs to be dropped, and also conversion from an older format savegames to new format introduced. At the same time ai_level_convert() issue (#44163) interferes with the very same parts of savegame handling. Unless further complications come up, it certainly makes sense to resolve #44163 first.

Another thing that patch I'm working on does is rearranging enum ai_level so that "Away" is always the highest value (as we have means to terminate some iterations early, but no means to skip values from the beginning). This is a bit risky change, though I don't *know* any place to rely on old hardcoded order any more.

Given these points, does anyone have strong opinion whether we still should target this to 3.1, or should we postpone it to 3.2?

2022-03-27 22:07 Updated by: cazfi
Comment

Reply To cazfi

Given these points, does anyone have strong opinion whether we still should target this to 3.1, or should we postpone it to 3.2?

Attached patch for master assumes that this is a new 3.2 feature - savegame format conversion happens between 3.1 and 3.2 formats (as well as from older 3.2 dev version)

Depends on #44164 and #44163

2022-03-28 00:41 Updated by: alienvalkyrie
Comment

Are access levels for the new setting meant to be ALLOW_HACK? Current AI level commands are ALLOW_CTRL.

2022-03-30 07:20 Updated by: cazfi
Comment

- New version with setting's properties adjusted: SSET_RARE -> SSET_VITAL, read access ALLOW_HACK -> ALLOW_NONE, write access ALLOW_HACK -> ALLOW_CTRL

2022-04-09 07:49 Updated by: cazfi
  • Resolution Update from Accepted to None
Comment

There's an issue in compat_load_dev(). It tries to determine if < 3.1.92 savegame is newer than this change or not by looking existence of the ailevel setting in it. However, setting that follows default value is not saved -> when ai level is the default, the code tries to look the level from old "game.level" entry and errors when it's not there either.

2022-04-09 14:04 Updated by: cazfi
  • Resolution Update from None to Accepted
Comment

Reply To cazfi

There's an issue in compat_load_dev(). It tries to determine if < 3.1.92 savegame is newer than this change or not by looking existence of the ailevel setting in it. However, setting that follows default value is not saved -> when ai level is the default, the code tries to look the level from old "game.level" entry and errors when it's not there either.

- Fixed

2022-04-11 14:44 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login