InverNessian / SafeguardsOfLeyto

For development of my game by the same name.
1 stars 0 forks source link

Reorganize combat math #10

Closed InverNessian closed 5 years ago

InverNessian commented 5 years ago

Because of the serialization process, I'm going to move most of the methods out of the Stats_Character class and into the Data Manager class. It makes more sense for everything to be handled there anyway.

InverNessian commented 5 years ago

Updated a lot of stuff with regards to this. Currently I just need to implement some basic UI so that they can call the functions I have.

InverNessian commented 5 years ago

Okay, I have a new organizational standard.

UnitData will contain all data for units. It is a ScriptableObject and will reside in the Asset menu. I created a function to parse in data from a csv file so it's not overwhelming. Unit-tagged GameObjects will be created in the editor since that's just easier and now more efficient. They will all be tagged with the appropriate UnitData in any given scene, so the persistence of data is automatic thanks to Unity.

There is a very small DataHolder class that allows us to tie the UnitData assets to the Unit-tagged GameObjects. it really is just a holder, but may also be the solution for having multiple enemy units keying off the same UnitData.

Unit Controller will handle all the actions that units can take. It has a Dictionary linking all possible actions (NormalAttack, Displace, etc) with the Events that correspond to them (DuelCombat, PhasingMovement, etc). Also has a list of the Events themselves. Currently it handles the inputs that lead to these, but based on the SOLID principles I think it may be better to separate out inputhandling later? We'll see.

For combat and action purposes, as described above there will be a few MonoBehaviors (or static classes?) of different types to manage the actions that need to be taken. CombatController will handle all Events that inherit from CombatEvent, and so forth.

GameController will handle the loading of scenes and managing the Turn Order/Active Player/other "meta" level functions.

InverNessian commented 5 years ago

Slight addition: We do want the XControllers for actions to be MonoBehaviors, so they can set their listeners at the start of the scene.

There needs to be a MapController or something that handles Turns and ActivePlayer. GameController should stay separate from that, since it's a singleton and will exist in every scene. We only want turn order functionality in mission scenes.

InverNessian commented 5 years ago

This is now tested and seems to be working well enough. I'll call it done, but in truth this system needs to be expanded on quite a bit. The core is there, but not the peripherals.