Jump to content

[SHARE] Hexagon Character Stats


Recommended Posts

Hey everybody,

 

One habit I have is creating a lot of stuff for Lineage 2 (java at least) and deleting it after I'm done with it. As I've recently been working on a project related to L2 with a friend I decided instead to release building blocks of my code that people can use to implement in their own solutions.

 

So part of my project involves a custom character creation process via a web user interface. One of the things I wanted to implement was a hexagonal style chart displaying the spread of statistical points.

YtYOr7v.jpg

 

Live test example of my objects in use: http://www.qzmpox.nl/l2/hexagon/hexagontest.php

 

So, I made it! And because I love all you guys so much (not really, most of you release the same pvp buffers over and over again and ask the same inane java questions, but oh well) I decided to release the building blocks I'm using to create the above image. So, let me explain:

 

- This requires a knowledge of PHP Programming

- This requires object oriented knowledge.

- This requires basic trigonometry knowledge.

 

Firstly, let me explain what this isn't:

This isn't code that will effect your gameserver. This isn't code that will have an impact on your data. This isn't a final solution to ready to be deployed. This also isn't the graphical information you see above in the picture.

 

Ok, then what is it?

Building block objects, provided to help you easily implement this style of solution in your own forum/website/project.

 

Then why is this useful?

Versatility! These objects have been built to be used with each other but also these objects can be use independently in projects even outside of Lineage 2! Perhaps you're even just curious and would like to see the code how it's done.

 

- CVector2.php

This is a general 2 dimensional vector object. You have an X and Y value. This object also includes static helper functions for doing mathematical operations upon vectors easily without having to pull their individual X and Y values out from the object. This can be used in all applications that involve some points in a coordinate system.

 

- CHexagon.php

This is a general hexagon calculated within a unit circle. An offset can be provided to this class since images in browsers are calculated with the origin of (0,0) being the top left corner instead of in the center. This hexagon can also be scaled to whichever size fits your application the best.

 

I'm not sure how Lineage 2 is involved.

No problem, because there are more objects!

 

- CL2StatsRepository.php

Following Domain Driven Design this object is responsible for pulling up information regarding the different classes which are defined in a seperate file (classes.json, but we'll talk about that in a bit). This repository will collect information from the JSON file, create instances of domain objects (CL2Stats) and place them in an array.

 

- CL2Stats.php

Following Domain Driven Design still this object contains all the information about a particular class. This object also calculates the scalar values for each statistic. The scalar value is a percentage of the actual stat value versus the max possible stat value. I originally had Interlude in mind but I know the later chronicles have higher values so I left this value adjustable.

 

- classes.json

A json string that contains information about avaliable classes. If your server features custom classes or you've removed some than this list is adjustable whenever so it's no problem! The inside hexagon points will be calculated automatically for the new class.

 

You said earlier theres no graphics, how do you use it then?

However you want! The geometrical information describing the entire picture is already completed for you. How you choose to draw or present these to players is left up to you using whichever graphical library you'd like to use. Maybe you don't even want to use in the same sense as I do. This can be applied to statistical things regarding L2 as well. There is an example of how I did it which you can see via files hexagontext.php and hexagonpng.php.

 

I know this one isn't very fantastic for most of you guys, but I'll be releasing my work as I go along. So perhaps I'll have some nice goodies in the future.

Download: http://www.qzmpox.nl/l2/hexagon/L2Hexagon.zip

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
    • we sell website templates, make websites to order. Great selection at very good prices. My contacts discord : advert1231 telegram : https://t.me/ggwpins  
  • Topics

×
×
  • Create New...