how to make game with directx,opengl

Started by
3 comments, last by j_uk_dev 7 years, 10 months ago

I have made game like the "survival shooter" with the unity3d engine, I don't know how it work...

is there any tutorial how to make game with dx/ogl? make a big game like WOW....

or where to find open source game code which is made in dx,ogl step by step ?

There many guys ask us to make game with existed engine, instead dx/ogl, but why

so many people ask question about how to make engine? or how to implement things use

c++....

Advertisement

Making games with OGL or DX is night and day different than making them with Unity. There's all sorts of stuff that Unity does for you that you take for granted.

OGL and DX, by themselves are more like graphics drivers. They really don't do much of anything other than draw triangles on the screen. So, you have to take the ability to draw triangles on the screen and turn that into Unity. There's a bit of a gap there.

Are there OGL and DX tutorials? Yes. Is there an OGL or DX tutorial on how to build World of Warcraft? Um. No. WoW probably took a team of over 100 people many years to build.

I'm kind of working on some tutorial stuff for OGL now. I had been working on DX tutorials. Before that I was working on XNA tutorials which is a good place to build up to working in DX or even OGL. I could point out some other good XNA tutorials as well, but you asked about OGL and DX.

My DX "tutorial" never got fully completed. After my experience writing XNA tutorials, I decided it was far too time consuming to write step by step tutorials. What I actually want when I'm learning about something is working sample code that I can read through line by line anyway. So, I decided to do working example projects instead of step by step tutorials. It's far more productive to write examples rather than tutorials. Writing step by step tutorials takes 100 times as long and by just writing code examples, I can share 100 times as much knowledge. I'm usually around on the forums almost always, if you have a question about my code.

But OGL and DX are something that take years to learn. You don't just jump in and start making games with them, especially DX11/12. Just drawing a triangle on the screen in OGL 4.5 or DX11 is quite an accomplishment (just did it for the first time by copying and pasting someone else's code in Vulkan and that's even worse). You have to back up and start from the beginning with DX and OGL.

People probably ask about engine making for several reasons including just curiosity. You're not going to build Unity by yourself. It's just not going to happen. The definition of an "engine" can vary widely. My example code is a very simple engine. But it doesn't do 1/1000th of what Unity does. All it really does is draw 3D models on the screen for rigid animation (I intended to add quite a bit more additional functionality and do tutorials on terrain and what-not, but never got there before now switching to OGL and trying to do it all over again in OGL). I mean, until you're up to this level, you're not ready to make even the most simple game in DX. But it takes quite a bit to get there. One of these days I hope to do a video tutorial where I go over all that code line by line and explain it. Although now, my goal is to rebuild my engine in OGL 4.5 and then maybe do a video tutorial explaining every line of that code. But I'm debating on whether to learn Vulkan and do the video after learning Vulkan.

There's nothing wrong with using Unity, but I prefer to do OGL because I want to know how things actually work at the lowest level. One of the problems I encountered trying to learn game programming is when you hit a "brick wall" where you have no idea how something works and neither does anyone else. And there's no way to figure it out because the answer could be anything in someone else's code. When it's all 100% your code there can never be a brick wall with no answers.

I also find that I just toy around in Unity rather than actually learning. It's just too easy to put together pieces you bought from the asset store rather than learning actual game programming in Unity. In OGL or DX, you don't have that problem. You have to learn to do anything.

Still, for most people Unity is probably going to be the better choice than DX or OGL, especially if they are brand new.

For ogl I really enjoyed these tutorials:

http://ogldev.atspace.co.uk/

They really helped with the basics on how to set things up - provided me with a starting point.

The short and sweet answer to you question "why make engine using DX/OGL" is that you can make it VERY specific to what you want. Someone else's engine may have everything you need, but will likely have a lot of things you don't need just sitting there taking up space. Others may not even have what you need...... That's why I prefer to make my own.

I'm gonna second @BBeck. I see very often putting 'equal' sign between game engine and any graphics API. There is absolutely no equal sign between Unity and OpenGL in terms of functionality. See that Unity itself uses OpenGL. Game engine is lot more than just drawing triangles ( because if you simplify the role of GL or D3D, this is what they do at the end - they just draw triangles ). Game engine is resource management, memory management, user input, handling persistent state, handling 3D world, scripting, networking and lot more. Unity or UE support all those things, while with GL all you can do is just rendering. I'm not saying not to try to build your own engine. I'd rather say - hell yeah, everyone should try to make a full game from scratch at least once to understand how all this stuff works under the hood. I know I may be overreacting, but I read such things here quite often and I think it's misleading for beginners. GL/DX/Vulkan are not engines. But they may be part of engines as they use them as rendering APIs.

Just one thing: "But OGL and DX are something that take years to learn" - that's not really true. It really depends on current skills of programmer. It doesn't even take long to learn Vulkan to the level that you can actually do what you want. It's all about skills and understanding certain things when you starting to learn. I use Vulkan as well as Metal and DX12 and it really didn't take ages to dive into it ( Vulkan was released in just in February ). It's all doable in finite time but very often requires to have certain knowledge from other areas.

@poigwym

In other words if you make your own solution from scratch, believe me, whether you decide to use GL or DX - this will be least of your problems comparing to other things you will have to deal with. Also understanding "guts" of own engine will give you better understanding of third-party engines.

This topic is closed to new replies.

Advertisement