OTClient Screen render freezing while keyboard walking

joaobobalhao

Member
Joined
Aug 30, 2011
Messages
18
Reaction score
6
Hello,
I'm using 772 client (edubart otclient) with Nostalrius server (772)

When I walking on otclient using keyboard happens small cuts for each walking SQM:

Another example on different ground:

But on click map (autowalk) this work very well:


I tested keyboard walking on otclientv8 and it works better (more smooth too):


These little freezes on keyboard walking occur at any speed and on different ground.

I tried to implement otv8 walk system but it wasn’t cool because they use another way of drawing (they don't share full source =[)

Can someone help me think of a way to render more smoothly or render normal walking like auto walk (when you click on the map)?
 
OP
J

joaobobalhao

Member
Joined
Aug 30, 2011
Messages
18
Reaction score
6
I can't find the problem, I tested OTHire with the same OTClient and it is much smoother with fewer frames locking when walking.

I tried to change the getSpeedDuration method of creature.cpp and leave the duration equal to that of OTHire, but that didn't work either.
I tried to change several parts of the code from player.cpp, creature.cpp and even OTClient but nothing works. Nostalrius is much slower / freezing when using otclient.
 

Lording

Well-Known Member
Joined
Jan 9, 2008
Messages
787
Reaction score
71
The same happens to me with a downgraded TFS. Another OTClient with modified walksystem is @Mehah (no support for old versions). Maybe if we convert it to works for 7.x this issue get fixed.
I will link the github:
 

wlucas

New Member
Joined
Mar 17, 2021
Messages
2
Reaction score
0
found a solution?
Hello,
I'm using 772 client (edubart otclient) with Nostalrius server (772)

When I walking on otclient using keyboard happens small cuts for each walking SQM:

Another example on different ground:

But on click map (autowalk) this work very well:


I tested keyboard walking on otclientv8 and it works better (more smooth too):


These little freezes on keyboard walking occur at any speed and on different ground.

I tried to implement otv8 walk system but it wasn’t cool because they use another way of drawing (they don't share full source =[)

Can someone help me think of a way to render more smoothly or render normal walking like auto walk (when you click on the map)?
found a solution?
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
781
Solutions
18
Reaction score
320
Location
Santiago - Chile
@joaobobalhao @wlucas try this and see if works
First go to your server sources (not OTC sources) and find
C++:
int64_t Creature::getStepDuration() const
{
    if (isRemoved()) {
        return 0;
    }

Then replace this
C++:
uint32_t calculatedStepSpeed;
uint32_t groundSpeed;

int32_t stepSpeed = getStepSpeed();
if (stepSpeed > -Creature::speedB) {
    calculatedStepSpeed = floor((Creature::speedA * log((stepSpeed / 2) + Creature::speedB) + Creature::speedC) + 0.5);
    if (calculatedStepSpeed <= 0) {
        calculatedStepSpeed = 1;
    }
}
else {
    calculatedStepSpeed = 1;
}

Item* ground = tile->getGround();
if (ground) {
    groundSpeed = Item::items[ground->getID()].speed;
    if (groundSpeed == 0) {
        groundSpeed = 150;
    }
}
else {
    groundSpeed = 150;
}

double duration = std::floor(1000 * groundSpeed / calculatedStepSpeed);
int64_t stepDuration = std::ceil(duration / 50) * 50;

const Monster* monster = getMonster();
if (monster && monster->isTargetNearby() && !monster->isFleeing() && !monster->getMaster()) {
    stepDuration *= 2;
}

return stepDuration;

For this
C++:
uint32_t groundSpeed;
int32_t stepSpeed = getStepSpeed();

Item* ground = tile->getGround();
if (ground) {
    groundSpeed = Item::items[ground->getID()].speed;
    if (groundSpeed == 0) {
        groundSpeed = 150;
    }
} else {
    groundSpeed = 150;
}

double duration = std::floor(1000 * groundSpeed) / stepSpeed;
int64_t stepDuration = std::ceil(duration / 50) * 50;

const Monster* monster = getMonster();
if (monster && monster->isTargetNearby() && !monster->isFleeing() && !monster->getMaster()) {
    stepDuration *= 3;
}

return stepDuration;

Regards!
 
Top