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

    • Bump NEW USER IN TELEGRAM AND DISCORD IS "mileanum"  NEW USER IN TELEGRAM AND DISCORD IS "mileanum"  NEW USER IN TELEGRAM AND DISCORD IS "mileanum" NEW USER IN TELEGRAM AND DISCORD IS "mileanum" 
    • I'm not sure what you're concerned about. Could you elaborate a bit?
    • Opening January 25 at 19:00 (UTC +2) Lineage2dex.com Open Beta Test from January 21 Hello everyone! *This is pre-announcing of new server, so we want to share some key points of this new server. (Full details we announce a bit latter). This will be not seasonal server, server will be separate from Union and our seasonal program. We see a demand for a relaxed setup on a new game server. In the summer of 2022, we launched the first Skadi server, and it gained popularity among our players. You’ve been asking if we’d open it again. Yes, the time has come! After a rather hardcore last season, we want to give you a chance to take a break from excessive grind and enjoy a true PvP server this winter!  Skadi x300 – a server designed for faster character progression and simplified gear acquisition, tailored for solo players and small groups. One of its key features is to reduce the grind and minimize the "mandatory" routines, making it less dependent on joining large clans for character development. Skadi introduces unique (experimental) solutions not typically found on Dex servers. This server offers a refreshing break from the heavy grind present in our recent seasons. Some features: All unique Dex features will be available: New zones, Raids, Talent Tree, MW/PvP version of items, Events, TvT system etc No need craft to get A/S gr equipment. But the crafting system will remain Balanced Olympiad Box Limits: A maximum of 2 clients per PC. Only 1 client can actively participate in PvP/PvE, while the second client is limited to trading and moving around Masterwork items are now easier to obtain, craft simplified When enchanting with a Blessed Enchant Scroll, a failure will no longer reset the enchant level to 0. Instead, it will decrease by a few levels When enchanting with a regular Enchant Scroll, a failure will not destroy the item but will "freeze" it. A frozen item can no longer be enchanted or upgraded, but it can still be used in PvP and PvE Automacros with no time limits, but restricted to one game window per PC A simplified system for obtaining enchants, life stones, and giant's codexes An additional Epic Boss system will allow even solo players and small groups to eventually obtain the coveted Epic jewelry (details we post later) All Raid Bosses have been updated and boosted to level 80 A detailed description of the server will be published soon. Stay tuned for updates! Movies from our players Skadi 2022:  
    • Unfortunately, I couldn't get it to work with Hamachi, the only IP allowed is 127.0.0.1... I don’t really have a reason to buy it, I don’t even have a live server, I just wanted to play with my friend, and the only reason I wanted this was for the DressMe mod... I guess I’ll have to use L2JMobius instead...
  • Topics

×
×
  • Create New...