Making an engine

Miscellaneous Forums/General Discussion/Making an engine

I'm strongly considering making my own engine from directx in c++, and I have a few questions. First, should I make it for Directx 10, with the knowledge that by the time I'm done with it, Directx 11 will already be out. Second: should there be any global functions at all, or should I stick everything in methods within a grand Hierchy of classes that are initialized by loading the engine. Third: how do I go about making an engine DLL-ready, I want it to be all inside a simple DLL that can be quickly plugged into C++, and I happen to have no idea on how DLL's work.

Any help is greatly appreciated.
(PS: I DO know C++...enough...just not DLL's lol)

Why not use an open-source engine (such as Ogre) and learn from it?

That's no fun!

For me, DirectX 10 is pretty recent, I would say that as long as it's at least DX 9 or higher, perhaps DX10 with backwards compatibility to 9 in some way would be nice. I don't know anything about DX though.

Good luck with it.

Aiming at Direct X 10 I think is the wrong choice. The first reason is that not many people jumped to Vista. On the other hand, if you release at the time Windows 7 sits on store shelfs, then you've got something going. But, Direct X 9 is obviously a good choice. I'd look at the differences between Direct X 9 and Direct X 10 to sort out the elements that you agree to work with. And, how much time do you have on your hands to write such a huge project?

I would use OpenGL only, it runs on all Windows versions, and on all other OS too.

I would stick to a DirectX 9 and 10 compitable engine, so it runs on almost all Windows platforms. I find Direct3D a little easier in its command set. It does also handle a lot of vendor/hardware specific things.
A reason to that i won't be using OpenGL is, that it requires that you handle all the vendor-specific extensions that can be a big hell of hardware-compatibility, and DirectX does also provide a high performance and very stable extension library (D3DX) which OpenGL doesn't. I know GLUT and all the others, but not nearly as efficient as D3DX.
But in my engine, i write both a Dx9, DX10 and OpenGL renderer, so it is compitable with most OS'es, API's and hardware.

I've got time enough, I just graduated from 8th grade today, so I've got plenty of time on my hands. Also, I think I'm gonna be using DirectX 9, and if I feel a need, add DX10, I think I'm gonna draw out the function list & classes today...

If it is just for fun, it is quite reasonable , otherwise
from wikipedia
"Modern game engines are some of the most complex applications written, frequently featuring dozens of finely tuned systems interacting to ensure a finely controlled user experience."

If it wasn't for fun, why would I be on the Blitz3d forum, and not in a meeting with a group of 10 other ubernerds?

Because there are thousand ubernerds and milion day dreamers around
Have a look at GameDev.net you can see yourself how many people want to design an engine but not just a simple engine , much better than the commercial ones, of course

To design engine isnt easy unless u know what you doing !

Idea that's already been done 100 times over - CHECK
Lack of age AND experience to pull it off properly - CHECK
Post your idea in a NEW THREAD on some internet forum - CHECK
Claim you have a lot of time, and the fact that it being pointless doesn't bother you - CHECK
Refer to yourself as an ubernerd to gain respect - CHECK

and of course

Ask for other to help you - CHECK


Good show, good show indeed!

That or I'm just asking for friendly advice, no need to be rude...What's wrong with high hopes? If someone is hoping to be an astronaught, there's no need to bash them for it, it's not your place to do so.

Besides, the fact that I said 'By the time I'm done, DX11 will be out' implies that I realize this will take a large amount of time and work.


*sniff*

chwaga: Don't listen to the discouraging comments. It's true that there are hundreds of low-quality, ameture attempts at creating 3D engines all over the internet, but don't let anyone tell you that it's useless to try making one yourself. Since you have the time, it's the perfect opportunity for you to learn DirectX and game engine design, both very important skills. Even if your engine turns out to be a big mess, you can try again and learn from your mistakes.

Now regarding your original question, it depends. Your best, safest bet would probably be DirectX 9. It's the most widely compatible (games using it will run on practically any video card, depending on how many features you use), and doesn't require Vista. If you plan on making a game to distribute within the next one or two years, DirectX 10 wouldn't be a good choice for several reasons. First, it requires Vista, and a lot of people don't like Vista. It will probably be several years until Vista or it's successor is widely in use to the point where you can make a game exclusively using DirectX 10. Second, DirectX 10 requires a video card designed specifically for DirectX 10 compatibility, which limits you to GeForce 8xxx and up (I don't know the ATI equivelant).

Basically DirectX 10 severely limits the amount of people who can play your games - it's very recent, and isn't backward compatible, so only modern computers or recently upgraded computers will be able to play a DirectX 10 game. However, DirectX 10 does have it's advantages. Overall I think it's a little better and more consistant API, and is probably easier to learn and more logical (though I haven't done any programming with it so I'm not 100% sure).

If you don't plan on making commercial games for 3-4 years, choosing DirectX 10 might not be too bad an idea, but otherwise DirectX 9 would be the best choice.

Chwaga boy keep it up and dont worry...if that makes you happy, play with it, explore, learn new stuff, and let us know :) just dun get Xylvan complex please, otherwise I'll not like U anymore :)

I would definately go with dx10 only. By the time you've finished it, it'll be mature

you'll have much more fun dabbling with it.

I would definately go with dx10 only. By the time you've finished it, it'll be mature


DX10 only would also mean "it won't run on an non-vista machine", and currently there's still more people who DON'T run Vista than those who do...

But the same was with XP, but if you go to microcenter, there're only a couple machines without vista on them, microsoft had all the computer manufacturers use vista.

But the same was with XP, but if you go to microcenter, there're only a couple machines without vista on them, microsoft had all the computer manufacturers use vista.


Just because they mostly sell machines with Vista now, doesn't mean that there aren't several hundred million XP machines still in use worldwide...

the main problem with DX10 is not the "vista only" which is already an issue.
The main problem is that more than half of all sold Vista machines are NOT DX10 compliant!!
Intel GMA 900 / 950 are Vista capable. Not DX10 compliant. But sold in Vista boxes
Intel X3100 is DX10 compliant but 3 frames with ultra ugly graphics settings makes it non compliant in my eyes
ATI / NVIDIA onboards: not DX10 compliant as well

So by using DX10 you seriously cut it all. If you want to go that route you can as well just invest in the S2 or LeadWerks engine, they cut the possible user amount at least by less than that by "only" enforcing SM3.

I think id make an engine thats really good at doing one type of game, i know this sounds limiting but most of the engines ive tried are setup to do FPS games and trying to make say an RTS or RPG becomes harder because the engine isnt really geared in that direction. just something to think about

Pete

It's funny when you think that XP was released packed with Direct X 8 !

@Dark Half: if you have no positive comments, helpful advice, or anything constuctive to say whatsoever, why the #%$^ are you posting here to begin with? your post is an insult to the 1280-800 pixles of my screen that had to display it.

@Chwaga: I've always though working on an engine would be a fun project, unfortunatly however, my attention span has been compared to that of a shoe. personally I disagree with Pete, make the engine as moduallar as possible, even if its small scale (although, i gotta say, the thought of a full engine tricked out just for your RTS needs...)

I might have been a little bit older than you (9th grade) when I hit my peak in terms of hours per week programming. I tried to build three different engines, starting from scratch each time, one in DirectX 8 and two with OpenGL. The most advanced application that ever got built using them was a 3D pong game. Each of them had major design flaws that made me start again. I programmed so much that I ended up nearly failing most of my classes that year.

However, during that time I improved dramatically as a programmer; both in terms of being able to design code, and implement that design. I am now about to enter my third year at university in an unrelated field (physics and mathematics), and my most valuable skill is still my ability to program well.

So, I really understand and support where you are coming from as far as building something from the ground up. I would say, in terms of advice, that you shouldn't worry at all about choosing an API for compatibilities sake because, statistically speaking, nothing commercial will come out of this endeavor. Therefore, I would suggest that you use whichever API comes easiest for you. For me it turned out that it was OpenGL but I know for many others it is DirectX. Try them out and see.

I'd start with a 2d engine first, they're simpler. I'm working on building a basic 2d opengl engine in bmax, which i'll probably port to C++ eventually.

If someone is hoping to be an astronaught, there's no need to bash them for it, it's not your place to do so.
Would you bash someone who doesn't take the time to spell astronaut? (I would.)

On a more serious note.. screw DX, OpenGL ftw.

@Jsoren
A. Because it's an internet forum, and because I have been slowly adopting ENAY's philosophy on beings of the internet.
B. Freedom of information (regardless of how useful and helpful it may or may not be).
C. Because seeing young bloods come out of the wood work to announce their breath-takingly new ideas and plans for implementation is just as interesting now as it was 20 years ago. You have some wild hopes and dreams of being a 3d engine creator or astronaught (yeah, I know it's misspelled, perhaps one would have to spell it correctly before pursuing it as a career)? GREAT!!!! Show me you can do SOMETHING before wasting the bytes it takes to post how ambitious you are to take such a pointless project on.
D.
your post is an insult to the 1280-800 pixles of my screen that had to display it.

I would say the same about the thread starter however I merely used sarcasm to do it rather than boasting my monitor resolution like a true, how did he put it? Ubernerd?

On a more serious note.. screw DX, OpenGL ftw.

Have you tried DirectX? It's pretty nice (much less clunky and bloated than OpenGL + extensions), and has great documentation as far as I've used it.

C. Because seeing young bloods come out of the wood work to announce their breath-takingly new ideas and plans for implementation is just as interesting now as it was 20 years ago. You have some wild hopes and dreams of being a 3d engine creator or astronaught (yeah, I know it's misspelled, perhaps one would have to spell it correctly before pursuing it as a career)? GREAT!!!! Show me you can do SOMETHING before wasting the bytes it takes to post how ambitious you are to take such a pointless project on.

You've gotta learn somehow, and there's no better way to learn game programming than practical experience, and this is exactly what chwaga wants to do.

You've expressed your dis-interest in this topic, and there's nothing wrong with being disinterested, but you've taken it a step beyond that. It fine to be utterly careless about something, but not only is it somewhat impolite to state this in someone else's thread, but to actually insult and discourage as a result of your useless boredom is honestly very rude.

What's your purpose? If you think you're honestly helping chwaga by insulting and discouraging, then I apologize for having the wrong impression. But if not you might remember that the purpose of this forum is to be constructive and helpful. If you want to troll / insult / vent, I'm sure there are plenty of other public forums around for that.

@Dark Half: Well put! then we agree to disagree.

Imo what Dx version you use would depend heavily on the type of engine your creating. you should probably decide where the engine specializes, how scaleable it is, and the such first.

Chwaga,
To re-phrase Dark Half's (we are not the same person or connected this is just coincidence) points in a more palatable form:

I understand it's very exciting to look at developing your own 3D engine but it all boils down to basically a lot of work and much of that work has already been covered very comprehensively many times before.

Direct X for example is the evolution of 100's of thousands of hours of work from Mircosoft (who nobody will deny posses some of the best programmers in the world) and this is freely accessable to you to use for no charge. It is unlikely you would develop something as good as Direct X on your own even if you worked on it for a long time with every single member of the BB community.

I would instead focus on what you actually want to achieve from your programming as this, in the end is FAR MORE important than how you get there. Nobody will care whether you built your own engine, used OGRE, or Direct X to make your game when they are playing it. Results are everything. Once you have clearly identified what you want to do I would look at the resources you have available and then make a clear decision on how to achieve those goals as quickly as possible. In some scenarios building your own engine may make perfect sense, in many other cases it won't.

Many members of this community have been involved or at least party to (if only voyeristically) many game development projects. Most projects fail, most people never even finish one major project. Every now and then some new spark with an company name, logo and an attitude will come along and talk about all the great stuff they are going to do, and most of the time they are never heard from again, or come back 3 months later with much more realistic ambitions.

The main reason people like this become irritated is sometimes other people get sucked into putting time and resources into what is usually a dry well and also because they have seen this so many times before. The best possible reaction to this is to show people what amazing stuff you can do. Generally on this forum with talent and achievement comes respect. If you had come to this forum with some parts of your engine working (particulalry something flashy or hard to do) and a few screenshots to show off and a clear methodology of how to complete the rest of it and requested volounters you'd be in a very different place right now. However because you have not demonstrated any ability yet, you will find people somewhat skeptical, this is not personal, just based on previous experience.

I hope you continue to enjoy Blitz and the forums.

Darkheart

Those are all very good points, but chwaga said himself that:

1. Using something like Ogre / other engine would be no fun. I assume he wants to mess around and learn a lot in the process of making an engine. It's like if you wanted to be a mechanic, trying to build an car engine from scratch can only benefit your experience and knowledge, as long as you have the time.

2. He has the time to spare, and wants to spend it making an engine.

I see nothing wrong with what he wants to do. It's one thing to be cautious about what tasks you attempt to do (starting small is always better than starting big), but another thing to be so scared of failure that you don't accomplish or learn anything. I think you learn just as much from failure as you do from success, so whether you succeed or fail, it's never a bad choice to work towards any goal of any kind.

Like you say, it depends on what you're trying to accomplish. If chwaga said he wanted to make a game, I would agree that learning DirectX could be a waste of time (though I wouldn't go so far as Dark Half to insult and discourage - quit the opposite), but this is not the case.

However because you have not demonstrated any ability yet, you will find people somewhat skeptical, this is not personal, just based on previous experience.

Of course, everyone's going to be skeptical (including me) that anything significant will be accomplished, but does it really matter? When someone asks "I want to build ___. Should I use method A or method B?", do you answer "I don't believe you can build ___. I'm not going to answer your question, but just maybe I'll believe you if you come back later with something to show. Even though I didn't answer your question."

I can understand you don't want to waste time helping someone you're not sure will succeed, but if that's the case then you shouldn't be responding at all, because you're not adding anything to the topic.

Thanks guys, I'm gonna take a temporarly leave from C++ because my friend asked me to make him a game, but once I'm done with that I'll be going all in to the engine. I'm gonna just open up a few engines (OGRE, source, DXUT, etc.) to see how they did it and better understand the mechanics of one and decide how I'll make it. Also:

Wow, I've been misspelling astronaut all my life...How did you guys catch that?! Programmers are notorious for spelling!!

actually insult and discourage as a result of your useless boredom is honestly very rude.

I used to be the opposite, however I have found that this is common practice around here so I chalk it up to adaptation...... But seriously folks :-)

@-=Darkheart=-
Very well put.

@chwaga
Your final post sums it up perfectly. You already made John J.'s argument in your defense a complete waste of his time by back-burner-ing the project only 3 days after your announcement.

The part I find entertaining is
I can understand you don't want to waste time helping someone you're not sure will succeed, but if that's the case then you shouldn't be responding at all, because you're not adding anything to the topic.


And the only answer to that is that this case is very particular. This is a guy who wants to take on a HUGE "already been done" project by himself. The BEST thing for him is public ridicule because when it comes down to designing a 3d engine (with features he wants), public ridicule is going to be the least of his roadblocks. With that he better understand that he has a HUGE undertaking he is about to embark upon and that asking for help or merely making the announcement will be a complete waste of everyone's time, including his, if he backs out.

Whatever, dark half.

Well, the trolls were bound to come in to this thread and derail it. You get that a lot on these forums. :/

@chwaga
Your final post sums it up perfectly. You already made John J.'s argument in your defense a complete waste of his time by back-burner-ing the project only 3 days after your announcement.

Nah, I don't blame him for learning another engine before tackling DirectX. That's what I did. I just wanted to say that you can't go wrong trying to learn / gain practical experience, no matter what you do, and I've said it. Just try your best and work hard, try to ignore the trolls, and you'll get results eventually.

[Regarding rudeness] I used to be the opposite, however I have found that this is common practice around here so I chalk it up to adaptation

The BEST thing for him is public ridicule

Wow. At this point you're practically a self-admitted troll.

Sorry, but the best thing for him is a helpful reply to the question, and an honest suggestion if you think his time would be better spent elsewhere. Ridiculing someone is never helpful. If you think it's a bad idea, you might try explaining your point of view politely like Darkheart did.

Edit: And sorry to chwaga for letting myself get flamebaited from the trolling, I should have known better. I'll try to keep on topic if you have any more questions, etc. :)

And people say Xylvan's threads are "entertaining."

lol

at this point, you really have no choice but to make the engine, do a very professional job on it, and prove everyone wrong. :P

Yup. (It's kinda funny, if you read the original post, I was just asking for some pointers, and consequently was bashed for 'posting to announce my project')

at this point, you really have no choice but to make the engine, do a very professional job on it, and prove everyone wrong.

Now there's the ticket!

Ridiculing someone is never helpful.

True and False I would say. True as in it's discouraging and can put them off and False because it builds character to ignore popular opinion as in most cases the popular opinion isn't exactly a good opinion.

Take Mr Sibly for example. He gets more ridicule from his own user base than he does from the ENTIRE DB (GameCreators now?) community. Why is that? Yet here he is, making another attempt at greatness (and from the looks of things, he might just pull this one off). But the really funny thing (ironically funny) is that when he releases Product X, he of all people know that there are trolls just waiting to come out of the wood work to stab at his hard work. But he continues to press on because he knows that you never take an opinion expressed on an internet forum seriously for much is lost in textual expression. And those that want to bitch, will bitch, regardless of what you do to appease them.

Me on the other hand, well I've had a couple of bad days this week and was just looking for something to rant about to relieve some stress. But then again perhaps it's my turn in the spot light right? I mean I can be the future BlitzForums Troll! To take after such great names as GFK, ENAY, Cower, Flameduck, Amon (wonder if the sarcasm is still dripping from this paragraph or not).

True as in it's discouraging and can put them off and False because it builds character to ignore popular opinion as in most cases the popular opinion isn't exactly a good opinion.

I'll admit that that is partially true, but it sure sounds weird from that perspective. Kind of like "Hey, I'm gonna go beat up on that kid because it'll build character and make him tougher."

Regarding how public ridicule / trolling is common around here, I'd say I've probably been around the Ogre forums so long that I forgot how this forum was like. In the Ogre forums, everyone is almost always very helpful, polite, and with a professional attitude (and ironically, the moderators are far less restrictive than here - they even opened a off-topic forum after a poll showed it was favorable by the community). Anyway, the point is I was defending chwaga for being attacked for no apparent reason, and I became just a little annoyed that I seemed to be the only one, so sorry if I overreacted.

Yeah, I find the same to be true. Most of the XNA forums I have gotten involved with showed the same trend as well; even the Unity forums have a very 'adult' feel to them. It seemed to only be the TGC and Blitz forums that have that aspect although I have become a part of it from time to time (trolling and ridicule here).

As for 'being attacked for no apparent reason'; Just wait till Frank Taylor starts up another community project. I always hear a trumpet sounding the charge in the background :-)

If you make it modular enough it would make it more futureproof without the need for rewriting everything.

Good luck, its not an easy task.

"True as in it's discouraging and can put them off and False because it builds character to ignore popular opinion as in most cases the popular opinion isn't exactly a good opinion. "

I'll admit that that is partially true, but it sure sounds weird from that perspective. Kind of like "Hey, I'm gonna go beat up on that kid because it'll build character and make him tougher."

"A Boy Named Sue"

ok, 'nuff offtopic for me.

"A Boy Named Sue"

Damn, I was just about to say that.