[C++]ComputePoints Hareket Hızı Fix

Reached

Geliştirici
Geliştirici
Usta Üye
Editör
Mesaj
810
Çözümler
28
Beğeni
737
Puan
839
Karakter hareket hızını sınırı kaldırdım ve bineğe in bin yaptığında bu şekilde bir yavaşlama meydana geldi. Sebebini araştırdığımda Mount ve Unmount fonksiyonlarında ComputePoints Çağırılmış. Aynı olay pet çağırıp gönderdiğimde, kısacası computepoints'in çalıştığı her kodda bu hata karşıma çıktı.
Kodu incelediğimde;
1633682903878.png

(Emin Değilim Ama) - Sanırım eski hız limiti uint8_t olduğundan max 255 alıyordu ve statik olarak 300'e setliyorlardı, sonradan karakterin hareket hızı max 255 olacağından dolayı karakteri yavaşlatmıyordu.
Her neyse buraya 300 yazmak yerine GetMoveMotionSpeed() yaptığımda sorunum çözüldü. Fakat bu doğru bir çözüm müdür tam bilemiyorum. Başka bir yerde hata çıkarır mı sanmıyorum fakat yine de denemekte fayda var.
1633682920229.png



Eski;



Yeni;

 
En son bir moderatör tarafından düzenlenmiş:
Bu hareket hızının sınırının kaldırılmasındaki amaç nedir? Yani bilmediğimden soruyorum.
Son zamanlarda herkes bunu yapıyor, oysa oyunun kendine ait olan hız sınırı (iksirlerle falan) gayet iyi bence.
 
Bu hareket hızının sınırının kaldırılmasındaki amaç nedir? Yani bilmediğimden soruyorum.
Son zamanlarda herkes bunu yapıyor, oysa oyunun kendine ait olan hız sınırı (iksirlerle falan) gayet iyi bence.
Bir adet sistem yazdım, itemi bineğin üstüne sürükleyince ekstra hız alıyorsunuz. Bunun için yaptım.
 
Hareket hızı verisinin tutulduğu değişkenlerin veritipini yükseltsek sorun çözülmez mi?
 
Hareket hızı verisinin tutulduğu değişkenlerin veritipini yükseltsek sorun çözülmez mi?
Veri tipini yükselttikten sonra hareket hızı limitini getlimitpoint fonksiyonundaki POINT_MOV_SPEED üzerinden arttırıyoruz. Arttırdıktan sonra computepoints çalışan tüm fonksiyonlarda computepoints bizim hareket hızımızı 300'e setliyor. Bunun yerine karakterin sahip olduğu movespeed'e setliyorum. Kısaca mantık bu.
 
Veri tipini yükselttikten sonra hareket hızı limitini getlimitpoint fonksiyonundaki POINT_MOV_SPEED üzerinden arttırıyoruz. Arttırdıktan sonra computepoints çalışan tüm fonksiyonlarda computepoints bizim hareket hızımızı 300'e setliyor. Bunun yerine karakterin sahip olduğu movespeed'e setliyorum. Kısaca mantık bu.
I think you all had the problem with the speed limit, like you and me.
When you have more than 255 to slow down completely,
And on the net you can find all kinds of nonsense as you can do and no mobs appear. or it's a variant like you did,
But I used it as follows. (the one that removes that limit)

ON: Sursa/game/src: char.cpp
Searching for:


case POINT_ATT_SPEED:
min_limit = 0;

if (IsPC())
limit = 170;
else
limit = 250;
break;

case POINT_MOV_SPEED:
min_limit = 0;

if (IsPC())
limit = 400;
else
limit = 470;
break;



For Attack Speed change here Maximum limit: limit = 170; / limit = 250;

case POINT_ATT_SPEED:
min_limit = 0;

if (IsPC())
limit = 170;
else
limit = 250;
break;


For movement speed change here Maximum limit: limit = 400; / limit = 470;

case POINT_MOV_SPEED:
min_limit = 0;

if (IsPC())
limit = 400;
else
limit = 470;
break;


And if you want to change the basic speed that the character receives at the beginning of the game and is 100
Search and edit here:


Searching for:

void CHARACTER::ComputePoints()

Below you have:
SetPoint(POINT_MOV_SPEED, 100); // From here you change the basic movement speed of the player
SetPoint(POINT_ATT_SPEED, 100); // From here you change the basic attack speed of the player


And for all this to work:
Go to
(packet.h)
ON: (Game & Binary)

searching for:
typedef struct packet_add_char

typedef struct packet_add_char2

packet_update_char

packet_update_char2


Some of you only have 1/2 or all of the above functions,
in them look for these 2 lines of code:


BYTE bMovingSpeed;
BYTE bAttackSpeed;


You change them everywhere like this:

WORD bMovingSpeed;
WORD bAttackSpeed;


Proof:
 
I think you all had the problem with the speed limit, like you and me.
When you have more than 255 to slow down completely,
And on the net you can find all kinds of nonsense as you can do and no mobs appear. or it's a variant like you did,
But I used it as follows. (the one that removes that limit)

ON: Sursa/game/src: char.cpp
Searching for:


case POINT_ATT_SPEED:
min_limit = 0;

if (IsPC())
limit = 170;
else
limit = 250;
break;

case POINT_MOV_SPEED:
min_limit = 0;

if (IsPC())
limit = 400;
else
limit = 470;
break;



For Attack Speed change here Maximum limit: limit = 170; / limit = 250;

case POINT_ATT_SPEED:
min_limit = 0;

if (IsPC())
limit = 170;
else
limit = 250;
break;


For movement speed change here Maximum limit: limit = 400; / limit = 470;

case POINT_MOV_SPEED:
min_limit = 0;

if (IsPC())
limit = 400;
else
limit = 470;
break;


And if you want to change the basic speed that the character receives at the beginning of the game and is 100
Search and edit here:


Searching for:

void CHARACTER::ComputePoints()

Below you have:
SetPoint(POINT_MOV_SPEED, 100); // From here you change the basic movement speed of the player
SetPoint(POINT_ATT_SPEED, 100); // From here you change the basic attack speed of the player


And for all this to work:
Go to
(packet.h)
ON: (Game & Binary)

searching for:
typedef struct packet_add_char

typedef struct packet_add_char2

packet_update_char

packet_update_char2


Some of you only have 1/2 or all of the above functions,
in them look for these 2 lines of code:


BYTE bMovingSpeed;
BYTE bAttackSpeed;


You change them everywhere like this:

WORD bMovingSpeed;
WORD bAttackSpeed;


Proof:


Hi friend, can you post the public.dds and windows.dds files? There was one in the server files, but I don't remember.
 
I think you all had the problem with the speed limit, like you and me.
When you have more than 255 to slow down completely,
And on the net you can find all kinds of nonsense as you can do and no mobs appear. or it's a variant like you did,
But I used it as follows. (the one that removes that limit)

ON: Sursa/game/src: char.cpp
Searching for:


case POINT_ATT_SPEED:
min_limit = 0;

if (IsPC())
limit = 170;
else
limit = 250;
break;

case POINT_MOV_SPEED:
min_limit = 0;

if (IsPC())
limit = 400;
else
limit = 470;
break;



For Attack Speed change here Maximum limit: limit = 170; / limit = 250;

case POINT_ATT_SPEED:
min_limit = 0;

if (IsPC())
limit = 170;
else
limit = 250;
break;


For movement speed change here Maximum limit: limit = 400; / limit = 470;

case POINT_MOV_SPEED:
min_limit = 0;

if (IsPC())
limit = 400;
else
limit = 470;
break;


And if you want to change the basic speed that the character receives at the beginning of the game and is 100
Search and edit here:


Searching for:

void CHARACTER::ComputePoints()

Below you have:
SetPoint(POINT_MOV_SPEED, 100); // From here you change the basic movement speed of the player
SetPoint(POINT_ATT_SPEED, 100); // From here you change the basic attack speed of the player


And for all this to work:
Go to
(packet.h)
ON: (Game & Binary)

searching for:
typedef struct packet_add_char

typedef struct packet_add_char2

packet_update_char

packet_update_char2


Some of you only have 1/2 or all of the above functions,
in them look for these 2 lines of code:


BYTE bMovingSpeed;
BYTE bAttackSpeed;


You change them everywhere like this:

WORD bMovingSpeed;
WORD bAttackSpeed;


Proof:

Gotch u, thank you for your comment but this problem also occurred in people who did not remove the speed limit. That's why i shared. By the way, my problem is not caused by what you said. When I test what you said on my test server, this problem does not happen. I think there is something in my own files that conflicts with this. Thanks again for your comment.
 
Geri
Üst