Large Space Galaxy with JME

Hello All,

What is the best way to go about this… I am sure most people have their own ideas… but with what JME has and maybe a few JME plugins if needed what would be the best way to make a large space traveling galaxy game. What about path finding? If I remember correctly JME had some path finding built in? A*? I have been reading about the limits of float types and with this size one will run out of the limits of float even double…

Would one just use the Nodes in JME? Is this a possibility?

Thanks for any ideas and help.

The game world will be its own data structures. Entities, game objects, whatever pattern you want to use. This is separate from JME.

Locations of game objects would be in ‘double’.

The JME visualization part (the scene graph) then loads just the local space around the player and converts the double galaxy positions into local float space as scene graph objects (Nodes, Geometry, etc.) There could even be a separate “far” layer for rendering low-detail versions of ‘really far things’.

This is a big topic. There are many ways to organize such large spaces and they have their own tradeoffs. JME does not force you to pick one over another.

Probably the simplest way is a giant grid where the grid cell IDs are used to look in a hashmap for the objects in that grid cell. Whether this hashmap exists all in memory at once or is loaded from disk as you fly around is up to you… and there are several approaches for that, too.

My open source SimMath library has a Grid class that makes it easy to break up 3D space into grid cells and get their unique IDs. GitHub - Simsilica/SimMath: A double-based math package similar to JME's float-based math classes.

This is very similar to the problem of terrain-based games that allow one to walk infinitely in any direction (like my game Mythruna). Depending on how realistic you want a “space game” to be, it could be very very similar.

(Note that real space scale is incredibly boring, both to look at and to fly around in… so you should decide what your actual sizes will be. Pretty much every “cool scif-fi picture” you can think of with planets/stars/nebula/etc. in it are totally impossible in real scale.)


nothing much to add. Paul explained it enough. Even when you will look for game like X3/X4 they have sectors, and each sector probably single double value is enough. While if you dont want sectors, but just open space, still grids are way to go to avoid accuracy or out-of-bound issues.

You can make only 2d grid(not 3d) since most space sims anyway keep low height difference.