I am currently building a strategy game in which a single person shall be able to change its job during the game.
The difficulity with this is that I will have about 20 jobs, which will of course all need to interact with the world in different ways.
I am currently wondering what could be the best way to manage all of these jobs or the switch between them. I had several approaches in mind which all don’t seem good to me:
- Create multiple classes for all jobs, create a switch animation a la Sims and delete the old person object after the new was spawned at the same location (transferring basic information about the person into the new object)
- Create a massive behavior tree with most of the variables needed for job executions and use decorators to select different tasks based on the job enum
- Create separate behavior trees for humans with variables needed for a specific job. Change the assigned behavior tree after job was changed
In my opinion, all approaches are a bad solution for the problem and I feel like I am missing something since I still don’t know all facets of UE4. Have some of you already dealt with a situation like this and found a best practice approach?