[HELP] RoseZa - Health not showing properly

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[HELP] RoseZa - Health not showing properly

Postby toyz on Sun Nov 15, 2015 12:09 pm

Hi there,
I'm sorry if this isn't the right place to post this

So basically, There is a bug with my server files with the way the server sends the user's HP and MP.

Let's say i'm in game and have 100% HP, it will say 7,000/7,000
i attack a monster, and i get damage, the HP still remains 7,000/7,000
I tried investigating the issue and realized that when i type "/info"
the server sees my HP as 9,000/9,000
So the monster did damage to me, but in reality the damage is subtracted from the 9,000 and therefore my client doesn't see that damage until it reaches below 7k

(numbers are just for clarification)

I believe it is an issue with how the server files send char packets to the client but i don't know what to look for
I'm just starting out with coding and server files and could really use some guidance and help :(


Sorry for the long post!
Hope someone can help out

Thank you :)
toyz
Little soul
Little soul
 
Posts: 9
Joined: Sun Nov 08, 2015 5:07 am

Re: [HELP] RoseZa - Health not showing properly

Postby PurpleYouko on Mon Nov 16, 2015 3:35 pm

It's not packets. Those are fine.
Your problem is that your server and client are both calculating your stats and they don't agree.
When you send a 0x0799 packet to the client to show damage given it goes to a function which "adjusts" your HP by the amount of damage received. It has no way to know what the server thinks your maxhp is. It just goes on it's own calculated value.
Since the damage packet only contains damage and not totals then all the client can do is display what it thinks is right.

The other half of the problem is the 0x07ec packet which is sent on every game cycle for every character.
This one contains values for your current HP and MP as seen in the server so if the server is sending 9000 - whatever damage was taken (500 for sake of argument) then the client receives a value of 8500 as current HP. It's internal code takes a look at this and sees that it is above its own calculated max so it displays that instead. Therefore you get 7000 almost continuously with just a few blips when damage is actually taken.

There are only 2 possible solutions for this
1) Get a hold of the client source code and fix it so that it only displays what the server tells it to.
2) Fix your server side MaxHP calculations so that they match the ones the client is using.

I'm currently looking into ways to do option 1 using the evo 137 files that were released a couple of years ago but due to the client code architecture it's taking a long time to get it into any kind of usable condition.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4600
Joined: Fri Aug 10, 2007 2:05 pm

Re: [HELP] RoseZa - Health not showing properly

Postby toyz on Tue Nov 17, 2015 1:49 am

PurpleYouko wrote:It's not packets. Those are fine.
Your problem is that your server and client are both calculating your stats and they don't agree.
When you send a 0x0799 packet to the client to show damage given it goes to a function which "adjusts" your HP by the amount of damage received. It has no way to know what the server thinks your maxhp is. It just goes on it's own calculated value.
Since the damage packet only contains damage and not totals then all the client can do is display what it thinks is right.

The other half of the problem is the 0x07ec packet which is sent on every game cycle for every character.
This one contains values for your current HP and MP as seen in the server so if the server is sending 9000 - whatever damage was taken (500 for sake of argument) then the client receives a value of 8500 as current HP. It's internal code takes a look at this and sees that it is above its own calculated max so it displays that instead. Therefore you get 7000 almost continuously with just a few blips when damage is actually taken.

There are only 2 possible solutions for this
1) Get a hold of the client source code and fix it so that it only displays what the server tells it to.
2) Fix your server side MaxHP calculations so that they match the ones the client is using.

I'm currently looking into ways to do option 1 using the evo 137 files that were released a couple of years ago but due to the client code architecture it's taking a long time to get it into any kind of usable condition.


OH! I had no idea the client calculated stats as well!
Thought it was just server files that handled the calculations.
Honestly, my client editing abilities are limited to what is posted in forums haha, so i can't do 1.
But i will give #2 a shot.

Sorry if this sounds dumb, but how would i use the client's HP calculations instead of server?
toyz
Little soul
Little soul
 
Posts: 9
Joined: Sun Nov 08, 2015 5:07 am

Re: [HELP] RoseZa - Health not showing properly

Postby PurpleYouko on Wed Nov 18, 2015 3:25 pm

You have to use a process of trial and error.
You start with no items equipped on a new character and record the server and client values then start levelling up, adding stats and items until you find a step that makes them different. The you look at the server calculation in playerstats.cpp and figure out how to make them read the same as the client does.

It's extremely time consuming.
I went through the same process for INT effect on buffs a few years back.
I actually made a lookup table that extends to a value of 600. Beyond that it's not really a lot of use.
I'm always telling people to keep their stats lower than that but no, they have to go to 2000 INT or some stupid value then apply a speed buff then complain because the get disconnected when they go through a portal to another map.
I discovered last week that the actual rose client code that I'm working with only calculates these buffs up to about 500. That's why INT above 500 returns a non-linear and unpredictable buff. :D
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4600
Joined: Fri Aug 10, 2007 2:05 pm

Re: [HELP] RoseZa - Health not showing properly

Postby toyz on Thu Nov 19, 2015 12:50 am

Oh yeah? What files are you using? (curious)

AND DAMN... i see, yeah that does sound like a lot of work haha, um but i guess it has to be done. If i figure it out i will post here the solution as well as all the coding i did, might as well give back to the community.

I'll post another reply if i actually managed to figure something out haha.
Time consuming processes i like, i have some time on my hands, i actually adjusted the entire damage system in roseza files so that it is more balanced.. took me 3 days of trial and error
most annoying part was AOE summon dmg lol, apparently (for some strange reason) some summons also do AOE dmg.. and that value was retardedly high
Also most of my battle.cpp is adjustable through website, like pvp or pvm dmgs, skill dmgs, and summon dmgs, also monster dmgs. just in case i need to tweak values in the future

very simple coding, but time consuming :(
toyz
Little soul
Little soul
 
Posts: 9
Joined: Sun Nov 08, 2015 5:07 am

Re: [HELP] RoseZa - Health not showing properly

Postby PurpleYouko on Thu Nov 19, 2015 8:40 pm

The source I'm using is the one that was released at ragezone a couple of years ago.
It would appear that I'm one of the few people who have actually managed to compile the damn thing into a usable rose client :)
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4600
Joined: Fri Aug 10, 2007 2:05 pm

Re: [HELP] RoseZa - Health not showing properly

Postby toyz on Fri Nov 20, 2015 9:34 am

PurpleYouko wrote:The source I'm using is the one that was released at ragezone a couple of years ago.
It would appear that I'm one of the few people who have actually managed to compile the damn thing into a usable rose client :)


Oh wow!
that's kind of my goal with roseza files, it's super fucking hard there are so many little bugs here and there

Would it be okay if i added you on skype? i promise not to bug you everyday
I'd just like your opinion on somethings

if it's okay of course
toyz
Little soul
Little soul
 
Posts: 9
Joined: Sun Nov 08, 2015 5:07 am

Re: [HELP] RoseZa - Health not showing properly

Postby PurpleYouko on Fri Nov 20, 2015 3:23 pm

The problem with doing it with the roseZA files is that you can never quite be sure what the client end is doing. We used to be able to get some feel for it by capturing packets when it was running live from NARose but now the client is just a black box with no way to know what's going on inside
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4600
Joined: Fri Aug 10, 2007 2:05 pm

Re: [HELP] RoseZa - Health not showing properly

Postby toyz on Thu Jan 21, 2016 7:03 am

Was looking at various packets but still no luck.

Really don't feel like adjusting the HP formulas to match the client, but i guess it's the only alternative.
Besides forcing the TRose to accept a packet for HP instead.

I think it's dumb how they designed it to calculate it on its own instead of relaying on the server..
toyz
Little soul
Little soul
 
Posts: 9
Joined: Sun Nov 08, 2015 5:07 am

Re: [HELP] RoseZa - Health not showing properly

Postby PurpleYouko on Thu Jan 21, 2016 5:52 pm

yes it certainly IS dumb.
The client should exist only to graphically display stuff that arrives from the server.
The only kind of calculations it needs to do are things like collision detection and constantly updating the current location of game objects moving from start location to destination location.
It actually does that pretty well except that it also calculates your move speed before it displays intermediate positions.

In my current client code it no longer does this. I can now set Move Speed from the server and the client complies completely. Only bug right now is that it doesn't increase animation speed for high move rates. I'll get back to that later though
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4600
Joined: Fri Aug 10, 2007 2:05 pm

Next

Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 6 guests

cron