6 Replies - 2703 Views - Last Post: 29 June 2007 - 12:38 PM Rate Topic: ***** 1 Votes

#1 celchu456  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-May 07

C C++ C# and more!

Posted 16 May 2007 - 12:36 AM

Hi all. I am currently enrolled in a computer science program at my university. So far we have been using C# and I have really enjoyed it so far. Like oh so many young children, I want to design video games. Being good at math, I figured a programming background was the best way to get into the industry. Over the summer I only have one class and I want to take the time I have to learn some stuff I may not learn in school, and to learn what I SHOULD be learning in school. Onto the questions!

1 - Most games seem to be made with either C or C++ Why? Can they be made with both at the same time?

2 - Ties in with 1. I understand that C++ is an extension of C, but C# is NOT simply an extension of C++, as it also takes advantage of the .net framework, and perhaps other things as well (I am new remember). Why has the game industry not changed to C#? I assume it is because C++ handles graphics applications better. Am I right? What else am I missing?

3 - What other programming languages are used often in game making? And (briefly), why are those used over others? How important are the networking languages, and which ones see the most use in games?

4 - Aside from my required classes, what else should I try to take in the CS department to enhance my game making abilities? I am not an artist, should I take a 3D graphics class anyways? (I've taken plenty of english, writing, lit, philosophy, and acting classes previously for my people / interaction skills)

5 - We touched on interfaces, and it was mentioned that they are very important, but no concrete reason was given. What are the advantages of interfaces over regular classes? What makes them so important specifically?

6 - We used visual studio, which has many class libraries. Are those libraries free source? Can I use what microsoft has written without giving them credit?

7 - I am in the process of writing a simple game that has no art. I tried to write an interface using the "Windows Application" setting in visual studio, but have become frustrated by it as all we did in class was draw a few pictures. Are there good tutorials to get me started in this area? Or, should I not bother and write the interface using a different language entirely?

8 - If you answered any of my questions, please give yourself a pat on the back and a big thankyou from me.

Is This A Good Question/Topic? 0
  • +

Replies To: C C++ C# and more!

#2 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: C C++ C# and more!

Posted 16 May 2007 - 03:40 AM

View Postcelchu456, on 16 May, 2007 - 09:36 AM, said:

Hi all. I am currently enrolled in a computer science program at my university. So far we have been using C# and I have really enjoyed it so far. Like oh so many young children, I want to design video games. Being good at math, I figured a programming background was the best way to get into the industry. Over the summer I only have one class and I want to take the time I have to learn some stuff I may not learn in school, and to learn what I SHOULD be learning in school. Onto the questions!


Very good :)
This will probably lead to an addiction to games programming that so many of us here suffer from :)

Quote

1 - Most games seem to be made with either C or C++ Why? Can they be made with both at the same time?


You can mix C and C++
You can also use C++ and forget about all the OO stuff and just use it for the new() function, as so avoiding malloc :)
But why C/C++ ?
Some say C has the speed of assembler and the readability of assembler. And that can be true, if you make a mess of things. But the truth is that in C and C++ you simply have the most controll over everything, and it is the best language to do low level things in, like bitshifting etc. Those things are not always fun, but you will probably have to get into that at some point.
If its just about quickly making a game that works, you could also opt for something like blitzbasic (yes its still around), but if you for example want to do things in OpenGL then C/C++ is the obvious choice.

Quote

2 - Ties in with 1. I understand that C++ is an extension of C, but C# is NOT simply an extension of C++, as it also takes advantage of the .net framework, and perhaps other things as well (I am new remember). Why has the game industry not changed to C#? I assume it is because C++ handles graphics applications better. Am I right? What else am I missing?


C# is an invention of microsoft.
It is not adopted by the rest of the world for a number of reasons, the most important of which are:
- It is not open
- It is not free
You might talk about the advantages of the .net framework, but do they also teach you about the disadvantages of it?
For example:
- It is not portable
- You have no idea how it realy works
- You have to pay for the environment
- If it is broken... then what?
My advice is to avoid C# like the plague. Go for C++, get a free compiler (from gnu) and start working with that.
Remember that for example linux is written in C and C++. Thats right, the ENTIRE OS!

Quote

3 - What other programming languages are used often in game making? And (briefly), why are those used over others? How important are the networking languages, and which ones see the most use in games?


There are 2 different tiers here, there are different languages you can use, but also different libraries for those languages. And the choice of the latter is equaly important!
I have seen games in C/C++, BlitzBasic, Java, .net
On the server side i have seen multiuser backends in C/C++, Stackless python, .net, perl, even PHP ... anything realy.
As for the libraries: BlitzBasic is its own library. If you want to work with OpenGL take a look at both Allegro and SDL.


Quote

4 - Aside from my required classes, what else should I try to take in the CS department to enhance my game making abilities? I am not an artist, should I take a 3D graphics class anyways? (I've taken plenty of english, writing, lit, philosophy, and acting classes previously for my people / interaction skills)


Sounds stupid, but yes, go for it.
Even if you will maybe not be the best in it, it will be an eye-opener to see how 3d graphics works, something you will absolutely need for games. Even if only to be able to talk with designer types and know what they talk about!

Quote

5 - We touched on interfaces, and it was mentioned that they are very important, but no concrete reason was given. What are the advantages of interfaces over regular classes? What makes them so important specifically?


Ask :)
As far as i know they are primarily important when you work with more people on one project.

Quote

6 - We used visual studio, which has many class libraries. Are those libraries free source? Can I use what microsoft has written without giving them credit?


See above, the answers are no and no.
If you want things for free, use free software.
A nifty C++ library is BOOST, but it is quite advanced and difficult.
If specificaly for game programming, take a look at Allegro and SDL. Allegro handles many things, SDL is mainly for graphics.

Quote

7 - I am in the process of writing a simple game that has no art. I tried to write an interface using the "Windows Application" setting in visual studio, but have become frustrated by it as all we did in class was draw a few pictures. Are there good tutorials to get me started in this area? Or, should I not bother and write the interface using a different language entirely?


I am not sure about the visualstudio terminology for it, but if you have no interface (a user interface, right?) then you can look for a project mode called something like 'terminal application'. You need to run it from a dos window.
If you make things with a free compiler you will actualy start there, at the commandline.

Quote

8 - If you answered any of my questions, please give yourself a pat on the back and a big thankyou from me.


Thankme :)
Was This Post Helpful? 0
  • +
  • -

#3 celchu456  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-May 07

Re: C C++ C# and more!

Posted 17 May 2007 - 08:51 AM

Thanks a lot for your awnsers!

I have one follow up question. You said if you want things for free, use free software. That I understand, but if I have already purchased the software (ie Visual Studio 5.0), can I then distribute a program I write (using their language/libraries) for profit? If I can't release it for profit, can I still distribute it for non-profit?

Also, for other people, what are your feelings on C#? I realize it may not get the praise in the game programming section of the forum, but do people like it for other applications/reasons? I've spent a lot of time with it, and I would hope to be able to use it in some fashion in the future, even if it isn't for game making.

Thanks again!
Was This Post Helpful? 0
  • +
  • -

#4 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: C C++ C# and more!

Posted 18 May 2007 - 04:34 AM

I believe you can, yes, but you should read the EULA (end user lisence agrement) to know for sure what you can and what you can not do with those libraries.

As for C#... well it needs to be said that one year ago i made the switch to MacOSX, and there is no way in hell i will ever return to windows.
As the C# development is windows-only (that sad visual studio thing), and also the applications you write with it are windows-only (as far as i know) that kind of narrows your audience.
If that is okay with you then that is a choice you make, but be sure to think about it, you do have a choice!

I develop with Xcode in C++, and at the moment i use SDL.
Xcode comes with the mac, and uses the (free) gnu compiler.
SDL is an opensource (game) graphics library that handles a lot of complicated things, and its also for free, and not only is it for free, it is also available on many platforms.
The result is that everything i write runs on MacOSX, windows and linux (and perhaps other OSes too)

If you want to develop in C++ you have many many many options, many compilers, many libraries (think OpenGL for example) and many programing environments.
For C# you have... visualstudio. thats it.
If there is a problem in a C++ library, there usualy are other libraries you can use, comunity support, fixes, etc.
If there is a problem in a C# library or even the language itself, there are no other libraries you can use, hardly any comunity support, and knowing MS no fixes for half a year.

If you like it, go for it. If you have doubts, stay away from it.

/end of MS bashing :)
Was This Post Helpful? 0
  • +
  • -

#5 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: C C++ C# and more!

Posted 18 May 2007 - 07:19 AM

View PostTrogdor, on 16 May, 2007 - 12:40 PM, said:

Quote

2 - Ties in with 1. I understand that C++ is an extension of C, but C# is NOT simply an extension of C++, as it also takes advantage of the .net framework, and perhaps other things as well (I am new remember). Why has the game industry not changed to C#? I assume it is because C++ handles graphics applications better. Am I right? What else am I missing?


C# is an invention of microsoft.
It is not adopted by the rest of the world for a number of reasons, the most important of which are:
- It is not open
- It is not free
You might talk about the advantages of the .net framework, but do they also teach you about the disadvantages of it?
For example:
- It is not portable
- You have no idea how it realy works
- You have to pay for the environment
- If it is broken... then what?
My advice is to avoid C# like the plague. Go for C++, get a free compiler (from gnu) and start working with that.
Remember that for example linux is written in C and C++. Thats right, the ENTIRE OS!


There is a free project that gives you .net on other platforms (on Linux for sure, but I think it is available on OSX, too) It's called Mono sponsored by Novell. It can even run binaries compiled by VS. There are even OpenGL libraries for it, so it might not be a dead end.
Back to .NET/C#: it's mainly supported by companies which are Microsoft partners, have a mostly MS based infrastructure, and not into other operating systems, and last but not least they can afford an extensive support plan with MS. It is mostly used for business applications as far as I know.
For game development it's advantage is that it can take advantage of the DirectX features of Windows, and it's memory management might speed up development / debugging.

Quote

5 - We touched on interfaces, and it was mentioned that they are very important, but no concrete reason was given. What are the advantages of interfaces over regular classes? What makes them so important specifically?


Interfaces are important for clean design. For example if you create an interface in your game called camera which defines a method called look that's purpose is to set the camera's position in the 3D world, and you make the player and a missile implement it, then usually in an fps you would call the player's look method during drawing the scene, but you could change to the missile's view by calling the missile's look method. (naturally you could change to the view of anything that implements the camera interface)I hope it wasn't too messy... Anyway, it is true for business applications too, when you have different objects, that can be used in a common way, it is usually a good idea to extract the common functions into an interface, and when used in this context, the caller only have to deal with the interface, not the implementing object. So it is not used only in big teams.
Was This Post Helpful? 0
  • +
  • -

#6 zany_001  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 26-June 07

Re: C C++ C# and more!

Posted 27 June 2007 - 09:15 PM

so is C# better than C++ if you dont mind windows only games,and what about the Express version?thats free,so just use that.
Was This Post Helpful? 0
  • +
  • -

#7 Topher84  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 113
  • View blog
  • Posts: 359
  • Joined: 04-June 07

Re: C C++ C# and more!

Posted 29 June 2007 - 12:38 PM

View Postzany_001, on 27 Jun, 2007 - 09:15 PM, said:

so is C# better than C++ if you dont mind windows only games,and what about the Express version?thats free,so just use that.


C# has a lot more security issues and failsafes w/ pointers and whatnot.. basically C# helps users not make "easy" mistakes with memory allocation for example.

W/ the being good a math comment, i have yet to see where any high level math has come in handy in programming... the most i have used is some multiplication/division algorithms. Being great at logic and reason would be WAY more helpful than math :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1