Skip to main content
GameDev.net gamedev.net
🔒 Locked

it takes a while!

Started by yodaman Apr 21, 2003 at 2:52 PM 19 replies 950+ views
Original Post
yodaman
yodaman
Hiya everone! Ok, this is like an article I wanted to start that will point out a few problems and mistakes that people make in there programming childhood. Alot of times, when you goto forums and read some of the questions people are asking, you think to your self "that should be easy for them to figure out", or there post normaly starts out by saying they are having problem with this really advanced subject and that they have never even attempted the basic''s, for example: "Im having trouble with learning rigid body physics,can any one help. I havent actualy ever tried doing any type of physics before, but I read this article and it didnt sound to hard to me". This may be an extreme case, but in this brings up a big issue that I my self as well as many others I know have been fooled by. People sometimes dont understand that what they are reading is way to advanced for them and there for start learning the basics of the subject and think they got it mastered, only to find out later that they know nothing about it. This was the case with me a long time ago with BSP trees. They seam rather easy on the surface, but when you get in deep and start dealing with CSG,PVS , portals, etc, its a whole new ball game! Anyway, the big issue is that a lot of times people dont realize that there trying to do something that is very, very complex and requires alot of background knowledge before attempting it. Im not saying that every one who does, never learns, but most of us normal humans can''t fully understand something until we know and understand what it is built upon. Ive talked to a few people that are just beggining to learn how to program and maybe have just a little bit of gfx, or such under there belt and decide that they want to make a full 3d game engine! This has been talked about alot, but the truth is, is that a lot of people do this. If you can some how manage to start making a complex project when you are just starting out and you work on it until you are a pro, then many Kudos to you My enitre point is that, you should know where your at, in not only programming, but in anything, before moving on to something more grand and great. These may just be my opinions, but thru my own personal expirence with people I know, this is a reason why a lot of times you give things up. You ever wonder why some games on the market really suck, they have amazing 3d art work, but then, everything else justs blows, input is jirky and you see charactors sticking in walls, or the bots run into walls? Well this is because the person didn''t take the time to learn everything and skipped ahead, probably because the wanted glory or praise! I may not be by any means a pro, heck, im a begginer myself, these are just some things I have been thinking of and wanted to share with everyone. It may take a while to learn how to do things the right way, and even at times it may seam nearly impossable to learn how to do something, but keep with it and it will come to you! also, dont cut a paste code! its not programming and in the long run, it will mess you up because you''ll be thinking to your self that you already know how to do something you never really did. By not understanding something and just typing out some one elses code can only cause you problems if you ever need to extend upon it or chnage it to fit your needs and you dont understand it in the first place, how are you going to do it!? And, using libs im my opinion is ok as long as you know the principles behind what your using. Ok, enough of my garbage... ~yodaman
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
James Trotter
James Trotter
Good read!

And very understandable, I agree with what you''re saying...
Another reason for not copy & pasting code, is, think about how much more you will learn if you wrote it yourself! Read about the algorithm, and think about how you would code it.. Then code it...
llvllatrix
llvllatrix
I totally agree - as a rule of thumb: if you cant figure it out on your own then theres a 1% chance that the best message board on the net will and a 0% chance that you will understand them if they do.

Dont get me wrong though, Im all up for trying impossible projects. The only thing you have to keep in mind is this:

First look for stuff that is written on what you want to do - dont just do it if its too big. Then research the hell out of it. If you find stuff you dont understand then research the hell out of that.

Then make your project...but make sure that its your project - you know you understand enough about a project when you are able to make it better.
pIpEs ClaNGoR
pIpEs ClaNGoR
I konw is bad to copy & paste someone elses code and call it your own, but what if you copy & paste your own code that you wrote yourself?

---------------------------
The pipes clangor all the time.
---------------------------The pipes clangor all the time.
llvllatrix
llvllatrix
I would call that good coding...the only thing is that you should not have to copy and paste. Just include the modules.
RipTorn
RipTorn
you will find thats the view of every ''experienced'' programmer, because, even though they don''t want to admit it, they know they have been there

I''ve been there, have you?


yeah. You bring up a good point in a good way. It''s not easy to say what your''ve just said so for that I congratulate you. Seems when most people are asked to talk about this, well, emotion seems to cloud logical thought.

| - Project-X - my mega project.. close... - | - adDeath - | - email me - |

| - When it comes to programming, the most obvious answer is usually the wrong one - |
Lukerd
Lukerd
I completely, totally and unconditionally agree with what you said. And no matter what we say, newbie OpenGL programmers will still think they are gonna write a game to rival Doom 3 within a month of starting OpenGL.

I''ve been coding for 3 years now, and I still havent written that FPS i''ve been planning. Although I am a little closer

Lukerd.

Hyperdev

"To err is human, to really mess up requires a computer"
"To err is human, to really mess up requires a computer"
redragon
redragon
quote:
Original post by pIpEs ClaNGoR
I konw is bad to copy & paste someone elses code and call it your own, but what if you copy & paste your own code that you wrote yourself?


I'm going to try and be nice with this. Copy-Paste is the most basic form of code re-use. You're not really helping yourself in the long run, you're often just opening yourself up to old mistakes cropping up all over the place.

For example, let's say you've got some base code that you use on every project. Every time you create a new project, you copy those files into the new directory, add them to the project and modify them (Complicated form of copy-paste). You then edit that code, and sometimes copy and paste from other locations into this project, and add some new code to get it to do what you want it to do. Better code re-use than nothing, but how about another idea...

Create a static .lib file that contains a base module (C++ Class, or something like this), that you have several pure virtual methods (that you always cusomtize), some virtual methods that you sometimes over-ride, and a boat-load of utility functions that you've found useful. Then you just include a header for the library, and compile it into your app.

Now lets say that you find a bug in your "base-code"...you fix it in one place, not in just the current app, and then in the older apps when you find the time, but in one place, re-compile all your apps, and voila....done.

So anyway, copy-paste works alright...but it's not great. It's used too often by people that haven't looked into object oriented design.

I'd be happy to give more info on stuff like this if people are curious.

- sighuh?

P.S. Just realized I didn't say anything about the original post. Yodaman....you're right on I think. Really, getting to a point where you're able to implement some of these things takes times. So many people want to make really neat stuff right away, when spending some time doing text-based stuff would be of benefit, as it would help them learn some fundamentals that enable you to do the complex stuff in the future. I think sometimes it's ego, a lot of people feel silly asking basic questions when they're used to being at the front of the pack. Other times it's just enthusiasm...they're excited, and don't really want to go slowly and learn the basics...

Anyway, 2 years ago I couldn't have attempted the stuff I'm doing now, and really...even if I had done it, it would have been a train-wreck code wise.

[edited by - redragon on April 22, 2003 9:13:11 AM]
sighuh?
Crispy
Crispy
One thing to consider, though: if you learn something in some precise order dictated by some professional, you will most likely learn what he tells you to (if you don''t become bored with the linear routine and quit early) and in the end you might end up incapable of making your own decisions. This is what books are good for battling against. They contain thoughts and approaches, but generally not solutions. If you read enough theory you will start to understand the subject - in that case you don''t need anyone to tell you what to do and in what order - the latter will not necessariliy teach you how to think in the best possible way given your current situation.

If you can''t afford/don''t want to read/can''t find books, Google is your next best friend. A list such as this:

1) Create the window
2) Initialize your OpenGL stuff
3) Open "level.lev" and read in your BSP tree
...
n) If the user doesn''t do anything for 15 seconds and x > 10 ? reboot : crash;

is bad because this will tell you what and how to do something, but not how it''s best to do something in any given situation. The above list is good for general viewing, but not for living your life by.

Besides, solving the puzzle yourself is so much more fun - there''s the occasional Heureka! moment and it''s been known for ages now: the best tutor ou there is failure - it''s always been.

As for cutting and pasting code: it''s up to everyone themselves to decide if want to suck through all eternity.

Libraries and principles behind them? I don''t really understand what you mean by that...
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
yodaman
yodaman
what I ment crisp, was that you should basicly know how to do whats in them, and understand what there used for and how they work, like a animation lib.. or physics lib.
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
DalTXColtsFan
DalTXColtsFan
For some reason, it felt appropriate to share this story in this thread:

Another lesson to learn is, if you *truly* want to know whether or not your program looks good, show it to kids!

At a party this past weekend I was showing my city (http://home.swbell.net/joe2002/OpenGL.htm) to a couple friends'' daughters, one 7, one 10, one 12. The first thing one of them said is, "it looks like you''re in a big room with some buildings in it!" (translation: my skybox looks terrible! :D) other responses were: "Why are all the cars driving on grass?" "Why is there a tree in the middle of the river?" "Why is there a car DRIVING on the river???" "Why does the river look like a moving swimming pool?"

You get the idea . They were impressed, don''t get me wrong, but man, you want honesty you''ll get it from kids .
Juicy
Juicy
I tend to code in PHP more often than not, and as such I find I can very quickly produce complete projects (in the order of a week or two), full with backend administration.
Anyway, the point is, that I''m used to developing and completing projects fast. And it''s been a hard thing for me to admit that I just can''t do that with GL.
So, I''ve managed to get myself into a daily routine of reading this forum, commenting where I feel I can and learning bits and pieces.

I remember when terms like multi-texturing and b-splines confused me completely. There were so many techniques to learn and think about, but if you just sit back and take a passive attitude, you''ll pick up so much.

Of couse, if you''re anything like me, you''ll not want to just sit back and try and absorb the information (It''ll never work, but it''ll help, guaranteed.). So So what I did, and grab yourself a couple of good books (in my case the red book - a given; and the gamedev game programming book).
I''ve found that I can read though the gamedev book and pick up a general feel for the structure of games and good techniques for solving problems without getting too in depth, while the red book is good for looking up a topic for more info.

My point is, I''ve been studying GL for about 6 months now and I''ve not touched code in any great way (other than to try out ideas and the odd example/tutorial - ta NeHe )...I''m still learning, slowly and when I''m ready I''ll start developing.
I''m already throwing together an overly ambitious storyboard for the LOTR:TT contest. Whether it sees the light of day or gets past the basecode remains to be seen, but it''s all part of the curve isn''t it?
I like pie! - weebl.
Oneiric - Another graphics engine in the works.
James Trotter
James Trotter
quote:
Original post by Juicy
a couple of good books (in my case the red book - a given; and the gamedev game programming book).


I have both those books too, and they''re great!! The red book I use more as a reference, but I''m still trying to read through it, (not an easy thing to do!)... But the OpenGL game programming is very easy to read and very understandable!

_Ace_
_Ace_
Hmm, I was thinking... about that copy & paste... For instance, creating the basic window in VC++, one always has to do the same to make it work (well, there is some kind of logical structure in it. Im no Windows programing guru exactly) One have to initilize some basic things to make a window apear every time. Now, this basic code is bad copy & pasting? For me, it kinda feels like "unnecessary" work to write that over and over again (yes, I have actually read the tutorial how to create a window for OpenGL, and understood the most of it) Now the thing is, do I REMEMBER all? No, well surtenly not all those names for it! Things like this for example:

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc

I guess one learns this "unnecessary" info if one writes this down I few times (by making some windowses), but it sure doesnt really feel like its something I have to know by hand. Or? Its like "public static void main(String[] args)" which I can write in my sleep , but this is just one row. Creating the window is more!

Ace
Ready4Dis
Ready4Dis
quote:
Original post by _Ace_
Hmm, I was thinking... about that copy & paste... For instance, creating the basic window in VC++, one always has to do the same to make it work (well, there is some kind of logical structure in it. Im no Windows programing guru exactly) One have to initilize some basic things to make a window apear every time. Now, this basic code is bad copy & pasting? For me, it kinda feels like "unnecessary" work to write that over and over again (yes, I have actually read the tutorial how to create a window for OpenGL, and understood the most of it) Now the thing is, do I REMEMBER all? No, well surtenly not all those names for it! Things like this for example:

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc

I guess one learns this "unnecessary" info if one writes this down I few times (by making some windowses), but it sure doesnt really feel like its something I have to know by hand. Or? Its like "public static void main(String[] args)" which I can write in my sleep , but this is just one row. Creating the window is more!

Ace





You miss-understood. The point was to not just copy and paste from nehe, but to write your own version. There is nothing wrong with using your own version over and over again, and a much better way than copying/pasting it, is to put it into a file that you can simply include in all your projects, instead of copying and pasting all the copy, you just copy and paste the files into your new directory, and include them into the project.
_Ace_
_Ace_
Ok, but for me as a newbie, I have NO!! idea how to create that window by hand! I mean, I dont remember all that has to be done! Yes, I can use .net''s one that creates one by default (+ some other rubbish). But NEHE''s is basic and complete...
baldurk
baldurk
_Ace_: that''s the point. You should learn basics like that before moving on any further. Once you *understand* how it works, you are fine. I''m not saying you should memorise it, but once you understand it, you only need docs and references. Not tutorials. Besides, for advanced topics articles are more easily found than tutorials.
_Ace_
_Ace_
Ok.
NeHe''s first tutorial on how to set OpenGL is great to start with...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.