no save when ai sides only?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

Post Reply
spir
Posts: 97
Joined: September 15th, 2009, 9:31 am
Contact:

no save when ai sides only?

Post by spir » October 20th, 2009, 6:15 pm

Hello,

Just let a stand-alone scenario play with both sides controlled by ai and noticed there were no save files at all. I needed them, actually, that was the purpose (gather stats). The same scenario is normally saved when I play one side myself -- but it's not the point. I need the saves for all-ai games to be able to launch them multiple time (through the command-line, with no-gui, and fast...).
Any hint about this issue?
Denis
life is strange

various stuff about BfW (rules, stats, alternatives) and WML (parser, semantic schema, evolution)

Soliton
Site Administrator
Posts: 1597
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: no save when ai sides only?

Post by Soliton » October 21st, 2009, 6:28 pm

File a feature request? Producing savegames is not exactly fast though...
"If gameplay requires it, they can be made to live on Venus." -- scott

spir
Posts: 97
Joined: September 15th, 2009, 9:31 am
Contact:

Re: no save when ai sides only?

Post by spir » October 22nd, 2009, 6:14 am

Soliton wrote: File a feature request?
Yep, that's what I'm going to do. I have been stuck for too long with this ¤$*%#!!! question of getting game statistics (see a note on this topic and thread).
Anyway, I would like a confirmation that there actually are no saves for ai-only games, and if yes, why? Saves are not only for players playing (why the [statistics] section?) and if someone runs a game with only ais, s/he probably has a good reason for this, no?

Producing savegames is not exactly fast though...
Sure, but it's the user's choice. There are easy ways to allow producing savegames on request -- see proposals below. So, would you give me feedback on these versions (individually and comparatively) before I "File a feature request"?

===============================================================================

purpose

This is a proposal intended to allow producing whole or partial savegames on request, including for AI-only games, and at end of scenario. Presently:
* AI only games seem not to produce saves at all.
* Saves beeing done at start of turn, there is never a save file to get feedback on how a whole scenario was played!
* There is no way to get only a partial save, especially the highly worthy [statistics] section.
Particuliarly, I find strange that such a great source of feedback exists, is actually computed, but there no way to pick it up & make valuable use of it...
Both proposals are intended to solve these issues in a simple manner.

I won't list all use cases for such relevant information, because there are simply too many I guess. I'm thinking mainly at ai development and testing new/variant game elements.
* What advantage does the Elvish Hunter actually give to a side?
* What is it worth compared to the Fighter / to the Archer?
* How does this new ai / ai version actually play?
* How does it play compared to / against others?
* How does this new/changed rule affect gameplay?

I personly need this feature for a tool intended to produce statistics on multiple playing of (possibly variant versions of) a game, as exposed in docs pointed above.


common syntax

The feature would be implemented through a [savegame] section, either in the "parameters" file, or as a new WML action.

Code: Select all

[savegame]
	content=<code>
	filename=<filename>
[/savegame]
The content parameter may have following values:
* "none" (default)
* "all"
* "<section name>"
The latter would for instance allow saving statistics or variables only -- meaning producing exactly the feedback one needs. In the file name, "_end" would replace "_autosaveXX" (alternatively the file could be given ).

Alternative: the "content" parameter is not strictly needed, for "more can less". A human user can jump to the needed section, a script can extract requested information only.

The "filename" instead is really helpful because of platform-dependant (and even user-dependant) variation on standard savefile location.

new parameter
An optional [savegame] section is added to the "parameters" file. There is no matching GUI choice, for this feature is probably useless for most players.
This proposal is probably easier and faster to implement, but it has drawbacks:
* The user (actually probably a developer of any kind) constantly needs changing the parameter value according to what work is currently done -- or not -- and not forget it.
* There is no way to decide when exactly saving happens: in fact, there can only be one save per game. It should be done at end-of-game because it's the most valuable source of information, but depending on use cases this is not always the best choice.


WML action
A [savegame] (internal?) action is created
Main differences:
* Saving or not, and the actual content, is freely defined in game scenarios for which it makes sense.
* Saving can be required on various events, not only end-of-game, possibly with different content.
* There can be several savegames at different points of a scenario, for the same game.
Denis
life is strange

various stuff about BfW (rules, stats, alternatives) and WML (parser, semantic schema, evolution)

Soliton
Site Administrator
Posts: 1597
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: no save when ai sides only?

Post by Soliton » October 22nd, 2009, 7:56 am

spir wrote: * Saves beeing done at start of turn, there is never a save file to get feedback on how a whole scenario was played!
What's wrong with the replay?
"If gameplay requires it, they can be made to live on Venus." -- scott

spir
Posts: 97
Joined: September 15th, 2009, 9:31 am
Contact:

Re: no save when ai sides only?

Post by spir » October 22nd, 2009, 1:35 pm

Soliton wrote:
spir wrote: * Saves beeing done at start of turn, there is never a save file to get feedback on how a whole scenario was played!
What's wrong with the replay?
Dunno, have never saved a replay. Does the file hold [statistics] [variables] and all such interesting sections? I'll try and have a look...

PS: Oh, sorry, I see what you mean, maybe. The point is not to watch, it's to get data instead. anyway, I'll review the content of a replay file.
Denis
life is strange

various stuff about BfW (rules, stats, alternatives) and WML (parser, semantic schema, evolution)

Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Re: no save when ai sides only?

Post by Yogibear » October 22nd, 2009, 2:54 pm

If you are only interested in the stats, a replay savegame should be sufficient.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!

spir
Posts: 97
Joined: September 15th, 2009, 9:31 am
Contact:

Re: no save when ai sides only?

Post by spir » October 22nd, 2009, 5:59 pm

Yogibear wrote:If you are only interested in the stats, a replay savegame should be sufficient.
Just watched it, thank you. Seems it may solve my issue. Just have to check replay savegames are done even for ai-only games, when save_replays="yes"...
Yes!

By the way, can someone tell me if there is a way to tell wesnoth where to find scenarios run from the command-line with eg "-m --no-gui --exit-at-end --scenario=<id>" (for the scenario-id is passed, not the file). Or do we need to put them in the main wesnoth dir? Wesnoth does not seems to search in user dir. Mine are not found for sure, even at the standard location in user data dir. Or what else do I need to know?
Denis
life is strange

various stuff about BfW (rules, stats, alternatives) and WML (parser, semantic schema, evolution)

Soliton
Site Administrator
Posts: 1597
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: no save when ai sides only?

Post by Soliton » October 22nd, 2009, 7:26 pm

spir wrote:By the way, can someone tell me if there is a way to tell wesnoth where to find scenarios run from the command-line with eg "-m --no-gui --exit-at-end --scenario=<id>" (for the scenario-id is passed, not the file). Or do we need to put them in the main wesnoth dir? Wesnoth does not seems to search in user dir. Mine are not found for sure, even at the standard location in user data dir. Or what else do I need to know?
Just put them where add-ons go (~/.wesnoth1.7/data/add-ons/ by default on the dev version) and it'll work. If not you need to be more specific about your setup.
"If gameplay requires it, they can be made to live on Venus." -- scott

Post Reply