Honorable Member Distraught 5946 Posted August 2, 2022 Honorable Member Share Posted August 2, 2022 (edited) Hello everyone, I was optimizing the loading of maps for my server and I decided to share it with the public. With this modifications, only the objects and effects around the character will be loaded and it will handle their load and unload as you move around. Also effect updatings are optimized a way that closer effects are updated more frequently. Okay, so let's start the work This is the hidden content, please Sign In or Sign Up Good luck! Edited August 3, 2022 by Distraught 258 6 2 1 1 1 4 45 13 102 Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted August 2, 2022 Premium Share Posted August 2, 2022 Any video to see the effect? I love this kind of works. Thank you for share! 1 Link to comment Share on other sites More sharing options...
Honorable Member Distraught 5946 Posted August 2, 2022 Author Honorable Member Share Posted August 2, 2022 I added a GIF 1 1 Link to comment Share on other sites More sharing options...
Active Member Volvox 1514 Posted August 3, 2022 Active Member Share Posted August 3, 2022 You are amazing 1 Link to comment Share on other sites More sharing options...
Active Member Valki 523 Posted August 4, 2022 Active Member Share Posted August 4, 2022 @ ASIKOO #honorablefordistraught 1 1 1 Link to comment Share on other sites More sharing options...
naim 6 Posted August 4, 2022 Share Posted August 4, 2022 Thank You 1 Link to comment Share on other sites More sharing options...
Premium Ulthar 3143 Posted August 4, 2022 Premium Share Posted August 4, 2022 Thanks! ^^ Do we need to create the python part for ourselves? @ ASIKOO #honorablefordistraught 1 1 Ulthar Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2523 Posted August 4, 2022 Forum Moderator Share Posted August 4, 2022 Thank you, another excellent release! #honorablefordistraught 2 1 Gurgarath coming soon Link to comment Share on other sites More sharing options...
Management AZICKO 7402 Posted August 4, 2022 Management Share Posted August 4, 2022 gn gn gn gn 1 Scamming ? Reselling ? metin2.download | metin2.dev | fr.metin2.dev | metin2dev.org | metin2.top | top-metin2.org Link to comment Share on other sites More sharing options...
Honorable Member Distraught 5946 Posted August 4, 2022 Author Honorable Member Share Posted August 4, 2022 (edited) Thank you guys 31 minutes ago, Ulthar said: Thanks! ^^ Do we need to create the python part for ourselves? @ ASIKOO #honorablefordistraught Yes, that's not included, it will use the clipping distance by default. You can play with the distance in CArea::GetMaxLoadingDistanceSqr. Edited August 4, 2022 by Distraught Link to comment Share on other sites More sharing options...
Premium Ulthar 3143 Posted August 4, 2022 Premium Share Posted August 4, 2022 1 hour ago, Distraught said: Yes, that's not included, it will use the clipping distance by default. You can play with the distance in CArea::GetMaxLoadingDistanceSqr. Thanks for answer! ^^ 1 Ulthar Link to comment Share on other sites More sharing options...
Malin 8 Posted August 9, 2022 Share Posted August 9, 2022 in CArea::__UpdateLoadedObjectInstances u have new func "emplace" and here it is not used value_type if ((*it)->dwType == prt::PROPERTY_TYPE_BUILDING) m_GraphicThingInstanceCRCMap.emplace(TGraphicThingInstanceCRCMap::value_type((*it)->pThingInstance, c_pObjectData->dwCRC)); like this: if ((*it)->dwType == prt::PROPERTY_TYPE_BUILDING) m_GraphicThingInstanceCRCMap.emplace((*it)->pThingInstance, c_pObjectData->dwCRC); Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted August 27, 2022 Share Posted August 27, 2022 (edited) Hello,i have this error when i compile, any ideas? BUG Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted August 28, 2022 Premium Share Posted August 28, 2022 (edited) 53 minutes ago, Jimmermania said: Hello,i have this error when i compile, any ideas? BUG #include "StdAfx.h" Be sure you didn't broke something in the #includes + in the Template declaration. Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted August 28, 2022 Share Posted August 28, 2022 16 hours ago, WeedHex said: #include "StdAfx.h" Be sure you didn't broke something in the #includes + in the Template declaration. These are my includes in file Area.cpp: #include "../eterLib/ResourceManager.h" #include "../eterLib/StateManager.h" #include "../effectLib/EffectManager.h" #include "../SpeedTreeLib/SpeedTreeForestDirectX8.h" #include "../eterBase/Timer.h" #include "Area.h" #include "PropertyManager.h" #include "Property.h" #include <boost/algorithm/string.hpp> #ifdef CAREA_OPTIMIZATION #include "StdAfx.h" #include "../effectLib/EffectInstance.h" #include "../UserInterface/PythonApplication.h" #include "../UserInterface/StdAfx.h" #include "../UserInterface/PythonCharacterManager.h" #include "../UserInterface/PythonBackground.h" #endif Link to comment Share on other sites More sharing options...
Active Member Helia01 2145 Posted October 18, 2022 Active Member Share Posted October 18, 2022 On 8/4/2022 at 6:17 PM, Ulthar said: Thanks! ^^ Do we need to create the python part for ourselves? @ ASIKOO #honorablefordistraught As far as I understand, to change the download area, you need to change the fFar value from the file PythonApplication.cpp (it is necessary to implement the possibility of changing this value from the settings inside the game) This can be done by following the example of fNear (MIN_FOG) 1 Link to comment Share on other sites More sharing options...
Honorable Member Distraught 5946 Posted October 22, 2022 Author Honorable Member Share Posted October 22, 2022 (edited) You just need to modify the return value of CArea::GetMaxLoadingDistanceSqr function, that's why I put this into a seperated function so it's easy to implement a slider. For example interpolate between pfStart and pfFarClip. Just add a new option to CPythonSystem and a slider in python which sets its value and you can use the value of the sliderbar as it is (0.0-1.0). float CArea::GetMaxLoadingDistanceSqr() const { int peNum; float pfStart, pfEnd, pfFarClip; CPythonBackground::instance().GetDistanceSetInfo(&peNum, &pfStart, &pfEnd, &pfFarClip); // you need to get your value for exmaple from CPythonSystem or from whenever you want float fRatio = CPythonSystem::instance().GetLoadingDistance(); // use one of the interpolation functions i provided return LinearInterpolation(pfStart * pfStart, pfFarClip * pfFarClip, fRatio); } Edited October 22, 2022 by Distraught 3 Link to comment Share on other sites More sharing options...
forum80 18 Posted October 26, 2022 Share Posted October 26, 2022 1 Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted October 26, 2022 Premium Share Posted October 26, 2022 5 hours ago, forum80 said: Do it x20 times while checking your ram. Link to comment Share on other sites More sharing options...
forum80 18 Posted October 26, 2022 Share Posted October 26, 2022 3 hours ago, WeedHex said: Do it x20 times while checking your ram. I tried 30 times, it's 300mb 1 Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted December 14, 2022 Premium Share Posted December 14, 2022 There's a problem with this feature in maps composed only by object. (Skipia for eg.) Do you think is doable to skip the loading of some maps? Or make some workaround... Link to comment Share on other sites More sharing options...
icaloxi 36 Posted April 16, 2023 Share Posted April 16, 2023 (edited) i have this ??????? Edited April 16, 2023 by icaloxi Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2523 Posted April 16, 2023 Forum Moderator Share Posted April 16, 2023 51 minutes ago, icaloxi said: i have this ??????? update your sources Gurgarath coming soon Link to comment Share on other sites More sharing options...
Hornet 0 Posted May 25, 2023 Share Posted May 25, 2023 (edited) On 4/16/2023 at 7:00 PM, Gurgarath said: update your sources i have same problem, but for dump_proto when i try to compile it! error C2146: syntax error : missing ';' before identifier 'T' _src\client\gamelib\../eterBase/Utils.h(223): error C2146: syntax error : missing ';' before identifier 'LinearInterpolation' _src\client\gamelib\../eterBase/Utils.h(223): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int _src\client\gamelib\../eterBase/Utils.h(223): error C2143: syntax error : missing ',' before '&' _src\client\gamelib\../eterBase/Utils.h(226): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int _src\client\gamelib\../eterBase/Utils.h(229): error C2146: syntax error : missing ';' before identifier 'T' src\client\gamelib\../eterBase/Utils.h(229): error C2146: syntax error : missing ';' before identifier 'HermiteInterpolation' _src\client\gamelib\../eterBase/Utils.h(229): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int _src\client\gamelib\../eterBase/Utils.h(229): error C2143: syntax error : missing ',' before '&' _src\client\gamelib\../eterBase/Utils.h(234): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Utils.h #include "../UserInterface/Locale_inc.h" #ifdef ENABLE_MAP_OBJECT_OPTIMIZATION template<typename T> constexpr T LinearInterpolation(const T& tMin, const T& tMax, float fRatio) { return T((1.0f - fRatio) * tMin + fRatio * tMax); } template<typename T> constexpr T HermiteInterpolation(const T& tMin, const T& tMax, float fRatio) { fRatio = MINMAX(0.0f, fRatio, 1.0f); fRatio = fRatio * fRatio * (3.0f - 2.0f * fRatio); return LinearInterpolation(tMin, tMax, fRatio); } #endif Edited May 25, 2023 by Hornet Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2523 Posted May 26, 2023 Forum Moderator Share Posted May 26, 2023 21 hours ago, Hornet said: i have same problem, but for dump_proto when i try to compile it! error C2146: syntax error : missing ';' before identifier 'T' _src\client\gamelib\../eterBase/Utils.h(223): error C2146: syntax error : missing ';' before identifier 'LinearInterpolation' _src\client\gamelib\../eterBase/Utils.h(223): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int _src\client\gamelib\../eterBase/Utils.h(223): error C2143: syntax error : missing ',' before '&' _src\client\gamelib\../eterBase/Utils.h(226): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int _src\client\gamelib\../eterBase/Utils.h(229): error C2146: syntax error : missing ';' before identifier 'T' src\client\gamelib\../eterBase/Utils.h(229): error C2146: syntax error : missing ';' before identifier 'HermiteInterpolation' _src\client\gamelib\../eterBase/Utils.h(229): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int _src\client\gamelib\../eterBase/Utils.h(229): error C2143: syntax error : missing ',' before '&' _src\client\gamelib\../eterBase/Utils.h(234): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Utils.h #include "../UserInterface/Locale_inc.h" #ifdef ENABLE_MAP_OBJECT_OPTIMIZATION template<typename T> constexpr T LinearInterpolation(const T& tMin, const T& tMax, float fRatio) { return T((1.0f - fRatio) * tMin + fRatio * tMax); } template<typename T> constexpr T HermiteInterpolation(const T& tMin, const T& tMax, float fRatio) { fRatio = MINMAX(0.0f, fRatio, 1.0f); fRatio = fRatio * fRatio * (3.0f - 2.0f * fRatio); return LinearInterpolation(tMin, tMax, fRatio); } #endif You quoted the solution to tell me the problem. Update your sources, simple as, use C++14/17> Gurgarath coming soon Link to comment Share on other sites More sharing options...
Recommended Posts