I've been tinkering with an idea for a space sym, kind of like MOO2, writing it for mobile or browser as a way to learn Java. Command ships and control planets, etc. I'd love to make the game in 3d, with x, y, and z coordinates to make things more realistic, but I'm afraid that it'd be too much to implement. The engine wouldn't be any harder to code, just add another vector to the calculations, but a user interface for navigating a 3d galaxy is more difficult. I'd prefer to keep the graphics simple, without a lot of hardcore rendering for different angles.

Does anyone have any experience designing a UI for directing units in 3D? If I decide to go the 3D route, how should I have the player control the 3rd coordinate (the one that would come out of the screen)? Is there a method that would allow a player to easily tell the ship how far "back" or "forward" to travel in addition to the usual up/down, right/left?

  • 2
    \$\begingroup\$ It sounds like you might want to do some research, watching gameplay videos of games with 3D control of units, to get a feel for what techniques are available and what conventions are popular. You don't need us to do this - there are plenty of videos on YouTube you can go watch directly, rather than have someone relay the info to you second-hand. \$\endgroup\$ – DMGregory Sep 19 '19 at 3:03
  • \$\begingroup\$ Java has some good 2D engines to make games with, and those are a great way to learn the language. There are some 3D engines for Java too... but you'll likely wind up spending a lot more time learning how to use these specific engines than actually learning Java. Java is one of my favorite languages but it's not a great language to develop 3D games in. Due to the way it works with runtime compilation and an interpreter, the demand 3D games require has lead to a very limited set of tools for 3D gamedev. If you're just starting out, maybe start with 2D games. Slick2D is great for learning Java. \$\endgroup\$ – Batman Sep 19 '19 at 4:31
  • \$\begingroup\$ Galaxies are 2D※, you might not need 3D. ※: They have a fractal box (Minkowski-Bouligand) dimension that approaches 2 at some resolutions. I'm saying they mostly spread in two dimensions if you do not look close enough, ok? \$\endgroup\$ – Theraot Sep 21 '19 at 15:32

The way you control your spacecraft depends a lot on how the camera works.

If the camera is at a fixed angle and looking at the game scene in an overhead perspective, your best solution would be having the directional-pad or control stick to move forward, backward, left and right, then have a couple separate buttons for ascent and descent. So left and right on the pad/stick would affect your X position, up/down would affect your Z position, and Y would affect your ascent/descent (however, depending on the game engine, Y and Z may be swapped).

If the camera is following behind the spacecraft, you would have the pad/stick to tilt left and right, ascend and descend. Then you'd have buttons for acceleration/braking. This is more of an space action game style (think games series like Star Fox).

As for UI, you'd have either a circle pad or directional pad for mobile, which works for both styles mentioned, and you'd have additional buttons for ascent/descent (or acceleration/deceleration).

In summary, with a fixed-angle camera, the forward and backward (coming out of the screen) would be your up and down, and the ascent and descent would be different controls. With a camera that follows behind the player, you would have buttons for acceleration and deceleration.

| improve this answer | |
  • \$\begingroup\$ This would be fixed angle, with a sort of top-down, broad view of the map. I like your idea of having a way to zoom in and out to place the coordinates. Is that kind of system easy for players to manage, though? It seems like it would be rather difficult to decide where to send a ship in the third dimension, even if placing the order were a simple slider or button. How do you visualize how far away to send something? It would be frustrating to send your forces to the right x and y coordinates to counter your enemy only to get the z wrong and send your ship to the wrong side of the map. \$\endgroup\$ – CMB Sep 20 '19 at 1:51

You should really think of good reasons why your game would benefit from a 3rd dimension other than realism. That is if realism isn't your selling point like it is for simulation games. In my opinion realism is only important if a lack of it breaks immersion in a big way. You can also try to think about why this was or wasn't used in other games.

As for how it's done you should do some investigating by analyzing how similiar games did it. The only game that I personaly played and that did this is EvE Online. While there are 3 Axis in EvE, players don't actually navigate arround space by issuing the so called 'Approach point x y z' command that often. But instead go with commands like:

  • 'Approach station'
  • 'Keep distance of 2km to Ship x'
  • Or 'Orbit asteroid at 500m' By holding the respective hotkey and clicking on the station/ship/asteroid and using default values or select a specific one like 1,5km)

But 'Approach point x y z' is vital in some pvp scenarios where out maneuvering can easily win you the fight. In EvE this basically works with 2 mouse clicks:

The first is for selecting the distance that you want to travel on the x y plane and an axis A (which is orthogonal to the path of travel) by selecting a point on the x y plane.

Moving the mouse after the first click then rotates a line (indicating the path of travel), starting from your ship and pointing to the point where you first clicked on the x y plane, arround the axis A. So moving the mouse after the first click determines how much you travel on the z axis (+z beeing up). The command is executed after you click a second time.

I'll link/upload something to illustrate this once i have access to better internet, since my explanation sounds a bit too complicated and this actually is kind of an intuitive way of doing it.

| improve this answer | |

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.