OK.
I’m a Blueprints (BPs) type of person. I can do C, C++, etc; I just don’t like to. The visual nature of BPs appeals to me.
That being said, I imagine that you:
- have a list of objects by size and other characteristics
– those characteristics also include the xyz vector in space and the vector of motion?
Unreal is primarily a visualization-engine, not really for ‘hard computing’ so I am going to take the track of assuming this is all for a game/visualization, etc. Where the math has to work, but it’s under the umbrella that this (strongly) needs to be shown to someone(s). Not that it cannot do a lot of stuff in a performant way, but it was strictly just orbital mechanics, I’d think there is likely a better app/environment for that.
Regardless, to that end you are likely going to want to make an object that has some data stuff (enumerations, maths, structures around it’s position, etc) that could be coupled with a mesh to be popped into the visual. Same for your spaceship, etc.
The concept you want here is objectification, that all the orbital-bits are essentially the same when described mathematically, they all have mass, position, vector of motion, etc. Make ONE object that can roughly describe that orbital-bit and then populate them based on their positions, animation along vector of motion. Within that, your special object, your spacecraft, would be a child of the orbital-bit; have all the same parts but something extra (the controls for finding a path, etc).
Functionally, for the visual, since you don’t want to make it crawl, you want to leverage something called an instanced static mesh. You can pick a mesh and instead of making a bunch of copies, you can send that 1 mesh and a list of transforms (it’s a triplet of the scaling, position, and rotation of the object, 3 3-vectors). This is the performant way of doing it vs sending X-meshes you send 1 mesh and a list of x-transforms.
ref: UE4 Optimization: Instancing - YouTube
Math-wise, insofar as how you calculate safe-distance, how long to burn, etc, you can always do it the way you really need to. If, for example, you really have a need to iterate through ALL orbital bits as compared to the spacecraft, then you will just have to do that. Can be done in BPs or C++ if you want. Functionally within Unreal, like all dev-environments, there’s more than one way to skin any particular cat. From a simple iterate-the-array/list to a more gamified, run a sphere-trace for objects within a certain distance and use logic based on that. Something in between, I really don’t know what you might need here in particular, but I can say there’s going to be a path you can build.
There’s a lot more to this, but that might be a start?
Lastly, mechanically, inside Unreal, the video above is as good a place to start as any to get a sense of what the environment is about. Right-click is your friend. Right-click inside the content-browser to make new stuff; things like structures & enumerations are listed under the Blueprint flyout. Inside a blueprint, as you can see in the vid, it gives you all the context stuff you need; I learned as I went this way as UE4 is a pretty dev-friendly thing. Control-z/x/c all work in most places and you can even copy/paste functions from one BP to another (click to select, control-x/c, and control-v in the target BP); very objectified. I can’t tell you how many times I went “I wonder if does that…oop, there is, yup, thanks again Epic…”.
If you are getting involved with the C-side of things, you are on your own there, I’d suggest the official docs to get set up, etc.
Just to ask, do you have any coding experience in general and are just new to Unreal, or new-new to programming in general?