- Home /
Different scenes or single scene for a space rpg ?
Hi.
I know the question has been asked a lot, but every time it was for platform game, meaning different levels so people were answering that it would depend if the scene needed to be manually crafted or could be code generated.
For my case, i'm looking for an answer for a space rpg / management game.
Right now i went the multiple scene road (which i usually don't). I have a scene for the galaxy map, one for sector map, one for character information and some will come down when needed.
Here are the pros/cons i see :
Single Scene :
pro : Loading panels and information screen seem a little faster, since everything is already present and just need to be enable or disable. Also, easier to use the editor since i don't need to switch scene every time i need to adjust something. Moreover, since it is mostly UI, i don't need to resupply the same top menu, background and everything for each scene. con : The bigger the game would get, the more complex the scene will be in the hierarchy and i fear it will be end a complete mess, in the editor at least.
Multiple Scene:
pro : Better organisation, i can give each scene it's own manager (could do the same with a single scene, but make more sense here). con : Transition is not that fluid (i'm talking about something like 250-500ms delay though, not dramatic but noticable).
Now, before i keep adding scene, i want your feedback on similar project, did you end up with better performance with a single scene ? How did it went ? What are your advices ?
Thanks for the answers ! Have a nice day :)
Edit : How the hell do we insert space between lines :o
Answer by Shemamforash · Jul 19, 2018 at 09:39 AM
I think this depends on your ability and the size of the team really. If you are working by yourself on a what sounds like a fairly complicated game just managing the complexity of a single scene as the game develops is going to become difficult. You can make it work if you do things like save your various menus as prefabs and instantiate/destroy them as they are needed, create a structure for your hierarchy that you stick to rigorously, etc.
Personally, I would probably go the multi-scene route, as it would be easier to manage the hierarchy, and easier to track down where issues/bugs lie.
I worked on a reasonably large 4X game as a personal project. At the time I used a single scene, but the menu system did become unmanageable, and it became difficult to debug specific issues as I had to run through a significant portion of the game just to reach the point where the problem occurred. If I were to do it again I would definitely use multiple scenes for each menu, etc.
My suggestion would be to think about how complex it is likely to become and compare that to your current ability. Remove features you don't need, strip it down to the basics, do some planning, then make your decision. It's not the end of the world if you pick one method and have to switch, but it's better to do it earlier than later as it'll get more and more difficult to split a single scene apart the more your work on it.
Hope this helps you decide!
Since you seem to have had the same experience that i'm about that have, i'll take your advice ! Thanks for answering :)
And yes, i'm going for a reasonable goal for my game, but it will still be cramped in the end if I pick one scene only. Thanks for confir$$anonymous$$g that too !
No problem, hope you have fun with the project!
Thanks ! While i'm at it, and since you have experience in the same area i'm coding in, i got another question for you.
How did you manage your entities locations ?
I explain :
$$anonymous$$y galaxy is divided between sectors. To represent the sector activity, i need to know at some point what ships are in the sector. For that i have two solution.
1- Either i use my variable Location of type Sector that every ship have, so i loop through all ships to find which one are in the sector. It should work at first, but i fear that in the more advanced stage of the game, where more ships will be available, this loop will be costly. I do that once to fill a temporary list available only to the sector the player is looking at. From now on, every time a ship will move, it will send an alarm to check if the ship entered or left the current sector, to update the local List.
2- The other solution is that each sector have a list of ships. The thing is, I will end up with a lot of various size List that will change a lot through the game. I'm not sure this is performance friendly to have the list resize again and again to remove object and add object every 1 or 2 seconds. What do you think ?
3- I could also store a single List of $$anonymous$$eyValuePair, containing ships and their location, in the static Game$$anonymous$$anager. But is that even more efficient than a loop on a List of Ships to check their Location value ?
I got the exact same problematic with stations. They need to know which ships are docked. Sure, their list won't change as often as sectors, but we are still talking hundreds of small list that will change size and content through the game.
Did you encoutered this issue ?
Thank again for your help !
Your answer
Follow this Question
Related Questions
Unity Editor - Scene view not redrawing 0 Answers
How do I switch scenes by obtain a children ui canvas text 0 Answers
How to make the camera render RenderTexture if the camera is in another scene? 1 Answer
Unity performance issues. 0 Answers
Is there a way to activate a timer from another scene? 1 Answer