Support showing CTH histogram from enemy point of view
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
Support showing CTH histogram from enemy point of view
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?
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.)beetlenaut wrote: ↑February 26th, 2019, 12:20 amI 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.
Patch:
Screenshots:
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: BfW is a game that relies on save-scumming too much
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
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: BfW is a game that relies on save-scumming too much
Yeah, that would be nice. I'll just recolor the arrow withbeetlenaut wrote: ↑February 27th, 2019, 3:10 pm First, a differently colored arrow so you can see that something different is happening (I suggest blue),
~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.Yeah, it works when the "attacked" unit is a unit on a future/planned location in whiteboard mode.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.)
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: BfW is a game that relies on save-scumming too much
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.
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
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: BfW is a game that relies on save-scumming too much
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...
Re: Support showing CTH histogram from enemy point of view
Just posted #3956, please test
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Support showing CTH histogram from enemy point of view
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.
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
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Support showing CTH histogram from enemy point of view
Thanks for the link. Yes, the screenshots use a modified theme. To test the PR change
I'll see if I can make the blue arrow work outside planning mode too.
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.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Support showing CTH histogram from enemy point of view
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
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Support showing CTH histogram from enemy point of view
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)
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)
Re: BfW is a game that relies on save-scumming too much
(hopefully this counts as productive)
For simulating enemy attacks don't we have (as a starting point at least) Ctrl+v?
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Support showing CTH histogram from enemy point of view
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
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Support showing CTH histogram from enemy point of view
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.
Of course then, if you have a truly random number generator it's all up to chance anyway.
Re: Support showing CTH histogram from enemy point of view
There’re errors that can be improved and I apologise for bringing this up and I hope you understand.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.
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:
Spoiler:
Re: Support showing CTH histogram from enemy point of view
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.Mawmoocn wrote: ↑May 12th, 2019, 1:31 amI think it would probably be unnecessary? I’ll try to explain.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.
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.
That is what Beetlenaut was targeting in the quoted comment.