Jump to content

Recommended Posts

Posted

You could, indeed, get this done simply by giving characters a passive skill and applying the bonuses depending on the character class, as Kelrzher said. But you're not really going to balance anything that way.

 

Lineage II always have had its very own meaning of balance.

well... at least it's something.. :P

Posted

Create a table, array or whatever container to hold the values you want to edit, and then simply call it.

 

Example Map<Integer, int[]> : first int would be clas id, and then the array holds the value. Eventually imbricated Maps if you want to put weapon types : Map<Integer, Map<WeaponType, int[]>>.

 

Your code is barely readable, and hard to maintain.

Posted

Create a table, array or whatever container to hold the values you want to edit, and then simply call it.

 

Example Map<Integer, int[]> : first int would be clas id, and then the array holds the value. Eventually imbricated Maps if you want to put weapon types : Map<Integer, Map<WeaponType, int[]>>.

 

Your code is barely readable, and hard to maintain.

Finally a real feedback.

Thank you for your answer but i think you are kinda wrong...

I can't hold 2 Map values with the same key, can I?

I mean... to do that i must put

Map.put("Class 96", Map2.get("SWORD",
{
     1.2,
     1.1,
     1.3
};)

and then

Map.put("Class 96", Map2.get("DUAL_SWORD",
{
     1.0,
     1.2,
     1.3
};)

Can i actually do that?

Posted (edited)

I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

 

You, you want to retrieve player classid, then retrieve weapon type, then only you refer to array of values.

 

From what I understand, it fits.

 

https://xp-dev.com/svn/aCis_community/aCis_gameserver/java/net/sf/l2j/gameserver/datatables/BufferTable.java

 

See _schemesTable implementation.

 

PS : you are right, you can't put twice the same key, otherwise it replaces. So you have to feed entirely map2, then only when map2 is fed you place on correct classid. Then you clear() map2, refeed it with correct info, and put it on another classid. Do the same for all classes.

 

Your Map would probably be Map<Integer, HashMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

 

AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

 

You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

Edited by Tryskell
Posted (edited)

I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

 

You, you want to retrieve player classid, then retrieve weapon type, then only you refer to array of values.

 

From what I understand, it fits.

 

https://xp-dev.com/svn/aCis_community/aCis_gameserver/java/net/sf/l2j/gameserver/datatables/BufferTable.java

 

See _schemesTable implementation.

 

PS : you are right, you can't put twice the same key, otherwise it replaces. So you have to feed entirely map2, then only when map2 is fed you place on correct classid. Then you clear() map2, refeed it with correct info, and put it on another classid. Do the same for all classes.

 

Your Map would probably be Map<Integer, HashMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

 

AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

 

You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

hmmm bad idea... to much Map calculations...

The code gets the final outcome from Formula.java and it gets calculated with the code (%) and gives the final damage...

I think your thought could cause performance issues.. Imagine all these Map calculations in each hit or skill.. On a server with more than 20 people pvp'ing, the server would lag really badly i guess, wouldn't it?

 

Edit: I'm not using string.. It doesn't need too actually... I think xml would be better than properties... too much values...

Edited by xXObanXx
Posted
Your code is barely readable, and hard to maintain.

If you read and understand the first class, then you know the rest of the code... It's not hardcoded at all but i wanted to keep the performance part, that's why i didn't use any Map.

And I steel don't know what this code's performance would be in a live server, that's why i asked for a feedback, to tell me your thoughts :)

Posted (edited)

The cost of 2 maps .get() is neglictable compared to the gain of readability.

 

I don't even speak of my last point, which is the possibility to load from a config file, and so you can edit your crap externally, without the needs to recompile and replace your .jar. In any case, if you want to edit using an external way, you will have to use my method or a derivated (container).

 

If you state about performance issue, that means you got no clue what is REALLY happening during a server session. If we speak about spawns, that's 60k concurrent map, updated every second, according L2WorldRegion which are 88*128 = 10k. That's right you got 10k region, each holding 2 maps = 20k maps and a task to activate/desactivate it = 10k tasks.

 

As you can see, babbling about 2 .get() and a static map holding infos is kinda nonsense, while knownlist system is basically said 80k Maps and 10k tasks.

 

Finally if you want to edit, one day, the main formula used xxx times you have to edit it xxx times. I will have only a single line to edit.

Edited by Tryskell
Posted

private HashMap<Integer, HashMap<String, ArrayList<Integer>>> schemeCache = new HashMap<>();

 

L2AEPvP scheme buffer !

Posted

I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

 

HashhMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

 

AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

 

You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

 

And the benchmarks:

 

LOAD:

 

gsDhXDI.png

 

SAVE IN DB:

 

YguonDy.png

 

 

Ofc all ingame operation are done in the RAM and there's no DB connections. The schemes are loaded once in db, then truncated and saved in DB using myISAM ofc.a

Posted

Finally a real feedback.

Thank you for your answer but i think you are kinda wrong...

I can't hold 2 Map values with the same key, can I?

I mean... to do that i must put

Map.put("Class 96", Map2.get("SWORD",
{
     1.2,
     1.1,
     1.3
};)

and then

Map.put("Class 96", Map2.get("DUAL_SWORD",
{
     1.0,
     1.2,
     1.3
};)

Can i actually do that?

Well why don't you create support class?

Example

 

public class classBalance
{
    int values[];
    string name;

    public classBalance(String nm,int vl)
    {
        name = nm;
        values = vl;
    }

    //create your own get and set methods
}


So you could use something like that:

Map<Integer,classBalance>;

 

Dunno if this is gonna be "heavy" for your system or generally if it is heavy but for sure it will be more readable and easy to work on it. ( I guess)

Posted (edited)

private HashMap<Integer, HashMap<String, ArrayList<Integer>>> schemeCache = new HashMap<>();

 

L2AEPvP scheme buffer !

 

I have written it from zero, based on DrHouse scheme buffer (shared on L2J).

 

I don't have a clue what is L2AEPvP. If you or another guy made a similar implementation, that only means it was the most obvious implementation. The saving process is also made on server shutdown.

Edited by Tryskell
Posted (edited)

I have written it from zero, based on DrHouse scheme buffer (shared on L2J).

 

I don't have a clue what is L2AEPvP. If you or another guy made a similar implementation, that only means it was the most obvious implementation. The saving process is also made on server shutdown.

 

 

L2AEPvP its aCis 260 rev still online today, I've coded it's scheme buffers based on that HashMap

Edited by xxdem
Posted (edited)

I'm sorry boys but I don't get it..

It doesn't need to store all these informations into Maps.

Each player has a different class and weapon.. but I don't get it why I should do all this...

It's like a duplicate of the whole class/weapon system because all these weapons and classes are stored in enums and i call them directly from their classes...

My current code is probably barely readable but it's simple and easy to understand..

 

Edit: Btw I'm currently opening the server from eclipse debugging so I don't need to recompile and change .jar files to change the value... i just change it from eclipse/save it and boum... the value has change and gets immediate effect... I will think about placing in properties or an xml later..

Edited by xXObanXx
Posted (edited)

I'm sorry boys but I don't get it..

It doesn't need to store all these informations into Maps.

Each player has a different class and weapon.. but I don't get it why I should do all this...

 

Readability, easy code maintenance, easy to edit values (no need to recompile) externalizing configs. Basically said, whatever a developer seek coding.

 

Your code works that's not the problem, but if L2J was coded like your custom... Well it would give L2JFrozen.

 

:happyforever:

Edited by Tryskell

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Posts

    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
    • ACTUALIZATION > SAMURAI CROW PRICE. 500$ (P542) 300$ (P520) 200$ (P509)  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock