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

Added drag direction mouse interaction for set the approach direction for airstrike and parabombs #15226

Merged
merged 2 commits into from Apr 4, 2019

Conversation

@teinarss
Copy link
Contributor

commented Jun 10, 2018

This PR will update the WorldInteractionControllerWidget with support for drag a direction that could be used for setting the direction for AirStrike, Parabombs and similar stuff. It also updated the AirStrike Power to use this direction.

Fixes #4873

Open discussion around #14181
One idea I have is to make the plane spawn equal distance from the target location regardless of the location of the map. Problem is to make it look good with when it spawns inside the map boundaries. I tested a bit with making the plane approaching from higher heights, but I'm not sure if its the best way to do it.

@pchote

This comment has been minimized.

Copy link
Member

commented Jun 12, 2018

I'm really excited by the idea of this, thanks for taking it on after such a long time!

Unfortunately I don't have time to do any serious reviewing for the next couple of weeks, so I can't leave any detailed comments. At a broad level, I have one big request about how the input for this should work, which I was absolutely convinced that I had written up in that issue a long time ago, but it must have been somewhere else (the forum or IRC): Instead of having a rendered line (which IMO isn't very intuitive or polished) we should keep the standard cursor and have the default click action keep a random direction. If the user drags outside of a defined dead zone we should switch to the scroll arrow cursors and draw the default targeting cursor manually at the target location. This then lets the player select one of 8 directions for the plane.

@pchote

This comment has been minimized.

Copy link
Member

commented Jun 28, 2018

I haven't forgotten about this, but need to focus my OpenRA-time on tasks for the playtest.

Have you had a chance to think about solutions for my comments above?

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Jun 29, 2018

Hi Pchote, I'm guessing that you mean this cursor?
image
I will start looking at the changes for the cursor this weekend.

And I agree on the changes on the IOrderGenerator, I think i need some more input to come up to a better solution.

@CatGirls420-NerevarII

This comment has been minimized.

Copy link

commented Jun 30, 2018

If you're worried about aesthetics, a simple function to call the distance from the closest border/border point, to the target location, aligned with the direct the player chooses, the bombers could then fly in from the border, in the direction of choice, as close as possible to the target location, dependent on the alignment.

Example Picture: https://imgur.com/a/Yhkt4L7

The problem with a single click drop, is that the direction cannot be chosen as desired.

The red lines show the desired target location and direction, towards the x mark.

The green lines show the path that will be taken.

As you can see, if the player chooses a direction that would cause the planes to fly in from the farthest point in that alignment, the planes code would simply switch/reverse the path taken, so they still come in from the closest point, while following the chosen, desired alignment.

The only problem I see, is getting past enemy air defenses way too easily, but at the same time, it's a support power, which should help change the tide of battle a bit.

@pchote

This comment has been minimized.

Copy link
Member

commented Jun 30, 2018

Hi Pchote, I'm guessing that you mean this cursor?

Indeed. The implementation I have in mind is to change the cursor to an invisible placeholder on mousedown, and draw the cursor manually at the mousedown location using IOrderGenerator.RenderAboveShroud. This allows you to fix the cursor in the original location while the player moves the pointer. Nothing changes if the (invisible) cursor position remains within a few px of the down location - the white circle on the action cursor seems like a reasonable boundary for the dead zone. If the cursor moves outside this deadzone then we quantize the direction into one of the 8 facings, and draw the appropriate arrow cursor next to the targeting cursor (again at a fixed location, keeping the "real" cursor invisible).

screen shot 2018-06-30 at 13 27 54

@chrisforbes chrisforbes added this to the Next + 1 milestone Jul 29, 2018

@chrisforbes

This comment has been minimized.

Copy link
Member

commented Jul 29, 2018

@teinarss ping?

@pchote pchote modified the milestones: Next Release, Next + 1 Oct 26, 2018

@teinarss teinarss force-pushed the teinarss:airstrike branch from e38c782 to 9d69424 Mar 6, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

Updated: still wip but would like to have some input on the changes in WorldInteractionControllerWidget.HandleMouseInput(...) mostly if we want to move some of the logic into IOrderGenerator implemention.

@teinarss teinarss force-pushed the teinarss:airstrike branch from 9d69424 to 02e786e Mar 6, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

rebased

mods/cnc/cursors.yaml Outdated Show resolved Hide resolved
@pchote

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

I'm confused about what to comment on. Most of the code seems to be missing!

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Mar 9, 2019

@pchote

This comment has been minimized.

Copy link
Member

commented Mar 9, 2019

The pushed code doesn't have a selectdirection order generator!

@teinarss teinarss force-pushed the teinarss:airstrike branch 2 times, most recently from ce04f38 to 140dedd Mar 9, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

Updated: Made the changes to OrderManagers and added support for RA.

@teinarss teinarss force-pushed the teinarss:airstrike branch 2 times, most recently from 290a968 to 945b8bc Mar 14, 2019

@pchote
Copy link
Member

left a comment

A few more thoughts, nothing too major (hopefully).

mods/ra/cursors.yaml Outdated Show resolved Hide resolved
mods/cnc/sequences/misc.yaml Show resolved Hide resolved

public string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
return startedDragging ? "invisible" : cursor;

This comment has been minimized.

Copy link
@pchote

pchote Mar 24, 2019

Member

This seems to be returning "invisible" slightly too early - I see a flash when clicking where neither real or fake cursor are visible.

This comment has been minimized.

Copy link
@teinarss

teinarss Mar 26, 2019

Author Contributor

Could it be that this is caused by that we have two animations playing which are not in sync?

@teinarss teinarss force-pushed the teinarss:airstrike branch from 945b8bc to 6459879 Mar 26, 2019

@pchote

This comment has been minimized.

Copy link
Member

commented Mar 30, 2019

Can you please split the OrderGenerator changes into its own commit before implementing the direction changes?

@teinarss teinarss force-pushed the teinarss:airstrike branch 3 times, most recently from eba8797 to afb2f7e Mar 30, 2019

mods/cnc/sequences/misc.yaml Outdated Show resolved Hide resolved
mods/ra/sequences/misc.yaml Outdated Show resolved Hide resolved

@teinarss teinarss force-pushed the teinarss:airstrike branch 2 times, most recently from 59b1cbb to 2bd62ee Mar 31, 2019

@teinarss teinarss force-pushed the teinarss:airstrike branch from 2bd62ee to 7fc3324 Mar 31, 2019

@pchote

This comment has been minimized.

Copy link
Member

commented Mar 31, 2019

Regression: the "Select Target" audio notification no longer plays in at least RA. Otherwise LGTM.

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

@teinarss teinarss force-pushed the teinarss:airstrike branch from 7fc3324 to 5f3f6aa Mar 31, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Mar 31, 2019

Regression: the "Select Target" audio notification no longer plays in at least RA. Otherwise LGTM.

Should be fixed now

@pchote pchote added the PR: Needs +2 label Mar 31, 2019

@matjaeck
Copy link
Contributor

left a comment

When you drag above the sidebar, the cursor stays in "direction" mode after mouse up, but another left mouse button input will set a new airstrike order.

airstrike

@teinarss teinarss force-pushed the teinarss:airstrike branch from 5f3f6aa to 788a686 Apr 2, 2019

@teinarss

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2019

Should be fixed now!

@reaperrr reaperrr merged commit 71596ae into OpenRA:bleed Apr 4, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@teinarss teinarss referenced this pull request Apr 11, 2019
@reaperrr reaperrr referenced this pull request Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.