Hello everyone. I’m a hobbyist game programmer and from time to time I get to work on some stuff on Roblox, most related to programming. However, apart from all the weird engine limitations, I’m having some problems by myself related on how to code in a scalable way, considering the scopes of a big project.
Let’s say you have a Mission System, now speaking more conceptually, you get to start a Mission and, for example, some activities that you are able to perform outside of a mission get disable, such as Shops, Car Workshops, other Missions, etc. These Shops, for example, are shown in a Minimap also, and when you start a Mission, its icon gets hidden so it indicates you can’t buy stuff there anymore, atleast during the mission.
Now consider programming this in OOP style, you code some classes such as: Mission, Shop, Minimap, Blip, etc. What would be the most efficient way to link all these features together in a way that you tweak them easily, expand upon and maintain it properly?
Everytime I try to design some reusable framework, I fail because I can’t seem to find a good way to do it. Explicitly calling code of one object from another seems too coupled, and it’s not one object’s responsability to make other object do something. I thought of a event-driven system, but the code where the object listen to events would be just spaghetti code, one event listening after the other. Maybe have a system where each object can have ModuleScripts acting as code holders, and these Scripts have the name of the event, so the code inside them gets called upon event firing. I don’t really know, only thing I know is that it is an abstract idea, but I would like to know some ideas of maybe how y’all handle this kind of interaction in your games. Thanks.