Support showing CTH histogram from enemy point of view

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:
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Support showing CTH histogram from enemy point of view

Post by josteph »

TrashMan, would you like to answer the question in my first post? Would you name a particular scenario that you haven't been able to beat without save-loading?
beetlenaut wrote: February 26th, 2019, 12:20 am
octalot wrote: February 25th, 2019, 8:11 pm Has anyone done a mod that records the times that a unit was at risk of death?..."had a 45% CTD"
I made a feature request for allowing you to simulate an enemy attack on your units so you could more easily check that kind of thing before your turn was over, but it never got implemented.
Actually I think it might not be that hard. There is already support for showing the chance-to-hit histogram in the sidebar. I use this and it allows me to see the CTH histogram of my side's attacks during my turn. By changing a few lines of C++, I can get the reverse histogram too: I can now click on an enemy unit and mouseover one of my own units and get the CTH histogram for the enemy's attack on me. (That histogram will be different when it's possible that one of the units will die before completing all its strikes.)
Patch:
Screenshots:
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: BfW is a game that relies on save-scumming too much

Post by beetlenaut »

josteph wrote: February 26th, 2019, 7:18 pmI can now click on an enemy unit and mouseover one of my own units and get the CTH histogram for the enemy's attack on me.
Oh! That's great! I expected that it would be harder. It still needs two things in my opinion: First, a differently colored arrow so you can see that something different is happening (I suggest blue), and second, it should work on planned move "ghosts" from your side because otherwise, if there is fog, shroud, or an event, you would have to complete the move before you check to see if it's dangerous. (I never use planning mode ATM, but I would if this worked.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: BfW is a game that relies on save-scumming too much

Post by josteph »

beetlenaut wrote: February 27th, 2019, 3:10 pm First, a differently colored arrow so you can see that something different is happening (I suggest blue),
Yeah, that would be nice. I'll just recolor the arrow with ~CHAN(blue,green,red) (the arrow itself is attack-indicator-*.png). The functions that place the arrow know what map_location it is on, so it would be easy to check if the unit on that map location belongs to the viewing team, or is an ally of the viewing team, or whatever, and color the arrow accordingly. Could you put this on github please so I don't forget it?

I just got an assertion error with the patch, wesnoth: src/mouse_events.cpp:707: map_location events::mouse_handler::current_unit_attacks_from(const map_location &) const: Assertion `source_unit->side() != target_unit->side()' failed. I haven't investigated but I guess it will be easy to fix.
beetlenaut wrote: February 27th, 2019, 3:10 pm and second, it should work on planned move "ghosts" from your side because otherwise, if there is fog, shroud, or an event, you would have to complete the move before you check to see if it's dangerous. (I never use planning mode ATM, but I would if this worked.)
Yeah, it works when the "attacked" unit is a unit on a future/planned location in whiteboard mode.
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: BfW is a game that relies on save-scumming too much

Post by beetlenaut »

This all sounds great! I thought of something else though. The damage calculations should be based on the time of day it will be on your enemy's turn, which will not necessarily be the current one.
josteph wrote: February 28th, 2019, 4:05 pmCould you put this on github please so I don't forget it?
I put in the feature request on the old svn server, and I thought everything got migrated over to github. I don't see it on github when I search, but I want to make sure it's not hiding somewhere before I post it again. Is there an archive of old issues?
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: BfW is a game that relies on save-scumming too much

Post by josteph »

Old issues were migrated, see for example https://github.com/wesnoth/wesnoth/issues/1351. Good point about timeofday, I think that will require a further change to src/reports.cpp...
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Support showing CTH histogram from enemy point of view

Post by josteph »

Just posted #3956, please test :)
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Support showing CTH histogram from enemy point of view

Post by beetlenaut »

josteph wrote: February 28th, 2019, 5:53 pm Old issues were migrated
I see. I wasn't looking under the correct author. Here is original feature request: https://github.com/wesnoth/wesnoth/issues/1252. No reason it can't show up in the sidebar though.
josteph wrote: February 28th, 2019, 6:15 pm Just posted #3956, please test
It's a little inconvenient if it only works in planning mode, but not a huge deal. I don't see any stats though. I get the blue arrow now, but nothing new shows up in the sidebar. (I don't see anything for my attacks in the sidebar either in case I should.) Your screenshot shows an experimental theme, doesn't it? There are only two available for me: Classic and Default.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Support showing CTH histogram from enemy point of view

Post by josteph »

Thanks for the link. Yes, the screenshots use a modified theme. To test the PR change unit_weapons to highlighted_unit_weapons in data/themes/default.cfg. That will give you one of the two histograms, even outside of planning mode.

I'll see if I can make the blue arrow work outside planning mode too.
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Support showing CTH histogram from enemy point of view

Post by beetlenaut »

josteph wrote: February 28th, 2019, 7:29 pmTo test the PR change unit_weapons to highlighted_unit_weapons in data/themes/default.cfg.
Now it works. I like it! It wasn't immediately obvious what the sidebar histogram was showing, but it does what I wanted it to.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Support showing CTH histogram from enemy point of view

Post by josteph »

Great, thanks for testing! Both histograms together (highlighted_unit_weapons and selected_unit_weapons) show both parts of the histogram from the Damage Calculations dialog, one of them shows the expected HP of the attacker after the attack and one of them the expected HP of the defender after the attack.

I should probably try to find time to post my version of the asymmetric theme https://forums.wesnoth.org/viewtopic.ph ... 5&start=15, that's what the screenshots show. (The screenshots are a little cramped though because they're 800x600. Usually I play on a widescreen resolution where it looks much better)
User avatar
Sadaharu
Posts: 336
Joined: December 13th, 2017, 11:39 pm

Re: BfW is a game that relies on save-scumming too much

Post by Sadaharu »

(hopefully this counts as productive)
The_Gnat wrote: February 26th, 2019, 6:24 amP.S. -
I made a feature request for allowing you to simulate an enemy attack on your units so you could more easily check that kind of thing before your turn was over, but it never got implemented.
That is a great idea! :D
For simulating enemy attacks don't we have (as a starting point at least) Ctrl+v?
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Support showing CTH histogram from enemy point of view

Post by beetlenaut »

Sadaharu wrote: March 1st, 2019, 4:38 am For simulating enemy attacks don't we have (as a starting point at least) Ctrl+v?
I want to know what chance a unit has of being killed on the enemy's turn. Ctrl+V doesn't tell you that.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Sadaharu
Posts: 336
Joined: December 13th, 2017, 11:39 pm

Re: Support showing CTH histogram from enemy point of view

Post by Sadaharu »

I did say ‘as a starting point at least’. If you want a mod to calculate that specific thing I suppose it could be done, but Ctrl+V is good for a rough guess.

Of course then, if you have a truly random number generator it's all up to chance anyway.
Mawmoocn
Posts: 154
Joined: March 16th, 2019, 3:54 pm

Re: Support showing CTH histogram from enemy point of view

Post by Mawmoocn »

beetlenaut wrote: February 28th, 2019, 5:15 pm The damage calculations should be based on the time of day it will be on your enemy's turn, which will not necessarily be the current one.
There’re errors that can be improved and I apologise for bringing this up and I hope you understand.

I think it would probably be unnecessary? I’ll try to explain.

One turn consists of players/AI participating as different teams.

Every side, gets a "turn" to act freely.

The truth is, "one" turn consist of many "turns", if you consider all teams that will get a turn, inside a "turn". In multiplayer, side turn is necessary(???) and directly affects team play.

Retaliation can be considered as an "attack" that you have "no" control, since attacking your unit, is decided by your enemy.

Day of time will not change in an opposing or allied side "turn". It will only change after the last player/AI ends their turn.











Disclaimer: The following words I’ll say is a hypothetic idea that’s related to unit team risk management.

Histogram from enemy point of view, works best for 1 vs 1 fights.

Risk of death calculation, hypothetically depends on multiple factors that are outside of 1 vs 1 fights.

Calculating chance of death for a team fight would be different, and can’t be calculated if certain procedures aren’t met.

Battles inside a map or scenario, involves various units of team composition.

The main reasons for unit death, are as follows:

1. Surronded by a large number of hostile, enemies or units.
2. Lack of hit points.
3. Inadequate resistance against damage type.
4. Special abilities or mechanisms, that temporarily increase damage.
5. Units that naturally have high innate damage.
6. Units that naturally have low terrain evasion rate.
7. Vulnerabilities of a unit to damage type.
8. Lack of map cover to use terrain evasion or hazardous unit placement in a map.
9. Units and special abilities or mechanisms, that will increase or alter accuracy.
10. A combination of the things listed above.

Based on the things listed above, I made a hypothetical suggestion.

The basis for this are the comments and the feature (#3961), which highlights hostile units that can attack within the range of a friendly unit.

To calculate risk of death for team play this is my suggestion.

Position risk assessment based on total damage enemies inflict

Suggestions

1. Hypothetical calculation
2. Slow unit damage calculation modification if the unit can retaliate slow
3. Highlight color (red), adjusts based on chance of death of a friendly unit
4. Toggle for total amount of damage or percentage
5. Zone of control influence and ignored zone of control (best possible enemy moves)
Spoiler:
Consequence
Spoiler:
I’m willing to answer or clarify questions if I have time and if it’s possible to answer.
User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: Support showing CTH histogram from enemy point of view

Post by pauxlo »

Mawmoocn wrote: May 12th, 2019, 1:31 am
beetlenaut wrote: February 28th, 2019, 5:15 pm The damage calculations should be based on the time of day it will be on your enemy's turn, which will not necessarily be the current one.
I think it would probably be unnecessary? I’ll try to explain.

One turn consists of players/AI participating as different teams.
[...]
Day of time will not change in an opposing or allied side "turn". It will only change after the last player/AI ends their turn.
Example: In a two-player game, if you are Player 2 and it is currently dusk, the next attacks of the enemy (player 1) will be at first watch, which is a different time of day. If you want to know how probable it is that your unit survives, the damage output of the enemies in the next turn is important.

That is what Beetlenaut was targeting in the quoted comment.
Post Reply