Jump to content

Improving: Loading about Players


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

Hello, thanks to @masodikbela ideea about motions i could find a way of how to improve the loading of players. You must follow the tutorial exactly as it is.

1. Open root/playersettingmodule.py and replace all

RegisterCacheMotionData

with

RegisterMotionData

 

2. Open \UserInterface\PythonCharacterManagerModule.cpp

Search for

PyObject * chrmgrRegisterMotionData(PyObject* poSelf, PyObject* poArgs)

Replace this line

pRaceData->RegisterMotionData(iMode, iMotion, c_szFullFileName, iWeight);

With

	const char * c_szFullFileName = CRaceManager::Instance().GetFullPathFileName(szFileName);
	CGraphicThing* pkMotionThing=pRaceData->RegisterMotionData(iMode, iMotion, c_szFullFileName, iWeight);

	if (pkMotionThing)
		CResourceManager::Instance().LoadStaticCache(pkMotionThing->GetFileName());

3. Open \EterLib\ResourceManager.cpp and replace

int g_iLoadingDelayTime = 1;
const long c_Deleting_Wait_Time = 3600000*4;
const long c_DeletingCountPerFrame = 1;
const long c_Reference_Decrease_Wait_Time = 3600000*4;

Search for and comment it (not really necessary, it's your will )

//m_pCacheMap.clear();

Search for GameLib\RaceData.cpp

void CRaceData::RegisterMotionMode(WORD wMotionModeIndex)

comment

//pMotionModeData->MotionVectorMap.clear();

This is what will load for cache at your first login https://metin2.download/picture/al59hIJx0Bvf7nJpT2HUwrm7F1AOC6DH/.gif

What will fix this: When your walk and see new players screen freeze whould be way shorter or not happening at all.

Recommended after this tutorial to update the granny in the source and the gr2 models (except the buildings).

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 66
  • Dislove 1
  • Angry 1
  • Think 1
  • Lmao 2
  • Good 20
  • Love 4
  • Love 50
Link to comment
Share on other sites

  • Premium
30 minut temu, PeaceMaker napisał:

Out of curiosity i tested what you posted and that's the result after running for about 3 minutes in map1 

https://metin2.download/picture/qufIS66CDqIX4990Z4h3m6VGq23Kaj2F/.gif

I was about to write that. The idea is great, it's kinda annoying when you farm something and your game freezes for a second. That's not a problem with hardware, cause I have pretty decent pc. I'll try to find a better solution when I have more time 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
Acum 1 oră, PeaceMaker a spus:

Out of curiosity i tested what you posted and that's the result after running for about 3 minutes in map1 

https://metin2.download/picture/qufIS66CDqIX4990Z4h3m6VGq23Kaj2F/.gif

It's tested on a live server since yesterday. Something was missing from tutorial. Check again.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 2
Link to comment
Share on other sites

I Love you so much for this i searching a solution for that for Months !
and i think some other Persons here can write somenthing over that too here.
hope you will made it public to run metin2 better.. without lags and such stuff..


Edit: omg its running so smooth ingame now i love it working like a charm ?

  • Love 1
Link to comment
Share on other sites

  • Premium

The original topic got updated/changed over time but I will not update this comment, so its normal to feel confused while reading it.

Spoiler

OFF:
I'm a bit disappointed... at least you could have mention where the idea come from, but whatever...

I've run through the method you chose, and I have some notes about them.

  1. c_Reference_Decrease_Wait_Time is unused right now, because the client is not using other thread for background loading by default, so m_RequestMap will be empty always, so ms_loadingThread.Fetch(&pData) will return false always. Moreover, the whole ProcessBackgroundLoading function is unused right now, since it only do things if the mentioned background stuff is enabled.

  2. Editing g_iLoadingDelayTime in that file is probably pointless, since it will be overwritten by the config file. You should remove that option from the metin2.cfg.

  3. Editing __DestroyCacheMap is pointless aswell, since it will only run when you close the client. Also I would put a very very big red exclamation mark here, since you commented out m_pCacheMap.clear(). In theory (ofc it will never happen because the function runs only when you close the client so nobody will give a fck about that cache map anymore) this could lead to huge crashes since in CReferenceObject::Release a deallocation could happen (its possible that it won't, because its possible that at that point something is using that actual file for some reason, so the reference count will still be higher than 1). And after that since you don't clear the cache map, the next time when the system would try to use the cache map, it would receive a corrupt memory address, since we deallocated the object from that address.

    So anyway if you still want to make sure that nothing will call that function, just put a return to its beginning.

  4. About the last edit: I would put an even bigger red exclamation mark there. This requires some further explanation tho, so get ready for it.

    So first of all, let me talk about memory pools. So as you may know, our processors work better (talking about performance) if the memory addresses are close to each other. Also it works even better, if the affected memory block it needs to read is inside its cache. Also, allocating/deallocating memory runtime is an expensive operation. So long ago programmers came up with an idea: Lets allocate a big chunk of memory when we start our program, so we can put our instances inside it, so the data will be in one place close to each other, and we don't even have to bother with allocation and deallocation. So memory pooling was born.

    Now that we know this, lets talk about the implementation of CDynamicPool. So as you can see, we have 2 vectors inside it. m_kVct_pkData and m_kVct_pkFree. The first one contains all the ADDRESSES of the given object's instances (even if they are not used at the moment). The second one contains ADDRESSES of those objects that are no longer in use. (As you can see it contains ADDRESSES, so this type of implementation does not solve the problem with the "data in one place" problem, because its possible that we will get an address far far away from the previous one, but its irrelevant right now.) If you take a closer look, you will see new operator, but you won't see delete operator. (This is a possible memory leak factor tho, but since you don't remove those memory addresses from the union of those two vectors, its not the case in reality.) Moreover, if you check the Free function, you will only see that we just simply put an address to the pkFree vector. It means, that the destructor of the given object will not get called. (This could and probably do (in some cases) lead some actual memory leaks, but again, this is not what I want to talk about right now.)

    Okay, now lets say that we have 2 allocated instances, so we have 2 already-in-use addresses in pkData vector. Lets say that one of them gets "deleted". The Free function will put its address to the pkFree vector. Then, we say that uhhhh ummmmm wait wait, I need a new instance. Okay, we call Alloc. Lets see what will happen: pkFree is not empty, so it will not allocate a new instance, just simply gives the last free address back from pkFree. Looks safe and simple right? Yes, thats the case if you are aware that NO CONSTRUCTOR WILL BE CALLED THERE. Whats the problem with it you may ask... The problem is that we didn't change the content of that instance during this Free and Alloc call. (Sure if we've called some cleanup function outside of the CDynamicCache this is not the case like I said, but then it means you were aware of this problem.)

    So what you did when you commented out that pMotionModeData->MotionVectorMap.clear(); part was removing this correct cleanup. So what could happen (at least in theory)? Lets say we have a male warrior. This male warrior go away and all the data gets deleted after 4 hours, and you just simply stand still and no other characters appear. The game will remove the unused motions from the CDynamicCache. Then suddenly out of nowhere someone summons a wild dog. It will receive the same exact stuff from the pkFree vector that we just removed. So that wild dog will have 240+ motions loaded instead of 4 or something like that.

    Sadly we can state that our new wild dog won't run with the male warrior's animation, since in NEW_RegisterMotion that animation will be overwritten, so there will be no visual defects.

  5. I'm not sure about the chrmgrRegisterMotionData changes, but probably those don't add much to the final result. My opinion is that changing c_Deleting_Wait_Time to a much higher value was the only thing you did and actually helps in this problem.

    So basically what you did was: You changed that the unused files don't get deleted over time (or just after 4 hours), which means that in this specific case if you go to somewhere alone, and no other player appears for 4 hours (instead of the original 30 second) and after that someone with other type of character (so you are a warrior and the other player is not a warrior) appears, you will still have the same lag like before.

Conclusion:

Disregarding the wrong/useless parts, it doesn't solve the main problem. In the gif you shared its clearly visible, that not all the motions load during the loading screen. Example (what you should see) for female assassin (241 motions in total):

Spoiler

d:\ymir work\pc\assassin\general\wait.gr2
d:\ymir work\pc\assassin\general\wait_1.gr2
d:\ymir work\pc\assassin\general\walk.gr2
d:\ymir work\pc\assassin\general\run.gr2
d:\ymir work\pc\assassin\general\damage.gr2
d:\ymir work\pc\assassin\general\damage_1.gr2
d:\ymir work\pc\assassin\general\damage_flying.gr2
d:\ymir work\pc\assassin\general\falling_stand.gr2
d:\ymir work\pc\assassin\general\damage_2.gr2
d:\ymir work\pc\assassin\general\damage_3.gr2
d:\ymir work\pc\assassin\general\back_damage_flying.gr2
d:\ymir work\pc\assassin\general\back_falling_stand.gr2
d:\ymir work\pc\assassin\general\dead.gr2
d:\ymir work\pc\assassin\general\attack.gr2
d:\ymir work\pc\assassin\general\attack_1.gr2
d:\ymir work\pc\assassin\intro\wait.gr2
d:\ymir work\pc\assassin\intro\selected.gr2
d:\ymir work\pc\assassin\intro\not_selected.gr2
d:\ymir work\pc\assassin\skill\amseup.gr2
d:\ymir work\pc\assassin\skill\gungsin.gr2
d:\ymir work\pc\assassin\skill\charyun.gr2
d:\ymir work\pc\assassin\skill\eunhyeong.gr2
d:\ymir work\pc\assassin\skill\poison_cloud.gr2
d:\ymir work\pc\assassin\skill\seomjeon.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\gyeonggong.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\seomgwang.gr2
d:\ymir work\pc\assassin\skill\amseup.gr2
d:\ymir work\pc\assassin\skill\gungsin.gr2
d:\ymir work\pc\assassin\skill\charyun.gr2
d:\ymir work\pc\assassin\skill\eunhyeong.gr2
d:\ymir work\pc\assassin\skill\poison_cloud.gr2
d:\ymir work\pc\assassin\skill\seomjeon.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\gyeonggong.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\seomgwang.gr2
d:\ymir work\pc\assassin\skill\amseup.gr2
d:\ymir work\pc\assassin\skill\gungsin.gr2
d:\ymir work\pc\assassin\skill\charyun.gr2
d:\ymir work\pc\assassin\skill\eunhyeong.gr2
d:\ymir work\pc\assassin\skill\poison_cloud.gr2
d:\ymir work\pc\assassin\skill\seomjeon.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\gyeonggong.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\seomgwang.gr2
d:\ymir work\pc\assassin\skill\amseup.gr2
d:\ymir work\pc\assassin\skill\gungsin.gr2
d:\ymir work\pc\assassin\skill\charyun.gr2
d:\ymir work\pc\assassin\skill\eunhyeong.gr2
d:\ymir work\pc\assassin\skill\poison_cloud.gr2
d:\ymir work\pc\assassin\skill\seomjeon.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\gyeonggong.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\seomgwang.gr2
d:\ymir work\pc\assassin\skill\amseup.gr2
d:\ymir work\pc\assassin\skill\kwaegeom.gr2
d:\ymir work\pc\assassin\skill\gungsin.gr2
d:\ymir work\pc\assassin\skill\kwaegeom.gr2
d:\ymir work\pc\assassin\skill\charyun.gr2
d:\ymir work\pc\assassin\skill\kwaegeom.gr2
d:\ymir work\pc\assassin\skill\eunhyeong.gr2
d:\ymir work\pc\assassin\skill\kwaegeom.gr2
d:\ymir work\pc\assassin\skill\poison_cloud.gr2
d:\ymir work\pc\assassin\skill\kwaegeom.gr2
d:\ymir work\pc\assassin\skill\seomjeon.gr2
d:\ymir work\pc\assassin\skill\kwaegeom.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\gwangyeok.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\gyeonggong.gr2
d:\ymir work\pc\assassin\skill\shoot.gr2
d:\ymir work\pc\assassin\skill\seomgwang.gr2
d:\ymir work\pc\assassin\action\clap.gr2
d:\ymir work\pc\assassin\action\cheers_1.gr2
d:\ymir work\pc\assassin\action\cheers_2.gr2
d:\ymir work\pc\assassin\action\kiss_with_warrior.gr2
d:\ymir work\pc\assassin\action\kiss_with_assassin.gr2
d:\ymir work\pc\assassin\action\kiss_with_sura.gr2
d:\ymir work\pc\assassin\action\kiss_with_shaman.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_warrior.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_assassin.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_sura.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_shaman.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\general\dig.gr2
d:\ymir work\pc\assassin\action\dance_1.gr2
d:\ymir work\pc\assassin\action\dance_2.gr2
d:\ymir work\pc\assassin\action\dance_3.gr2
d:\ymir work\pc\assassin\action\dance_4.gr2
d:\ymir work\pc\assassin\action\dance_5.gr2
d:\ymir work\pc\assassin\action\congratulation.gr2
d:\ymir work\pc\assassin\action\forgive.gr2
d:\ymir work\pc\assassin\action\angry.gr2
d:\ymir work\pc\assassin\action\attractive.gr2
d:\ymir work\pc\assassin\action\sad.gr2
d:\ymir work\pc\assassin\action\shy.gr2
d:\ymir work\pc\assassin\action\cheerup.gr2
d:\ymir work\pc\assassin\action\banter.gr2
d:\ymir work\pc\assassin\action\joy.gr2
d:\ymir work\pc\assassin\action\selfie.gr2
d:\ymir work\pc\assassin\action\pushup.gr2
d:\ymir work\pc\assassin\action\doze.gr2
d:\ymir work\pc\assassin\action\exercise.gr2
d:\ymir work\pc\assassin\action\dance_7.gr2
d:\ymir work\pc\assassin\onehand_sword\wait.gr2
d:\ymir work\pc\assassin\onehand_sword\wait_1.gr2
d:\ymir work\pc\assassin\onehand_sword\walk.gr2
d:\ymir work\pc\assassin\onehand_sword\run.gr2
d:\ymir work\pc\assassin\onehand_sword\damage.gr2
d:\ymir work\pc\assassin\onehand_sword\damage_1.gr2
d:\ymir work\pc\assassin\onehand_sword\damage_2.gr2
d:\ymir work\pc\assassin\onehand_sword\damage_3.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_01.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_02.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_03.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_04.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_05.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_06.gr2
d:\ymir work\pc\assassin\onehand_sword\combo_07.gr2
d:\ymir work\pc\assassin\dualhand_sword\wait.gr2
d:\ymir work\pc\assassin\dualhand_sword\wait_1.gr2
d:\ymir work\pc\assassin\dualhand_sword\walk.gr2
d:\ymir work\pc\assassin\dualhand_sword\run.gr2
d:\ymir work\pc\assassin\dualhand_sword\damage.gr2
d:\ymir work\pc\assassin\dualhand_sword\damage_1.gr2
d:\ymir work\pc\assassin\dualhand_sword\damage_2.gr2
d:\ymir work\pc\assassin\dualhand_sword\damage_3.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_01.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_02.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_03.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_04.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_05.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_06.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_07.gr2
d:\ymir work\pc\assassin\dualhand_sword\combo_08.gr2
d:\ymir work\pc\assassin\bow\wait.gr2
d:\ymir work\pc\assassin\bow\wait_1.gr2
d:\ymir work\pc\assassin\bow\walk.gr2
d:\ymir work\pc\assassin\bow\run.gr2
d:\ymir work\pc\assassin\bow\damage.gr2
d:\ymir work\pc\assassin\bow\damage_1.gr2
d:\ymir work\pc\assassin\bow\damage_2.gr2
d:\ymir work\pc\assassin\bow\damage_3.gr2
d:\ymir work\pc\assassin\bow\attack.gr2
d:\ymir work\pc\assassin\fishing\wait.gr2
d:\ymir work\pc\assassin\fishing\walk.gr2
d:\ymir work\pc\assassin\fishing\run.gr2
d:\ymir work\pc\assassin\fishing\throw.gr2
d:\ymir work\pc\assassin\fishing\fishing_wait.gr2
d:\ymir work\pc\assassin\fishing\fishing_cancel.gr2
d:\ymir work\pc\assassin\fishing\fishing_wait.gr2
d:\ymir work\pc\assassin\fishing\fishing_catch.gr2
d:\ymir work\pc\assassin\fishing\fishing_fail.gr2
d:\ymir work\pc\assassin\horse\wait.gr2
d:\ymir work\pc\assassin\horse\wait_1.gr2
d:\ymir work\pc\assassin\horse\wait_2.gr2
d:\ymir work\pc\assassin\horse\walk.gr2
d:\ymir work\pc\assassin\horse\run.gr2
d:\ymir work\pc\assassin\horse\damage.gr2
d:\ymir work\pc\assassin\horse\damage.gr2
d:\ymir work\pc\assassin\horse\dead.gr2
d:\ymir work\pc\assassin\horse\skill_charge.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\combo_01.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\combo_02.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\combo_03.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\skill_wildattack.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\skill_splash.gr2
d:\ymir work\pc\assassin\horse_dualhand_sword\combo_01.gr2
d:\ymir work\pc\assassin\horse_dualhand_sword\combo_02.gr2
d:\ymir work\pc\assassin\horse_dualhand_sword\combo_03.gr2
d:\ymir work\pc\assassin\horse_dualhand_sword\skill_wildattack.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\skill_splash.gr2
d:\ymir work\pc\assassin\horse_bow\wait.gr2
d:\ymir work\pc\assassin\horse_bow\wait_1.gr2
d:\ymir work\pc\assassin\horse_bow\wait_2.gr2
d:\ymir work\pc\assassin\horse_bow\run.gr2
d:\ymir work\pc\assassin\horse_bow\damage.gr2
d:\ymir work\pc\assassin\horse_bow\dead.gr2
d:\ymir work\pc\assassin\horse_bow\attack.gr2
d:\ymir work\pc\assassin\horse_bow\attack.gr2
d:\ymir work\pc\assassin\horse_onehand_sword\skill_splash.gr2
d:\ymir work\pc\assassin\wedding\wait.gr2
d:\ymir work\pc\assassin\wedding\walk.gr2
d:\ymir work\pc\assassin\wedding\walk.gr2
d:\ymir work\pc\assassin\action\clap.gr2
d:\ymir work\pc\assassin\action\cheers_1.gr2
d:\ymir work\pc\assassin\action\cheers_2.gr2
d:\ymir work\pc\assassin\action\kiss_with_warrior.gr2
d:\ymir work\pc\assassin\action\kiss_with_assassin.gr2
d:\ymir work\pc\assassin\action\kiss_with_sura.gr2
d:\ymir work\pc\assassin\action\kiss_with_shaman.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_warrior.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_assassin.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_sura.gr2
d:\ymir work\pc\assassin\action\french_kiss_with_shaman.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hit.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\slap_hurt.gr2
d:\ymir work\pc\assassin\action\dance_1.gr2
d:\ymir work\pc\assassin\action\dance_2.gr2
d:\ymir work\pc\assassin\action\dance_3.gr2
d:\ymir work\pc\assassin\action\dance_4.gr2
d:\ymir work\pc\assassin\action\dance_5.gr2
d:\ymir work\pc\assassin\action\congratulation.gr2
d:\ymir work\pc\assassin\action\forgive.gr2
d:\ymir work\pc\assassin\action\angry.gr2
d:\ymir work\pc\assassin\action\attractive.gr2
d:\ymir work\pc\assassin\action\sad.gr2
d:\ymir work\pc\assassin\action\shy.gr2
d:\ymir work\pc\assassin\action\cheerup.gr2
d:\ymir work\pc\assassin\action\banter.gr2
d:\ymir work\pc\assassin\action\joy.gr2
d:\ymir work\pc\assassin\action\selfie.gr2
d:\ymir work\pc\assassin\action\pushup.gr2
d:\ymir work\pc\assassin\action\doze.gr2
d:\ymir work\pc\assassin\action\exercise.gr2
d:\ymir work\pc\assassin\action\dance_7.gr2

Because of this, when you login the first time, and you meet a different type of character, you will still have the same lag as before. (The first time I had some doubts in myself tho, so I tested this one to be sure, and I was right, so this is the case.)

  • Love 9

The one and only UI programming guideline

Link to comment
Share on other sites

20 minutes ago, Dobrescu Sebastian said:

Must be done only with my tutorial. https://metin2.download/picture/3Q996a930Zjm286o9r45q8ny9GpE6YAo/.jpg because RegisterMotionData it's edited.

It has nothing to do with the tutorial, it was the case of 3d weapons when i cached them the memory usage increased by 80%

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
Acum 26 minute, PeaceMaker a spus:

It has nothing to do with the tutorial, it was the case of 3d weapons when i cached them the memory usage increased by 80%

I don't have something like that on my server or something similar, but i know effects are power hungry. You can add them to an exception list. With all my changes this is how a first loading looks https://metin2.download/picture/00K8Ff1qGfBl9FougpimBHus06GvHUiz/.gif . At this point i succeeded in removing my screen freeze which was big.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Good 1
  • Love 5
Link to comment
Share on other sites

  • Bronze

A little reminder: When Metin2 was freshly launched people had low computers with 512mb RAM, the korean guys did a great job with the cache system(it was needed at that time),

still some memory leaks today but it works :D

 

@Dobrescu Sebastian

Disclaimer: No hate, no nothing, just letting you to know some parts are wrong, just read with attention.

Quote

 

CGraphicThing* pkMotionThing = pRaceData->RegisterMotionData(iMode, iMotion, c_szFullFileName, iWeight); 

RegisterMotionData -> returns NULL and writes on syserr if the file was not found.

What do you do?


if (pkMotionThing) 

	CResourceManager::Instance().LoadStaticCache(pkMotionThing->GetFileName());

else // We try again LOL and we also get a double syserr line xD

	pRaceData->RegisterMotionData(iMode, iMotion, c_szFullFileName, iWeight);

 

Did you just adjust the function RegisterMotionData to have LoadStaticCache line inside of it and then to be the same as RegisterCacheMotionData just to replace their "callings" in playersettingmodule.py ?

 

 

 

@masodikbela 

Quote

Very good answer but I doubt everybody will understand what you have written there.

 

  • Love 1
Link to comment
Share on other sites

Just now, Dobrescu Sebastian said:

@Exygo 

Else part can be removed, it's not used at all. I left that line just because i wanted to see if there is a else there (for traceerror). You can remove it if you want.

Yes yes i did, why ? Test yourself and see why.

You want this be fixed ? Copy the tutorial nobody wanted to do for years even for money.

the playersettingmodule part is useless since you already edited chrmgrRegisterMotionData and its identical to chrmgrRegisterCacheMotionData now , 

and yeah as masodikbela mentioned increasing the  c_Deleting_Wait_Time was most likely the factor change.

Link to comment
Share on other sites

  • Premium
Acum 2 ore, PeaceMaker a spus:

the playersettingmodule part is useless since you already edited chrmgrRegisterMotionData and its identical to chrmgrRegisterCacheMotionData now , 

and yeah as masodikbela mentioned increasing the  c_Deleting_Wait_Time was most likely the factor change.

No.. you have to do the tutorial as i posted it. RegisterMotionData is used in another parts of the source.

 

 

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.