Saving quest status in multiplayer RPG
Hi, I am designing a multiplayer RPG (similar to Diablo2) and last night I came to a problem, where I dont know how to solve it: I want to manage all player data (like health, experience, etc.) in a data base. But how should I save there the status of several quests? I thought of making a field in my table for every quest with an integer saving the current status. But isn't this bad DB design? I would have to change the DB for every new quest... What do you recommend me? How do you do this? Greetings, Enrico
--
Well, a pretty standard way of handling this in something like a MUD was to have an array (int quests[MAX_QUESTS]). This meant there was a lot of space to add stuff in without causing the errors of adding new quests. I know this isn't database specific (I'm trying to learn about those at the moment actually), but I think it covers your question.
In DB design this is a very bad thing. I would have to change my tables everytime I want to implement a new quest :(
Any other ideas?
Any other ideas?
--
The solution depends on how you implement quests, but here's an example. In my engine, quests consist of two components: a collection of event-based scripts and a collection of properties. The properties change depending on the quest. One of its properties, for example, would be the ID of the player to whom the quest was assigned. The quest's properties are available to the scripts as variables.
To save a quest's state to the database, I use two tables. One holds the quest's unique identifier and the name of the function that generates its scripts. The other holds the quest's variables.
To reload the quest, I instantiate the quest class, call the function that generates its scripts based on QuestName, and populate its property collection from the QuestProperties table.
To save a quest's state to the database, I use two tables. One holds the quest's unique identifier and the name of the function that generates its scripts. The other holds the quest's variables.
Quest QuestProperties-------------- ---------------QuestID QuestIDQuestName PropertyName PropertyValue
To reload the quest, I instantiate the quest class, call the function that generates its scripts based on QuestName, and populate its property collection from the QuestProperties table.
Post Extant Graphical MUD
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement