KTRose Bug list and Todo List

New forum to discuss KTRose code

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

Re: KTRose Bug list and Todo List

Postby PurpleYouko on Wed Apr 16, 2014 4:58 pm

Lol just found this in the trose source after translating some korean comments
  1. case GSV_CHAR_HPMP_INFO: // 1 Each server in the second HP / MP and sends it.
  2.                 Recv_gsv_CHAR_HPMP_INFO();
  3.                 break;

Look familiar?
Maybe it will when I tell you that GSV_CHAR_HPMP_INFO is defined as 0x07ec :lol:

And here is the function that it calls
  1.  
  2. ///
  3. /// @brief Langley MP every second on a server and sent to HP.
  4. ///        
  5. //---------------------------------------------------------------------------------------------------- 
  6. void CRecvPACKET::Recv_gsv_CHAR_HPMP_INFO()
  7. {
  8. #ifdef _NoRecover
  9.     if( g_pAVATAR )
  10.     {
  11.         if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP > 0)
  12.         {
  13.             if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP >= g_pAVATAR->Get_MaxHP())
  14.                 g_pAVATAR->Set_HP(g_pAVATAR->Get_MaxHP());
  15.             else
  16.             {
  17.                 g_pAVATAR->SetReviseHP( m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP - g_pAVATAR->Get_HP());
  18.             }
  19.         }
  20.         if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP > 0)
  21.         {
  22.             if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP >= g_pAVATAR->Get_MaxMP())
  23.                 g_pAVATAR->Set_MP(g_pAVATAR->Get_MaxMP());
  24.             else
  25.             {
  26.                 g_pAVATAR->SetReviseMP( m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP - g_pAVATAR->Get_MP());
  27. /*
  28. #ifdef _DEBUG
  29.                 char Temp[64];
  30.                 sprintf(Temp, "MP levels that must be recovered : %d", m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP - g_pAVATAR->Get_MP());
  31.                 g_itMGR.AppendChatMsg(Temp, IT_MGR::CHAT_TYPE_SYSTEM );
  32. #endif
  33. */
  34.             }
  35.         }
  36.     }
  37. #endif
  38. }


So basically they had the very same idea that i came up with and even wrote the code to handle it.
the server sends an 0x07ec packet once per second..... all the time
The client uses this to fix the HP and MP of your avatar that it displays in the game.
Now why the hell they didn't also take out their own internal calculations is anybodies guess.
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: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: KTRose Bug list and Todo List

Postby XxXshidoXxX on Thu Apr 17, 2014 8:29 pm

PurpleYouko wrote:Lol just found this in the trose source after translating some korean comments
  1. case GSV_CHAR_HPMP_INFO: // 1 Each server in the second HP / MP and sends it.
  2.                 Recv_gsv_CHAR_HPMP_INFO();
  3.                 break;

Look familiar?
Maybe it will when I tell you that GSV_CHAR_HPMP_INFO is defined as 0x07ec :lol:

And here is the function that it calls
  1.  
  2. ///
  3. /// @brief Langley MP every second on a server and sent to HP.
  4. ///        
  5. //---------------------------------------------------------------------------------------------------- 
  6. void CRecvPACKET::Recv_gsv_CHAR_HPMP_INFO()
  7. {
  8. #ifdef _NoRecover
  9.     if( g_pAVATAR )
  10.     {
  11.         if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP > 0)
  12.         {
  13.             if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP >= g_pAVATAR->Get_MaxHP())
  14.                 g_pAVATAR->Set_HP(g_pAVATAR->Get_MaxHP());
  15.             else
  16.             {
  17.                 g_pAVATAR->SetReviseHP( m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP - g_pAVATAR->Get_HP());
  18.             }
  19.         }
  20.         if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP > 0)
  21.         {
  22.             if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP >= g_pAVATAR->Get_MaxMP())
  23.                 g_pAVATAR->Set_MP(g_pAVATAR->Get_MaxMP());
  24.             else
  25.             {
  26.                 g_pAVATAR->SetReviseMP( m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP - g_pAVATAR->Get_MP());
  27. /*
  28. #ifdef _DEBUG
  29.                 char Temp[64];
  30.                 sprintf(Temp, "MP levels that must be recovered : %d", m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP - g_pAVATAR->Get_MP());
  31.                 g_itMGR.AppendChatMsg(Temp, IT_MGR::CHAT_TYPE_SYSTEM );
  32. #endif
  33. */
  34.             }
  35.         }
  36.     }
  37. #endif
  38. }


So basically they had the very same idea that i came up with and even wrote the code to handle it.
the server sends an 0x07ec packet once per second..... all the time
The client uses this to fix the HP and MP of your avatar that it displays in the game.
Now why the hell they didn't also take out their own internal calculations is anybodies guess.



Jesus christ rose online devs :roll:
My collection ( Tools, clients sources...)
https://mega.nz/#F!AdcFnQDL!sKp3O9tWGGdWvLEj_EYfwA
osrose mobile project
viewtopic.php?f=34&t=5787
OsRose Mobile development + Titan Rose redesign
https://github.com/shid0x
XxXshidoXxX
osiRose dev
osiRose dev
 
Posts: 445
Joined: Mon Aug 27, 2007 11:44 am

Re: KTRose Bug list and Todo List

Postby Totat on Mon May 21, 2018 5:49 am

Since the problem occurs when the server calculates the damage 'too late' before the animation finishes, wouldn't there be two possible approaches on fixing it?

1. Make the animations longer or put the damage flags at the end of the animation
- This would theoretically be able to 'fix' well not really, it will just remove the 300 hp jumps to 0 part

2. Isn't this a problem with TCP (network design) or transactions where it just keeps on sending the packet until it gets a confirmation that the client/server receives it (sooo probably delay the damage on the serverside if it takes too long to calculate prob?)


Anyway I have never tampered with rose code so all these are just assumtions
I make animations and 2d effects
Totat
Pomic
Pomic
 
Posts: 75
Joined: Mon Jun 01, 2015 9:15 pm
Location: Discord: Add me! What#7452

Re: KTRose Bug list and Todo List

Postby Raven0123 on Mon May 21, 2018 2:17 pm

Totat wrote:Since the problem occurs when the server calculates the damage 'too late' before the animation finishes, wouldn't there be two possible approaches on fixing it?

1. Make the animations longer or put the damage flags at the end of the animation
- This would theoretically be able to 'fix' well not really, it will just remove the 300 hp jumps to 0 part

2. Isn't this a problem with TCP (network design) or transactions where it just keeps on sending the packet until it gets a confirmation that the client/server receives it (sooo probably delay the damage on the serverside if it takes too long to calculate prob?)


Anyway I have never tampered with rose code so all these are just assumtions


The problem is that the client doesn't have the correct formula to calculate any of this stuff.

Someone at either triggersoft or gravity thought it was a good idea to make two different files that did the same exact thing, calculate these things, and then they forgot to update both at the same time. It got to the point that they changed the server side version so much that they couldn't do the same on the client, so they gave up and made a hacky workaround to make the server just update the client even 1 second. The true fix would be:

    1) Make the client match the server calculation formula
    2) Remove the calculations from the client (would make lagging feel worse)
    3) Make the server match the client formulas
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: KTRose Bug list and Todo List

Postby PurpleYouko on Mon May 21, 2018 2:32 pm

And number 2 is exactly what I've already done in project 137
2) Remove the calculations from the client (would make lagging feel worse)


The 137 client no longer even attempts to calculate anything. It just takes what the server gives it and displays that.
That also goes for move speed so that other players (expecially in carts) are not seen to drive a bit then teleport then drive a bit. etc.
The move speed calculated in the server is exactly what you see in the client. For all players

I do still have a little work to do related to attack speed but that has way less effect on a battle than HP and MP jumping around all over the place.
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: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Previous

Return to KTRose Release

Who is online

Users browsing this forum: No registered users and 3 guests