Development Troubles

Hello, my name is Ethan. First, some background, I have been scripting on this platform for about 2 years. Most of it has been on and off as I can get burnt out quick. I wouldn’t call myself a great scripter but I know the basics. I now face problems regarding what path to take regarding scripting and Roblox development and I need feedback and opinions.

I’ve recently published a game as a proof of concept: Mystic Armageddon - Roblox

However, their are multiple problems with that game. For instance, that game uses only a basic local and normal script which makes it very hard to read, edit, and bug fix. Another glaring issue is the projectiles movement, effects, etc. are all server sided making the projectile laggy, cause performance issues, and overall be unsatisfying and delayed and I don’t know how to fix it. I want to remake that concept into an actual game but I need some assistance.

The problem is I don’t know where to start. I did some research and I’ve narrowed it down to 3 options. Using module scripts, object oriented programming (with module scripts), and custom frameworks (like Knit from @sleitnick). But I have problems with all 3.

Option 1

Option 1 is the use of basic module scripts and functions being called in a local and normal script. Potential problems would be modularity and readability (I think?)

Option 2

The second option is to use Object Oriented Programming. I only know the basics and I find it confusing at times so I would need to learn more about it. I also don’t know when and how it is useful. A link to explaining my questions would help.

Option 3

The final option is a framework. Their are multiple frameworks that exist like Knit, Volt, etc. I don’t know what would be best for my project/s but, I did try and learn knit (I tried for about 3 days straight) but it was too confusing for me. If anyone has any suggestions on what I should learn please let me know.

Options
  • Module Scripts
  • Object Oriented Programming
  • Framework

0 voters

Please explain your poll answers. Also, if you chose OOP or Framework tell me some useful info or links you learned from if possible,

I would personally use module scripts
I mean I don’t know much about the framework option(I would have to look into what they do) and OOP is more of a preference thing, only use OOP if you want to because it isn’t necessary

that is just my opinion on this

1 Like

I would generally avoid frameworks, but I suppose that’s personal preference.

You can’t really script in Roblox without using OOP since every Roblox instance is an object. From a metatabling perspective, OOP and module scripts pretty much go hand in hand. You can’t gain full functionality of either without combining both.

Having said all that, it seems like your main problem lies in use of proper client/server communications and optimisation of said scripts. Using modules/OOP might streamline your work but it probably won’t make it faster since you’ll be using the same logic.

1 Like

Thanks for the response! If you could send any links to how you learned OOP that would help a lot. Also, another problem I have is server/client communication like you said and I tried making a post but I didn’t get much help.

this post looks good from a glance.

1 Like

I would consider all three to be important but module scripts are the most basic bare bones and most important.

Module scripts promote reusing functions and functions are the best. You call them like foo() and if it goes wrong or if you want to change what it does you know where to look.

Generally my rule of thumb with OOP is to take advantage of the self keyword with comma functions refer to the code sample here

local object = {color = "blue"}
print(object.color) --prints blue, and you can see it kind of looks like an actual property, like part.BrickColor the one you're used to

function object.ChangeColor(obj, color)
   obj.Color = color
end

object.ChangeColor(object, "pink") --we have to specify the object!

function object:ChangeColor(color)
   self.Color = color
end

object:ChangeColor("pink") --shorter and maintains state and object unique properties related.
--there can be way more internal properties that gets modified later on you can refer to other open source OOP code in community resources.

Also remember composition over inheritance and remember even more options exist like ECS.

For frameworks they generally promote a coding pattern which is not necessary but helps give you ideas on how to organize things like how Knit promotes service like programming. Also Knit components are pretty cool for automatically setting up collection services to avoid putting scripts in models and having to search for them.

Additionally most frameworks also has server to client management so no need to deal with creating remote events in replicated storage folder somewhere and having to do :WaitForChild on them and such. Though you could also just use a module specifically for that which is more easier to integrate from my experiences.

1 Like

This guide on how to make a building system using OOP is pretty cool and might help you to understand OOP a bit better:

Generally I would say that the client should be doing as much as possible. Anything that doesn’t make your game vulnerable to exploiters should be on the client. As long as you have appropriate server side checks you should be fine. I also somewhat expect you’re not using the most optimal methods for projectile creation/production.