Conquer & Async

11/30/2022 23:18 LepEatWorld#1
Someone provided me with a example script from a different source the other day for some information and I saw that they were using Asynchronous programming. My knowledge of C# is very basic and I'm trying to upgrade that so I started looking into it. I understand that it's very useful when running multiple operations at the same time, but my question stands on when and where should I be using it on Conquer.

The example that I receive was for Durability, I don't know if there's any point in doing it for that or not, since it's a simple subtraction method. I understand if it's pulling multiple things such as "Is attacking and durability is going down at the same time" but I'm not sure, I haven't really had an issue with that.

Would there be an issue or would it be an increase in productivity within the game? It's not like if 2 characters can't do the same thing at the same time. Should I be using it on all my methods or is there a chance that the server will start lagging if there's a lot of data being processed at the same time rather than a Stop-Read-Next?
12/01/2022 09:56 Spirited#2
Well, I wrote a skeleton server project that uses async-await patterns, if you wanted to take a look. There's also an article I wrote about multi-threaded game server design on that same page. You can check it out here: [Only registered and activated users can see links. Click Here To Register...].

Generally, yeah. The tldr is: there would be problem and it does add complexity, but you could get better performance if done correctly. The async-await pattern I referenced is difficult to understand in C#, but it's getting more and more common. And then there're some async classes in C# you can use in synchronous code, but it's pretty inconsistent.