Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-29-2003, 10:25 AM
loudent2
Sarnak
 
Join Date: Apr 2003
Posts: 95
Default hard coded class skill caps

I can't help but notice that skill caps by class are hard coded in the server. Doing a search will net you a couple dozen places where there's "case <class>: case <class>GM:"

Is anyone working on moving these values to a table in the database?


I have some free time this weekend to do some work but don't want to start something someone is already working on.
__________________
Ignorance is Bliss
Reply With Quote
  #2  
Old 05-29-2003, 11:25 AM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

Pointless er i mean why? DB querys just slow stuff down and bloat the HD space required.

Code:
#include "maxskill.h"
#include <iostream>
int main(void){
for (int class = 0; class <= 15; class++){
 cout<<"Some crap here";
 for (int skill = 0; skill <= 73; skill++){
  cout<<"Some more crap here";
 }
 cout<<"Last crap here"<<endl;
}
return 0;
}
Now really before you go and connect the table think about how many times the db is going to get queried, take 5 melee chars at max haste with fast weapons, gives you about 20 query per second, just for the weapon skill, Another 20 for thier Offense checks. Now scale that up to a real raid size where melee class range from 1/3rd to 1/2 or more of the raid ;)
Reply With Quote
  #3  
Old 05-29-2003, 11:50 AM
loudent2
Sarnak
 
Join Date: Apr 2003
Posts: 95
Default

I'm not suggesting you read the database everytime.

Wouldn't it be preferable that you have some class that wraps 2 values. (lets call it CClassSkillCap) Skill cap and Per-Level skill cap. You then have a class that is wraps a vector of classes(eq classes) that each has a vector CClassSkillCap. One for each skill.

Whether you store these in the database or they're hard coded in the source they're read once on start-up. Then when you need to check for max skill you pass in race, class and level

pseudo-pseudo code:

maxskilllevel = Classvector[class].Classskillcap[skill].m_skillcap;
plvlmaxlevel = ((level+1) * (Classvector[class].Classskillcap[skill].m_plvlskillcap))

rlevel = (maxskilllevel > plvlmaxlevel) ? plvlmaxlevel : maxskilllevel;



There might have to be a couple tweaks to handle special advancements, trade skills and race based overrides but it should clean up a great deal of those class switch statements. With the list centralized it would be easier to make edits. The reason I suggested it go in the database is because it would allow world serverops to alter values for their world without re-building the source.
__________________
Ignorance is Bliss
Reply With Quote
  #4  
Old 05-29-2003, 01:10 PM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

Bah i was typeing and talking and left out the function call.
int8 Mob::MaxSkill(int16 skillid, int16 class_, int16 level)

Or if you haven't noticed it yet common/MaxSkill.cpp
Code:
/* TODO: 
        Load MaxSkillTable function into ram as a really big matrix:
        MaxSkillTable[skillid][race][eqclass][level]

        in preperation for that, dont put anything that wont work in
        that table into MaxSkillTable (ie, AA checks, skill values that
        depend on other skill values, etc), put it into MaxSkill instead
*/
int8 MaxSkill(int16 skillid, int16 race, int16 eqclass, int16 level) {
        int8 ret = MaxSkillTable(skillid, race, eqclass, level);
        return ret;
}

/* SPECIAL VALUES:
        level:
                0 = "skill level at character create"
                TODO: catch levels > 65 (ie, npcs)
        race:
                NPCs will always have their skills maxed, and often ignore class
                restrictions, accomplished by the special values below.
                EMU_RACE_NPC
                EMU_RACE_PET
                EMU_RACE_UNKNOWN
        return value:
                TODO: Find out the specal values for the client for "your class/race doesnt have this skill" and
                "must put one point in at GM", etc

*/
MaxSkillTable[74][17][16][66]

I don't feel like doing the math but i'm pretty sure I don't want to load that (zones*zones_on_server)+World times on any of my servers. I'll hook up a new share in cvs for non win32 people.

Use
if (MaxSkillTableMMF.Open("EQEMuMaxSkillTable", tmpMemSize)) {
Like in EMuShareMem/NPCtypes.cpp line 72
if (NPCTypesMMF.Open("EQEMuNPCTypes", tmpMemSize)) {

Or you might conflict with one of the others we only check the first letter after EQEMu on the unix side because i really don't think we'll ever have that many =)

with the database.LoadMaxSkillTable() in world/net.cpp
If you want to get ambitious include the class_skill table we use for GM trainer windows.
Reply With Quote
  #5  
Old 05-29-2003, 01:50 PM
loudent2
Sarnak
 
Join Date: Apr 2003
Posts: 95
Default

Ok, am home now and actually looking through the source.

Incidentally I think storing this info as MaxSkillTable[skillid][race][eqclass][level] is a bad idea as well.

Only the max skills for each class and the per level max skill. This would reduce it number of classes*number of skills*2. at 1 byte per value you end up with a pretty small chunk of memory.

Anyway I'll delve a little deeper into the source.
__________________
Ignorance is Bliss
Reply With Quote
  #6  
Old 05-29-2003, 02:22 PM
loudent2
Sarnak
 
Join Date: Apr 2003
Posts: 95
Default

bah, I got lost in MMFs, MMFMutexs, Semaphores and how they relate to data. I'll leave this to those more comfortable with the source and stick with small stuff.
__________________
Ignorance is Bliss
Reply With Quote
  #7  
Old 05-29-2003, 02:31 PM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

You need the race for racial skills. Sneak hide forage ect
Reply With Quote
  #8  
Old 05-29-2003, 02:36 PM
loudent2
Sarnak
 
Join Date: Apr 2003
Posts: 95
Default

Yes, but the race based bonuses could be checked seperately.
__________________
Ignorance is Bliss
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:32 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3