mtanksl / OpenTibia

A simple implementation in C# of open tibia server.
17 stars 9 forks source link

Server Structure #1

Closed VulgoRox closed 1 year ago

VulgoRox commented 1 year ago

Hi Mtanksl,

Hope you're doing well. I'm a Unity developer currently working on an MMO server project. While digging around, I stumbled upon your code and gotta say, it's impressive!

Just a bit curious - where did you get the ideas to structure the server the way you did? Did you follow any specific papers or already established server structures?

Also, could you shed some light on how it scales? Can it handle a large crowd, say, 3k+ players, like some OT TFS servers do?

mtanksl commented 1 year ago

Hello VulgoRox,

The ideas came from a lot of experimentation, trial and error. The way this project is structured now is very different from how it started. And it will probably evolve further. It's a mix of all the good stuff.

I tried to incorporate the concept of Middleware, used for processing web requests (client/server architecure) in ASP.NET core, using Command Handlers . The event-driven architecture (EDA) can be seen in the Event Handlers, which allow the application to react when something happens. The entity component system (ECS) can be seen in Behaviours and Components, which allows you to create a wide variety of layered things. Combine all that with lot's of game programming patterns. Again, it is a mix of architecures.

Cipsoft gave a presentation at GDC 2011, showing The Technical Infrastructure of an MMORPG. The official Tibia server only supports around 1000 players online, as it uses a single CPU core to process the game. The advantage is that there is no synchronization within the world simulation. The disadvantages are that it doesn't scale very well and is limited by the performance of a single CPU core.

This is a simple hobby project, and from time to time, I have some fun to recall the good old days :)

Thank you!