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

    • Hello everyone I'm Albert, Starting now with the dream on have a L2 server, I'm having several issues with RS and I need someone help to Create an skill and implement to the correct class ID and make it work. Skill Required from me is  Festival Sweep  Skill or Item with the ability. I really need help guys and then after if possible i would need NPC and skins with .dressme        
    • Changeset 410 (3371)   Makers, NpcAi / Desires, Cursed Weapon rework, Bugfixes, Admincommands, Movement, Organization   Makers Fix ghost corpses. Introduce task manager for MultiSpawn spawn schedule. Introduce task managers for Npc respawn and despawn tasks. Add missing random treasurebox maker. NpcAi / Desires AttackableAttack > NpcAttack, allowing ATTACK_FINISHED event over Npc. Merge all reduceWeight from NpcAI operations. Don't broadcast MoveToPawn packet for cast hold scenarii. CH and CP managers use hold cast. Probably way more to add. Rework DesireQueue#addOrUpdate to avoid to generate a List. Drop _isInHitAnimation, avoid twice runAI calls upon attack end animation, save a ThreadPool. Implement Desire#isInvalid, used over the main loop to clean invalid Desires. All sided getDesires().removeIf are dropped, notably over AggroList/HateList. Cursed Weapon rework Fix potential task scheduling issues, reworking the whole layers. Reduce code by 1/3. Use L2OFF formulas/data for item drop rate, staging process. CW end duration now decreases when killing other Players. Bugfixes Revert schedule part from ThreadPool. Fix Pet inventory IU. Ty Denzel for the report. Fix Pet item timestamp reuse delay. Ty artemis for the fix. Disable automatic beastshots when his owner dies. Ty Root for the report. Player cannot craft while casting a skill, nor trade. Ty Root for the report. Add missing weight checks for player/summon pickup, and player craft. Ty Root for the report. Implement /graduatelist command, which displays a list of clan academy graduates for the past week. Ty RooT for the report. Fix PLAYING_FOR_LONG_TIME concept ; rest message is server related, not Player related. Ty RooT for the report. Player should stop movement when opening store. Fix Q351 occurences of itemId 4310 by 4407 one + slight fix. Fix Q365 missing memoState + poison skillId. Ty Root for the report. Fix Q417 Torai despawn over cond 11. Fix Q216 4 missing npcIds. Ty Karudin for the report. Fix the invalid comment of DeleteCharAfterDays Config. Fix NPC drop penalty level calculation. Ty Bandnentans for the report. Items are now dropped in a 30/45 donut shape around dropper. Ty Bandnentans for the report. PartyMatch fixes Don't show Party members or CW holder as available waiting members. You can't show overall List or join a PartyMatch room as CW holder. CW owner, upon acquisition, leave PartyMatch system. PartyMatch window is now automatically closed upon Player#removeMeFromPartyMatch. Remove Player from PartyMatch if Player and newly joined Party leader PartyMatch rooms differ. You can't join or be invited in a PartyMatch room if already partying/CW holding. Fix ShowLicence config when set to false. Ty artemis for the fix. Fix maximum number of macros. Ty artemis for the fix. Fix invalid IU update over //enchant. Ty artemis for the fix. Fix Castle Mass Gatekeeper HTMs. Ty kingNik0n for the fix. Drop _disabledItems implementation. Won't be used by next refactors. Ty artemis for the report. Fix loading handlers under debug. Ty Keku for the fix. Fix character_macroses table structure (commands = 12x32 chars minimum). Admincommands Merge all old spawn admincommands (//list_spawns, //spawn, //unspawnall, //respawnall, //delete) to //spawn and //unspawn (previously //delete). Generate //help. //unspawn works over all ASpawn. Merge all old fence admincommands (//spawnfence, //deletefence, //listfence) to //fence [add|remove], generate AdminFence. They now use proper Pagination. You can also teleport to it. Implementation of //show manor. Implementation of //set quest <id> [cond]. Related items must be hand-given. Implementation of //set henna [page] [add|remove symbolId]. The hennas are still bound to game logic (slots, canBeUsedBy). Movement - Ty LaRoja, Bandnentans Fix Boats IOOBE. Adapt getHeight logic from L2OFF. Introduce back WASD movement, handle boat board/unboard. Fix WATER/FLY movement logic. Avoid to pathfind diagonal cells with detected obstacle. Organization Addition of QuestVars class, holding all related variables from quests (itemIds, npcIds, questNames, sounds, etc), allowing to reduce length of each script while reusing variables. 100+ cloned variables were deleted. Refactor geometry package and Territory. Territory is now a unique 3D shape, holding any type of 2D geometry.  Remove few useless Location#clone uses. Implementation of ItemContainer#forEachItem. Clean many unused FrequentSkill. The whole enum is questionable. Drop MathUtil#checkIfInRange, implement WorldObject#isInStrictRadius (involve collision of that WorldObject, and potential WorldObject parameter). WorldObject#isIn2DRadius parameter is now a Point2D, not a Location (since a Location inherits Point2D, Location are still usable as parameter). Rework Pagination#generatePages to handle page number > 1000. Use Pagination over Tryskell SchemeBuffer. Ty CUCU23 for the share.
    • It's a custom instance used as Event not retail - like. You can re-create it easily.
    • GRAND OPENING TODAY !!! FROM - 16/05/2025, FRIDAY, 20:00 +3 GMT !
  • Topics

×
×
  • Create New...