GameScene: Difference between revisions

reorder sections
imported>Leoetlino
No edit summary
imported>Leoetlino
(reorder sections)
Line 5: Line 5:
Unlike most other subsystems, GameScene is not a singleton: it is a member of the uking::frm::System structure<ref>uking::frm::System::gameScene @ 0x10 (Switch)</ref>.
Unlike most other subsystems, GameScene is not a singleton: it is a member of the uking::frm::System structure<ref>uking::frm::System::gameScene @ 0x10 (Switch)</ref>.


== Init ==
== Definitions ==
* '''GameScene::initialize''' (0x71007A8014)
=== Stages ===
** Load the environment graphics archive ([[Content/Env/env.genvb|env.genvb]])
** Create the GameScene heap
** Create the [[StageBinder]] heap
** Start the GameScene TaskMgr (thread)
** '''InitializeSubSystem''' (note: some of the below names are unofficial, see [[Subsystems]] for more details)
*** [[AutoPlacementFlowMgr]]
*** [[FadeProgress]]
*** [[DungeonPackMgr]]
*** [[PlayerInfo]]
*** [[GameSceneSubsys2]]
*** [[GameSceneSubsys3]]
*** [[GameSceneSubsys4]]
*** [[GameSceneSubsys5]]
*** [[ActorHeapUtil]]
*** [[E3Mgr]]
*** [[aoc2]]
*** [[aoc3]]
*** [[GameSceneSubsys6]]
*** [[CookingMgr]]
*** [[GameSceneSubsys7]]
*** [[GameSceneSubsys8]]
*** [[GameSceneSubsys9]]
*** [[GameSceneSubsys10]]
*** [[IceBlockMgr]]
*** [[AmiiboMgr]]
*** [[GameSceneSubsys11]]
*** [[GameSceneSubsys12]]
*** [[GameSceneSubsys13]]
*** [[GameSceneSubsys14]]
*** [[GameSceneSubsys15]]
*** [[ResidentActorMgr]]
*** Create UI heap
*** [[uiManager]]
*** Load the [[Fade]] screen
*** [[OnUiActorMgr]]
*** [[CreatePlayerEquipActorMgr]]
*** [[CreatePlayerTrashActorMgr]]
*** [[TipsMgr]]
*** [[nxargs]]
*** GameScene::initializeGraphicsLayer_
*** ErrorViewerTask init
*** Set Get Demo handler
*** Set Check Weapon Free Slot handler (1, 2)
*** ...
*** [[SaveSystem]] init
*** Set [[#Initial state|initial state]]
*** nn::err::ShowUnacceptableAddOnContentVersionError if needed
***
**** [Debug] StarterPackMgr: Load Title pack
**** [[GlobalParameter]]
**** GlobalParameter: Load [[actorpack]]
**** E3Mgr: Load [[Content/System/BuildTime.txt|System/BuildTime.txt]] (stubbed in release versions)
**** TipsMgr: Load tips
**** ResidentActorMgr: Load configuration ([[ResidentActors.byml]])
**** AutoPlacementFlowMgr: Load auto placement [[event flow]]s
*** KingEditor: Stubbed
*** E3Mgr: init
 
=== Initial state ===
The initial state the game launches into is determined by GameScene<ref>GameScene::initialize, 0x71007A86CC</ref>.
 
<source lang="cpp">
const bool isFirstLaunch = SaveSystem::sInstance->isFirstLaunch();
State* state = isFirstLaunch ? &state_NewSave : &state_LunchTitle;
 
if ( aocManager::sInstance && aocManager::sInstance->flags & 2 )
  nn::err::ShowUnacceptableAddOnContentVersionError();
 
const bool isDemo = E3Mgr::sInstance && E3Mgr::sInstance->isDemoMode();
if (isDemo)
  state = &state_LunchTitle;
 
if (!isDemo && isFirstLaunch)
  sIsFirstNonDemoLaunch = 1;
 
StateMachine::changeState(&this->stateMachine, state);
</source>
 
== Stage types ==
{| class="wikitable"
{| class="wikitable"
!Type
!Type
Line 117: Line 38:
Maps that have the same stage type typically use the same subsystems and share most characteristics. For example, all open world stages use the [[Tera]] height map terrain system and load [[Map unit|map units]] in the same way.
Maps that have the same stage type typically use the same subsystems and share most characteristics. For example, all open world stages use the [[Tera]] height map terrain system and load [[Map unit|map units]] in the same way.


== StageBinder types ==
=== StageBinders ===
{| class="wikitable"
{| class="wikitable"
|+ Stage binder types<ref>As returned by the first virtual function in the StageBinderBase interface</ref>
|+ Stage binder types<ref>As returned by the first virtual function in the StageBinderBase interface</ref>
Line 135: Line 56:
|}
|}


== Fade types ==
=== Fade types ===
{|class="wikitable"
{|class="wikitable"
! Type !! Description
! Type !! Description
Line 146: Line 67:
|}
|}


== State strings ==
=== GameScene state strings ===
{|class="wikitable"
{|class="wikitable"
|+ List of state strings in 1.5.0 (incomplete)<ref>The state string is a sead::FixedSafeString<0x100> stored in GameScene @ 0x720.</ref>
|+ List of state strings in 1.5.0 (incomplete)<ref>The state string is a sead::FixedSafeString<0x100> stored in GameScene @ 0x720.</ref>
Line 197: Line 118:
| ActorViewer||
| ActorViewer||
|}
|}
== Init ==
* '''GameScene::initialize''' (0x71007A8014)
** Load the environment graphics archive ([[Content/Env/env.genvb|env.genvb]])
** Create the GameScene heap
** Create the [[StageBinder]] heap
** Start the GameScene TaskMgr (thread)
** '''InitializeSubSystem''' (note: some of the below names are unofficial, see [[Subsystems]] for more details)
*** [[AutoPlacementFlowMgr]]
*** [[FadeProgress]]
*** [[DungeonPackMgr]]
*** [[PlayerInfo]]
*** [[GameSceneSubsys2]]
*** [[GameSceneSubsys3]]
*** [[GameSceneSubsys4]]
*** [[GameSceneSubsys5]]
*** [[ActorHeapUtil]]
*** [[E3Mgr]]
*** [[aoc2]]
*** [[aoc3]]
*** [[GameSceneSubsys6]]
*** [[CookingMgr]]
*** [[GameSceneSubsys7]]
*** [[GameSceneSubsys8]]
*** [[GameSceneSubsys9]]
*** [[GameSceneSubsys10]]
*** [[IceBlockMgr]]
*** [[AmiiboMgr]]
*** [[GameSceneSubsys11]]
*** [[GameSceneSubsys12]]
*** [[GameSceneSubsys13]]
*** [[GameSceneSubsys14]]
*** [[GameSceneSubsys15]]
*** [[ResidentActorMgr]]
*** Create UI heap
*** [[uiManager]]
*** Load the [[Fade]] screen
*** [[OnUiActorMgr]]
*** [[CreatePlayerEquipActorMgr]]
*** [[CreatePlayerTrashActorMgr]]
*** [[TipsMgr]]
*** [[nxargs]]
*** GameScene::initializeGraphicsLayer_
*** ErrorViewerTask init
*** Set Get Demo handler
*** Set Check Weapon Free Slot handler (1, 2)
*** ...
*** [[SaveSystem]] init
*** Set [[#Initial state|initial state]]
*** nn::err::ShowUnacceptableAddOnContentVersionError if needed
***
**** [Debug] StarterPackMgr: Load Title pack
**** [[GlobalParameter]]
**** GlobalParameter: Load [[actorpack]]
**** E3Mgr: Load [[Content/System/BuildTime.txt|System/BuildTime.txt]] (stubbed in release versions)
**** TipsMgr: Load tips
**** ResidentActorMgr: Load configuration ([[ResidentActors.byml]])
**** AutoPlacementFlowMgr: Load auto placement [[event flow]]s
*** KingEditor: Stubbed
*** E3Mgr: init
=== Initial state ===
The initial state the game launches into is determined by GameScene<ref>GameScene::initialize, 0x71007A86CC</ref>.
<source lang="cpp">
const bool isFirstLaunch = SaveSystem::sInstance->isFirstLaunch();
State* state = isFirstLaunch ? &state_NewSave : &state_LunchTitle;
if ( aocManager::sInstance && aocManager::sInstance->flags & 2 )
  nn::err::ShowUnacceptableAddOnContentVersionError();
const bool isDemo = E3Mgr::sInstance && E3Mgr::sInstance->isDemoMode();
if (isDemo)
  state = &state_LunchTitle;
if (!isDemo && isFirstLaunch)
  sIsFirstNonDemoLaunch = 1;
StateMachine::changeState(&this->stateMachine, state);
</source>


== States ==
== States ==
Anonymous user