Jump to content

Question

Posted

Hi guys,

 

So recently i did a new IL server for our small group, and i noticed that there is a bug regarding speed. If the characters base runspeed is standard, and you toggle/buff with a certain buff that reduces the speed temporarily, the runspeed goes down to 0 until you cancel that skill. I recompiled my server, checked the skills settings for the runspeed reduction, checked the core settings for the formula calculations, the problem still persists. The only solution i found that works is if i increase the base runspeed by 30, but this isn't a fix. Any ideas why?

 

Here is the link to a short gif to see whats happening:

SpeedBug.gif 

7 answers to this question

Recommended Posts

  • 0
Posted

So, regarding your question I did some testing with a Human Fighter (no speed boost). Base run speed 126.

If i buff with WW lv2, thats +33 speed, totaling at 159 (ok).

Adding Quick Step passive lv2, thats +11 speed, totaling at 170.

Equipping the DC robe set that gives +7 speed, totaling at 177.

As you can see, I can increase the speed as much as I want, and its correct.

Now, with 177 speed, if i activate Parry Stance which is -10% off the basic runspeed (126-10% = 12.6)  (<mul order="0x30" stat="runSpd" val="0.9"/>)  it gives me 164 run speed which is correct again. But, after several tests, i came to the conclusion that the speed decrease is working until the runspeed reaches 115. If the value goes below, it turns to 0. 

I just don't get it why...In the SQL table at the char_templates, the MOVE_SPEED is 115.

This is one weird bug to be honest...

  • 0
Posted

So, "run to walk" toggle also triggers that 0 behavior ?

 

And if you disconnect while being 0, you get 0 at player store ?

 

Buffing you enough (ww2 + run speed totem + bers + ...) + parry stance debuff, for a run speed total higher than 115, don't trigger the behavior ?

 

----

 

You should check about custom config related to speed.

 

If you're sure "115" value triggers it, search for this value on core and  properties.

  • 0
Posted

So after a long and painful testing and searching the core what might cause this bug, i finally caught the little bastard.

My knowledge in coding is mediocre at best, but i still managed to fix the problem.

In the java file gameserver/model/actor/stat/CharStat.java is where the speed is calculated. I compared this file with an older core i have and noticed a small difference:

 

This is the bugged code:

 

	public final float getMovementSpeedMultiplier()
	{
		if (_activeChar == null)
		{
			return 1;
		}
		
		return getRunSpeed() / _activeChar.getTemplate().baseRunSpd;
	}

And this is the fixed code:

	public final float getMovementSpeedMultiplier()
	{
		if (_activeChar == null)
		{
			return 1;
		}
		
		return (getRunSpeed() * 1f) / _activeChar.getTemplate().baseRunSpd;
	}

As you can see, the getRunSpeed function was missing this character * 1f. Not sure what it does, but my guess would be it rounds up the final value. I might be wrong. Either way, its fixed now. Thanks for the advice.

 

  • 0
Posted

If both getRunSpeed() and _activeChar.getTemplate().baseRunSpd are int, then you lose the division accuracy. Introducing 1f add back the float behavior.

 

But normally those values aren't supposed to be both int. Not sure what is your getRunSpeed(), but it should return float normally.

  • 0
Posted (edited)
21 hours ago, Tryskell said:

If both getRunSpeed() and _activeChar.getTemplate().baseRunSpd are int, then you lose the division accuracy. Introducing 1f add back the float behavior.

 

But normally those values aren't supposed to be both int. Not sure what is your getRunSpeed(), but it should return float normally.

Actually, L2J has been using both as integers until Freya (in the case of getRunSpeed, it's probably because packets write speed stats as integers and it seemed an easy solution to them).

Here is the method he's probably using.

	/**
	 * Return the RunSpeed (base+modifier) of the L2Character in function of the Armour Expertise Penalty.
	 */
	public int getRunSpeed()
	{
		if (_activeChar == null)
		{
			return 1;
		}
		
		// err we should be adding TO the persons run speed
		// not making it a constant
		double baseRunSpd = _activeChar.getTemplate().baseRunSpd;
		
		if (baseRunSpd == 0)
		{
			return 0;
		}
		
		return (int) Math.round(calcStat(Stats.RUN_SPEED, baseRunSpd, null, null));
	}

They even preferred rounding value and casting it to int instead of returning it as it is.

Edited by DnR
  • 0
Posted

The first example was not returning a float result as the second one seems like it's the correct one however when you want to do a division between 2 floats and you want the exact result you have to type something like "2/.1f”

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
Answer this question...

×   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

    • Good day. Our game currency store is looking for suppliers of adena and items on a project such as L2REBORN x10. We also sell Epic jewelry and various items on this project L2REBORN x10. There are items and adena on L2REBORN x1. For all questions, write to us in discord - goddardshop
    • AdvExt64 are the only one real L2OFF Developpers still alive. Athena Project is L2J. L2Reborn is Java for their Interlude Seasonal & Essence servers, the rest are fully L2OFF. If you want a pro L2OFF implementation of Protocol 110, your only option is AdvExt64 and be ready to get out your cash, you have to order them a special creation, it will not be cheap at all. If you want a more okish implementation, you can use the one shared here on MXC.
    • We've worked hard for 14 years to gather all the information for your preferred type of game server - we've put together your ideas, your suggestions, information and researches from different knowledge bases and we've made a lot of tests to make the project as good as you love it. Our goal is to create a masterpiece that everyone can enjoy. We are one of the best server and we will be forever. There are many things we did damn right in the past and we will do more in future! Because of that - you're going to see many things you have not seen before on any other servers! Our team knows what you want and what we should do! You value quality and technical excellence? You need safety and exceptional security? You seek true adventures, unique game world, exquisite and eventful game? It means you are in right place! Welcome to L2Blaze, only here you will find and enjoy real game! X150 WARFIRE INTERLUDE SPRING SEASON: 2025 APRIL 26th! Opening time: 14:00 UTC+3 Poland opening time: 13:00 UTC+2 Norway opening time: 14:00 UTC+3 UK opening time: 12:00 UTC+1 Brazil opening time: 8:00 UTC-3 OPENING BONUS Opening bonus for first 100 players who will reach 3rd class will receive VIP Coin as bonus! Automatic registration on game login window, unnecessary to register in website! Do you want stability? Lagless and bugless game? Instant support? Daily PVP? Long-Term playing? You are in the right place, time to start! How to connect STEP BY STEP: 1. Install clear Lineage2 Interlude client 2. Download our patch, delete old system folder and add our 3. Delete, turn off anti virus or add our system folder to anti virus exceptions 4. Run l2.exe from Lineage2/system 5. Enter data on login window and enjoy the game! * You have to remove, turn off or use exceptions of antivirus because of our security protection. It is not a virus. * If you have connection issues with Windows 8 or 10, press right mouse button on l2.exe icon, press Properties, choose compatibility and unmark compatibility mode. Hearts of War EVENT! Collect War Hearts from Hot Springs monsters: Yeti, Buffalo, Antelope, Bandersnatch, Atroxspawn, Flava, Nepenthes, Grendel (3%), Atrox with (6%) and Heart Breaker Boss in Hot Springs Stage 2! You can trade it, sell it or spend in shop! Raid Boss Heart Breaker spawn every 4 hours (+4 hours random) Custom Raid Boss drop list: - Raid Boss Horus, Ember and Brakki, Nakondas: 1 VIP COIN (25%) | Korim (70%). - Raid Boss Apepi, Shacram, Atraiban, Korim: 1 BEWS (10%). - Raid Boss Glaki, Olkuth: 1-2 BEAS (40%). - Raid Boss Golkonda, Galaxia: 1-3 BEAS (60%). - Raid Boss Shyeed: 1-3 BEWS (30%) | 1-7 BEAS (40%) | 1-5 TOP LS 76 (50%). - Raid Boss Shuriel: 1-7 TOP LS 76 (50%) | 1-4 BEAS (60%). - Raid Boss Ashakiel: 1-2 BEWS (30%) | 1-7 TOP LS 76 (50%) | 1-4 BEAS (75%). - Raid Boss Antharas Priest Cloe: 1-3 BEWS (30%) | 1-7 TOP LS 76 (70%). ------------------------------------------------ - Hestia: Demon Splinters / Forgotten Blande (30%). - Ember: Arcana Mace / Draconic Bow (30%). - Galaxia: Angel Slayer / Heaven's Divider (30%) Take your friends, clan, alliance, enemys, sharp your sword, clean your armors and meet your destiny at 2025 APRIL 26th! WEBSITE: http://WWW.L2BLAZE.NET
  • Topics

×
×
  • Create New...