Jump to content
  • Advertisement
Sign in to follow this  

2D/3D Programming related topic.

This topic is 2185 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, everyone. Here is a new beginner for all of you.


Well. Lets put this straight. 

I'm currently researching on how videogames are done. For that matter, I still don't understand how 2D/3D art, characters and such things are implemented in games. Is it part of the Engine features? Or is everything programmable? I really am confused on this. 


Mi idea is as follows: The programmer works with 2D/3D graphics libraries on his chosen language and use it to import art from 3Ds Max, Maya or so, on the main code for being manageable from there. That means, pressing any button move character from A to Z, while its animation is taking place. Okay, lets be clearer. The user presses any button, then the code runs that character's animation for start moving from A and then walking while the button is till pressed on, to finally run the animation for stopping when arriving at the giving Z point. 


Is this how it really works?.

Who does this?

How can it be done?

Is it too hard?

What does it take to accomplish such task? 


And then, how programmers make all that to happen on a 3D/2D full environments will complex scenes and NPL character all over the place, plus, collision detection systems and on and on. 

I really still don't get how all this is accomplished. 

Any feedback will be appreciated. 

Share this post

Link to post
Share on other sites

A game can be roughly divided in 3 parts:


- common logic

Reusable stuff that you bought, downloaded, or programmed yourself. This could be a complete engine, or at least standard libraries such as DirectX/OpenGL(3D graphics), Newton(physics) or FMOD(sound). Although the borderline is vague sometimes, this part should be isolated from the actual game more or less, meaning it can be reimplemented in another game, as it does not contain specific rules or restrictions.


- game logic

This part tells how the actual game is played. Game rules, how to control the "player"(whatever that is), when to win or lose, enemy AI, et cetera. It's based on what the common logic provides you, so the implementation depends on it as well. It could be just some more code in the same application. But also DLL's or script files.


- resources

3D models, 2D textures, animations, audio, game maps, and everything else you could load from a disc. Usually these assets are made by the artists, and loaded into your game depending on the game-mod, current level or current location the player is.




>> Is it part of the Engine features? Or is everything programmable?

That really depends. If you program your own game or game-engine, then of course everything is programmable. In that case, you are responsible for rendering ("drawing") your 3D stuff, as well as for loading the resources (image, animation and 3D model files). When using an engine, those functions are likely done for you. Though you still have to tell which files to load, or what drawing options are used to render something. As said, its really different for each approach, although the raw basics are the same.



As for your 3D example. This is how I would do it:

1- Artist makes a 3D file in Max, Maya, or whatever

* This contains: the 3D model itself, one or more textures(images) applied on that model, some animations eventually


2- Some editor or convertor tool provided by the engine, or self-made, will convert the Max/Maya/Image/xyz/ file to our own internal format

* This internal format is basically the same, but is assured to contain everything we need in our game, and loads fast.


3- In another map-editor, I place this 3D object I just imported into a map. So, an instance of this object is placed at a certain location. This is saved within the map data.


4- Now when playing the game, the engine loads the map files, and creates those object instances I made in step 3.

* This creation basically means that I'll make usable "objects" in engine & computer memory. An object for the map(s), an object for the player, objects for enemies, decodations, audio fragments, textures et cetera

* The engine knows what to do with those objects. How to play them, or how to draw them in case of visual objects.

* Visual objects are usually a bunch of vertices & triangles (a "mesh"), linked to a material (textures & shader) and maybe some animation. All this data is available in the computer RAM and/or videocard memory now.


5.- X(60?) times per second, the engine draws everything you should see.

* This is based on the loaded resources, how the graphics pipeline in the engine was made, shaders, and the underneath rendering API (OpenGL, DirectX, ...)




>> Who does this?

Someone who can draw textures, someone who can model 3D meshes, and someone who can code its own engine or at least knows how to use an existing engine. Look at any game "credits" screen.


>> How can it be done?

>> Is it too hard?

Hard? Yeah, I'm programming 13 years and still don't know half of it. But you don't have to start with super advanced things of course. What is your role in this? Are you a programmer? Ifso, just start with some basic programs. Tons and TONS of OpenGL / DirectX demo's that show you how to setup a first drawing screen.


Or, another route is to start editing existing games. Just make your own map in Halflife Source, Unreal UDK or CryEngine Sandbox. You don't have to code anything, but you get in touch with very typical game engine design. How a map is made, what kind of resources are needed, and in which programs to make them. 



>>What does it take to accomplish such task? 

Patience my friend. And a lot of love for the subject. If your goal is to quickly create something to earn some cash or whatever, then forget about it.


Good luck!


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!