Page 2 of 2

Re: KTRose Bug list and Todo List

PostPosted: Wed Apr 16, 2014 4:58 pm
by PurpleYouko
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.

Re: KTRose Bug list and Todo List

PostPosted: Thu Apr 17, 2014 8:29 pm
by XxXshidoXxX
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:

Re: KTRose Bug list and Todo List

PostPosted: Mon May 21, 2018 5:49 am
by Totat
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

Re: KTRose Bug list and Todo List

PostPosted: Mon May 21, 2018 2:17 pm
by Raven0123
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

Re: KTRose Bug list and Todo List

PostPosted: Mon May 21, 2018 2:32 pm
by PurpleYouko
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.