Hi, I’ve been planning on tackling quite a challenging project basically creating my own space game taking ideas from the many that already exist.
I’m currently pondering a problem:
If I have like 30 different star systems, with warp gates between each… what’s the best way to keep things going on in each star system without it destroying performance?
For example, in starsector, there’s always things going on in each star system even when I’m not a part of that star system. Such as traders moving from one star system to the next, pirates raiding specific star systems, etc.
I’ve thought of a really bad way of doing this, just instancing every level at once and have them play out. But of course this isn’t the best idea lol.
I looked up the World Partition system and I’m wondering if that would be useful? Or if there are other parts of UE5 that would be useful for me as well?
Maybe with the world partition system I can build one gigantic world, and designate subsets of grids to be individual star systems… but not sure if that would be a great idea.
I would create multiple levels of simulation – maybe only two levels. In one level, it’s real actors that walk around, bump into things, and so on. In the other level, it’s abstract. The “what do I want to do” bit is still evaluated for a bunch of actors (“I want to buy goods” “I want to raid ships” and so on.) However, there are no assets loaded, no physics simulated, just desires and outcomes. Perhaps you figure out how long a particular desire will take to fulfill – a travel will take X amount of time for Y distance; a purchase transaction will take T amount of time; etc. And just schedule simulation events based on those times.
When the player enters the system, figure out what the simulation is, and re-inflate the actors based on simulation state. If Trader Bob is 20% of the way from point A to point B, then spawn the ship of Trader Bob that far along that vector. If there’s currently a pirate raid going down, spawn those entities in essentially random-but-plausible locations.
Yeah, this was a thought of mine as well. But it’s really good to see it laid out like this.
Appreciate the input! Most likely this is how I’m going to do it but still open to additional thoughts from others ^^
EDIT:
When you say “Two levels” the first level of simulation will be in the physical star system you’re in, right? Then when you leave the star system, immediately abstract that star system’s information, and initialize the destination star system’s information?
Hey @Scarlet012! Since you said you were open to thoughts from others, figured I’d go ahead and chime in with a little extra information. Starsector is a massive inspiration for me and my games as well, so I’ve got a bit of hands on experience there. You definitely want to go with jwatte’s idea most of the time, as there’s no reason to have the rest of the universe simulated to full fidelity.
The best sims tend to come from being able to take stats and turn them into a fully realized world, even though at the end of the day they are never anything but numbers, that sometimes get a face, mesh, or scenario. Take rimworld for example. The game actually does not actually have pawns or anything outside of the tile you’re in (or viewing). Just some locations which have some values that indicate if they are mad at you or your friend, what they trade, and that’s basically it. Only if you go to their tile do they generate an actual scenario, and that scenario is based on the data from before. But once you’re gone? Back to just being data.
That said, maybe you want to have massive space battles way bigger than would be possible without a data oriented angle? Then the (Currently in beta) Mass system could help out. You know how they say Eve is just a spreadsheet? In reality, it is! But when they have massive battles, all of the entities are actually there. Unreal’s new Mass system is on it’s way to being the gateway to data oriented design. If that sounds like it could be up your alley, keep this link on hand. The system isn’t quite ready for prime time yet, but it’s getting there.
This is actually so sick! I appreciate you chiming in with your own viewpoint.
Yeah, big space battles was a really cool thought of mine. Being able to build up a huge fleet and fighting against an AI fleet (or even a boss of some kind).
This is a really cool concept, will definitely be checking this out. Thanks!!
Which brings up a point: There’s been a large number of two/three hour video presentations out of EPIC, but no text based description to go with them lately.
I find video is a bad way to transfer programming knowledge, because you can’t search it with ctrl-F, and you can’t follow it at your own pace – sometimes, the presenter talks about things that are already known, and othertimes, they go too fast across something that I’ll need to double-click on. Also, it’s hard to copy-and-paste code snippets from encoded video.
But mostly, the ctrl-F is missing (as well as the Google finding the class names when searching.)
Oh trust me I agree, I’m a documentation rat if you’ve seen my posts around, I was just leaving a little reminder that once this is out of beta and has proper documentation, it’ll be a perfect use case for the type of game they were working on.
Understandable, but I’m a programmer at heart so thinking about solving these problems is 80% of the joy of game dev for me haha. I already have a “core gameplay loop” idea but a lot of the core gameplay and enjoyment factors come from this system up above.
A lot of the games I played were good, but they were always lacking something.
Astrox Imperium lacked world feeling… when you’d go into a system it would feel a bit empty. Yes ships would move around… but they’d have no purpose. You’d never see ships warp in. There would be no convoys, or other fleets really. And the worst part are the raiders that would spawn on timers.
Avorion was just frustrating in many aspects (trading was pain, getting money wasn’t super hard just time consuming with mining).
Eve just has tons of ganking.
Granted these games above are not bad games, it’s just no game seems to get everything I like right, so I’ve decided to take my own crack at it. (Starsector is the best space game for me in this regard)
My idea is combining the good ideas from many games and adding in my own flare / features. No matter how difficult the concept is I want to try and build this.