Any good tutorials or resources for learning how to design a scalable and "component" game framework?
In short, I am creating a 2D mmorpg and unlike my last "mmo" which I started developing with, I want to make sure that it scales well and works well when I want to add new game features or modify existing ones.
With my last attempt at avatar chat in the first few thousand lines of code, and just adding core functionality to the game, I saw the quality of the code decline and my ability to add new features or change old ones got progressively lower. I added more features. It turned into one big mess that ran somehow, lol.
This time, I really need to fit and find a design that allows me to create a game frame that will easily add and remove features (things like playing minigames in my world or a mail system or buddy list or a new public area with interactive elements).
I think maybe a component based approach MAY be what I'm looking for, but I'm really not sure. I read the docs about mmorpg design and 2d game engine architecture, but nothing explained how to design a game environment that would basically allow me to "plug" new features into the main game.
Hope someone understands what I mean, any help is appreciated.
a source to share
Yes, I got what you want ...
Basically, you will have to use the classic OOP design, the same as software coders ...
First you will need to lay out the underlying engine, this engine needs to have a "module loader" or general OOP style interface, then you either load the code modules to be loaded (like .dlls for example) or directly the code in your source code. using this mentioned OOP style interface and NEVER, NEVER let a module depend on each other ...
Communication, even within your code, should ALWAYS be using an interface, never put "public" vars in your modules or use them elsewhere, or you end up with awfull and messy code.
But if you do it right, you can do some really cool stuff (for example I changed the whole game (API that provides access to video, mouse, keyboard, audio ...) of my game, in the middle of development ... I just need was to recode one file, this is the one that made the interface between logic and game library ...)
a source to share
If you are looking for component-based systems in games, you will find something completely different from what you are actually asking for. And how best to do this is not yet agreed upon. Therefore, I would not recommend doing this. What you are really talking about really has nothing to do with games, let alone MMOs. It is simply being able to write maintainable code that allows for extensions and enhancements, which has been a challenge for business software long before games as a service became so popular and important.
I would say that the solution to this problem comes mainly from two things. First, you need a good specification and resultant design that tries to understand future requirements, so that the systems you are writing now expand more easily when you come to that. No plug-in architecture can work well without knowing what exactly you are hoping to plug in. I am not saying that you need to compose a 100 page document, but at least you should brainstorm your ideas and plans and find common ground there, so when you code function A, you write it with a function " In future".
Second, you need good software design principles that mean your code is easy to work with and use. eg. Check out the SOLID principles and take the time to understand why these 5 ideas are helpful. Code that follows these rules is much easier to loop around for future needs.
There is a third way to improve your code, but that won't help you yet: experience. Your code gets better the more you write, and the more you learn about coding. It's possible (well, probably) that with an MMO you bite off a lot more than you can chew. Even teams of skilled professionals end up with unattainable clutters of code when trying projects of this magnitude, so it shouldn't come as a surprise that you too. But they have a mess of code that they managed to see before completion, and often that's what it talks about rather than stopping and redesigning whenever it gets tough.
a source to share
What you think of is exactly what this article describes . It's a great way to create games that I've blogged about , and the article is a great resource to get started.
a source to share