Page 1 of 1

Rules vs Variables?

Posted: Thu Feb 19, 2015 5:25 pm
by Jabantiz
Which should we use? Are they meant to live together and if so how should we decide where to put a new rule/variable? I would assume that global stuff that should change should be in variables, so the irc stuff should be moved from rules to variable? What about other global values, like Heroic Op time or trade skill success/failure chances?

Re: Rules vs Variables?

Posted: Sat Feb 21, 2015 5:55 pm
by John Adams
Rules System is the "new way". Variables was the "old way". However, there are some variables that do still exist, which is why the table was left there.

General "rule" (snicker), if the server needs to store data for some global reason (game time, lotto #'s) then use the `variables` table for that.

Rules system stuff is just for static settings of things you want to be able to switch quickly without recompiling. Eg., giving players a 10% bonus to their spell damage in a particular zone (or world-wide). Btw, there are Zone rules, not just World (global) rules :)

Rules system kicks ass. Know why? I designed it that way. :D

Re: Rules vs Variables?

Posted: Sat Feb 21, 2015 6:06 pm
by Jabantiz
I had a thought the other day, what if we expose the variable system to lua so lua can save values over server restarts, an example from live would be some live events needed a quest completed x number of time before the event would progress, could also add a lot of options for custom content too.

Also, if you give a zone a special ruleset (in the zone table) will it just use the zone rules or the entire ruleset within that zone?

Re: Rules vs Variables?

Posted: Thu Mar 05, 2015 8:26 pm
by John Adams
Jabantiz wrote:I had a thought the other day, what if we expose the variable system to lua so lua can save values over server restarts, an example from live would be some live events needed a quest completed x number of time before the event would progress, could also add a lot of options for custom content too.
Hmm, isn't that what `character_quest_progress` is for? You probably do not want to over-load the simple Variables table with stuff. There's also the `statistics` table, which once upon a time was going to keep track of various states the world was in, but we never got to expanding it. And of course, `character_history`.
Jabantiz wrote:Also, if you give a zone a special ruleset (in the zone table) will it just use the zone rules or the entire ruleset within that zone?
I believe if you make a brand new ruleset (2), and create a ruleset_detail for R_Player::XPMultiplier = 2.0, then go to Antonica zone and set it's ruleset to 2, players in that zone will receive 2.0 modifier to their XP gains... as well as all Global rules that were not overridden by a Zone (local) rule. At least, that was the design.

Re: Rules vs Variables?

Posted: Fri Mar 06, 2015 12:03 am
by Jabantiz
John Adams wrote:Hmm, isn't that what `character_quest_progress` is for? You probably do not want to over-load the simple Variables table with stuff. There's also the `statistics` table, which once upon a time was going to keep track of various states the world was in, but we never got to expanding it. And of course, `character_history`.
What I am thinking is a few live events had quests that needed to be completed x number of times globally by all players before the story would advance for any one, was usually an insanely high number of completions. I do not believe we can check how many times a player has completed a repeatable quest, not to mention grabbing how many times the quest has completed on the server, thought of this as a quick way to do it.

As for custom content I was thinking of needing to save the state of a zone, say you have qeynos capture the crossroads in commonlands, you would need a way to save that so it persists through a zone/server restart, in the zone script you could grab the state and spawn guards accordingly.

Of course this was just random thought I had and the variables table looked like the easiest way to implement it, might be a better way.

Note: I am not implementing any of this just ideas.

Re: Rules vs Variables?

Posted: Fri Mar 06, 2015 7:33 pm
by John Adams
Jabantiz wrote:What I am thinking is a few live events had quests that needed to be completed x number of times globally by all players before the story would advance for any one, was usually an insanely high number of completions.
Oh, yeah then in this case, that makes sense. You mean like unlocking the Froglok race :) Yeah that might be a good thing to track in a Variable.