PDA

View Full Version : Ease of use Vs. Power


Jesse Aldridge
06-09-2007, 07:57 PM
This last week, the majority of my time has been spent working with low-level OpenGL stuff.

Basically what I wanted to do was have nested clipping for some custom gui stuff - so i could clip some controls to a box and then clip that box into a parent box and so forth. This lead me to investigating various ways of accomplishing this in OpenGL.

Now, just getting this one little feature working has taken 25% of the time I spent getting the entire rest of my game up and running. It has been a significant bottleneck in my development time. I think similar problems would be faced whenever one is working with any low-level library that sacrifices ease of use for power.

So now I'm wondering how I should address this issue.

I suppose you could say that there's a spectrum which has limiting yourself to solving easy problems on one end and pushing the limits of what you're capable of at the other end. Making something with Game Maker vs. figuring out how to make a 3d mmo fps from scratch :) Both approaches seem to have unique appeals.

I'm really not sure which I should go with.

Practically speaking, limiting yourself to a given tool is probably the best option. You can actually get things done. Also, limitations can be a good thing; they can promote creativity and so forth.

Still, my inner engineer really wants to harness as much power as possible ( who doesn't :) ). I think it would be really great if I could take any idea that popped into my head and turn it into reality. I'd rather not limit myself to features provided by a given engine.

So another question I ask myself is, "How can I make working with low-level code less painful?" More specifically I mean, "How can I figure out how to get a library to do what I want and then debug the associated code so that it runs smoothly and how can I do that in a timely manner?"

Maybe I could develop an encyclopedic knowledge of my underlying toolset. In a perfect world, this would probably be my ideal solution. But with some tools, OpenGL for example, there is a LOT to learn. Even doing something relatively simple like switching to orthogonal viewing mode is pretty archaic:GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, screenWidth, 0, screenHeight, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);(I'm pretty sure that switches to ortho mode. I'm definitley no OpenGL expert. :) )

And even then what if I switch tools? I'd end up having to learn everything about everything :) While knowing a tool inside and out carries a lot of appeal, I'm not really sure it's worth it, or how much I'm even capable of understanding.

I suppose this post has two main themes, "What's a good balance between ease of use and power?" and "Is it worth it to learn a complex low-level library like OpenGL inside and out?" Questions without easy answers, I know. Just thought I'd voice my thoughts and see what you folks have to say.

Bad Sector
06-09-2007, 10:05 PM
You don't learn a low-level library like OpenGL inside out. First you learn what libraries like OpenGL are doing and then you apply your knowledge to OpenGL.

The difference is that even if you use OpenGL at this point, you could use Direct3D or any other similar library at the future without the need to learn what they're doing - when you want to do something, all you'll need to learn is how this "something" is done with the library in hand (given that the library can actually do it).

That is of course, if you really want to learn such things. Someone could just copy/paste the ortho switching code around without really knowing what it does and why it works, caring only that it allows him to use glVertex2f to draw images fast...

electronicStar
06-10-2007, 10:55 AM
Here's what I've been doing:
First you create your own framework, with your own high level functions so you don't have to deal with low level stuff when you design your game, then you code the framework using the library you have chosen, that's when you have to deal with the low level stuff, but you don't have to learn everything from OpenGL (or whatever you're using), just learn what you need to have it work. Open GL is very large and complex because it can solve several different types of problems but there are some commands that you'll probably never use.

Once you've done your own framewok, things become easier, because when you'll want to switch to a different library you'll just have to translate your high level functions to the low level functions of the particular library, which shouldn't be very difficult with a good documentation.

In my case, I've done a very comprehensive "2D in 3D" framework using OpenGl and Java (in 2005 (http://www.javagaming.org/forums/index.php?topic=9699.0)), then I decided the Java distribution problems (at the time) would be too much trouble, so I translated everything to Blitz3D, it was relatively painless, because I knew what I wanted to do.