PDA

View Full Version : Yes, Yes, Another "My Own Engine" or "Someone Elses" Question... (Sort of.)


eddie
05-06-2006, 02:19 PM
OK, apologies for what might seem like the same question all over again.

This time I'll add a twist by being specific in why I'm asking this ages-old question.

I'm currently using g3d in my application, but I'm not really enjoying the experience (on Linux, anyhow -- they ship with a copy of OpenGL you have to use, and it doesn't mesh well with Gentoo).

Since what I'm doing is mostly for recreation/learning, I'm curious I'm mad as a hatter for even thinking about writing my own engine.

Before you declare me a lunatic, the reason I want to do this is the typical one: control. I can see what's going on, I can limit dependencies, and I can learn the entire while. I'm not saying I can out program other graphics engines, or even that the other ones are "shit", but mostly that I can learn a great deal more, and I can actually fix problems without worrying about integrating the 'newest version' that will be a bigger pain (with any mods I put into the source) than it might be worth.

So, since I obviously don't care about the latest 'features', and such, you might be wondering, "Well, why even ask us? Why not just do it?".

My question then comes down to one thing. Models.

While I don't have a lot of experience in writing 3D engines, I (naively) think that it shouldn't be too bad, and it should be rewarding. The hard part for me, is doing imports from other 3D packages (Blender, most notably (Free, Free, Free!)).

I can imagine learning the file format, parsing it, and then using it as a data point for rendering can be some long, non-interesting work.

Is this something I'm going to have to deal with, if I go this route? Or is there some thing that'll make it easier (Existing code snippets, library calls that aren't crazy dependant on other things, etc)?

Are there any other headaches that I'm not thinking about? I'm OK with having to learn the basics of computer graphics to get the thing rendering, I just want to avoid grunt coding drudgery...

Yes, I know, I'm a princess. ;)

roel
05-06-2006, 02:33 PM
You aren't crazy if you want to code your own engine. I think that it is very healthy. I don't think that loading models will be the hardest part. I once wrote a milkshape3d (ms3d) model loader, and I had at that moment not more than about a month experience with direct3d and 3d stuff in general, and I'm not really the smartest person on earth (that is an understatement). At that time, I could successfully load a model and animate it using its skeleton and animation frames. If I were you, I'd target the 3ds format, and I'm very sure that there are enough libraries/snippets to help you with it. Besides that, you don't have to support the whole format, probably you can slowly build it up, if you code it yourself.

Mattias Gustavsson
05-06-2006, 03:43 PM
Expect a lot of "long, non-interesting work" if you write your own engine. Avoiding the tedious stuff is the main reason for using an existing engine, as I see it. Sure, you can use existing code snippets and libraries, but that's not all that different from modifying an existing engine (I mean, you could just use an existing engine and rewrite the rendering code).

I still say you should go ahead and write your own though. Just don't expect it to be all fun or to be quick. If you need something that just works from the start, go with an existing engine.

bignobody
05-07-2006, 12:25 AM
Since what I'm doing is mostly for recreation/learning


Dude! Enough said! You don't need any more reason than this to write your own engine.

Expect a lot of "long, non-interesting work" if you write your own engine. Avoiding the tedious stuff is the main reason for using an existing engine, as I see it.

You've got it exactly. In my hobby-turned-serious project, because I started it just to learn, I've written EVERYTHING. Needless to say there has been a lot of tedium. But I learned a hell of a lot too. On the flip side, I've been working on what started as "make 3D arkanoid" on and off for 4 years now (though I had the basic game working within the first month).

That being said, now that I've gotten serious (started a business and all that) I'm seriously considering buying an engine for the next project... But we'll see ;)

Regards,

roel
05-07-2006, 03:48 AM
Can you give any examples of tedious jobs?

eddie
05-07-2006, 09:48 AM
Sorry, I suppose I'm waffling without being specific.

Basically, 'tedious' jobs are probably similar across people. The only difference for me, is that if I've never done it before (so, rendering in general), it will be less tedious, as I'll be learning something.

Things that are tedious to me right now, are file format conversions, parsing work (ugh. I'm so sick of grammars and lexers right now), and such.

Hence why the biggest nightmare for me right now ( at least fore-seen nightmare ) is getting a model to load into my game. I love programming, but I don't want to sit around and daydream about how to parse a file format so as to load my model.

I'm not sure if there are similar levels of boredom I'll have to endure (I know, I know, I'm sure there will be. I'm just curious as to what).

Cheers,

Ed Mack
05-07-2006, 12:40 PM
Tedious:
Making list and array containers
Writing 3d [maths] libraries
Dealing with data
Dealing with users (interfaces)
Writing object / event frameworks
Making cross-platform interfaces to the OS
And so on. All very boring

bignobody
05-08-2006, 10:05 AM
Ed's got a good list. I'll just add a general statement which for me encompasses the tedium - "The work you need to do to be able to do the work you want to do" ;)

eddie
05-08-2006, 10:55 AM
Cool. OK, so most of this I already knew. But that's good to have it listed for me.

I'm currently writing a tool for Lua -> C++ and back again binding, and it's dry as hell. I'm hoping the rest of this will become a little more enjoyable.

Here's hopin'. ;)

Prozac
05-16-2006, 12:38 AM
Wavefront OBJ is really fun to load, the files are simple and have some pretty
complete material defenitions along with Bezier curves (optional, most programs don't even use them).

If you really want to go overboard try loading Quake 3 BSPs,
they are as easy to hell to read and render, easier than I though it would be
especially after hacking the Half-Life BSP format.