Showing "Advantage" In-Game/End-Game

Discussion among members of the development team.

Moderator: Forum Moderators

Post Reply
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Showing "Advantage" In-Game/End-Game

Post by Sapient »

Here's a possible idea for more in-game Statistics. The original idea came from eddieballgame in this thread (although I dislike his Performance Rating idea).

The equation would look something like:

Code: Select all

Advantage = Income Factor + Holdings + Other Advantage Factors
Income Factor = Net Income * INCOME_WEIGHT
Holdings = Gold + ALL( Unit Value )
Unit Value = MAX( price*(%hp), Next Level Value*(%exp) )
Other Advantage Factors = {undefined}
Essentially, it would be the computer's idea of "Who's winning?"

It might be nice to display Ending Advantage if turns run out in MP.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Temuchin Khan
Posts: 1800
Joined: September 3rd, 2004, 6:35 pm
Location: Player 6 on the original Agaia map

Re: Showing "Advantage" In-Game/End-Game

Post by Temuchin Khan »

Sapient wrote:Here's a possible idea for more in-game Statistics. The original idea came from eddieballgame in this thread (although I dislike his Performance Rating idea).

The equation would look something like:

Code: Select all

Advantage = Income Factor + Holdings + Other Advantage Factors
Income Factor = Net Income * INCOME_WEIGHT
Holdings = Gold + ALL( Unit Value )
Unit Value = MAX( price*(%hp), Next Level Value*(%exp) )
Other Advantage Factors = {undefined}
Essentially, it would be the computer's idea of "Who's winning?"

It might be nice to display Ending Advantage if turns run out in MP.
I like this idea. It has always seemed a little odd to me that someone can be trampling his opponent's units in multiplayer, but still be counted a loser if time runs out.
AT
Posts: 476
Joined: May 6th, 2004, 9:44 pm

Stats

Post by AT »

I've always wanted a more comprehensive set of statistics to be generated (at least) after the game is over. I'll see if I can come up with something in a patch once I get back up to speed.
Gandalf-"I am a servant of the Secret Fire, wielder of the Flame of Anor. You cannot pass. The dark fire will not avail you, flame of Udun. Go back to the Shadow. You cannot pass!"
AT- "That sounds like more trouble than it's worth."
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Showing "Advantage" In-Game/End-Game

Post by AI »

I have started implementing this feature. It can be found in trunk using the default era.

Income currently has a weight of 5 and unit value is simply the cost of the unit. A more complex (and configurable) unit worth formula can be found in the test scenario. (right click any unit)
The current formula there is:
(BASE + (hp/max_hp) * HEALTH_WEIGHT + (xp/max_xp) * XP_WEIGHT)
where the default values are 0.5, 0.5 and 2.

If anyone can come up with a better formula or better (default) weights, I'd love to hear it.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Showing "Advantage" In-Game/End-Game

Post by Sapient »

ummm... I like the formula that was proposed a lot better:

Code: Select all

Unit Value = MAX( price*(%hp), Next Level Value*(%exp) )
(NextLevelValue would be the highest price from the available advanceto choices)
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Showing "Advantage" In-Game/End-Game

Post by AI »

I considered that, but that would require accessing the cost of a unit type by its name. Not an easy task from WML. (I'm already abusing the fact that a [unit_type]'s variables are carried over into it's [unit] instances)

This would require something along the lines of:
-parsing advances_to
-creating a unit of each type
-accessing its cost
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Showing "Advantage" In-Game/End-Game

Post by AI »

I've moved the implementation to C++ and changed to your formula, the formula's innards are exposed in the test scenario.

The UI has also been polished (mostly Soliton), so I think it's about done.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Showing "Advantage" In-Game/End-Game

Post by Sapient »

AI wrote:I've moved the implementation to C++ and changed to your formula, the formula's innards are exposed in the test scenario.

The UI has also been polished (mostly Soliton), so I think it's about done.
Very Nice!

thanks 8)
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply