Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow previewing enemy attacks #3956

Open
wants to merge 2 commits into
base: master
from

Conversation

@jostephd
Copy link
Member

commented Feb 28, 2019

@beetlenaut https://forums.wesnoth.org/viewtopic.php?f=12&t=49404

This allows simulating enemy attacks in planning mode. Select an enemy unit and mouseover an own unit, you'll see a blue attack indicator arrow similar to the usual red one, and if you have highlighted_unit_weapons or selected_unit_weapons in your theme you'll see the CTH histogram in the sidebar.

(See https://forums.wesnoth.org/viewtopic.php?f=12&t=49404&p=639014#p639014 for how to add those to the theme and https://forums.wesnoth.org/viewtopic.php?f=12&t=49404&p=639014#p638934 for screenshots)

Known issues:

  • account for the timeofday changes between your turn and your enemy's
  • (should be done, but test) it should be possible to get the blue arrow and histogram even when not in planning mode
  • check the if(!wb_active) restrictions if they can be relaxed/lifted
  • reword commit messages
  • Figure out attack indicator arrow coloring issue #3956 (comment)
  • Let the attack dialog be opened so the CTH histogram can be viewed in the default theme too #3956 (comment)

Please review/test

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

Regarding the second commit message, if I understand correctly what that does, I wouldn't call it planning the enemy's move.

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2019

Does this only allow simulating one attack or does this allow adding planned enemy moves/attacks ?

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Mar 1, 2019

@CelticMinstrel Yeah, I need to reword both commit messages.

@gfgtdf The former.

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Mar 8, 2019

I think there's a problem with the attack indicator arrow's color.

In master, the attack indicator arrow is always red. This PR as it stands uses a red attack indicator for your own attacks and a blue attack indicator for your enemies' attacks. That works very well for side 1, but not so much for side 2. If you play side 2 then blue is your team color and red your enemy's team color, so using red for your own attacks and blue for your enemy's is literally the most confusing color scheme possible.

I'm not sure what to do. I suppose we could try to draw magenta attack indicator arrows and then properly team color the attack indicator arrows, so instead of "the viewer's arrows are red and everyone else's is blue" we'll have "side 1's arrows are red, side 2's arrows are blue, etc". Regardless of which side you play, side 2's attack arrows will be blue. Any other ideas?

UI: Allow attack indicator arrows to be drawn for enemies' possible m…
…oves

Attacks by the enemy are shown with a blue attack indicator arrow. This
is useful in conjunction with the selected_unit_weapons ThemeWML report
that shows the CTH histogram in the sidebar.

See https://forums.wesnoth.org/viewtopic.php?p=638934#p638934

@jostephd jostephd force-pushed the jostephd:enemy-cth-histogram branch from bf31836 to 690e69e Mar 8, 2019

UI: Enemy attack indicator now render the sidebar in the enemy's turn
This only matters when if your enemy comes before you in side order.
For example, if it is currently side 2 turn 10 and your enemy is side 1,
the sidebar will show the statistics (time of day, alignment, attacks,
etc) as they will be on turn 11.
@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

Does ~RC(ellipse_red > blue) (for example) work on the arrows? Even if it doesn't, I imagine it'd be easier to convert them to the ellipse palette rather than the magenta palette.

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Mar 9, 2019

Sort of. This is the original: https://raw.githubusercontent.com/wesnoth/wesnoth/1.14/images/misc/attack-indicator-dst-n.png
And this is with ~RC(ellipse_red>blue):
ellipse_red-to-blue

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

I see... wonder if fixing that is as simple as what I did to fix the hero ellipse. It's been a looooong time, but if I recall correctly, the red pixels (or at least some of them) weren't quite pure red, so I just masked out the other colour and then it worked. It might be a bit trickier for the arrow, since it looks like some parts aren't red at all...

@jostephd jostephd changed the title Sidebar: Allow planning attacks by enemies Allow previewing enemy attacks Mar 10, 2019

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Mar 10, 2019

Thanks, CelMin. Before I look into this (or, what's more likely, ask the art forums for help), does anyone have any other feedback about the change? If there are objections to the core change I would rather figure them out now before spending time getting the art right.

@jostephd jostephd removed the In-progress label Mar 10, 2019

@ProditorMagnus

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

I would rather have option to open the usual attack dialog (with weapon choice discarded after). Sidebar solution seems like it will only fit to screen in rare cases.

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Mar 21, 2019

I guess a version of the attack dialog with the "Attack" button disabled would work, right? I think GUI2 does support that (look for set_active or something like that).

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Mar 21, 2019

Good idea. Added to the todo list in the first post.

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

i'd say we can close #1070 if this gets merged.

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

looks good to me but travis failed

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2019

#1070 asked for seeing the result of an engagement between any two units. This PR only allows to simulate battles that an enemy unit can engage in in its next move; this PR can't be used to simulate an attack by an enemy unit on a friendly unit that's two turns away from the enemy unit (say, 7 hexes away if the enemy unit can move 5 hexes this turn). Neither can this PR be used to simulate an attack by an enemy unit on a friendly unit that's screened by other friendly units (unless one moves the friendly units first, but in some siege scenarios that's not possible). Can we close #1070 regardless of these limitations?

The travis error isn't my fault, is it? It's only one build and the cause doesn't seem to have anything to do with my changes.

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2019

Yes actually the 'looks good to me but travis failed' was meant to go into #3997 oups was already wondering why it was missing there

@jostephd jostephd removed their assignment Jun 14, 2019

@jostephd

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

Unassigned myself as I'm not actively working on this. Feel free to take over, the todo list is in the first post.

@jostephd jostephd referenced this pull request Jul 20, 2019

Closed

Add the asymmetric theme? #4184

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.