MaxSkill Calculations
A lot of our max skill calculations are incomplete and getting them right means adding a lot of ugly code to the MaxSkill class. Would it be possible to use a class_skillcap list and a block of generic code to get the max skills?
I am guessing that checking the value from a list, several times, is too expensive. Heres some pseudo code of how I thought it could work: Code:
Code:
/* The class_skillcap table would have about 500 records. (There would also have to be a race_skillcap list for the race specific skills). |
this is perfectly reasonable to do, if you wanna code it up. The biggest reason it hasnt been done is that nobody wants to populate the database table.
I see these fields in the table: classID skillID formula (integer which you switch on for various calculation formulas) min_level (the level at which this cap starts to apply) cap (the cap at this level) some formula types, which apply until the formula's result exceeds the cap: 0. untrainable 1. untrained (at this level it cannot be trained, but will be avaliable later) 2. just use cap 3. (level * 5) + 5 4. ((level - min_level) * 5) + 5 ... I believe theres some others in there ... I dont see the point of your index field really, just store them sorted by level, and run throught the list until the level of the next entry is higher than your current level, or the list ends. Actually, you could pull these from the database and apply them as you load them to calculate the level cap at each level and then just store that in a big array in shared memory: uint8 skill_caps[MAX_CLASS][MAX_SKILL][LEVEL_CAP]... for level 70, thats 78kb of data... which is nothing in shared memory... dont really use a 3d array though, use: uint8 skill_caps[MAX_CLASS * MAX_SKILL * LEVEL_CAP] and index it with: getskillcap(class, skill, level) \ skill_caps[class * (MAX_SKILL + LEVEL_CAP) + skill * LEVEL_CAP + level) This is a very shared-memory friendly system, and is what I recommend. I dont know if it would be worth your time to put all the race-based caps into the database, its prolly easier to just make a quick switch statement for them, and intelligently combine the results with the results of the class stuff. However you do it, these caps should all be loaded into memory at zone start time, if not shared memory. There would need to be at least 1200 entries in this table for each class/skill combination, maybe reducable by making the default 'untrainable', but there will be a lot of extra entries for 50+ and 60+ levels, so it'll end up being a few thousand... not that it matters. |
OK, i will get all the data together for starters.
|
http://members.dodo.net.au/~mollymillions/Skills.xls
*Edit* -Added code to create table. It's going to take quite a while to locate all the 65+ caps. |
gunna be a lot of work still to turn that into a db table like we need, but its a good start.
|
Here you go, mostly accurate up to PoP table, also table of racial skills.
http://www.wintersroar.com/files/caps.zip Function for it here: Code:
int8 Database::GetSkillCap(int8 skillid, int8 in_class, int16 in_level) |
hey wiz,
I had the code for this, and I looked it over, but I didnt like the way it deals with the higher level skill caps. But since im not the one programming it right now, I guess I cant really voice what I dont like, eh? |
Quote:
|
theres no issue per-se, I know it works for live-like skill caps up around level 60. I would just rather have a system that is more flexible. Allowing people to put as many differernt caps at as many different levels as they want, with whatever formula they want to use in between each milestone. Gives us better flexibility into the future, and for custom servers.
|
Quote:
table: (skillid, class, race, level, max) And code that takes the entry >= your skilllevel and the entry closest to your level and < your level. Calculate the difference between the two caps / the difference between the two levels. So you have a skill with a cap of 10 at level 10 and a cap of 50 at level 20. You can gain 1 in it per level up to 10, then 4 per level up to 20, so your cap at level 12 would be 18. I'm not really inclined to split my table entries or do the writing-up for it though :P |
This is minor, but code needs to handle skill values > 254.
|
All times are GMT -4. The time now is 07:49 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.