Quantcast

Jump to content

» «
Photo

Programming

8 replies to this topic
Liamardo
  • Liamardo

    Player Hater

  • Members
  • Joined: 25 Nov 2011

#1

Posted 25 November 2011 - 04:32 PM

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
  • Barguast

    Thy next foe is...

  • Andolini Mafia Family
  • Joined: 27 Jul 2002

#2

Posted 25 November 2011 - 05:07 PM

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. tounge.gif

In summary, take it slow, start from the beginning, and have patience.




Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#3

Posted 25 November 2011 - 05:37 PM Edited by Swoorup, 25 November 2011 - 05:40 PM.

I started out with C a month ago, should I go with C++ at the same time?
I looked at making a window-based app from C++ and really its too complex process going on! What I meant to say is, how long will an average programmer be fluent in these languages?

EDIT:Liamardo, I would suggest you take a look at cprogramming.com site. They contain the basic stuffs of C/C++ and explain very well.
Also you have any problems then there is always the forum. icon14.gif

Liamardo
  • Liamardo

    Player Hater

  • Members
  • Joined: 25 Nov 2011

#4

Posted 25 November 2011 - 05:54 PM

QUOTE (Barguast @ Friday, Nov 25 2011, 17:07)
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.



Cheers for the info dude!
I'm assuming your already adept at using c++.

so far Ive covered the basics but in the stuff I've read, it doesn't really explain too well how to create codes, if that makes sense. basically I understand how to make codes work and what processes have to happen before a basic application can work but what I don't get is, How do I know what codes to use... is there a list of data I should learn? for example Data works in binary witch is basically 1's & 0's witch is the computers native language (so to speak) but there is the other language witch is in text.... so does this mean for a specific number sequence there is a preset text equivalent? or is that over simplified? lol!




K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#5

Posted 25 November 2011 - 07:30 PM

QUOTE (Swoorup @ Friday, Nov 25 2011, 13:37)
I started out with C a month ago, should I go with C++ at the same time?

You should keep learning C until you get hang of structures, linked lists, and trees. That's a good point to switch over to C++.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#6

Posted 26 November 2011 - 04:16 PM

I am learning from the site you told me, but with slower pace, applying each and every chapters into practical by just programming some useful things.
But how can I apply those linked lists and binary trees in practical. I mean for which problems.

Thank you though for all the information!

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#7

Posted 26 November 2011 - 11:16 PM

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.

SagaciousKJB
  • SagaciousKJB

    Captain tl;dr

  • The Connection
  • Joined: 21 Jun 2003

#8

Posted 05 December 2011 - 09:27 PM

I hate lists and trees, mostly because I can never find a good way to actually practice using them, so always find myself going back to reference manuals when trying to do something with them, never really getting a complete understanding since I seldom use them.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#9

Posted 07 December 2011 - 03:34 PM

I have not seriously gotten into game programming now, because I am just covering some windows programming with C++. And honestly, I feel kind off empty doing linked list and trees now.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users