Jump to content
  • Advertisement
Sign in to follow this  
AlbertoT

OO or not OO

This topic is 4786 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I have been testing some 3d engines for a period of time Two are left. I dont' mention them , a "vs" thread being not appreciated. Let's say they provide the same features (skeleton animation, dynamic shadows, particles...) Both use C++ ( I dont' like scripting languages) both are stable both are cheap both support a lot of file formats good documentation Ok , the same The only main difference is : a ) is OO b )is a list of functions Now, I suppose the a) should be more advanced then b) However I can not imagine nothing more user friendly then Scrolling a list of selfexplaining functions and copying it in my code. Why should I use prefabricated classes ? Why should I try to "enter" the mind of the 3d game engine programmer ? So my question is Do OO 3d game engines provide ,in general,actual benefits for end users? is so what? Thanks in advance for your reply Please just spare me the common answer " Use the one that suits your needs.." Obviuosly personal tastes are important but some advantages, if any, should be appreciated by everybody.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Please just spare me the common answer " Use the one that suits your needs.."


The whole point of OO and non-OO designs is to provide a system of getting something done. Sure, each has their pros and cons, benefits and restrictions, but in either case, those factors are built upon what the end user needs.

If you are just making a quick one game example demo for the fun of it, and have a personal preference for non-OOP systems, then of course the non-OOP engine will be of the best interest for you.

If you are working a game that you will be extending and maintaining down the line, then the OOP engine would be of the best interest.

So what I am getting at is this, while each has its own merits and flaws, those applied to a general sense are useless for you as a game developer. You really do need to choose the one that best suits your needs in the current situation.

So, if both are the same, except the fact that one is non-OOP, then choose the one that is non-OOP. Why? Because at anytime you can wrap up those functions yourself and make your own OOP system how you want it. Going the reverse way is pretty much impossible if the engine is large. Now to answer your questions directly.

Quote:
However I can not imagine nothing more user friendly then Scrolling a list of selfexplaining functions and copying it in my code.


Well there you go, the non-OOP has the edge already. Go with what you want to use, because if you spend your precious time with it, it should be how you want it to be (unless you are doing this programming for a job, then you have no chocie). BUT since you do have a choice, make it!

Quote:
Why should I use prefabricated classes?


To make game design go more quickly and smoothly. Rather than have to make your own classes that are used often, you can just use the functionality of a prefab class and extend it if necessary. That and the classes are tried and true - they do work.

Quote:
Why should I try to "enter" the mind of the 3d game engine programmer?


Good question, who in their right mind would want to? [smile]

Quote:
Do OO 3d game engines provide ,in general,actual benefits for end users? is so what?


If you mean end users as in game programmers, then yes. The whole purpose of an OO design it to "effectively allow more". Depending on the design this could mean it could be easier to add functionality to an engine, or customize what already exsits, and so on. If you mean the end user as in the gamers, then only if the programmers have allowed a system that the gamers can add their own content and extend the game themselces (aka game modding)

Just my take on this, feel free to ask if you need clarifications of anything I've mentioned. BTW, I'm curious, what two engines did you have in mind? if you don't want to publically state them, you can send me a PM if you want, not like it's important, just curious [wink]

Share this post


Link to post
Share on other sites
If I was faced with the same situation you have I would probably only consider the non-OO one if it meant finding a more efficient compiler. Since most compilers on the PC have .dll files for all of the overhead of implementing C++ code such as the Visual C runtime library so there isn't much more overhead in using C++ over C I'd probably choose C++.

Personally I'm less familiar with C++ than with C but I know from my experience in Python and Java that OO makes the code a lot more reusable. I won't go in to any more detail now since I am just repeating what Drew_Benton just said.

Share this post


Link to post
Share on other sites
Quote:
Original post by AlbertoT
Please just spare me the common answer " Use the one that suits your needs.."
Obviuosly personal tastes are important but some advantages, if any, should be appreciated by everybody.


Well, what advantages? All we know is that they have the same features, but one is OO, one isn't.
So the answer *is* "use the one that suits your needs".
Or rather, "use the one you feel comfortable with".

If you think OO is a completely crazy way of coding, then you might be happier with the non-OO engine. If you think OO makes for some cleaner, more readable code, then go for the OO engine.
That's the only differnce you've told us about, so that's the only difference we can base our answers on. And the only advantage of OO is that some people find it easier to work with. So the question is, are you one of them?

OO is simply a style of programming. It doesn't magically make an engine become better or faster or able to push more polys.
It simply dictates some rules for structuring the code. That means the people reading the code can make some assumptions about the structure, and save time because they don't have to try to figure out the entire codebase as a whole.

Quote:

However I can not imagine nothing more user friendly then Scrolling a list of selfexplaining functions and copying it in my code.
Why should I use prefabricated classes ?

So you don't have to write them yourself. That's what an engine is *for*. [wink]

And if you're copying the code from the engine, then it sounds like you're doing something drastically wrong, no matter which engine you use. [wink]

Share this post


Link to post
Share on other sites
Quote:
Original post by AlbertoT
Both use C++ ( I dont' like scripting languages)
Why should I use prefabricated classes ?
Why should I try to "enter" the mind of the 3d game engine programmer ?
So my question is
Do OO 3d game engines provide ,in general,actual benefits for end users? is so what?
Thanks in advance for your reply
Please just spare me the common answer " Use the one that suits your needs.."
Obviuosly personal tastes are important but some advantages, if any, should be appreciated by everybody.


So you don't want to use scripting languages, but you also don't want to use "pre-fab" objects from the engine..

so which is it?

Engines are supposed to do all your work for you..or at least the brunt of it. If some script interfaces with the language but reduces the code complexity by 10-fold...then the engine has accomplished its purpose IMHO.

If you're engine shopping, then you also HAVE to give up a modicum of control on your code. If you want to write everything from scratch, or do things ONLY "your" way, then engine shopping is a pointless exercise.

I think I know the two you speak of..;)

Share this post


Link to post
Share on other sites
Thanks all for your answer

Honestly I think that Drew_Benton Only,hit the target.
It is hard for me to accept that OOP is just a coding style that you can like or dislike same as it were literature or art.
That's why I wrote :

" Please just spare me ..."

I hope nobody got offended

I quote Drew_Benton

"If you are working a game that you will be extending and maintaining down the line, then the OOP engine would be of the best interest"

"then choose the one that is non-OOP. Why? Because at anytime you can wrap up those functions yourself and make your own OOP system how you want it. Going the reverse way is pretty much impossible if the engine is large "

unquote

After some years experience as hobbyest game programmer I came to about the same conclusions
It is quite common even at an amateur level either to design our own 3d engine starting from direct x or to use a sophisticated OOP 3d engine

In my opinion it an emotional rather than a rational choice.
Ok you feel smart...

By the way I dont' mean that OOP is not good I mean it is a mistake to abuse of it
I dont' agree with theOther

" reduces the code complexity by 10-fold...then the engine has accomplished its purpose IMHO "

The game engine reduces the code complextity but it also reduce flexibility
Some applications enable you to design a complete game without even writing a line of code
The problem is to find the right compromise.
Again I dont' think it is a matter of tastes, rather it depend on your target, that's different

I was testing in these days IrrLicht and DarkBasic SDK

Share this post


Link to post
Share on other sites
Quote:
Original post by AlbertoT
I dont' agree with theOther

" reduces the code complexity by 10-fold...then the engine has accomplished its purpose IMHO "

The game engine reduces the code complextity but it also reduce flexibility
Some applications enable you to design a complete game without even writing a line of code
The problem is to find the right compromise.
Again I dont' think it is a matter of tastes, rather it depend on your target, that's different

I was testing in these days IrrLicht and DarkBasic SDK


Funny, I was so convinced you were stuck between Torque and Ogre..;)

Anyways, what you say is correct. OO done right leads to an improved codebase which can be somewhat flexible.

OO done wrong is a very heavy framework (IMHO) in which you only really use a small part of it.

A lot of these decisions are up to your target platform, your target audience as well as your own personal skill level. *shrug*

I've said it before and I'll continue to say it: The worst thing you can do is absolutely nothing.

Just pick an engine/library and go do your game.

Good luck!




Share this post


Link to post
Share on other sites
theOther

Actually you got close
I tried Ogre first and I was scared.
What's the reason for using a so complicated engine?
Attention...I am not ironic...just asking
Maybe in the long run there are some benfit


Share this post


Link to post
Share on other sites
The library code can be pretty much anything, you just call the routines. There are two cases when OOP is superior:

1. The project is large and complex (more than 0.5Mb source size)
2. Need for constant re-programming/factoring

If your project has one or both of these conditions, your choice is OOP. It's not even a matter of taste, it's exactly how it is.

Share this post


Link to post
Share on other sites
Quote:
Original post by AlbertoT
Actually you got close
I tried Ogre first and I was scared.
What's the reason for using a so complicated engine?


A complex engine for creating a complex graphical application, maybe? :)

A lot of Ogre's "complexity" is that it's large and very flexible. And it's intended (and used) for more than just games which often confuses people looking for a mainly game-oriented graphics engine.

Ogre is intimidating at first because of its size, but you don't need to understand all of it to get started. Of course a simpler engine would be a good choice if you don't need Ogre's flexibility and something simpler fits your needs.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!