Advertisemen
So I made decent progress last night and go a basic prototype for a battle up and running (though the only actual gameplay of it is pressing a button titled "Win Battle" - the rest is just for show).
I am totally not ripping off Persona 5 for this prototype
Anyway the whole transitioning between the overworld and a battle I have fully working (or so I think) and it was easier than I thought. So in this post I'm going to go into the design of how that is set up and probably the next post will be on how I'm keeping things organised with structs OR how I plan to do the battle menu exactlylikepersona5
So we have a level in Unreal and this is where the design of the overworld is made, so all the scenary NPCs and etc. The only addition to this that is necessary is a custom actor called a StateManager hereafter abbreviated as SM :^)
So the basic level actors are defined as follows:
- OverworldActor0
- ...
- OverworldActorN
- StateManager
Note that there may be other actors that you want to exist for both overworld (hereafter OW) and battle (BTL) states, this is possible and will be covered in a bit.
The functionality of the SM is:
- Handle transition from OW to BTL and vice versa
- Contain the actors/meshes for the battle scenary, in the above image it's the two cuboids which make the floor and the wall (not the mannequins!)
- Contains vectors for where the enemies and players are spawned in this stage: i.e. players on the left, enemies on the right
- Contains a class of the battle UI (the 5 buttons in the above image) which can be created and destroyed on the state transitions so it is only active for the battle
- Contains a camera
- Encounters are instigated by an encounter object which stores the enemies the player will face, this is defined as Encounter Invoker
On OW to BTL state change the following takes place:
- Freeze all actors that exist apart from the SM itself and actors whomst've class is contained within a list titled 'Do Not Freeze Actors Of This Class', some examples of the contents of this list include:
- GameMode
- GameNetworkManager
- I can't remember any more but there were five more
- Display Battle UI
- Change camera from the pawn's camera to the StateManager's camera
- Show mouse cursor
- Check which enemies are contained within the Encounter Invoker and spawn them
- Spawn an actors for the player (no support for multiple people on the player's team at the moment)
On BTL to OW:
- Unfreeze all actors
- Destroy Battle UI
- Change camera back to pawn's camera
- Hide mouse cursor
- Destroy spawned actors
Advertisemen
Tidak ada komentar:
Posting Komentar