Max Nielsen
Member
I am currently using my own FSM to control the AI in my city management game. It can be anything from woodcutters, bakers, blacksmiths to soldiers or ogres.
It works really well but as the game grows it's scaling quite poorly and I am re-writing a ton of code for each professions since they share almost 80% of the behaviour.
I used this asset once but found it hard to work with when the AI got really complex. But I want to give it another try, but cannot really find any documentation that goes beyond the basics, which is not interesting.
Say I have a worker, and at runtime this worker can change profession between 30 different professions, and when it has freetime it can choose between a ton of different activities. I cannot imagine doing that in a single behaviour tree view. How can I manage a scenario like this to keep things seperated and tidy and scaleable? In a perfect world each profession would be its own behaviour tree, and there would probably be a "main" behaviour tree that checked like:
1. Am I hungry? -> Go eat
2. Do I have a job? -> Go work profession where professionKey == "woodCutter".
3. If I reach here I am idle -> Find an activity to do.
Is there some samples or anything I can look to that would help me get started writing a really big tree like this? Maybe that uses "sub-trees" for each profession to keep things seperated.
EDIT: (Please move this to behaviour designer forum)
It works really well but as the game grows it's scaling quite poorly and I am re-writing a ton of code for each professions since they share almost 80% of the behaviour.
I used this asset once but found it hard to work with when the AI got really complex. But I want to give it another try, but cannot really find any documentation that goes beyond the basics, which is not interesting.
Say I have a worker, and at runtime this worker can change profession between 30 different professions, and when it has freetime it can choose between a ton of different activities. I cannot imagine doing that in a single behaviour tree view. How can I manage a scenario like this to keep things seperated and tidy and scaleable? In a perfect world each profession would be its own behaviour tree, and there would probably be a "main" behaviour tree that checked like:
1. Am I hungry? -> Go eat
2. Do I have a job? -> Go work profession where professionKey == "woodCutter".
3. If I reach here I am idle -> Find an activity to do.
Is there some samples or anything I can look to that would help me get started writing a really big tree like this? Maybe that uses "sub-trees" for each profession to keep things seperated.
EDIT: (Please move this to behaviour designer forum)
Last edited: