0
\$\begingroup\$

What i would like to achieve is to have 1 global 2d map where armies could move (Scene 1). When they collide, trigger loads new scene, setup parameters like army size etc (Scene 2). Once battle is finished, I would like to close scene2 and load again scene1. I implemented this and had bad feelings about setting up Scene 1 into the same position as i left it(I used singletos for this). Wouldnt it be better approach to hide Scene1, so all data will be consistent and once scene 2 is finished, show it again? Is it possible and is it good idea?

Another way I was thinking about was to create scene3 which would contain all important data needed for scene1 setup. So when I move from scene1 to scene2, i can destroy scene1. Once I finish scene2, I would start scene 1, which has its data inside scene 3 so scene setup would be done out of the box without defining some special scene init scripts.

Honestly I could not fight any proper solution for scene management, only tons of basic tutorials

\$\endgroup\$
  • \$\begingroup\$ Presumably you started by searching for your question and found existing answers about ways to do this. What specific problem have you encountered putting these solutions into practice? \$\endgroup\$ – DMGregory Apr 23 at 13:42
  • \$\begingroup\$ I did already read those questions before i asked new one and also I did already test those methods, but it seems to me that this helps only if you would like to transfer some smaller data, not whole scene setting which could contain 300 parameters on different objects. The main question was if it is good idea to hide scene/have important data in 3rd scene \$\endgroup\$ – Eleer Apr 23 at 13:49
  • \$\begingroup\$ Did you test it, and did it work? If it works, it's a "good enough" idea to get the job done. If it didn't work, then ask about how to fix it. \$\endgroup\$ – DMGregory Apr 23 at 13:53
  • \$\begingroup\$ Ok, so should I be using "it works" sollution instead of best one for me and after 3 months scrap whole game coz I used bad pattern? \$\endgroup\$ – Eleer Apr 23 at 14:01
  • \$\begingroup\$ If you can't see 3 months into the future, neither can we. There are very few cases in game development where there's a universally-agreed "best" solution. So "does it work?" is often our best guide. Is there a particular problem with your approach that you're worried will break in 3 months, that we can help you solve proactively? \$\endgroup\$ – DMGregory Apr 23 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.