Are there performance benefits to an OOP-based tycoon?

Traditionally, my tycoons have run by storing player data with value objects in ServerStorage, and a plethora of folders for things such as buttons, items purchased, and the items left to purchase. Recently I started learning OOP on Roblox and I want to take advantage of it in my own tycoons, but are there actual benefits, performance-wise or others, to using OOP for a tycoon?

1 Like

I don’t personally see any advantage to OOP in Roblox and I never have. The reason is because it takes a lot to implement, and everything is already OOP with the exception that you can’t extend them or do anything with them. OOP is a paradigm, and it’s not faster per se than another paradigm. OOP shines best when you have a variable number of cookie-cutter objects with slight variation.

Tycoon games are always full of pauses and delays. A delay before money is awarded, a delay until someone presses a button, a delay until someone delivers a truck of goods or however the game works. This gives plenty of time for the script to think. Tycoons are a very straightforward x-causes-y system, and take pretty much zero processing capabilities as far as scripting is concerned. Don’t fret in the slightest because your scripts won’t be under any sort of strain running a tycoon. Now, if you have a huge amount of trees and buildings in the game, people can lag due to rendering or physics or whatever. But that’s something you don’t have as much control over, and your scripting style certainly won’t affect it.

OOP is less about performance and more about organization. Many times you’ll see just a single jumbled up script where you can’t tell what’s going on. Object oriented programming is a programming construct and doesn’t really do anything for performance, but it will produce a more organized project overall.

1 Like

Can, not will. Don’t use OOP where you don’t need OOP or you end up with Java.

I should clarify I suppose that I am not averse to people using it in Roblox. I just think that, as cool as it is, people overhype it and think that it is a save-all. It can hurt in a lot of casees especially since it is not native to Roblox both in cleanliness and performance, but it is ultimately a preference.

1 Like

If you know what you’re doing, OOP will produce a more organized project. If you follow the 4 pillar of OOP which are Encapsulation, Abstraction, Inheritance, and Polymorphism. The problem is most people don’t even use OOP correctly. There are places where it’s not needed, and can even be worse, but if you use OOP correctly, it will make an organized class-based project that is highly modular and easy to use and work with.

3 Likes

im gonna be honest that my scripts look readable to me and I don’t think ill ever use it
besides im so confident most of the time I will use local variables as settings in scripts instead of attributes