Hello all!
I am still starting to get familiar with the quest machine system, so far so good.
I would like to know if there's any tips/advices when working with a dedicated server setup, I'm using fish-networking (similar to mirror). In the context of quest conditions being met etc, would the server simulation have that and then sync state to a player? Or would both the client and server just simulate the quests?
Thanks a lot.
Dedicated authoritative server integration
Re: Dedicated authoritative server integration
Hi,
To be fully authoritative, you'll want run the simulation on the server, but you don't have to necessarily run Quest Machine on the server. You can still run Quest Machine on each client. Write custom quest actions and quest conditions that run on the client's instance of Quest Machine but reach back to the server for authorization. You'll probably want these actions and conditions to run asychronously like TimerQuestCondition instead of blocking the main thread until they receive a result.
To be fully authoritative, you'll want run the simulation on the server, but you don't have to necessarily run Quest Machine on the server. You can still run Quest Machine on each client. Write custom quest actions and quest conditions that run on the client's instance of Quest Machine but reach back to the server for authorization. You'll probably want these actions and conditions to run asychronously like TimerQuestCondition instead of blocking the main thread until they receive a result.
Re: Dedicated authoritative server integration
Thanks for your reply.
We are building an mmo, where the player's quests states must be saved in database, so I had to run quest machine on the server as well. Serializing and deserializing quests nodes were intimidating but I think I got it now.
Didn't get to saving counter list for example, but might not need it for now. Having a built-in method would've been really awesome though. I've taken a look at the Save system but I don't think it's built for network and database.
I might get into trouble again but hopefully not soon
We are building an mmo, where the player's quests states must be saved in database, so I had to run quest machine on the server as well. Serializing and deserializing quests nodes were intimidating but I think I got it now.
Didn't get to saving counter list for example, but might not need it for now. Having a built-in method would've been really awesome though. I've taken a look at the Save system but I don't think it's built for network and database.
I might get into trouble again but hopefully not soon
Re: Dedicated authoritative server integration
Hi,
Sounds good. The save system supports authoritative saves from the server or non-authoritative saves from the client, by dropping in a custom SavedGameDataStorer subclass that writes to a network and/or database, but neither is appropriate for an MMO. For an MMO, you'll need to implement your own saving.
Sounds good. The save system supports authoritative saves from the server or non-authoritative saves from the client, by dropping in a custom SavedGameDataStorer subclass that writes to a network and/or database, but neither is appropriate for an MMO. For an MMO, you'll need to implement your own saving.
Re: Dedicated authoritative server integration
Yeah, my saving method is basic for now, just a list of all QuestStates, where a QuestState is just a string quest ID, and the active node id int. And on initializing quest journal from state, I just iterate over quest nodes and set to True, until I reach the active node and set to Active.
Re: Dedicated authoritative server integration
That sounds like a good approach. It doesn't hurt to keep things as simple as you can, for as long as you can, especially when making an MMO.
Re: Dedicated authoritative server integration
I see, thanks a lot, your comments are really appreciated.