Hello, I'm new to game programming and new to this forum.
I try to look through the forum, the books and the articles, but the content is so vast that I could not find what I was looking for. My background is PhD in physics and all my programming skills are through my education. I'm not a great programmer and for this reason i started playing around with game make studio, because it seemed simple. I've watched a lot of tutorials on youtube and read some articles and I think I've got the basics down. I want to make games in my past time and not professional and I think I will do it as a one man thing, at least in the beginning.
Now to my problem. Whenever I try to start making a game I loose the overview of the game. I simply don't know how to make efficient structure of the game. That is what to put where, should i use the build in physics engine, should i write something my self. What code should be put in the objects what should be put in scripts, and the list goes on.
All tutorials I have found are very basic, so if a tutorial says it will show you how to make a platformer, it will show you how to make a solid object and a player you can control. I can do that, however my code is very messy and not very flexible. So if I suddenly want to integrate for example a level up system for the player, it will be very difficult. Another example, I can make a player that can shoot and kill enemies, but if i want to add the possibility to change weapons, again it gets very messy.
I hope someone can help me to learn writing efficient, flexible and smart code. In my head it would be very nice if i could write single modules, and then combining them to a game. And also latter easily add a new module if i get a new idea, without having to go through all single objects implementing this new module. Don't know if this is possible. Hope my problem is clear, or else write and I will elaborate.
So to summarize I don't need help learning to program specific code (I learn on the fly, using google and the help file), but help to build the complete structure and combining the individual code efficiently.
Ant type of help would be appreciated: books, webpages, youtube, direct guidance ...
Thanks in advance.
I have the same problem. You need to study everything as a building block. You have a phd in physics so that shouldn't be hard. :P
Pretend you are playing with lego's. The entire structure can be complicated as a whole, but broken down, it's pretty simple. In fact,
once broken down to the individual blocks, the mechanics behind the build are pretty intuitive. Unfortunately the building blocks of
programming languages are not as simple as lego's, but once you start learning to keep looking at the basic blocks, you start to
intuitively get a better grasp of whats efficient and what isn't. It's easier said than done, but this IS the way to view it.
Start by learning the basic types and the general do's/do not's on how to use them. Then use those blocks to build a small, tightly
packed (i.e. efficient) larger lego structure. Now that you have that efficient block put together, you can stop looking at the
underlying specifics behind it every time you need that function, and use it to build and even larger lego structure made up of other
tightly packed, pre-structured code. Now again, easier said than done. I have learned that you will eventually hit parts of code
where it seems so abstract and non-straight forward, like a dot product can be, that it's hard to find an efficient way to string
together blocks into an efficient struct. It's the same in physics. It's easy to calculate gravitational effects on a baseball thrown
in an arc on earth. It's not so simple to calculate the effects on a baseball thrown into a binary-blackhole system. :P Sometimes
you'll just run into problems that seem so abstract and removed from a certain paradigm you are use to working on, that it will just
be a mother*******. :P But remember:
KISS.
Keep. It. Simple. Stupid.
I constantly have to remind myself of that. I'm extremely tired, and still, I have to retrain myself to break things down like this
no matter how tired or discouraged I am. Once you train to the point that you start noticing that programming certain types
of problems efficiently becomes intuitive, you'll be more motivated and actually possibly come to enjoy sifting through some
forum posts, which were seemingly inane previously, on how to improve this algorithm or that. Patience is a big factor. I am
no where near expert, but I have noticed the more time I invest in the basics instead of trying to skip ahead and make
something, the more I just naturally understand. Having a high level degree, you have already experienced the kind of
pace you need to think at when programming. It's long term, methodical work. And as usual, it's best to not try to cram
overnight before the big exam. No one writes a Far Cry 3/Battlefield 3 overnight, especially not as a loner, fly-by-night
programmer. The more methodical and slow your approach at programming in the beginning, the faster you will actually
begin writing better code. Also, don't forget to do back-research. You should have some understanding of different os
platforms since each handle windowed apps differently (unless you use scripted languages which are often able to handle
much of the thinking there for you). You also need knowledge of your individual compiler, and os file system/path
requirements.This is currently annoying the hell out of me. I have been fooling around with python seriously for the past
year, and I just started earnestly trying to learn C++. C++ requires all kinds of weird linked in file types and organization.
The IDE/compiler alone feels more complex than any of the C++ programming concepts themselves.
But again, that's because I naturally slip back into viewing the IDE as a whole rather than it's simple pieces. KISS. Lordy KISS,
KISS, KISS.
In short:
- Learn the general overview of the problems you need to solve. Then find out the basic starting points you need to
start solving the smallest problems. You can't solve 3d rotation without trig, and you can't figure out trig without
understanding basic arithmetic.
- Remember to break the whole problem into manageable pieces that you easily, and intuitively can solve. Those then
combine with the other smaller pieces you have already solved.
- Keep reminding yourself to not throw yourself headlong into a brickwall trying to solve the problems immediately.
It causes undue stress, making the problems even harder to solve. If you are apt to doing this out of your very nature
as I am, I feel sorry for you because I know what you are in for. :P But again, keep working at it, while just taking up
the additional task of purposefully, and intently, retraining yourself to break this habit and remind yourself of the
mindset needed to solve the paradigm at hand.
Have fun. Once I get the initial roadblocks out of the way, I know I will be doing so.