Showing "Advantage" In-Game/End-Game

Discussion among members of the development team.

Moderators: Forum Moderators, Developers

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 » July 23rd, 2006, 8:44 am

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: 1715
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 » August 17th, 2006, 2:39 pm

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 » October 14th, 2006, 9:39 pm

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: 2394
Joined: January 31st, 2008, 8:38 pm

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

Post by AI » June 12th, 2009, 1:31 am

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 » June 12th, 2009, 1:52 am

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: 2394
Joined: January 31st, 2008, 8:38 pm

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

Post by AI » June 12th, 2009, 2:12 am

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: 2394
Joined: January 31st, 2008, 8:38 pm

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

Post by AI » June 17th, 2009, 1:12 am

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 » June 17th, 2009, 2:55 am

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