Jump to content

Recommended Posts

Posted (edited)

Long story short, I've written a function that displays a circle around the character when certain conditions are met. However, I can't seem to find a way to make it so that the circle in question is dynamic, or in other words to make it move around with the character. (No matter what I tried, the result was always the same - heavy FPS drop in the client after 15-20 seconds).

Is there a way to update the circle in real time (as the character moves) and if so, how?

I'm looking for a solution that does not involve client modifications. Any ideas, tips, and tricks are more than welcome.

Edited by Bru7aLMike
improved clarity
Posted
1 hour ago, Bru7aLMike said:

Long story short, I've written a function that displays a circle around the character when certain conditions are met. However, I can't seem to find a way to make it so that the circle in question is dynamic, or in other words to make it move around with the character. (No matter what I tried, the result was always the same - heavy FPS drop in the client after 15-20 seconds).

Is there a way to update the circle in real time (as the character moves) and if so, how?

I'm looking for a solution that does not involve client modifications. Any ideas, tips, and tricks are more than welcome.

 

A primitive packet require you to define it using a name.

Basically try send again an empty primitive or to a different location such as 0, 0, 0 with the same name and it will replace it.

Posted (edited)

Well, I did try sending an empty primitive but the client still suffered from an FPS drop.  I'll try sending a point at predetermined coordinates next.

Any idea how to make it so that the circle moves with the character without clearing the existing lines and sending them all over again at different coordinates?

Like, is there a way to basically link the said packet to player's coordinates so that no matter where the character goes, the circle goes with it and the char is always in the middle of the circle (from top-down perspective).


I realise this might be a silly question but I'm still new to this kind of stuff, so... here we go. 😄

What would happen if I simply send another packet with the same name but with different coordinates without clearing the lines of the previous one? Would the old one be replaced?


 

//debug_center: the assigned name of the packet 
//clearDebugPackets: clears all lines and points associated with the packet and sends an empty packet with the same name
//reset(): clears the cached packet server side;

debug_center = activeChar.getDebugPacket("center");
debug_center.reset();
activeChar.clearDebugPackets(debug_center);

 

Edited by Bru7aLMike
additional question in order not to spam the thread
  • Thanks 1
Posted

The only possibility would be to use a Threadpool and call it every X times. That packet DRAWS things on client, there is nothing like "realtime". It stays on screen until you decide it mustn't stay on screen.

 

As you say, more you use forms, laggier your client will be. At this moment, I don't think it's possible to dump all the "hidden" forms, even after a packet reset. Client properly cleanups when the Player actually disconnects to the lobby, which probably cleans all forms from client memory.

  • 3 weeks later...
Posted (edited)
On 12/6/2021 at 7:29 PM, Tryskell said:

The only possibility would be to use a Threadpool and call it every X times. That packet DRAWS things on client, there is nothing like "realtime". It stays on screen until you decide it mustn't stay on screen.

 

As you say, more you use forms, laggier your client will be. At this moment, I don't think it's possible to dump all the "hidden" forms, even after a packet reset. Client properly cleanups when the Player actually disconnects to the lobby, which probably cleans all forms from client memory.

Hello , i am using acis 382 pack and i set when teleporting into town to get rr , select char and enterworld and i am wondering if is there any way to check client memory cache size to set this to happen when is like > 60% full ? because right now i just set to Rnd.get(1,100) > 47 🙂

Edited by arm4729
  • 2 years later...
Posted (edited)

You can LOCK the topic. I have finally found the answer to my problems. It appears to have been here, on the forum, all along.
And more specifically, the following excerpt of Elfo's comment:

"In order to fix that you have to store the original Location (x, y, z) of the player when they EnterWorld.

When you create an ExServerPrimitive package you need to provide a name, an x, a y and a z. These values NEED to be the X of the spawn location and the Y of the spawn location. The Z can be -65535 to ensure that the icon will be below the ground."

 



 

On 12/6/2021 at 7:29 PM, Tryskell said:

The only possibility would be to use a Threadpool and call it every X times. That packet DRAWS things on client, there is nothing like "realtime". It stays on screen until you decide it mustn't stay on screen.

 

As you say, more you use forms, laggier your client will be. At this moment, I don't think it's possible to dump all the "hidden" forms, even after a packet reset. Client properly cleanups when the Player actually disconnects to the lobby, which probably cleans all forms from client memory.



From what I could gather over the years, it appears as if the client replaces the circle based on String "NAME", which you send with the ExServerPrimitive.

Also, I did try your suggestion, albeit slightly altered, and it works like a charm. Namely, creating a runnable that loops through a POOL of players and sends them the updated Circle. A player is added and removed from the pool based on the VIEW FARM ZONE OUTLINE variable status. I'm just not sure if I should stop the runnable when the pool is empty or let it cook, given the fact that it loops only once per second and that I'm using a Flag at the very first check to break execution if the POOL is empty.

Edited by Salty Mike
Posted (edited)
On 6/11/2024 at 6:48 PM, Salty Mike said:

You can LOCK the topic. I have finally found the answer to my problems. It appears to have been here, on the forum, all along.
And more specifically, the following excerpt of Elfo's comment:

"In order to fix that you have to store the original Location (x, y, z) of the player when they EnterWorld.

When you create an ExServerPrimitive package you need to provide a name, an x, a y and a z. These values NEED to be the X of the spawn location and the Y of the spawn location. The Z can be -65535 to ensure that the icon will be below the ground."

 


From what I could gather over the years, it appears as if the client replaces the circle based on String "NAME", which you send with the ExServerPrimitive.

 

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

Quote
private Location _enterWorld;
private final Map<String, ExServerPrimitive> _debug = new HashMap<>();


https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads

Quote

// Set the location of debug packets.
player.setEnterWorldLoc(player.getX(), player.getY(), -16000);

 

Edited by Tryskell
  • Thanks 1
Posted
On 6/11/2024 at 7:48 PM, Salty Mike said:

You can LOCK the topic. I have finally found the answer to my problems. It appears to have been here, on the forum, all along.

This is dedication! 2 years working on a problem. Congratulations!

Posted
16 hours ago, Tryskell said:

 

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

 


Thanks!

I'll take a second look and let you know if my implementation of the clearCircle() helps with the stuttering once I find time for some extensive testing.

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

    • Yeah inside router i had to enable udnp services 
    • Hello cheaters, As a team of avid developers and enthusiasts of Lineage 2, we are excited to present the L2 Control Hub, a groundbreaking plugin designed by myself and my collaborator, StinkyMadness. This innovative tool equips server administrators with powerful automation capabilities directly within the game's community board. L2 Control Hub simplifies the creation and management of automations, enabling you to customize your server operations without the need to modify the source code.   Key Features of L2 Control Hub: Robust Automation Triggers: Select from a plethora of triggers currently available, with continuous additions in the works to enhance your control options. Dynamic Conditions and Actions: Tailor your server operations with an extensive range of conditions and actions, ensuring flexible and precise control over game events and player interactions. Customizable Variables: Easily integrate server-specific variables from your database to further personalize and streamline your automations. Utilize these variables across various automation scenarios to cater to your specific server requirements. JavaScript Integration: Execute custom JavaScript codes that interact seamlessly with Java classes, bringing advanced functionalities to your server's ecosystem.   Explore L2 Control Hub in Action: We've prepared a series of video tutorials to demonstrate the capabilities of L2 Control Hub: Control Hub - Create a Simple Flow with 1 Condition and 1 Action: Get started with basic automations. Control Hub - Multiple Conditions with Multiple Actions: Explore more complex automations for detailed server management. Control Hub - Using Variables: Discover how to implement and use custom variables for tailored automations. Control Hub - Using JavaScript: Experience the power of custom scripts in enhancing your server functionality.   L2 Control Hub is currently about 70% complete, and we are actively developing and refining features. We invite you to join our ➡️ Discord community ⬅️ to engage with the development process, provide feedback, and be the first to test new features. Additionally, any updates or changes to the plugin are seamlessly delivered to all customers directly from our web server, ensuring your system is always up-to-date without the need for manual downloads.   Your game, your rules, automated. Join us in redefining server management in Lineage 2 and elevate your gaming community with unmatched automation capabilities. For more details, contact us directly to get started with L2 Control Hub.   Currently, the plugin is developed using aCis sources. We will continue with these sources until we finalize all the necessary details before proceeding to integrate with the more prominent sources available.       The L2 Control Hub is designed to extend beyond mere functional additions to your server. We are in the process of implementing a suite of advanced mechanisms, such as a vote manager capable of interfacing with any Lineage 2 voting site without requiring configuration, live statistics to provide admins with real-time insights, and an event engine that can generate any desired event within seconds. All these features will be seamlessly integrated into the module, enhancing your server management experience significantly.     Please note that L2 Control Hub will be a premium tool, reflecting the extensive features and benefits it offers. While we are finalizing the pricing structure, rest assured that we aim to deliver great value for your investment. We will announce the cost details soon on our platforms to ensure everyone is well-informed and can plan accordingly. Join us to take your server management to the next level with L2 Control Hub.     
    • The link soucer and system are off, reup please, thanks very much @HypeH
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • Hola, Busco proveedores de adena en Reborn signature. Trabajo serio, Web de ventas Seria. Adena-Shop. Discord: susi007317   Hello, I am looking for adena suppliers in Reborn signature. Serious work, Serious sales Web. Adena-Shop. Discord: susi007317
  • Topics

×
×
  • Create New...