Jump to content

Maki

Members
  • Posts

    1195
  • Joined

  • Days Won

    21

Everything posted by Maki

  1. Ind I find the way this function is used very concerning. it is called on every hit/flee calculation (on every physical damage hit -- except on mob.c but there it doesn't bother anyone), to me, it is the culprit of increased latency on busy WoEs. In battle.c it is called to know how many units are attacking this target, it loops through all units in the map (YES ON EVERY DAMN HIT!) to check if their target is the person being damaged. This topic aims at discussing a replacement for this method. Post if you have any ideas. I just came up with something, let me know what you think: It would use a bit more memory and save a reasonable amount of CPU. What do you think?
  2. This implementation wont need any noticeable performance issues, because of its only a new variable, used in less than 30 places. So dont worry about your CPU or memory. 4 bytes more wotn kill your RAM. Be happy about correct status effect timers
  3. GodLesZ I dont have any other ideas for this problem. In fact we need a 2nd storage for the real status duration, no matter where, we need them to tell the client the real duration, not only a status tick time. Ind OK ended up like this r30 (bottom)
  4. GodLesZ Okay, sounds strange.. 2 possible options i think: find all "effect per tick over time" effects or any effect changing the tick value, add a 2nd variable for status duration and compare them before clif_status_change(). If the 2nd variable is above zero, send this a the tick. how about storing the tick given before any change is added and use this as the duration send to the client? The tick is given as parameter in status_change_start() and reduced by resistances in line 5228. We could store them in "duration" (i.e.) and send this to the client. Any other judgment?
  5. Ind berserk uses a endure icon in the client, which also goes negative.
  6. GodLesZ Damn i got it, sorry x.x Unfortunately i can not test nor debug atm, so how is berserk working? I checked the code and could confirm, berserk works the same way and sends the delay of 10 seconds as duration to the client. Could someone test this please? If berserk also got this problem, any other skil with a "effect per tick over time" feature will need this fix and your first approach should be fine I.e. here berserks status initialisation (line 6131+): case SC_BERSERK: if (!sc->data[sC_ENDURE] || !sc->data[sC_ENDURE]->val4) sc_start4(bl, SC_ENDURE, 100,10,0,0,2, tick); //HP healing is performing after the calc_status call. //Val2 holds HP penalty if (!val4) val4 = skill_get_time2(status_sc2skill(type),val1); if (!val4) val4 = 10000; //Val4 holds damage interval val3 = tick/val4; //val3 holds skill duration tick = val4; break; The important part is the rarly found comment after val4: Val4 holds damage interval And of course the tick setting: tick = val4; At the end of initialisation, this tick is used in the clif send (line 7252+): if( vd && (pcdb_checkid(vd->class_) || bl->type == BL_MER || bl->type == BL_MOB ) ) clif_status_change(bl,StatusIconChangeTable[type],1,tick,(val_flag&1)?val1:1,(val_flag&2)?val2:0,(val_flag&4)?val3:0); i checked it more than once and the tick is never touched in case of berserk, so this problem HAS to be the problem for all "effect per tick over time".
  7. Ind Yes it is sent only once and the effect works fine, the issue is the following: the timer is set to the 5s interval, and this 5s is sent to the client as the effect duration (while its actual duration is 90s), to fix this my first thought (and imo not a good approach performance-wise) was to create a temp var to store the actual duration to send it to the client in these cases; so that the icon timer matches the actual duration (at this time it isn't, test renovatio if you'd like to see it live)
  8. GodLesZ Is this the result of a test? I thought the status data (ID, icon, tick) is only send once upon status start and cleared on status_change_end(). status_change_timer() should never resend data to the client for general status effects. This would be failed by design in my opinion. If this is the actuall state, we should think about an optimisation! Anyways, if this occours for these "<effect> per tick" effects, how is i.e. berserk worken? The effect SC_BERSERK reduce the HP by 5% every 10 seconds and i never recognized a bug in the timer overlay o.o
  9. Ind I've encountered a bug I'd rather discuss the fix so we get the best option around. I'll use renovatio as the example, however there are about to 5 others in the same situation. Renovation is meant to last 90s but its iteration tick is 5s so it heals every 5s, however this affects the display in the client, being it sends the icon to last for 5s and then it goes negative until it reaches -85. The first I thought was: However the above is quite of a waste :[ we have about to 600SCs processed through the same function and the above would be only useful to about 1% of them. Do you have any work-around suggestion that would save performance? Thank you for your time
  10. GodLesZ I think the main reason for this is "more memory but less cpu", just for request skill informations (skill_get_*()). If they only save the available data, they had to check for sizeof() array for bound-checking. Maybe this is less efficient? Some sort of this could be the main purpose. The second one is - eAthena, laziness. "Its working, so why changing?".. There are some other ways for doing this, for sure. I.e. using sizeof() to check the max bounds. So theres no need to fill up wasted space. Maybe a *_count variable for storing array size after database loading ("more memory but less cpu" compromise) to save sizeof() calls. In my C# server i used these two ways. All data is stored in flat arrays, only available data of course, and a *_count variable saved the available count. On a information request the *_count variable is checked against lv -1 and if fitting bounds, information will be returned. Consumes less memory than 90 slots of wasted space and no cpu for live-time sizeof() checks.
  11. These "auto-populate"'rs I talked about are like this one from skill_split_atoi (the function behind all values delimited by a ':') //Single value, have the whole range have the same value. for (; i < MAX_SKILL_LEVEL; i++) val[i] = val[i-1];
  12. Ind We have about to...1k skills (and don't even have 3.2x in yet!)? The structure of each skill is filled of arrays limited by MAX_SKILL_LEVEL struct s_skill_db { char name[NAME_LENGTH]; char desc[40]; int range[MAX_SKILL_LEVEL],hit,inf,element[MAX_SKILL_LEVEL],nk,splash[MAX_SKILL_LEVEL],max; int num[MAX_SKILL_LEVEL]; int cast[MAX_SKILL_LEVEL],walkdelay[MAX_SKILL_LEVEL],delay[MAX_SKILL_LEVEL]; int upkeep_time[MAX_SKILL_LEVEL],upkeep_time2[MAX_SKILL_LEVEL]; int castcancel,cast_def_rate; int inf2,maxcount[MAX_SKILL_LEVEL],skill_type; int blewcount[MAX_SKILL_LEVEL]; int hp[MAX_SKILL_LEVEL],sp[MAX_SKILL_LEVEL],mhp[MAX_SKILL_LEVEL],hp_rate[MAX_SKILL_LEVEL],sp_rate[MAX_SKILL_LEVEL],zeny[MAX_SKILL_LEVEL]; int weapon,ammo,ammo_qty[MAX_SKILL_LEVEL],state,spiritball[MAX_SKILL_LEVEL]; int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE]; int castnodex[MAX_SKILL_LEVEL], delaynodex[MAX_SKILL_LEVEL]; int nocast; int unit_id[2]; int unit_layout_type[MAX_SKILL_LEVEL]; int unit_range[MAX_SKILL_LEVEL]; int unit_interval; int unit_target; int unit_flag; }; And these arrays are not even left empty, after normal maximum level (say 10) is filled. All loaders auto populate empty values with the last valid value so that if ever (!!!) it receives a, say heal lvl 50, it answers with the last known value (which is for skill lvl 10). I've did a small test by reducing the MAX_SKILL_LEVEL from 100 to 10, and the RAM used by the map server after boot gone from 193MB down to 157MB. And it's not only about ram, its about that looping through these arrays when it wants info from a certain level, so during runtime it consumes extra CPU too. Whats your opinion on this? Do you see/know the actual reason behind this monster? Thank you for your time.
  13. Ind: I was looking at the dispell code to add a mado-gear specific check and noticed although a target-selected skill it foreaches the target's cell on a splash range of 1x1 and dispells everyone in that cell oO (I didn't test the stacking; but the code seems clear that it's what happens). What is the meaning of this? the skill actually works like that or...(?) GodLesZ: If I'm not wrong, dispell's initial implementation was like this. One target, but affects a 1x1 splash area arround the target with a small damage. Something like that a had in my mind.. Seems like another old piece from eAthena which could be removed imo.
  14. Ind: As brought up by Error404 and GodLesZ commenting is a very welcome habit which helps not only other developers to understand your code faster but to users trying to modify the source in some way. I've given it a try on the r55 and would like to know your opinion on it, hows done, layout (got a better idea for a pattern? mines not good), etc. Let me know what you think. Thank you for your time. GodLesZ: Indeed, but this will be a lot of work and a over-time milestone. We should try to document any point of code if we visit him and have some time. This way i document old projects of mine which arent documented well. Every time i visit the code to look for something or extend it, i add documentation to every spot i see. This dosnt take too much time @ once and documents the code over the time. If we documented the most of the code we should setup a DoxyGen or another script to create a html or pdf document. I know, double post, but its a totally new question. We should decide a comment-style. I like to use the XML-style, covered from my C# coding: /// <summary> /// Some description /// </summary> /// <param name="id">Session id</param> /// <return>1 on any error</return> int clif_some_function(int id) { The other often used style is javadoc, commonly used in java, php ect. (Note: Style may varry from user to user) /** * Some description * * @param id Session id * * @return int 1 on any error */ int clif_some_function(int id) { It is most often a user question, but i hate it to see 5 or more comment styles in the eAthena code even in one file.. So i think someone has to clean it up and standardize them. Once we had commented all in a regular same way, we may use tools to generate a whole server documentation (doxygen i.e.), like mentioned in the post above. I will try to test some comment add-ins for Visual Studio to refactor comments. Also some simple scripts for parsing existing comments and standardize them wont be that hard.
  15. Maki

    VC Support

    Ind: Whenever we're required to add a new file to be included, say a configuration file such as General.h, we're required to edit 10 files just for VC (because we support VC6,7,8,9,10 and thats 2 files for each) + 1 file for gcc support. Do you think it'd be possible to reduce the amount of supported VC versions? Do you see any problem in reducing? Do you think these older are even used anymore? Let me know your opinion. Thank you for your time. GodLesZ: +1. I personally use VS 2010 Ultimate @work and private. Only for some of my old projects VS 2008 until convert. I dont see any reason why we should keep any project files for old 2003, 2005 or even older versions. We should declare some guidelines for clean up of old stuff like this. IMO we should keep support for the last 2 version (and gcc of course).
  16. JakeRed: Should we keep checking over kRO mechanics?. Or are we gonna just follow iRO just looking at irowiki, because i found several things which works way different over kRO when it's compared to iRO. The amount of bug fixes from kRO is hard to keep it updated since they're changing mostly the skills and also def,mdef, every single week. Gravity also nerfed Matk formula a few months ago over kRO. - Shield penalty works in a different way than iRO (kRO is based in a % not fixed amount). - ASPD formula works different than iRO (kRO ASPD increases exponencially depending on AGI/DEX/Level). - Weapon penalty works in a different way than iRO (kRO is based in a %, not fixed amount). - The 98% of almost every single 3rd job skill has been tweaked compared to iRO. - They have moved a few mobs from fields to another places. - Spear Quicken, Two Handed Quicken has been changed the amount of aspd (Now is based in a % not a fixed amount). - Missing in iRO a few Towns from kRO mostly due iRO still way outdated (1 and half years outdated). - A bunch of old npcs from Town has been changed their location. - Changed the drop rate adjustment based on current level. - Changed the exp rate adjustment based on current level (I still testing this). - They have added lots of new NPC's. - Gravity changed the MDEF and also DEF formula. - kRO has a new system named Shop Lookup System which allows to buy items from Vending of other players (more info below) http://forums.irowik...669&postcount=1 And the list goes on... If we're going to follow iRO mechanics, then we haven't need to support Ragexe_RE.exe packets sice we can use iRO clients. If we're going to use iRO it would be hard to test the mechanics, cause iRO doesn't have any skill or stat reset npc and leveling at 1.5x is kinda hard compared to kRO sakray but at least we have the wiki.
  17. JakeRed: Here i made a comparative between main servers, iRO calc, Ragstate 2.25 and our RR mod rev 79, just to see how far are we against the real Renewal Mechanics from main servers. The comparative has been done using a Swordman 15/17 using a Blade[4]+4 Even if our ATK doesn't show correctly it still granting the same damage. I'm not quite sure where are we getting the +8 from ATK, but we need to move Weapon_ATK to the right side of the ATK fields. Our Def is reversed, and also we need to work a little bit with Mdef.( Doing a few test to get a correct formula) The only good thing we can get from iRO wiki is their ASPD formula. Luk must to be changed since the correct formula must to be: luk = critical + 0.35 Tested over fRO/kRO/iRO/bRO. And not as it's actually applied. luk = critical + 0.3 For that reason we're missing 1 Critical and on higher levels the difference will get noticed even more because the gap of missing 0.05 LUK will increase by each statpoint added. Def bonus from stat is being added incorrectly in RR mod since it has been added the def bonus from vit 3 instead vit 2 and for that reason we have that little variation in Def compared to main servers. Here are a few screenshots explaining better the issue: As everyone can see there is a little difference when is applied the Def bonus. i used RagState to take the screenshots from Main servers, because i don't have more free slots to make chars in my iRO accounts, and kRO is down applying a new update for their servers. After to complete a few tests that i'm doing over main servers iRO / kRO / fRO, i'm going to edit my post with more comparatives. Note: After thousand of tests i began to realize the information from iRO wiki site is not too reliable when it comes to test skill formulas against how it works over main servers. I still gathering more info about Renewal Mechanics to have enough information about how does the formulas work, to fix a few stuff. Regards,
  18. jTynne: One of the things I'm seeing across many of the more established private servers these days is a live vend database displayed on each server's website. Such a feature is extremely useful, however, I've never seen the coded publicly shared. I was given a code snippet from Trojal a long while back that I only half understood (thus it was deleted after many failed attempts at getting it to work) that provided similar results to that of the auction system; that is, the data was stored in the database rather than, presumably, system memory. So, what I'm getting at is, providing built-in support for server owners to be able to display vending information easily on their websites by storing vend data in a SQL table. To my understanding, adding the support for such a feature isn't too difficult, and I'd commit it myself if I was proficient in C and if everyone was alright with such a feature being added in as an optional feature. Thoughts? GodLesZ:
  19. SunDeath: The current Training Ground is the same as eA, basic, straight forward, zero effort, minimal explanation. The iRO Training Ground is much better than eA, complicated, clear, maximum effort, maximum explanation. I suggest we either comment out or completely remove the eA Training Ground NPCs and replace them with those from iRO. For a start I've already replaced Shion with Sprakki. Don't worry, Shion is still there, just commented out. I made Sprakki the EXACT same as on iRO. * The text layout is the exact same * The "typos" are the exact same * The cutin is the exact same * She gives you your very first quest Here's an example of both: Shion (eA): Sprakki (iRO): As you can see, Sprakki gives less info, but more accurate info. She also gives you an item (Pumpkin Pie, heals a small amount of HP and SP..and I mean really small) and a quest (Fixed the quest description and name, although description is client side). As you can also see, Sprakki, unlike Shion, does NOT give you a level. Don't worry about it, you get it later, inside the castle. My opinion: We kill the eA training ground and re-create the iRO training ground (I'll do the scripting). I don't care if you leave the NPCs in, but I do suggest removing them to save space. Those who play on iRO know the end result of the Training Ground, those who don't play iRO, go play it! Thank you for reading and allowing me to waste your time, unless you feel you invested your time right, then I just want to say: "Good for you ^^" EDIT: noticed Sprakki gave the wrong quest (1015) instead of the right one (7117), fixed that.
  20. Ind: Quote from JakeRed (over bug tracker) I'm wondering whether this is a actual mechanic difference or if kRO changed this and iRO is just not up to date to that yet. Also I'd like to ask what do you think we should do about this in case that it's a actual difference, who do we follow in this case?
  21. JakeRed: I been doing for a while today a research about weapons which grants bMatk over kRO Chaos main server. Until now this what i got. http://db.irowiki.org/olddb/ [Pre Renewal] http://db.irowiki.org/db/ (You may be better off using the RMS databases if you're going to do this, this one seems to be missing items, for example, angra manyu and ahura mazdah)
  22. Is not how it works, iRO is still and has been changing their 3rd classes with buffs and nerfs for months now (as has kRO). iRO does not usually obtain the finalized balanced product and even if it does, they sometimes change it to suit their own needs!
  23. Maki

    kpop.

    I am very sad, no one mentioned BIGBANG?! Time to make a new sig for them =p
  24. Is that a flower? Hah! Yes it is =p As well as Garu on a swing!
×
×
  • Create New...