Sign in to follow this  
carl granberg

Did someone can share his learn methoods

Recommended Posts

I learn game programming from some book,I find a question,I read through all the code of the book,but finally I can't write the code myself,some author suggession our reader copy the code again by again,
get the effect of learn ,but I feel that is no real effect for me,so does someone call answer my question,
how to learn it?

Share this post


Link to post
Share on other sites
SimonForsman    7642
Start small and work your way up, don't try to run before you've learned how to walk.

The book you're reading (Based on the other thread you posted) covers a set of fairly advanced topics and isn't aimed at beginners but rather at people who allready have quite a bit of experience with C++, Direct3D and with game programming in general.

Put that book back in the shelf and make a few less complex applications first.

try making these applications for example:

1) a text based "Guess the number" game
2) a program that draws a blue square at the center of the screen/window
3) a program that draws a blue square that you can move with the arrow keys.
4) a pong clone
5) Some more complex game clone like tetris, breakout, asteroids.
6) a scrolling 2D game (platformer or top down shooter for example)
7) a program that renders a rotating textured 3D cube
8) a program that renders a 3D model loaded from a file.
9) a simple 3D game

Then you can pick up that book again, it will still be a bit on the advanced side but it will make a bit more sense atleast.

(From the books description on amazon.com)
[quote]

[b]Product Description[/b]
There are many books that teach the basics of Direct3D, but few of these books teach and apply the more advanced topics needed to program complete applications such as games. Programming an RTS Game with Direct3D is such a reference. The book provides intermediate programmers with a step-by-step implementation guide for programming a complete RTS game.[b][u] [/u][/b]And, unlike other books that teach basic game programming, this book teaches programmers how to implement the more challenging parts of an RTS game, including advanced topics such as Skinned Meshes, Fog-of-war implementation, Team-color pixel shaders, AI, networking, and much more. The game is developed from chapter to chapter, beginning with design and storyboards through the development of a fully implemented RTS game, complete with Multi-Tier AI and Networking. [u][b] This is a must-have resource for intermediate game programmers who wish to increase their skills and learn the more advanced topics required in todays commercial games.[/b][/u] [/quote]

Share this post


Link to post
Share on other sites
not as you think,this book's frist part is reallly difficult to understand,because it involves a subject,Terrain,so I'm stuck with that code,my problem is here how to understand alpha UV
code as below:
void TERRAIN::GenerateRandomTerrain(int numPatches)
{
try
{
Release();

//Create two heightmaps and multiply them
m_pHeightMap = new HEIGHTMAP(m_size, 20.0f);
HEIGHTMAP hm2(m_size, 2.0f);

m_pHeightMap->CreateRandomHeightMap(rand()%2000, 2.0f, 0.5f, 8);
hm2.CreateRandomHeightMap(rand()%2000, 2.5f, 0.8f, 3);

hm2.Cap(hm2.m_maxHeight * 0.4f);

*m_pHeightMap *= hm2;
hm2.Release();

CreatePatches(numPatches);
CalculateAlphaMaps();

//Add m_objects
HEIGHTMAP hm3(m_size, 1.0f);
hm3.CreateRandomHeightMap(rand()%1000, 5.5f, 0.9f, 7);

for(int y=0;y<m_size.y;y++)
for(int x=0;x<m_size.x;x++)
{
if(m_pHeightMap->GetHeight(x, y) == 0.0f && hm3.GetHeight(x, y) > 0.7f && rand()%6 == 0)
AddObject(0, INTPOINT(x, y)); //Tree
else if(m_pHeightMap->GetHeight(x, y) >= 1.0f && hm3.GetHeight(x, y) > 0.9f && rand()%20 == 0)
AddObject(1, INTPOINT(x, y)); //Stone
}

hm3.Release();
}
catch(...)
{
debug.Print("Error in TERRAIN::GenerateRandomTerrain()");
}
}
How to understand thease code,and I'm looking for a learn plan to learn it!just copy the code isn't good learn way,so suggest me a way to learn must step by step so detail!the other part of the book is really easy to understood,I can write a simple 3D Game,I use the book as a reference and tool to learn how to write 3d game!A book's name is introduce 3d game programming teach write a cube programm,but the math invoved is so many in that book!

Share this post


Link to post
Share on other sites
Evil Steve    2017
Please try to keep one thread for each topic. I've replied in your [url="http://www.gamedev.net/topic/602218-does-someone-undersatnd-the-code/page__gopid__4811852#entry4811852"]Other Thread[/url] about the alpha UV / colour UV problem, let's keep this thread on the original topic.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this