Homeworld style rts control

Hi folks! Does anyone know of a way to implement vertical movement in an rts setting, i.e. Homeworld style unit movement?
I have successfully set up my RTS camera and 2D movement, but I’d like the ability to move selected units up/down in the vertical space.

Any ideas?

assuming 3d like actual space you could just

  1. vinterp actor location
  2. use physics based apply an impulse towards the target on tick

these wont include pathfinding or avoidance but they’re potentially much easier in space

Mmm… that could totally work. I’d like to try and avoid physics based thought as I use time dilation as an alternative to real-time with pause, and physics stuff causes issues with that.

Alternatively, I was thinking that I could intersect the level with a horizontal plane and calculate the plane normal at the mouse pointer, the use that to calculate movement in the z-axis. I guess I could do that by just using X-Y coords and doing the same calculation, in lieu of having an invisible intersecting plane.

I’m surprised nobody has cracked this one tbh, and RWTP. Seems like RTWP is in every tactical games these days.

image

You can have an imaginary surface to trace against at any angle and placed anywere. It’s a pretty common thing to do, indeed. Trace from the screen center towards the mouse, the trace will intersect the plane giving you the desired intersection. To visualise it:

Hi @Everynone, I found this method and it appears to be similar to the method you suggested. However, I can’t get it to work with my RTS camera setup.

Have you seen anything like this before, and have any idea of how to get it working, even with a simple pawn?

Any help would be awesome.

  • for a horizontal plane:

  • for a vertical plane:

  • we trace against horizontal unless a modifier key is held:

More is needed to make it better. You could restrict axis for vertical adjustment like in @pezzott1’s example. Debug:

Thanks @Everynone! I’ll give this a shot. One thing I am not clear on though is how to integrate this into the player controller, which contains all the camera movement logic and inputs?

I’ll try this first and see how far I get.

1 Like

Interestingly enough, this does very much belong in the PC:

Get rid of these and you should be done. The rest of the nodes are agnostic. This:

Would probably be the currently selected Unit that you are commanding.

@Everynone Looks like I got it half working (not sure what’s going on… maybe it’s because I am using a camera that can rotate, zoom, etc?):

Here’s my player controller BP:

https://blueprintue.com/blueprint/i9079jnx/

Unlikely.

There are caveats and special cases that need handling, ofc. The above is NOT a complete system. Like going over the horizon - running out of the horizontal plane to trace against:

You can’t hit the green mark using the horizontal tracing… You may want to switch to another far away vertical plane to trace against - that’s why those functions spit out booleans. Print them to see which one fails. And handle the fail in some way. What is supposed to happen if we select a nav point outside of the playing field?

Besides, the above is set to 25000uus - 250 meters. Wiggling the mouse like that may simply take the whole thing too far. Up it a bit, print values.

If you want to continue with this (duh, ofc, we’re just starting), do ensure you wrap you mind around what this script is doing. It’s a really versatile set of nodes with countless application. Draw more debug to figure out what is what.

3d flying navigation is no joke. :expressionless:

Thanks so much for the help and feedback! I really appreciate it!

I’ll play around with debugging and see what’s going on.
In theory I could give my levels HUGE bounding boxes, and they could act as planes to trace against perhaps?

This mechanic is central to my game, as you need to be able to bounce in and out of fps mode to direct units in 3d space, so I’d love to crack this :slight_smile:

I guess another aspect is that I am using pawns, not characters, since all my units are ships, not people, so they don’t need much of the functionality that the character class has. They’re using 6DOF movement instead.

Yeah. That’s going to be 10x as hard as moving a character on a navmesh… :smiley: You will either write it from scratch or buy a super duper complex plugin.

I mean, moving is easy. Pathfinding and avoidance is not.

In theory I could give my levels HUGE bounding boxes

You could but it would be kind of useless:

You want to trace here - not 2.5m uus away. Essentially, if you run ouf of horizontal plane, you trace on the vertical. And revert it when you reach the horizontal again. Now you have box without having a box.

Ah right! Okay, that makes sense.
What’s super weird is that the blue trace doesn’t move at all when I move the mouse, but when I press the alt key, the green trace moves in both Horizontal and Vertical, like it’s confused.

Well, that’s how it’s set up atm - it moves in YZ.

The script is just a stub. You need to add more stuff to make it work the way you need.

Ah got it! :+1: