Is OOP acceptable in the context of game dev?

Is OOP acceptable in the context of game dev?

Attached: FGDT1-State.png (637x463, 72K)

OOP is unironically always acceptable

yes. one of the more natural places for OOP desu

This is very literally the only situation where OOP is """okay""" to use.

there is nothing wrong with oop in general as long as you don't take it to the extreme. you can do a combination of oo and imperative programming based on what suits each situation best

what's OOP

Attached: 1559846421070.jpg (701x1024, 89K)

This. OOP is perfectly fine, just don't go turbo autist over maintaining a perfect structure. Use the parts of OOP that you need, when you need them. Don't just make a bazillion classes for everything extending out of each other if you're never going to use half of them.

Object oriented programming
>Object oriented
>Programming
Choose one.

sometimes

I've found compositional models better for game systems - when you have dozens of things going each tick, it's more helpful to have a clearly defined order of logic than try and mentally model n*n layers of hierarchy

monolothic god objects can also fuck right off

once you get up into special-case scripting, is-a relationships are a lot more manageable

No, it destroys performance by throwing your data all over the place in memory, calling lots of constructors/descructors instead of doing those operations all at once, and virtual function calls. And inheritance isn't flexible enough for a game.

>C++ is shit when used wrong
>that means OOP is universally bad

Yes but use composition over inheritance

It's especially bad for game dev. Data-oriented is the truly enlightened way.

Depends on context. If your writing the next squeenix game that needs to take advantage of every last cycle on a 5 year old console, no it is not acceptable. If you're writing your dream visual novel then hell you can write it in python for all anyone cares.

Performance matters when it matters, and chances are there are other things you'd want to optimize before rewriting your whole entire entity framework.

no

inheritance is fucking worthless

Absolutely. Its necessity for game programming since your game would have many objects(items/players/monsters/etc) to deal with. You need a clear way to store data and manipulate them.

based and rationalpilled

Use composition instead of inheritance.

so you guys are telling me that top(huge from big companies) video games are not written in OOP?

You can use OOP without inheritance you retards.

Depends: are they from the early to late 2000s? If so yes.

please be that kid who always brings up AAA engines in rust threads

so what are big video games use instead OOP nowadays? i really want to learn this stuff

Yes, and that's exactly why they run like shit. And the few big studios that utilize DOD more than OOP (like DICE) also happen to make the best-performing games.

they still use oop

Composition. If you've ever used Unity you should know about MonoBehaviour.

arent modern computers powerful enough?
i thought teams use OOP for it simple and intuitive design to understand and work on in exchange for performance of course which gets mitigated by powerful modern computers

object-oriented programming

if you make a c++ class called thief you have messed up your life somewhere

npc_thief

like said, interface composition is generally better suited to game design
throw out the "is-a" relationship and replace it with "has-a" instead.

>pajeet who writes 1000 case switch statements for logic

>gameplay developer wants to try some new whizbang spell he came up for the thief
>clumsily writes the code in visual studio
>"this works great!"
>segfaults
you write a vm in c++ to handle their shitty scripts, you don't give a kid the keys to an ice cream truck

Fuck no, not only are games getting more demanding all the time, but hardware is not advancing like it used to. And OOP is not even simple and intuitive, it's needlessly over-complicated and abstract. Literally the only advantage of OOP is it allows retard code monkeys to program without knowing a thing about the hardware, which is exactly why it has become so popular.

unreal's object model is inherited directly from unreal 3, which is piggybacking off even older versions

if you see a AAA video game "made in unreal," you've seen a AAA video game made with 10-15 year old assumptions and just as much time worth of bloat. it takes an entire team of professional engine programmers to beat it into workably performant shape for any non-trivial game, and that's before the artists get ahold of it and start making six 300-node material graphs per asset

I usually use a component system, but that's still sort of OOP. Just stay away from excessive inheritance.

OOP = POO

Can someone please explain to me a single advantage of OOP over simple data-oriented design achievable in every language ever created.

even languages like SML and Haskell offer solutions for ad-hoc polymorphism that, from my experience, outperform C++/Java when it comes to ease of designing programs

Attached: 1543395298723.jpg (1024x762, 144K)

hello summerfriend, please make sure to leave forever when school's back up