You are viewing our Forum Archives. To view or take place in current topics click here.
Learning Game Programming In C++?
Posted:

Learning Game Programming In C++?Posted:

A1_Q2
  • New Member
Status: Offline
Joined: Aug 28, 201112Year Member
Posts: 16
Reputation Power: 0
Status: Offline
Joined: Aug 28, 201112Year Member
Posts: 16
Reputation Power: 0
How should I start learning the C++ syntax used in games like Call Of Duty? I already have knowledge of basic C++ Syntax used in windows and I have written a few programs such as:


#include <cstdlib>
#include <iostream>
using namespace std;
float a,c,n;
char b,d;
float addizione(float a, float c){      //Function +
      float m=a+c;
      return(m);
      }
      float sottrazione(float a, float c){  //Function -
            float m=a-c;
            return(m);
            }
            float divisione(float a, float c){    //Function /
                  float m=a/c;
                  return(m);
                  }
                  float moltiplicazione(float a, float c){    //Function *
                        float m=a*c;
                        return(m);
                        }                 
int main()
{
          cin >> a;          // insert first integer
          LOOP:
          cin >> b;        // insert +-/*
          cin >> c;       // insert second integer
          cin >> d;      // insert =
          cout << a;
          cout << b;
          cout << c;
          cout << d;
          if(d=='=' && b=='+'){
                    n=addizione(a,c);
                    cout << n;
                    a=n;
                    }else if(d=='=' && b=='-'){
                          n=sottrazione(a,c);
                          cout << n;
                          a=n;
                          }else if(d=='=' && b=='/'){
                                n=divisione(a,c);
                                cout << n;
                                a=n;
                                }else if(d=='=' && b=='*'){
                                      n=moltiplicazione(a,c);
                                      cout << n;
                                      a=n;
                                      }
                                      goto LOOP;   /*goes to loop and allows to
                                                   automatically continue operating*/
          system("pause");
          return 0;
          }


I Understand the C++ syntax used in games is different to the C++ syntax in windows but i want to be able to right my own patches and DVARS for games like COD Like this one* and I want to know what they mean.


ai_corpseCount "16"
aim_accel_turnrate_debug "0"
aim_accel_turnrate_enabled "1"
aim_accel_turnrate_lerp "1200"
aim_aimAssistRangeScale "1"
aim_autoaim_debug "0"
aim_autoaim_enabled "0"
aim_autoaim_lerp "40"
aim_autoaim_region_height "120"
aim_autoaim_region_width "160"
aim_autoAimRangeScale "1"
aim_automelee_debug "0"
aim_automelee_enabled "1"
aim_automelee_lerp "40"
aim_automelee_range "128"
aim_automelee_region_height "240"
aim_automelee_region_width "320"
aim_input_graph_debug "0"
aim_input_graph_enabled "1"
aim_input_graph_index "3"
aim_lockon_debug "0"
aim_lockon_deflection "0.05"
aim_lockon_enabled "1"
aim_lockon_region_height "90"
aim_lockon_region_width "90"
aim_lockon_strength "0.6"
aim_scale_view_axis "1"
aim_slowdown_debug "0"
aim_slowdown_enabled "1"
aim_slowdown_pitch_scale "0.4"
aim_slowdown_pitch_scale_ads "0.5"
aim_slowdown_region_height "90"
aim_slowdown_region_width "90"
aim_slowdown_yaw_scale "0.4"
aim_slowdown_yaw_scale_ads "0.5"
aim_target_sentient_radius "10"
aim_turnrate_pitch "90"
aim_turnrate_pitch_ads "55"
aim_turnrate_yaw "260"
aim_turnrate_yaw_ads "90"



Thanks,

A1_Q2
#2. Posted:
Derp
  • TTG Senior
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
Status: Offline
Joined: Jan 24, 201014Year Member
Posts: 1,478
Reputation Power: 106
You'll need to learn C++ a hell of a lot more. C++ can be a really hard language, and games is no easy subject. Call of Duty has a load of people working on it for around 2 years.
#3. Posted:
A1_Q2
  • New Member
Status: Offline
Joined: Aug 28, 201112Year Member
Posts: 16
Reputation Power: 0
Status: Offline
Joined: Aug 28, 201112Year Member
Posts: 16
Reputation Power: 0
That Didn't really help a lot? Im asking if anyone knows any good books or resources for learning the C++ syntax and sub-language used in games.
#4. Posted:
M0D1F13D
  • TTG Senior
Status: Offline
Joined: Sep 06, 201013Year Member
Posts: 1,069
Reputation Power: 47
Status: Offline
Joined: Sep 06, 201013Year Member
Posts: 1,069
Reputation Power: 47
The language you're looking for is GSC. It's syntax is similar to C++ but it isn't C++. There really isn't one good place to learn the whole language but you could start [ Register or Signin to view external links. ]
#5. Posted:
TwilightSparkle
  • TTG Contender
Status: Offline
Joined: Jul 22, 201013Year Member
Posts: 3,947
Reputation Power: 169
Status: Offline
Joined: Jul 22, 201013Year Member
Posts: 3,947
Reputation Power: 169
best thing to do, is to look at the game coding for a long time, and try to understand how it works, and why, sooner or later, you will understand how to write your own coding
#6. Posted:
FinancialChad
  • Summer 2020
Status: Offline
Joined: Apr 10, 200915Year Member
Posts: 7,581
Reputation Power: 1576
Status: Offline
Joined: Apr 10, 200915Year Member
Posts: 7,581
Reputation Power: 1576
A1_Q2 wrote That Didn't really help a lot? Im asking if anyone knows any good books or resources for learning the C++ syntax and sub-language used in games.

Well it should help. You can't really skip to C++ game coding. You have to have a good understanding of the language first. You could buy books on XNA studio and that sort of stuff but you wouldn't get any of that. Creating a game like COD would take Years (By yourself) and the Activision team is full of coders that have practiced programming their entire lives. I would suggest getting an understanding of C++ first. Try books and class courses at your school (I'm sure they'll have some) and then get into XNA.
Download XNA when you're comfortable with C++ and C#
[ Register or Signin to view external links. ]

If you wanted to submit an arcade game to MicroSoft you would have to buy an AppHub membership as well.

If you want XNA tutorials you could look at your local bookstore, or on Amazon. This is a nice website to look at. Even has free sprites
[ Register or Signin to view external links. ]
#7. Posted:
I_Rage_Hard
  • Challenger
Status: Offline
Joined: Aug 15, 201013Year Member
Posts: 161
Reputation Power: 6
Status: Offline
Joined: Aug 15, 201013Year Member
Posts: 161
Reputation Power: 6
M0D1F13D wrote The language you're looking for is GSC. It's syntax is similar to C++ but it isn't C++. There really isn't one good place to learn the whole language but you could start [ Register or Signin to view external links. ]

No no just no... Gsc is specific to cod it's just their own language they use for scripting. @Op Looks like all you done is the most basic type of C++ do some more difficult stuff than just math make some actual windows programs, learn about memory management and how to use the graphics cards first. And what you posted aren't codes their dvars which are just variables.
#8. Posted:
Strobe
  • TTG Contender
Status: Offline
Joined: Sep 11, 201013Year Member
Posts: 3,410
Reputation Power: 140
Status: Offline
Joined: Sep 11, 201013Year Member
Posts: 3,410
Reputation Power: 140
-Cola- wrote best thing to do, is to look at the game coding for a long time, and try to understand how it works, and why, sooner or later, you will understand how to write your own coding

Agreed, read the code if youve played the game a lot and try to put the pieces of the puzzle together...
#9. Posted:
Hiimmanly
  • Prospect
Status: Offline
Joined: May 08, 201113Year Member
Posts: 699
Reputation Power: 28
Status: Offline
Joined: May 08, 201113Year Member
Posts: 699
Reputation Power: 28
AIRBORNFATDOG wrote
-Cola- wrote best thing to do, is to look at the game coding for a long time, and try to understand how it works, and why, sooner or later, you will understand how to write your own coding

Agreed, read the code if youve played the game a lot and try to put the pieces of the puzzle together...


If you try to make a game similar to Call of Duty just by playing the game alot, you will fail misarebly (Or however you spell that), and then get bored with game programming and quit.
#10. Posted:
FinancialChad
  • Supporter
Status: Offline
Joined: Apr 10, 200915Year Member
Posts: 7,581
Reputation Power: 1576
Status: Offline
Joined: Apr 10, 200915Year Member
Posts: 7,581
Reputation Power: 1576
-Cola- wrote best thing to do, is to look at the game coding for a long time, and try to understand how it works, and why, sooner or later, you will understand how to write your own coding

Now that's one of the worst things you can do. You could look at code for days and not understand a line of it. Otherwise anyone in the world could be a coding genius. You wouldn't understand anything, and if anything, very little of it. C++ is frustrating and probably the only language that you can get anything from staring at it for a long time would VB.net.

Now if I gave you some code like this;

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}


Would you understand the slightest clue of what it meant? And that is the basic syntax! Imagine lines, and lines, and lines and lines of advanced coding. Staring at it would do absolutely nothing. Sorry but I must disagree with you, strongly.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.