0

... hello everyone... i'm a computer science student here in the Philippines and i just want to ask help on how to develop a game... honestly, i am very clueless on how can i start my program... i really don't know what to do. i need to make a program that have abstract classes and with inheritance.... pls... i need help...

5
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by Ketsuekiame
0

If your game must be created with "pure" C++, then you are going to be left with pretty simple, and pretty boring, console stuff. However, if you are asking how you should get started in game developement, my suggestion would be to learn Windows Programming (A.k.a. Win32 Programming). A game is nothing more than software, with animated images.

0

I beg to differ. All these games are written in "pure C++" as you call it. The graphics are created procedurally.

Games programming is not just software with animated images. Honestly, don't speak if you don't know what you're talking about. Technically *all* software is just an animated image, even the console apps. How else does the screen show you new information?

Yes an image (read frame) is created by getting information from the software, such as texture, model data, position data etc. But they are also physics simulators and network communicators with real time user interaction.

Also you do *not* need to learn windows programming to write a game. You *will* however, want to learn a Graphics API such as OpenGL if you want graphics. But there are still popular games (MUDs) out there totally in text.

0

Thank you. I will read literature about OpenGL
If there are some other suggestions, please tell me

0

... we were asked to develop a pure java program.... i'm already done with the interface of my game using gui and now, one of my big problem now is how to make the object or the character to move using arrow keys... can someone help me???

0

You could also look into XNA, which uses Microsoft's C# language. It's very similar to Java and C++.

0

Ketsuekiame, please know YOUR information before attempting to correct me. Any game that you have ever played on a PC,
(excluding flash made swf files) are essentially..applications. An application.. IS software, according to Wikipedia. Though it is true that there are MANY methods of creating APPLICATIONS on a pc, to say that a person can create a game that is NOT an application, is retardation. Even a simple text based GAME created with C++, MUST first be compiled into a .exe file(application) in order to play it.

All you managed to prove was that a GAME can be created using C++ AND a graphics application interface. I did not say anything different. I merely pointed out that Windows Programming WAS a route a person could take toward game developement (e.g. getting images on a screen, using C++ and the win32 language).

In short.. you COULD have said that a person does not necessarily have to learn windows programming, to make use of GRAPHICS.. in a C++ game. The much easier route would indeed be to simply learn a Graphics API (such as OpenGL). It is rediculous that you would have the nerve to say that I should not speak if I didn't know what I was talking about, when it is YOU who does not know what HE is talking about. A game IS software, when created with C++ (whether it has graphics, or not).

As a final note, the only reason why I suggested Windows Programming for game developement, is because windows programming makes it quite simple to handle windows events, such as keyboard input, mouse clicks.. etc.. Also, Windows programming can be utilized to generate sound in a game. Your method has ONLY shown how to utilize GRAPHICS in a game.. but the poster was requesting how one would go about learning how to create games, period.

A game, consists of: Graphics, content (story, etc), user interaction, and sound. OpenGL only covers the graphics portion of game developement (as far as I know), but how about the mouseclicks, and the sound? You've forgotten to mention the fact that a person would also have to learn a SOUND API to generate sound in a game (unless OpenGL already covers that..) Windows Programming permits a person to make use of: Graphics, sound, AND user interaction, which are all elements needed to make a game.

Sure, a person can create a game with raw C++ and several other APIS(including graphic, sound,and possibly even a mouse interaction api ..) However, you must consider that learning all of those apis would probably be more difficult than just learning the simple Win32. The only downside of learning Win32, is that it does not support 3d graphics, as the OpenGL api does. You would still have to learn the OpenGL api to make use of 3d graphics (but for everything else, there's win32.)

Edited by PixelExchange: n/a

0

Hi, please re-read my post.

Not only have you said that I've said something I haven't, you've also contradicted your previous post.

Games programming is not just software with animated images.

Is still correct. By this sentence I mean that a game is any application that provides entertainment to the user through which the user is interacting. You added a clause that a game had animated images. All programs are simply animated images, so to make the distinction is non-sense.

I have not once suggested that a game is not an application.

A game does not necessarily consist of any "3D or 2D rendered graphics". Please see MUD's and other similar text based games.

A game could best be termed as an interactive simulator, in which you define the simulation. The graphics/text are simply the response to the user as to what is happening in the simulation.

You do not need to know Windows programming. Flash, Linux, Java are all valid for writing games in. Hence the statement for not needing to learn the Windows API. Even in Windows style games, the amount of Win32 code is small as most of it will be your own code with only the window creation and message pump in Win32.

Writing a game in only Win32 (utilising the GDI+ library) will result in a game that is incredibly more complex to write and will not work very well at all. (GDI+ is a CPU based renderer, in XP at least and will be extremely slow for rendering full window animation)

OpenGL and DirectX are perfectly capable of creating 2D graphics. It doesn't have to be in 3D if you use a graphics API.

If you're going the windows route, DirectX is the obvious choice as it supports DirectSound and DirectInput which move the code away from the Win32 API.

As for mouse clicks, very little win32 code is used.

Here is code I use that is Win32 for the mouse.

case WM_LBUTTONDOWN:
        // User pressed left mouse button
        SetCapture( hWnd );
		m_mouseDown = TRUE;
        break;

    case WM_LBUTTONUP:
        // The user released the left mouse button
		if(m_mouseDown)
		{
			OnMouseClick();
		}
        ReleaseCapture();
		m_mouseDown = FALSE;
        break;

The Win32 Specific code there are the constants, SetCapture and ReleaseCapture.

The code which actually translates that into an object selection is actually a very basic ray creator. Given an origin and a target screen co-ordinate, you can calculate a ray and see what objects that ray intersects.

void CMenuApp::OnMouseClick(HWND hWnd)
{

	D3DXVECTOR3 vPickRayDir;
    D3DXVECTOR3 vPickRayOrig;

    // Get the pick ray from the mouse position
    if( GetCapture() )
    {
        POINT ptCursor;
        GetCursorPos( &ptCursor );
        ScreenToClient( hWnd, &ptCursor );

        // Compute the vector of the pick ray in screen space
        D3DXVECTOR3 v;
		D3DSURFACE_DESC* backBuffer = m_pFramework->GetBackBuffer();
        v.x =  ( ( ( 2.0f * ptCursor.x ) / backBuffer->Width  ) - 1 ) / m_matProjection._11;
        v.y = -( ( ( 2.0f * ptCursor.y ) / backBuffer->Height ) - 1 ) / m_matProjection._22;
        v.z =  1.0f;

        // Get the inverse view matrix
        D3DXMATRIX m;
        D3DXMatrixInverse( &m, NULL, &m_matView );

        // Transform the screen space pick ray into 3D space
        vPickRayDir.x  = v.x*m._11 + v.y*m._21 + v.z*m._31;
        vPickRayDir.y  = v.x*m._12 + v.y*m._22 + v.z*m._32;
        vPickRayDir.z  = v.x*m._13 + v.y*m._23 + v.z*m._33;
		D3DXVec3Normalize(&vPickRayDir,&vPickRayDir);
        vPickRayOrig.x = m._41;
        vPickRayOrig.y = m._42;
        vPickRayOrig.z = m._43;

		// calc origin as intersection with near frustum
		float fnear;
		vPickRayOrig+=vPickRayDir*m_fzNear;
	
		// Iterate objects
		m_pSceneObject->Pick(&vPickRayOrig, &vPickRayDir, m_fzFar - m_fzNear);
	}
}

So if you want to compare win32 to custom built code, there is a large difference.

Your first statement was that games written in "pure" C++ would be boring and text based, however, I provided you a link to evidence of the contrary. Procedurally created textures and graphics are still very alive in the demo scene and can create wonderful graphical effects without ever including or linking to a graphical asset.

If I were to give him my advice, I'd suggest he learn how to use the Windows Message Pump, Create a Window and DirectX. Then use something similar to FMOD for the sound system or fall back on the use of DirectSound (which I personally don't like)

Also, an SWF file is technically an application as it must be decompiled and executed by its own interpretation engine (Adobe Flash Player). With the advent of Adobe Air, more and more applications are being written in flash. Personally I hate the language but it's only my preference.

I think that's everything covered. I'm extremely tired and will post more tomorrow if I missed anything.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.