# Visual studios (C++)



## Saturisk (Jan 2, 2011)

Hello, i am fairly new to programming with C++, but would like to start game development. I already know the basics with the "#include" portions that are needed to run strings, arrays, etc, but i would like to start programming games, but don't know where to start.

Side question, what's the difference between Visual Basic C++ 2010 express and visual basic 2010 express?


----------



## Saturisk (Jan 2, 2011)

I don't think i was very blatant, I am trying to get into game development, and I am using Visual Basic C++ 2010 Express, i hear that i also need a SDK of some sort or what ever, I just don't know, so What do i need to get started (What programs etc)


----------



## niemiro (Feb 20, 2010)

Hello!

I am afraid that you are not going to really like this reply, but say it I must for it answers the question. You don't really have a hope of making games without a good few/many years of developmental experience. By the time you are ready, none of this will apply.

Visual Basic and C++ are two completely separate programming languages. They each have an Express Edition IDE from Microsoft, Visual Basic 2010 Express and (Visual) C++ 2010 Express.

How do you know when you are ready? When you know where to start. I am really sorry. This post will seem really heartless, but it is the honest answer. When you know what you need to download, what languages you need to know, what you need to type where; then you are ready to program games.

Basically, open up Visual C++ 2010 Express, create a new Win32 Project, and type the code! Make the game! 

However, for those who do understand this sort of stuff, you need the latest DirectX SDK: Download details: DirectX Software Development Kit

You also need a good tutorial. For example: zophusX - A Beginner's Source to Direct3D 9

I know you are going to jump in there, and download the Source Code. Believe me when I say that you need to learn to program, and write the code, rather than just downloading the code and running it. 

There is also an (arguably) better way. XNA. Buy a really good book on C#. Read it. Learn it. Practice it for a year at least. Get really good at Console Applications. Get really good at Windows Forms. Learn some basic Object Orientated Programming, LINQ, etc. etc. 

When you have done all of that, give XNA a try using your C# knowledge: App Hub - home

Get into it really well. Get really good at the game programming side of things. Really good. 2D and 3D. Basic physics ideas (just the basics - normals, graphics, 2D in a 3D world, reflection and refraction) By the time you have hung a skull in 3D space, rotated it on several axis, and shone a light through it, with excellent reflection and refraction, with a changeable reflective index, you are ready to move on.

Get a really good C++ book. Learn all about more advanced Object Orientated Programming (OOP) and memory management. Now take a look at DirectX! Start with 2D, then simple 3D, working up and up.

Eventually, maybe 10 years down the line, you will be a pro games developer.

I know this isn't what you wanted to hear, but I am not going to say sorry for telling exactly the truth 

The very best of luck!

Richard


----------



## Ninjaboi (Dec 27, 2010)

I agree with most of what niemiro said. You won't be able to just walk in, study a little and be ready to go. Your trying to walk into the heart of game development, programming. As you said in your original post, your literally just now starting out with the absolute basics of the language itself. It will take anywhere from an intermediate programmer to a master programmer to take on such a thing as game development.

You however didn't mention if your doing this as a hobby, or trying to get into the field. If its going to be as a hobby, don't aim for programming to be your start if your unaware of where to start. Try a game design engine or design software. Here is a few links to look at:

YoYo Games
Game Creation Resources
Game Editor - the game design software for anyone interested in game developing.
Video Game Develoment Software

On another note, there is far more to game design than programming. The programming aspect of it alone is staggeringly difficult, and takes several years to become good at. You still have to learn to be an artist, planner, tester, storyline editor, character design, modeler, sound editor, and so much more. Each of those takes lots of training. If your in it as a hobby, you can easily get away with creating simple ones, maybe ones with bad visuals, or many 'glitches'. However, doing it as a profession will indeed take several years for you.

My recommendation to you is if your doing it as a...

Hobby: Find the thing in game design that is enjoyable to you. Is it programming? Artwork? Character design? Idea maker? Maybe you just have an idea for a game and want to make it a reality? Choose what you want to do and then join a group of others ( preferably friends ) that like other aspects of game design. Create something with them as a whole. Optionally you could do it all yourself, doing what you can and leaving the rest to software and free pieces from online.

Profession: You'll have to hit the books, maybe take a course, and spend the next few years prepping for it. Practice is key. Start with books and tutorials.

Now if your really wanting to start now, I'd suggest getting what niemiro suggested and hack at it. If you need a much more in-depth explaining, just ask.


----------



## Saturisk (Jan 2, 2011)

I have changed my mind. I am not just working with java, slowely learning the language. I am using Netbeans and i have the java jdk and i linked the path and everything what would i need to create things with java?


----------



## Ninjaboi (Dec 27, 2010)

Here's a tutorial for starting out programming in NetBeans using Java:

Java Programming Using Netbeans Tutorial


----------



## Saturisk (Jan 2, 2011)

I just don't know which to switch too, i went to dark basic about a year ago, but want to move up, java seems really complicated, and i know a little C++ idk what to start on, could you help me?


----------



## Saturisk (Jan 2, 2011)

I'll explain more.

I am a very experienced Web Developer at the age of 15. Just so you can believe me, Technohawks.com is one website i have made, but since i have honed my skills in HTML, CSS, JQuery, Javascript, ASP.NET, etc I thought i could get into game development fairly easier then normal, i would just like to stick with C++ now that i think about it. I already know the basics and such, and I would just like to know how to start out, i have made forms with moving objects, and console applications but i would like to make just like a simple 2D game and work from there, i am somewhat good at picture, creating, but have no idea what to do with sprites or anything.

Also i am kinda anti Windows.... Long story, but i don't really want to use Visual Basic C++ is there a better one besides DevC++? I will use it if i have to, i just don't know.

Any help would be appretiated and thanks for the comments!


----------



## niemiro (Feb 20, 2010)

Hello!

I started programming when I was 12, and I remember what I could do when I was 15. I was at the stage of XNA (2.0)/3.1, .net 2.0/3.5, and I just started some C++ DirectX 9. That probably dates me.

You can do it. You obviously have that little bit of latent computer talent required, but it still won't be easy. You still can't just jump in. You will still need to spend a few years getting in the basics before you can code games.

You really need to decide what part of game development you want to be in. You are still open. You say programming, but this is a big decision. Give a try at the other sides of this profession. Ninjaboi has given you a lot of good advice there.

There is no such thing as Visual Basic C++. There is Visual Basic, and Visual C++. 

I can see that you may not like Windows. Most developers use Visual Studio, because it is an amazing suite. Others use X-Code. Almost all really serious development will be done in Visual Studio and then X-Code. If this is a petty hate (like my friends have - I hate Windows! Windows is rubbish! Windows suc*s!) and they dabble in a bit of Linux, and a bit of Mac OSX, and a bit of DOS, maybe a couple of weeks of Java, and then some C, you will not get anyway fast. I don't really know why you hate Windows, but Visual Studio is really, really good. Even if Ninjaboi doesn't use Visual Studio as his primary IDE, I highly doubt that he would ever slag it off.

Hitting C++ to start with? Many people do that - they do reasonably well with Console Applications, and then hit a brick wall. At least it is very easy to change to C#. 

If you are really serious about programming, seriously think over my first post.

BTW, C++ is a LOT harder than Java, which might give you one tiny piece of indication! lol

The very best of luck!

Richard


----------



## Crockeo (Apr 17, 2010)

I completely agree with niermiro and ninjaboi, although I'm just starting to learn C++ I can tell that it will take a long, long time before I can do anything worthwhile in it. Even in console applications, so I would imagine that it would take forever to even do a 2-d game.

Oh, and niermiro, my C++ teacher told me (even though I have VS2010 Professional) that I should get Dev C++, while you said Visual Studio is better. Does that mean I can be right, again, about C++?


----------



## niemiro (Feb 20, 2010)

Hello!

There is nothing wrong with Dev C++ at all. There may be slight differences, tiny things which you can learn in a day, and if your teacher teaches Dev C++, then that is absolutely fine. However, Visual Studio is far closer to being the industry standard, if not already, and so it is a good idea to know how to use it at some point. 

Keep going with Dev C++. This suits your teacher. When you know enough for the industry standard to affect you, you will be able to switch anyway, and a few days getting used to it, and its greater feature set than some other IDEs.


----------



## Saturisk (Jan 2, 2011)

I just tried to look at java, and it seemed way to complicated, like source package this, do this do that, make a file here but don't do it here, idk, i tried reading about beginning tutorials on oracle but it just seemed really complicated for some reason. I'll think about which one i want to work with, and go from there. 

I wanted to work with java, because i play a lot of java games or used to play them and they came out very well (games), like Runescape i dont play it anymore but it used to be horrible and now it's very good, or minecraft, i play it everyday with my own server an stuff. 

Like I said i just wanted to make a 2d game to start out with then go from there, but java just seemed to complicated, like i could go into Visual C++ and create a console application asking random questions using loops etc in about 10-15 mins, but it seems java would be a bit more technical, if any of this isn't true let me know, this is just how I understood it.

And lucky for me i'm in Podunk Idaho and were to poor to have classes like this so, i am trying to learn this all by myself. I am going into town today and i think ill take a look at java programming books and C++ books.

Again thanks for the answers and comments!


----------



## niemiro (Feb 20, 2010)

Hello!

If you have any specific Java issues, we will be more than happy to help. 

Java can create some rubbishy games, but it won't be the long term solution. At the moment, C++ is, although some argue that C# will be, and I tend to agree.

Even 2D games are tricky. You need to make sure that you understand the language really well before you try to create a game, even 2D. If you are desperate to make a game right away, you could try one of the game creation engines, and practice at game design and how to achieve your aims, and level design, all crucial skills for later.

Java is a far simpler language than C++. C/C++ requires you to work far closer to the hardware, and understand things a whole lot better. For a bit more detail, see here: http://www.techsupportforum.com/forums/f128/getting-started-548346.html

I think that your best bet is to create Console Applications for the moment, in either C++ or C#. Then you can switch to C# and write Windows Forms, and then move back into games development.

There is a massive amount which can be said here:



> Like I said i just wanted to make a 2d game to start out with then go from there, but java just seemed to complicated, like i could go into Visual C++ and create a console application asking random questions using loops etc in about 10-15 mins, but it seems java would be a bit more technical, if any of this isn't true let me know, this is just how I understood it.


You could practically write a thesis around that! It is a daunting task to get started! I will be very interested indeed to hear Ninjaboi's take on this.

Richard


----------



## Ninjaboi (Dec 27, 2010)

There is also an issue that most starting programmers don't understand that helps lay out what exactly programming is and does.

"Why are there so many different languages? Are they all better at some things than others? Or are they all just fighting to be the dominant language?"

Each language is made for a purpose. A programming language is a set of rules that are created for a task or objective. The maker(s) had a task or objective that needed to be done, that other languages weren't built for or are really good at. C was made as a general-purpose language, and therefore wasn't really made for any specific task other than to be used in all different fields as a medium. People see C++ as a totally different language, that just has very similar syntax as C that it derives from. This thought is more incorrect than anything. The syntax is similar, as with all 'languages' derived from C such as C#. 

However, C++ should be thought of more as an extension of C, not as a separate language. That's why you'll see much more people type C/C++ rather than C/C#. C# had a different goal in it's creation, and mixes both C and Java concepts into its design. C++ was created to allow OOP ( Object Oriented Programming ) to be utilized. C users use structured programming, and C++ users typically go for OOP. Neither is better than the other, and it's preferred to dabble in both rather than the extremes.

Java was made to two main purposes; simplicity, and portability. It was made to allow the programmer to make applications at a higher level than other languages for simplicity for the user, and the code you use can go from platform to platform without being altered for portability. MATLAB was designed for mathematical programming, and therefore thrives in it. So no language is better than others in whole, but each serves it's own design task very well. The only reason why C/C++ and Java are so popular is that they were made and taken up by major companies and corporations ( with reason obviously ).

So your going to be using C/C++ to start game programming right? We'll, newcomers will start by learning the syntax of the language they will be using. Afterwords, they will begin learning programming concepts that are universal to all languages, and will be utilizing them with their starting language ( in this case C++ ). In C++, you'll go through tutorials or books and start making lots of console applications that are mostly platform independent from OS to OS. You'll eventually get bored with this, and will want to add graphics to your games and applications. This is where people get stumped. C++ does not come with a library or a way to make graphical programs for, say Windows. You'll have to go and download and install a library that was made to be the medium between the OS your programming for and the language your working with. For Windows programming, they have the Windows SDK. The hardest part that people don't seem to figure out right away is that a programming language is not bound to certain operating systems. Again, they are a set of rules that define how you program.

So using C++ as your language of choice, and the library that will serve to program graphic applications, you can start making games. You'll need to learn game design concepts first of course, but that comes after all that.

So this is the order you should be learning before you should be able to program games of caliber:

- Learn syntax of language.
- Learn programming concepts.
- Learn library that serves as medium between language and OS.
- Learn game programming concepts.

If I left something out or didn't explain it very well, just say so and I'll do my best to explain. Also if someone else thinks I have said something wrong, please correct me.


----------



## Ninjaboi (Dec 27, 2010)

> There is a massive amount which can be said here:
> 
> 
> 
> ...


Sorry to double-post ( editing restrictions and all ), just now noticed I forgot to comment on this part.

Java is definitely easier, as it provides a higher perspective on what your programming. You don't have to worry about platform dependence, memory management, graphical library to download separately, and it's great to learn both programming concepts as well as rapid development of programs. It's also great to make mobile applications for phones and other devices.

For a 2D game, I'd actually wouldn't mind telling you to go for Java. There are several books out that teach 2D Java game programming. Now if your going to move onto 3D, I'd recommend a different language, as those typically get to eat up resources quickly, and therefore a more lean development would be in order to eek out as much performance as possible. Java isn't more technical, but it's definitely different from C/C++. The syntax is slightly different, but it's approach to things is different on it's own, on top of what I mentioned it's features held.

I love programming in C-style languages. C, C++, C#, and even languages that share very similar syntax or were derived from C such as Java. Now there are other language who's syntax looks nothing like these languages, and other programmers use those. That can eliminate any thought all programming languages sharing similar syntax. It's the same for speaking languages. Comparing English to Spanish, you can tell quickly that the arrangement of the sentences is enough to explain it.

Again sorry for the double-post. I'm sure nobody will care though :grin:.


----------



## Saturisk (Jan 2, 2011)

I just want to learn to make a 2D game for now, yeah i know if i want 3D to get something stronger, but what i like about Java is you can make an applet for websites which would get me more points of my FRC competition which is what Technohawks.com was made for. 

Today i purchased a book from borders: Java for Programmers - Harvey M. Deitel - Paperback (ISBN 9780137001293) - Buy Books, Music and Movies at Borders

It seems to be exactly what i am working on. I will try to work with this, i understand that it will be months before i start creating games probably but atleast i am learning something pretty valuable so i think i can manage it. 

Thank you guys very much with all of your questions and answers, if you don't mind when i hit you guys up with some questions!

Thanks again!


----------



## Ninjaboi (Dec 27, 2010)

Your welcome, and it probably won't take months to start making games, maybe a few weeks to get some basic text games going well.


----------



## Saturisk (Jan 2, 2011)

Real quick, i'm just following examples from my book, and it tells me to open a command window and change to the directory where it is stored, what's the point? Is it for a different output area or something like c++?


----------



## Ninjaboi (Dec 27, 2010)

You mean the directory that will be the default where you save your projects? That's just so that you'll have a default location where all your projects will be saved to. If that's not what you were asking, just say so.


----------



## Saturisk (Jan 2, 2011)

Eh, i read ahead it didn't make sense what it was saying but i worked around it.
But i came up to this one part where it is using "import scanner" and mine looks like:
============================================
package Javaapp;

import java.util.Scanner;

public class Main
{

public static void main( String args[] )
{

Scanner input = new Scanner( System.in );

int number1;
int number2;
int sum;

System.out.print( "Enter first integer: " );
number1 = input.nextInt();

System.out.print( "Enter second integer: " );
number2 = input.nextInt();

sum = number1 + number2;

System.out.printf( "Sum is %d\n", sum );

}

}
============================================

and i get this error message when i run it:

============================================
java.lang.NoClassDefFoundError: javaapp/Main (wrong name: Javaapp/Main)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: javaapp.Main. Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

============================================

I don't know what i'm doing wrong i typed it exactly like it is in the book and it doesn't work.


----------



## Ninjaboi (Dec 27, 2010)

We'll I'm sure that line 1 "package Javaapp;". Either when you typed this there was a typo in the book, or your misread or mistyped it. I'm not sure which package your going for.


----------



## Saturisk (Jan 2, 2011)

well that's just my package i named it Javaapp and it made a Main.java etc
but idk what's wrong


----------



## Ninjaboi (Dec 27, 2010)

Looking at the code, I'd say there's no need to have that first line that I've mentioned. I removed line 1 "package Javaapp;" and ran it perfectly. Try removing it yourself and see if that works for you.


----------



## Saturisk (Jan 2, 2011)

This is exaactly what i have


----------



## Saturisk (Jan 2, 2011)

Dang didn't work


----------



## niemiro (Feb 20, 2010)

Hello!



> Eh, i read ahead it didn't make sense what it was saying but i worked around it.


Do make sure that you read and understand the whole book, and don't skip ahead. The idea of having the book is to make sure that you really understand the language. Make sure that you do really understand the language, otherwise you risk getting stuck and having to re-read the whole book.

I don't have it with me, but when I get round to it, I shall upload my very first 2D game and the source, just to give you an idea. It was written in XNA, and please don't judge me by it  but it wasn't too shabby either, and level creation was quite neatly done.

Richard


----------



## Saturisk (Jan 2, 2011)

I just don't understand what is wrong, i fixed the CLASSPATH correctly, with the build java source and i have the current jdk, i just don't understand...


----------



## Ninjaboi (Dec 27, 2010)

The setup process can mess people up when they start out.

Setting Up and Getting Started in Java Programming

That's the link I used to set myself up when I started. Try looking through it and see if you set everything up correctly. If not, please make any changes or do anything you didn't do.


----------



## Saturisk (Jan 2, 2011)

Thank you Ninja Boy! ^^ And Neim!
I'll try this. But am currently at school soooo.. haha


----------



## Saturisk (Jan 2, 2011)

i was reading and i noticed i had to tell my IDE where the javac.exe is and th java.exe is just so it know how to compile and stuff, but it was better to do it in command prompt
how do i do it?

Do i go to where it is? so:
C:\Users\Administrator\Documents\NetBeansProjects\Javaapp\src\javaapp\main.java>?
what is going on here?


----------



## Saturisk (Jan 2, 2011)

Okay i looked at it again and it says under the import part incorrect package. Did i set up something wrong?


----------



## Ninjaboi (Dec 27, 2010)

javac.exe compiles your code ( hence, java'c' for compile ). java.exe runs your program that you create. So you first compile using 'javac', and run the compiled file using 'java'.

I think these tutorials will be of great help to you, as I've seen several of his tutorials and find them quite informative: Here.

He shows you through the download and install process of the JDK. Then, he follows up by compiling and running a program WITHOUT an IDE ( which requires a run-box/command box ). Afterwords, he goes through the simple download and install of a typical IDE and then begins teaching you programming with Java. He does this all in Windows XP, so if your using Vista or 7 and are having difficulty following, just say so and I'll look around for a few tutorials that run that OS.

If you did something wrong by reading, maybe watching tutorials is the way for you to learn. You can also go here to see a few links to free tutorials.


----------



## Saturisk (Jan 2, 2011)

Which do you think would be better to start on? Java or C++ I mean i already have a java book, but i can't follow it for whatever it's telling me except for simple: "System.out.println( "Hello World" );" things... Is there a different output area for java? or do i have to make sure i do it through the output thing in netbeans? Also what is the best IDE for this? I hear eclipse is good but i dunno.


----------



## Ninjaboi (Dec 27, 2010)

We'll I'd prefer you to go for Java for learning purposes as your starting language. After you get the fundamentals down with programming ( not necessarily programming with Java ) and you start to see the advantages and disadvantages of using it, look on to other languages and work with them a bit and see if you prefer the advantages and disadvantages with that language. Eventually you'll find the one you'll enjoy using often, and it can serve as your primary. Afterwords, you can expand how many languages you utilize by taking up one, learning it's syntax, use it a little, and then simply leave the rest to references and documentation when you decide to use it again.

By different output you mean something other than the console? Yes, a GUI ( Graphical User Interface ) program allows you to create output text to your interface, instead of the console interface.

As for best IDE, I cannot really answer. It's all based on preferences and conformity. NetBeans is great, so is Eclipse. Whichever one you choose is a good choice either way.


----------



## Crockeo (Apr 17, 2010)

As I said before, although I'm a newb to programming, I'm learning C++ and it's not as easy to learn as I've heard Java is, and I know first hand that Visual Basic is much easier to learn. But it is much more powerful. So I would suggest, (even though I've never used Java) to learn Java first, and later after you get the idea of programming down, to go to C++.


----------



## Saturisk (Jan 2, 2011)

Okay, thanks for the comments, but i still don't understand this. On my first line it says incorrect package why is it saying this?


----------



## Saturisk (Jan 2, 2011)

Sorry for the double post but i figured out what was wrong!
I'll keep posted, if i can, i don't know the rules of the forums all that well, might have o read up more, but thanks your the help guys :]


----------



## Ninjaboi (Dec 27, 2010)

Glad you figured it out. Post any questions you have here at TSF if you feel that the information we gave was good enough. Enjoy your programming!


----------

