|
 |
|
|
|
|
|
Programming
 |
|
 |
| |
Liamardo  |
|
Player Hater

Group: Members
Joined: Nov 25, 2011

|
Hey people.
So basically I have been modding for a while now but only at a basic level. Ive used Img Tool, SAMI, TXD workshop, GGMM, Ped Editor and Obviously Cleo. Ive designed vehicles, peds, buildings, etc. (3ds Max, Photoshop & Flash)
But I feel this is becoming small fry for me. I've started looking into C++ and Direct x programming and finding it all a little overpowering. The eventuality is that I want to be able to write my own codes and build my own games.
So this is kinda a request really, could anybody help me out with the basics of code writing? and general advise?
I do realise there are plenty of resources out there to help me on my way but I would like the opportunity to liaise with some one on the matter, say if I run into any problems or have questions I cant find answers to.
Cheers for now!
Liamardo.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Barguast  |
|
Thy next foe is...

Group: Moderators
Joined: Jul 27, 2002



|
| QUOTE (Liamardo @ Friday, Nov 25 2011, 17:32) | | I've started looking into C++ and Direct x programming and finding it all a little overpowering. | I'm not surprised, you're jumping in the deep end! If you're just starting out with C++, you're best off writing some small programs to teach yourself the basics of the language. I mean text-based console applications that perform very basic tasks like adding numbers. You'll probably find this a lot more rewarding than it sounds, and you'll inevitably end up creating more and more complex programs and indirectly learning good habits. Once you've nailed the basics of programming, the big bad scary world of DirectX will seem a little less daunting and a little more accessible, but again, you'll need to start with the basics. Your first Direct3D application will probably be a tricoloured gouraud triangle - but you'll look at it thinking that you're GOD. In summary, take it slow, start from the beginning, and have patience.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
K^2  |
Posted: Saturday, Nov 26 2011, 23:16
|
Vidi Vici Veni

Group: Zaibatsu
Joined: Apr 14, 2004



|
Any time you want to have an "array" of objects, where you might want to take out or add an element, especially somewhere in the middle of the "array", linked lists might be a good solution. Their only downside is that they aren't easy to search. If you need the Nth element, you have to start with the first, jump to second, then to third... But sometimes, you only need the array to be processed in that order, and then there is simply no better option.
Lists can also save you a ton of time on memory allocation. Imagine that you have a bunch of objects that you keep creating and destroying. If you had to allocate memory every time and the delocate it, it can become rather slow, not to mention fragmentation issues. Instead, create a linked list of unused objects. Since they don't have to be ordered in memory, you can take and add objects to that list as you please. Just make sure you check its length every once in a while, and delocate unused objects if you ended up with too many. If the list is empty, and you need more, you allocate memory then.
And trees... It's a broad topic. There are search trees. Just about any AI will involve a search in a tree. Directory structure is a tree, so if you want to represent one in your program you'll have to have a tree of some sort. For rendering and graphics, there are partition trees. In particular, there is binary space partition (BSP - might sound familiar) and there are octrees. Octrees are used for everything from graphics, to physics, to AI for all kinds of neat optimization tricks. BSPs are absolutely brilliant for rendering. If you're going through NeHe tutorials, they do have one on BSPs later on. But basically, whenever you get to transparency, do realize that order in which you render things is important. BSP makes ordered transparency an absolute breeze, but there are some limitations.
So yeah, lists and trees are extremely important in programming. And you will cuss and want to throw things while learning them, because when writing pointer-chasers, the fact that your program compiled means absolutely nothing, and trying to find an error in a program that compiles and just crashes can be a pain.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|