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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • From Salvation onwards I think you need a patched nwindow.dll that allows such modifications, try to see if you get what you need here: https://drive.google.com/drive/u/1/folders/1LLbQFGf8KlR-O0Iv5umfF-pwZgrDh9bd
    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
  • Topics

×
×
  • Create New...