10
\$\begingroup\$

How can I handle the click-and-move in a complete 3D space? It is easy to handle on a 2D plane by a simple raycast, but this is not the case in 3D since there is no end-plane for a raycast to get an end-point.

I have two ideas in mind:

  1. Do raycast, then allow player to select distance on the ray by another input (mousewhell, for example).
  2. Instead of complete 3D, have multiple "layers of height", so player can change the height layer before ordering the move.

What are your thoughts?

\$\endgroup\$
4
\$\begingroup\$

Breaking movement in two steps is an outdated approach.

Mouse movement for the horizontal plane. Mouse wheel for vertical plane.

Homeworld did a fine job, but mouse wheels weren't so widely deployed yet so they didn't go with that.

You can still have modifier keys to switch mouse movement between the modes but moving the mouse and scrolling can be done simultaneously thus is the most efficient method for the hardware. In homeworld you set the planes in sequence one after the other which slows you down. Not to mention you are only slowed down in moving to empty space. Moving to object automated the trajectory.

The other ways to do it simultaneously are two hands on the keyboard or twin stick controls.

If your fluidity of movement depends on speed, doing and extra step can kill your flow. Homeworld fits its system because it doesn't matter if you waste an extra second or two in issuing your move order, and you can be sure they factored that consideration when they built the pacing.

P.S. Zooming placement:

If zooming isn't a central mechanic and you don't need to keep it as robust as possible it can be offloaded.

Handle zooming the same way the original "Black and White" game did. Zoom by mouse movement + Mouse button hold (where the button is just the function modifier between map move and map zoom). The gametesters I've used all agree it "feels" to be the best zoom. I would recommend holding both mouse 1 and mouse 2 while for the zoom mode (exactly as B&W did) - but technically one of them would suffice if you don't have a conflict.

I've often recommended to people to install the game to try it. Add the keyboard usability and its the most useful and comfortable mechanic to date I've seen for large map navigation.

Now, this of course is not common default and you have to damn well make sure it is explained to your users at least a few times. But once people get it they are very comfortable with it. Besides you are teaching folks navigation in 3d. You are bound to venture out of the 2d controls comfort zone any way.

If your mouse is too overloaded with controls you can always use a modifier keyboard key or middle mouse button. Optimal configuration would really depend on your game flow.

\$\endgroup\$
  • \$\begingroup\$ This answer actually fits better in this scenario. But how should I handle zooming if I use mousewhell for this purpose? It would be too inconvinient to handle zooming via keyboard. \$\endgroup\$ – S. Tarık Çetin Jul 22 '16 at 19:06
  • \$\begingroup\$ @S.TarıkÇetin updated. \$\endgroup\$ – helena4 Jul 25 '16 at 11:40
9
\$\begingroup\$

Break movement into two steps

  1. Select a position on a 2D X/Z plane located at the entity's current Y position.
  2. Set the offset (up or down) from that plane.

This is similar to how Homeworld, one of the first 3D space RTS games handled movement. Works really well.

Breaking movement into two steps provides the most control, simply because the mouse is a 2D input device. It can only provide a position on one plane at a time. The same could be achieved by binding two keys on the keyboard to be the up/down in the Y axis.

Alternatively, you could use the right mouse button to toggle the mode. For example, left click starts the move command and moves the target on the X/Z plane, holding the right mouse button switches to altering the Y axis position.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ So far, this seems the most logical option. I will wait though, in case somebody comes up with a better idea. \$\endgroup\$ – S. Tarık Çetin Jul 19 '16 at 18:12
2
\$\begingroup\$

Do what EVE online does: Don't allow click-and-move! Note

What they do is that they create objects in space, and allow you to right-click on them (raycast or what-not), and select one of different options:

  • Go to object (with different speeds)
  • Rotate about object (at different radii)

This allows you to only move to relevant places.


Note (They might have changed that lately, though. Haven't played for a while.)

\$\endgroup\$
  • \$\begingroup\$ Yes, this solves the problem, but also destroys the aspect of the game which creates this issue in the first place. \$\endgroup\$ – S. Tarık Çetin Jul 19 '16 at 18:09
  • \$\begingroup\$ @S.TarıkÇetin Yep! Maybe in their case this was the most logical thing to do. And maybe it does not apply to your situation. \$\endgroup\$ – Vaillancourt Jul 19 '16 at 18:10
  • \$\begingroup\$ From what I remember, you could actually click to move in Eve. It was more of a picking a direction type thing, \$\endgroup\$ – MichaelHouse Jul 19 '16 at 18:17
  • \$\begingroup\$ There are keyboard controls in Eve that you can use to steer your ship, but when doing this you're restricted to tactical speeds (e.g. flying from a space station that's in orbit around Planet X to a satellite that's also orbiting Planet X might take a minute or two; flying to Planet X's moon via manual control will take at least 5 minutes). High-speed travel can only be initiated by selecting a destination. \$\endgroup\$ – Dan Henderson Jul 19 '16 at 21:27
  • 3
    \$\begingroup\$ There's a technique for evading pursuit based on this - start flying to a distant target, stop halfway there, then choose a new target in a different direction, and again stop halfway. Drop a "bookmark" at this isolated location, and then you can fly to this bookmark when attacked and your pursuers won't be able to fly at high speed in the same direction. \$\endgroup\$ – Dan Henderson Jul 19 '16 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.