Did someone can share his learn methoods

Started by
4 comments, last by carl granberg 12 years, 11 months ago
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?
Advertisement
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)


Product Description
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. 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. 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. [/quote]
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
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!

Hi!why does no one reasponce me?
Please try to keep one thread for each topic. I've replied in your Other Thread about the alpha UV / colour UV problem, let's keep this thread on the original topic.
Hi actually is not just on thread ,you will look the title is really diffrent,one request is want to get a learn plan,second is try to get a explain on that code

This topic is closed to new replies.

Advertisement