Rules vs Variables?

This is a design and development forum for EQ2Emulator's extensive Rules System.

Moderator: Team Members

Post Reply
Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Rules vs Variables?

Post by Jabantiz » Thu Feb 19, 2015 5:25 pm

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?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Rules vs Variables?

Post by John Adams » Sat Feb 21, 2015 5:55 pm

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

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Rules vs Variables?

Post by Jabantiz » Sat Feb 21, 2015 6:06 pm

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?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Rules vs Variables?

Post by John Adams » Thu Mar 05, 2015 8:26 pm

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.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Rules vs Variables?

Post by Jabantiz » Fri Mar 06, 2015 12:03 am

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Rules vs Variables?

Post by John Adams » Fri Mar 06, 2015 7:33 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest