[engine] Track unit statistics then [interface] display them

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
LittleHandle
Posts: 13
Joined: December 6th, 2012, 4:38 am

[engine] Track unit statistics then [interface] display them

Post by LittleHandle »

Currently Wesnoth does not track unit statistics - it would add an important emotional investment if users can track individual units by name and action across campaigns.

If unit statistics are tracked in a timeline fashion, this information can be used to improved to the user experiance in many possible ways [interface],
which would all give more personality as it adds a history to each unit in the game.

Proposed implementation would be a silent upgrade in-game user data, followed shortly to writing/loading this information to saved games and replays, then perhaps displayed by some of the suggested UI uses below,
given in rough order of difficulty. The key would be getting the timeline and basic stats for each unit recorded in detail so that calculating and displaying stats in any of the ways below would be possible from a save or replay file.
As it stands, it is only possible to recover even a rudimentary timeline from a save/replay file if the unit was recalled manually by the user from a previous scenario.

1. Display unit timeline (across campaigns):

Showing major events like battles, kills, healing, village capture, etc...
Mismatched replay files can be shown with a mark as well.

Code: Select all

--------------------------------------x----------------x-----------------||-----------------------------------------
                      (Konrad)

   ------------x---------+-------------xx--(death)
                     loyal elf #1

               ---------------------x-----xxxx-----+----------xxx^------||  r------xxx-------(death)
                     recruited elf #2
2. A better statistics screen.

When you click on statistics currently, it shows total number of units killed or lost. The proposed update using stats would allow the user to click
on the numbered box, say "Elvish Scout 4", and see a list of the 4 Elvish Scouts lost, their names, the name and type of unit that killed them (or "killed for narative purposes" if scripted), how they were killed, and in what scenario.

3. Unit statistics

In turn, the unit could be clicked on again (see #2), and a unit statistics screen would arise.
The statistics could be easily generated from the unit timeline

Sample stats:
List of units killed by name and type, and how.
Scenarios involved in.
Turns in play.
Turns at rest.
Turns poisoned/slowed
Villages liberated.
Total damage dealt/received/healed.
Close calls (# fights with >10% chance of death)
# of units fought
Turns spent alone/next to leader

Althought (6) below would be preferable for immersion in the world of Wesnoth.

4. Animated battle overview

Performance of each unit in each scenario (and campaign-wide) can be seen quickly by animating them in sequence and showing their health bar/status change,
possibly showing the unit they fought against (or healed) as well with their animations. This would be an easy addition with unit timelines.
It may be possible to do this on mass for a army-wide graphical battle overview.

5. Unit biography based on timeline:

The unit profile could be fleshed out with a unit biography - a word based (and therefore possibly more translation work) with major and minor events from the units timeline.

Example detailed biographical timeline, with pictures/links:

Recruited by Konrad in 'The rebels strike back'.
Fought 'Llewlyn' the elf.
Finished off 'Fengrir' the dwarf with her blade.
Captured a town.
Struck a blow against 'Breugh', the orcish leader.
Celebrated victory in 'The rebels strike back'
Was recalled to battle by Konrad in 'A Dwarves Delight'.
Massacred 'Gruli' the goblin.
Was promoted to Captain.
Changed name from 'Ewellyn' to 'Sir Knight'
Was slain by 'Lenny' the Lich

6. Unit titles/nicknames/awards/epitaths based on timeline

For instance 'the short-lived', 'the lucky', 'the beast', 'orc-slayer', 'the hero of <scenario>', could be conferred to the unit in their profile based on their timeline statistics,
or could be (with careful coding and translation) woven into a sentence or two in their bibliography:

'Sir Knight' was a Fighter who preferred to stay away from battle and was promoted to Captain by Konrad for nonetheless being instrumental
in 'the rebels strick back' and for slaying 'Gruli' the short-lived goblin. She was killed by 'Rampaging' Lenny, the Lich.

7. Full profile

Each unit could be given a full profile to date will all the above statistics, with links for statistics by scenario and unit database entry.

---------------------------

Currently, the saved replays regenerate unit names and reconstruct battles from saved random seeds, and units created/destroyed in the scenario file are not recorded, so it very difficult or impossible to reconstruct even some basic unit data from replays, scenario files and maps as it stands.
Therefore, tracking and saving a unit timeline and statistics will require changes throughout the code and a change in the save game/replay format, possibly breaking backwards compatibility.

Saved games and replay files should have an extra section to track unit statistics for each unit in play during that campaign. This means each time a unit is involved in an action, statistics and timeline should be updated in their unit profile.
This profile could be obtained by adding more variables for existing units and a simple list of events in chronological order, which could be encoded like a string or string array: "s2t1 Recruited by idKonrad, s2t2 moved 6 spaces to forest, s2t3 moved 4 spaces to plain, damaged idElvenArcher3 ranged 6hp from 16hp took 8hp from 32hp, s2t4 no movement, s2t5 healed 2hp".

This is a fairly major undertaking, but I feel would be well worth it and would add a lot to the game, since there are so many improvements (like the 7 listed above) that could be made to the game once this info is collected.
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

Re: [engine] Track unit statistics then [interface] display

Post by GunChleoc »

This sounds like an interesting idea if it can be done (that's of course up to the coders).

As for the extra strings to translate, Wesnoth is already so huge that I don't think it would make that much of a difference. The more complicated strings that depend on many placeholders could be discussed in the translation forum before committing, to make sure they meet various languages' needs.
User avatar
stikonas
Translator
Posts: 12
Joined: April 6th, 2008, 5:44 pm
Location: Cambridge, UK
Contact:

Re: [engine] Track unit statistics then [interface] display

Post by stikonas »

5. would bring some problems for translators. Some languages male/female forms, grammatical cases, so word by word translation would be clumsy with current tools available for translators.

On the other hand, there are already such problematic strings in Wesnoth, so we might argue why are they better then this one.

KDE has an interesting translation scripting system that could help in such cases http://techbase.kde.org/Localization/Co ... Transcript. In any case having something like this would help translators a lot but I suspect that it would be quite hard to port Transcript from Kdelibs to Wesnoth.
Last edited by stikonas on December 7th, 2012, 9:51 pm, edited 1 time in total.
Insinuator
Posts: 706
Joined: January 6th, 2004, 10:42 pm
Location: Portland, OR

Re: [engine] Track unit statistics then [interface] display

Post by Insinuator »

This is a cool idea. From your description, however, I'm not sure where this info would/should be displayed. Seems like an extra option in the drop-down menu might be nice, with some tables listing unit histories.
User avatar
Espreon
Inactive Developer
Posts: 630
Joined: June 9th, 2007, 4:08 am

Re: [engine] Track unit statistics then [interface] display

Post by Espreon »

Also, regarding point five, I imagine that it would cause nightmares for languages that show phenomena such as external sandhi and (perhaps) consonant mutations in writing.
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: [engine] Track unit statistics then [interface] display

Post by Crow_T »

I mentioned something similar a while back: http://forums.wesnoth.org/viewtopic.php?f=12&t=35856 I think it would add a whole new dimension to the game (could be a great GSOC 2013 project ;) )
LittleHandle
Posts: 13
Joined: December 6th, 2012, 4:38 am

Re: [engine] Track unit statistics then [interface] display

Post by LittleHandle »

Crow_T wrote:I mentioned something similar a while back: http://forums.wesnoth.org/viewtopic.php?f=12&t=35856 I think it would add a whole new dimension to the game (could be a great GSOC 2013 project ;) )
Sorry I missed that, didn't think to search for 'character'.
The timeline would be an important feature as well, adding the ability to show unit animation summaries of battles for instance.

I think the key upgrades required would be force wesnoth to save the units to its' savefiles and replays, add some basic statistics variables and a basic timeline to units, and allow the savefile/unit specification to allow for other statistics to be collect in future versions.

Where this can be displayed: timeline and/or animation at the end of battle (for a simple action implementation of this, see Tokyo Jungle's game-over screen).
Unit profile (including mission animations) could be accessed from the recall panel in-game,
via the stats screen, or by right-clicking/keyboard shortcut, like 'unit description' now. Indeed, the unit description/unit profile could be merged into one object.
This would also allow key characters to have biographies custom written and easily accessible in-game.

The biographies suggestion is understood to be difficult - but shows what can be done down the road if this information is collected now.
Insinuator
Posts: 706
Joined: January 6th, 2004, 10:42 pm
Location: Portland, OR

Re: [engine] Track unit statistics then [interface] display

Post by Insinuator »

LittleHandle wrote:Where this can be displayed: (1) timeline and/or animation at the end of battle (for a simple action implementation of this, see Tokyo Jungle's game-over screen).
(2) Unit profile (including mission animations) could be accessed from the recall panel in-game,
via the stats screen, or by (3) right-clicking/keyboard shortcut, like 'unit description' now. Indeed, the unit description/unit profile could be merged into one object.
Idea number one is kinda cool for immersion value. I've been playing XCOM - Enemy Unknown, which has a similar implementation after each mission. It would be an "in your face" addition, though. Far more prone to criticism and possible obnoxiousness down the road.

I like the second idea the best. Related to stats already, so that makes sense.

The third one is my least favorite. It would get annoying fast if I had to click through an extra, individualized screen for each unit when I'm just checking resistances for the type. Or even confusing if it was an addendum to the list, making new players question whether all units were like this or not.
LittleHandle
Posts: 13
Joined: December 6th, 2012, 4:38 am

Re: [engine] Track unit statistics then [interface] display

Post by LittleHandle »

Idea number one is kinda cool for immersion value. I've been playing XCOM - Enemy Unknown, which has a similar implementation after each mission. It would be an "in your face" addition, though. Far more prone to criticism and possible obnoxiousness down the road.
I've looked at videos and I don't see anything here. Do you mean the small stat overview on the side? I'm picturing something like a button in the victory overlay at the end of a scenario where you can click on 'campaign performance' to see the history lines of units in that scenario/others (if saved info exists). One way to do some animation that is not intrusive is to put 2 hexes on the victory screen and cycle backgrounds and animations in sequence for important characters and the units they fought. Skipping back and forth attack anims with one per side per battle is enough, with the unit that dies attacking first if it did any damage.
The third one is my least favorite. It would get annoying fast if I had to click through an extra, individualized screen for each unit when I'm just checking resistances for the type. Or even confusing if it was an addendum to the list, making new players question whether all units were like this or not.
My suggestion that they should be combined was a bad one, but there should be an option to see two kinds of unit description - the unit type's help page and the individual stats/history for that particular unit. It is already an issue - see Bug: https://gna.org/bugs/?3869
LittleHandle
Posts: 13
Joined: December 6th, 2012, 4:38 am

Re: [engine] Track unit statistics then [interface] display

Post by LittleHandle »

What a battle overview movie or animation can provide is a summary of the scenario that is like a replay but shows only battles/healing and is much, much quicker to run. It is mainly for eye-candy, but can also give a feel for how the scenario went.

One way an end-of-battle overview movie could work is this.

Pick a side to show battles for.

Keep track of all kills involving units of this side.

Say A1, A2, A3, A4, A5 are player's units and B1, B2, B3, B4, B5,B6 are other units.

A1 kills B2 and B5.
A2 kills B1
A3 had no kills
A4 kills B3, B4, B6
A5 had no kills
B5 kills A2
B4 kills A3

Then order the units like so on the screen (it doesn't have to be a hex grid):

Code: Select all

    A1 A2 | B1 B5 B2

    A4 A3 | B4 B3 B6

       A5
The battle lines can be animated so that the units fight either in order (and across gaps) or out of order (and adjacent), with one battle animation per death, and the ranks filling in behind the lost unit.

This gives a quick overview of how many units were involved and how mixed the battles were, in an organic rather than pure statistics way. For even the largest of battles, this animation would not take long to run, especially if different rows animated simultaneously. It would be more statistics like if health and experience bars were included (although fights not involving death would not be shown).

---------------

A single unit's line can be animated with health/experience an showing all fights with three queues:

row one (above unit) - enemies fought once that unit will fight again, after fight they queue to the appropriate location in this row
row two (same level as unit) - enemies that the unit has not yet met
row three (level below unit) - enemies that the unit fought, did not defeat, and will not fight again (and so leave hex next to unit blank).

Village and healing units can show up behind the character or in front.


A quick and cute summary per unit per scenario could be a 2-hex replay of that units actions, or 1-hex replay with a hex to the right scrolling up as appropriate (healer/battle), and then scrolling up to oblivion when the action is over. This could be embedded anywhere, like in a specific unit's profile or on the victory screen.
Insinuator
Posts: 706
Joined: January 6th, 2004, 10:42 pm
Location: Portland, OR

Re: [engine] Track unit statistics then [interface] display

Post by Insinuator »

LittleHandle wrote:Do you mean the small stat overview on the side?
Yes.
LittleHandle wrote:I'm picturing something like a button in the victory overlay at the end of a scenario where you can click on 'campaign performance' to see the history lines of units in that scenario/others (if saved info exists).
I'm not sure if you can even do an optional button. I don't recall seeing something like that in any campaigns I've played. Usually the overlay is just a pop-up box or "Next" & "Skip" buttons.
LittleHandle wrote:One way to do some animation that is not intrusive is to put 2 hexes on the victory screen and cycle backgrounds and animations in sequence for important characters and the units they fought. Skipping back and forth attack anims with one per side per battle is enough, with the unit that dies attacking first if it did any damage.
Now you're veering away from a simple stat tracking system. I'm sure some people would like this, but personally, I would abhor it. I have no interest in watching old battle animations and if someone started forcing me to watch them at the end of each scenario, I would quickly become irritated at the wasted time. Plus it would add another layer of complication to the code, not only in writing it, but storing all that info for later retrieval. It would bloat the system for what seems like, at the very least, a controversial feature.
Post Reply