Opennos performance improve

04/01/2020 14:43 fantasy942#1
Hi everyone.

Im here for talking with all the opennos "community" about the problems of the emulator.

This isn't a post for random isnult, emulators compare or kidding others.

So, having said that, let's start the real discussion :)

After some test, the part of code that result using more Cpu for me was:

MonsterLife

Drop Handler

BCard

I was think about change the BCard management from this big switch to something more performing.

About the Drop Handler there isn't so much to do... This part of code need a total review xD

I still have no idea about the MonsterLife but, i will studing something about that to...

What did u think?

Did u find other stuff that need to be changed?

Did u think that Opennos can be more "stable" than now or is just a waste of time?

PS: I apologize in advance for my English but I hope it is at least understandable xD
04/01/2020 17:53 erixor#2
Trying to improve OpenNos is completely useless unless you have a solid knowledge in development and a development team with some knowledge as well.

The emulator was poorly designed from the beginning, this is why the initial developer of OpenNos started a new one.
04/02/2020 09:11 0Lucifer0#3
It’s a lost of time. Yes it can be more performant but clearly you’ll use more time to fix it than it’s worth... and the worst is that their is no tests and not an easy way to add as it was not designed to be tested.
04/02/2020 10:08 Blowa#4
Quote:
Originally Posted by fantasy942 View Post
Hi everyone.

Im here for talking with all the opennos "community" about the problems of the emulator.

This isn't a post for random isnult, emulators compare or kidding others.

So, having said that, let's start the real discussion :)

After some test, the part of code that result using more Cpu for me was:

MonsterLife

Drop Handler

BCard

I was think about change the BCard management from this big switch to something more performing.

About the Drop Handler there isn't so much to do... This part of code need a total review xD

I still have no idea about the MonsterLife but, i will studing something about that to...

What did u think?

Did u find other stuff that need to be changed?

Did u think that Opennos can be more "stable" than now or is just a waste of time?

PS: I apologize in advance for my English but I hope it is at least understandable xD
Since you seem to be really attached to OpenNos, i'll still give a real argumentation, I'm sure that you won't accept it, cause you are denying facts since several months if not years (we already had that discussion)

"big switch to something more performing", don't worry, this switch does not create a significant overhead, the only thing that does, is all the implementations behind it.

The "CPU" wastes are coming from several things that got side effect overhead and aren't traced by
- Too much usage of lambdas
- Too much usage of LINQs (yes, allocating a delegate has an overhead, using a delegate is slower than having static symbols to call)
- Unmanaged concurrency (ReactiveX, complete abuse of it...)
- Direct calls to the databases (thread blocking I/O) instead of having a queued/batching/background approach
- SpinWaits (Synchronization over channels are badly done, its 100% dependant to the synchronous transportation layer ("OpenNos.SCS") make it slower than it could be over a properly managed message queue)
- No fast cache (redis/inmemory), in too much places of the code, everything is just loaded from database

But, CPU performance is not the only criteria about :
- Full of null checks everywhere cause the game core & game logic code is written by script kiddies without riguor
- Exception silencing
- Pure OOP code driven architecture in 95% of the code, which makes everything code related, while many many things could just be data driven (game logic code)


If you don't get it, all the core of OpenNos needs to be rewritten, and given how shitty the game logic code is written, it also needs to be rewritten.

We achieved to have a really smooth gameplay (no sluttering) & performance on NosWings' beta, it took several core rewrites (at least 3 since I began writing WingsEmu in June 2019).
Of course, WingsEmu's architecture is nothing comparable to OpenNos/NosCore, it has many similar architectural choices with SaltyEmu, all that improved thanks to the experience we acquired.
All these things are useless if you don't include a serious monitoring of your platform/softwares :
- Game realtime metrics
- Performance related realtime metrics
- Pure software related realtime metrics (this helped me finding that we had too much GC calls)
- Exception reporting

An "emulator" is a real software that requires to be well made to be able to scale, but given the technical skills that it requires to have a properly, it can not be handled by script kiddies.
Riguor, a lot of documentation & articles to write about MANY things

It's not for nothing that MMORPGs is one of the hardest kind of softwares in game engineering, there are much things to think about due to the "Massive" amount of objects to compute.

Leechers can cry "gneugneugneu opennos/noswings cpu issues" but, so far, we've seen a lot of people crying, no one really took the time to learn how to design such softwares.

That's why NosWings will outstand once our work will reach a stable phase, because we know what we are doing.

Our beta testers can confirm how fast we are adding things & deploying updates, it takes me one command to deploy and 30 seconds to update any of our components (game server, web api, metrics, monitoring, centralized logs server, CI/CD runners...)
Nothing that you guys are taking care of, but actually, it saved us more time than it took to be able to do it.
04/02/2020 15:05 fantasy942#5
Quote:
Originally Posted by val77 View Post
Since you seem to be really attached to OpenNos, i'll still give a real argumentation, I'm sure that you won't accept it, cause you are denying facts since several months if not years (we already had that discussion)

"big switch to something more performing", don't worry, this switch does not create a significant overhead, the only thing that does, is all the implementations behind it.

The "CPU" wastes are coming from several things that got side effect overhead and aren't traced by
- Too much usage of lambdas
- Too much usage of LINQs (yes, allocating a delegate has an overhead, using a delegate is slower than having)
- Unmanaged concurrency (ReactiveX, complete abuse of it...)
- Direct calls to the databases (thread blocking I/O) instead of having a queued/batching/background approach
- SpinWaits (Synchronization over channels are badly done, its 100% dependant to the synchronous transportation layer ("OpenNos.SCS") make it slower than it could be over a properly managed message queue)
- No fast cache (redis/inmemory), in too much places of the code, everything is just loaded from database

But, CPU performance is not the only criteria about :
- Full of null checks everywhere cause the game core & game logic code is written by script kiddies without riguor
- Exception silencing
- Pure OOP code driven architecture in 95% of the code, which makes everything code related, while many many things could just be data driven (game logic code)


If you don't get it, all the core of OpenNos needs to be rewritten, and given how shitty the game logic code is written, it also needs to be rewritten.

We achieved to have a really smooth gameplay (no sluttering) & performance on NosWings' beta, it took several core rewrites (at least 3 since I began writing WingsEmu in June 2019).
Of course, WingsEmu's architecture is nothing comparable to OpenNos/NosCore, it has many similar architectural choices with SaltyEmu, all that improved thanks to the experience we acquired.
All these things are useless if you don't include a serious monitoring of your platform/softwares :
- Game realtime metrics
- Performance related realtime metrics
- Pure software related realtime metrics (this helped me finding that we had too much GC calls)
- Exception reporting

An "emulator" is a real software that requires to be well made to be able to scale, but given the technical skills that it requires to have a properly, it can not be handled by script kiddies.
Riguor, a lot of documentation & articles to write about MANY things

It's not for nothing that MMORPGs is one of the hardest kind of softwares in game engineering, there are much things to think about due to the "Massive" amount of objects to compute.

Leechers can cry "gneugneugneu opennos/noswings cpu issues" but, so far, we've seen a lot of people crying, no one really took the time to learn how to design such softwares.

That's why NosWings will outstand once our work will reach a stable phase, because we know what we are doing.

Our beta testers can confirm how fast we are adding things & deploying updates, it takes me one command to deploy and 30 seconds to update any of our components (game server, web api, metrics, monitoring, centralized logs server, CI/CD runners...)
Nothing that you guys are taking care of, but actually, it saved us more time than it took to be able to do it.
Offtopic open

We got a different discussion.

When we talk on pm i told u that im using Opennos not cause is the best emulator ever or other stuff. Im using that cause im not able to do a new better one by my self. I always admit that. Im not a dev, i didn't have the capacity for do this works so, what i can do actualy, is just "help" how i can the already started project that accept that.

Offtopic closed

Well, you give me all the information that i was searching. That was exactly what i was looking for.

Thanks so much to all for the answer and, thanks so much to Blowa for the detailed explanation. That let me understand how much i need to learn about this world and, what i have to do on my next future :)

For me this thread can be closed but, if someone still have dubit related to this argument fill free to comment here ^^

(I think all is already explained but idk xD)