Discussion: Big client refactor #160
Labels
In Progress
Internal/ Improvement
Reporting code that could be better, or PRs that improve this code
Projects
What I want to do is refactor a lot of the client code.
Right now basically the entire client game is handled by a single class that can found here:
client.h
This is slowly becoming/ is a God Object/ God Class, meaning it is responsible for way too much.
It works fine, and I am low key afraid to change it as right now it is pretty easy to do things, but of course this can rapidly get out of hand.
It has the following responsibilities, all to do with gameplay:
Although this works, I feel it is doing a bit too much and so want to find a way (if possible) to split out the responsibility a bit, as eventually, this would just become a huge multi-thousand line class.
What I propose is some kind of refactor, with the intent to be that the rendering, netcode, world code etc should be split out as their own class.
This would also make it easier to delegate responsibilities in the client lua code.
For example, right now it simply wouldn't be possible to make a button for a main menu that creates a new world*, whereas if this is done correctly it could be pretty easily done while not violating things like SOLID or whatever.
*where create a new world:
The steps listed above seems like a good initial goal for this, which I am currently working on.
Definitely open to ideas on how to achieve more maintainability for the client code, which is what this issue is for :)
(And later, server code)
Other ideas/ Notes (just 1 for now lol):
Opening a chest, how could this work?
The text was updated successfully, but these errors were encountered: