The online racing simulator
C# Game programming?
1
(34 posts, started )
C# Game programming?
Hi guys, Now as you see from the title this is a BIG subject!. I wanna start learning C# game programming as i wanna start livving my dreams. I dont know if this is something you can learn from home, ive never realy looked into it? hence me posting here and asking for advice. Ive always loved the way computers worked and the way programming gives you the ability to do what you want(within reason). Ive also always wanted to be able to make my own games in such a way there unique. something else ill add is that i know game programmers spend many years learning the abilitly to make games. Id guess Scawen has been learning all his life to be able to create LFS in such a way.


Is there any books that involve game programming?, id like to think its something i can learn from home too. If its sticktly something i have to learn at college id not be very happy as thats kinda restricting its uses. Anyway, if you know anything that will help me please post it here
Quote from mcgas001 :Hi guys, Now as you see from the title this is a BIG subject!. I wanna start learning C# game programming as i wanna start livving my dreams. I dont know if this is something you can learn from home, ive never realy looked into it? hence me posting here and asking for advice. Ive always loved the way computers worked and the way programming gives you the ability to do what you want(within reason). Ive also always wanted to be able to make my own games in such a way there unique. something else ill add is that i know game programmers spend many years learning the abilitly to make games. Id guess Scawen has been learning all his life to be able to create LFS in such a way.


Is there any books that involve game programming?, id like to think its something i can learn from home too. If its sticktly something i have to learn at college id not be very happy as thats kinda restricting its uses. Anyway, if you know anything that will help me please post it here

you might wanna take a look at this...

http://www.microsoft.com/downl ... 2a78de&DisplayLang=en
mhh, the question is very general i think. a lot of aspects can play an important role, depending the game concept you wanna create. for some games you need to go deep into graphics/rendering stuff, for others AI is important and so on. so imo the most important aspect is to have clear ideas where to go with the game and what it should do. then you can determine the different aspects of game programming, which are neccessary to implement it.

a very good starting point for all the graphics related topics is http://www.realtimerendering.com/ but there are so many other important topics if you wanna do a whole game by yourself
Hello,

I try to give you my opinion

1 - Yes you can learn programming for yourself, but you need a minimal learning at school, not for programming but for some mathematical need ( By Exemple for 3D aspect ) and thinking approach. I Learn myself programming many year ago ( 26 ) and i make commercial games in France when i was young ( for VIC 20 and C64 computer ). But at this time it's more easy than now. Now you can't programming, make graphic rendition and find gameplay alone ( Scawen don't do it alone ). It's so hard.

2 - C# It's not a good tool for programming Games, it's to slow ( Microsoft framework it's not good anyway ). You can use compiled C++ or C language.

3 - For books, it's dependent from the language you choose. Try to do little application before start a game or make a little and not complicated game to learn that language.

When you have learned a language, it's not difficult to learn another.

In fact the best way to learn programming is to programm

Good luck


Gai-Luron
C# is more than capable of creating 3D games, it has a whole API and a specialised IDE for the task. Making games can be complex, but good fun. Performance is relative. C++ is not the be-all-and-end-all of programming, or even game programming. Languages are just tools and you should choose the best one for the job. If you wanna make commercial 3D games, then go with C++. If you wanna learn how to make games, then don't get hung up on the implementation details. Just grab a tool and start learning.

XNA Framework
Some tips on learning game programming
A free game written to show what's possible with C#
Thanks for the help guys, it seems the XNA framework is popular when it comes to C#, i have to admit if C++ is better id use it. But i know C# quite well and id rather use that atm
Gai-Luron, please don't spread misinformation. The .NET framework is quiet good. So is the base Java framework (Swing not so much).

Yes, C/C++ while being a higher level language does compile straight to machine code unlike Java, .NET languages, and a bunch of other langauges that use Virtual Machines (VB6 and its older siblings).

However, C/C++ is not for the timid. You really need to know what you are doing and be very methodolical (should do that with any language/environment) as the languages give the developer quite a bit of power and flexibility. But to quote Uncle Ben, with great power comes great responsibility.

Delphi, as an example, is an environment using the Pascal language. It like C/C++ also compiles direct to machine code and there are DirectX libs for it too. Its going to be a lot easier to program in than C/C++ if you know Pascal (or know it and like it).

A lot is dependent on the type of game. Is it a turn-based play on the web game? C/C++ probably isn't the right choice, perhaps PHP or ASP.NET, Ruby, etc. is. Does it need to be multi-platform? Java is a good choice (check out jMonkey). Do you want to do things for the Xbox360 (its very limited but still), then XNA is the way to go.

Biggest issues with XNA for .NET and Java is that there are *not* some high quality networking libraries. Doing networking *right* for twitch games is not a straight forward task. Less important for say turn-based games. And by "network library" I do *not* mean basic TCP/IP and UDP/IP networking libraries that are in both Java and .NET.

There is a JavaGameNetwork library for Java that someone from the jMonkey community wrote. Sun has an API, but its more aimed at larger MMO-style games. I'm only aware of the Lindgren network library for C#. XNA has nothing as of yet (it realy needs to be able to use the Live framework for Xbox and Vista).

For C/C++ there are several really good ones out there including the Torque Network Library (derived from an AAA engine) plus others.

Remember that XNA framework is a low level wrapper framework around DirectX. It is NOT a graphics engine (or game engine). To my knowledge there aren't any XNA graphic engines built yet using XNA. I know the guys at GarageGames have one in the works. There might be one or two more floating around.

As someone mentioned, there is a ton of other things beside the graphics that goes into most games. My suggestion is to start with something simple and go from there. Or go into modding. Find a retail game (Quake3, UT2003, UT2004, etc. or any other moddable game, Torque from GarageGames is another choice) that fits your basic concept and work from there. I have a couple of mods myself this way (Minions of Destruction for UT2003 got some acclaim and later got remade by Epic in UT2004) and ended up getting credits on a mod that went retail (Tactical Ops based on the UT2003) engine. There were a couple of other mods (both on Quake and UT engines) that went from mod to commercial retail box game. Heck thats the way Counterstrike started out. Same with TeamFortress.

Quote from mcgas001 :Thanks for the help guys, it seems the XNA framework is popular when it comes to C#, i have to admit if C++ is better id use it. But i know C# quite well and id rather use that atm

Hello,

I don't say C# it's not good, i say only it's not adequate for graphic game and mcgas001 want to dev game. Garbage collection, it's not the best way to manage memory. I say that maybe because i dev application in code machine and with C i retreive this kind of thinking.
I use c# for Lapper, LFSRelax et LFSStat and for this it's a good tool, but for game i'am not agree with you.
Sorry, i can't explain more because it's so difficult for me to speak english.

I don't want make a war about language and i use or have used more Languages: machine code, C, C++,C#, Java, Pascal,VB,PHP,Perl,Ada, Basic, Informix 4gl. Each language is good if you know the limit of each and you know what do you want to do with.

In fine, try more languages and you can make your opinion yourself


Gai-Luron
Quote from Hollywood :...
Biggest issues with XNA for .NET and Java is that there are *not* some high quality networking libraries. Doing networking *right* for twitch games is not a straight forward task. Less important for say turn-based games. And by "network library" I do *not* mean basic TCP/IP and UDP/IP networking libraries that are in both Java and .NET.

There is a JavaGameNetwork library for Java that someone from the jMonkey community wrote. Sun has an API, but its more aimed at larger MMO-style games. I'm only aware of the Lindgren network library for C#. XNA has nothing as of yet (it realy needs to be able to use the Live framework for Xbox and Vista)....

looks like xna 2.0 has some better networking code
#11 - sun
hmm. I'am a begginer at proggramming and what i atend to use is greenfoot. it teaches you some code that how to turn an object in a 90 degree angle or so, But some of the code in there is like the same code in C# 2008 Express Edition, but when you know how to do all that you can try doing some coding in C#. The best way to learn how to create games is to learn some code then try it out in your head without looking in the book or what ever you use. Hope it Helps!
correct me if im wrong, but doesnt c++ compile through the .net framework? Also I agree with them. C++ and open gl are probably your best bet. C# is a nice language as it has garbage collection and all, but I dont know how good its 3d is.
You can do c++ and c++ .net. One use the framwork, the other don't.

Another good idea is using XNA. It's another microsoft langage oriented toward the game development.
It really depends what type of games you want to make, for very simple 3d ones i would suggest using Windows Presentation Foundation (WPF) because it is very easy. Or you could use Managed Direct X and C#. If you already have C++ experiance then OpenGL is fairly simple to work with aswell. However remember that the maths involved can get pretty heavy and it is quite difficult to do anything in a short period of time
Again, that is incorrect Gai. C# has actually been used in a few published box games. It is also highly dependent, as I mentioned before, on the *type* of game. High-end, triple-AAA, twitch games, its probably not as good of fit. Indie twitch, role-playing, puzzle, etc. games its just as good if not better and probably more productive. Same goes for Java.

Quote from Gai-Luron :Hello,

I don't say C# it's not good, i say only it's not adequate for graphic game and mcgas001 want to dev game. Garbage collection, it's not the best way to manage memory. I say that maybe because i dev application in code machine and with C i retreive this kind of thinking.

Not about that, its about distributing misunderstanding.

Quote :
I don't want make a war about language and i use or have used more Languages: machine code, C, C++,C#, Java, Pascal,VB,PHP,Perl,Ada, Basic, Informix 4gl. Each language is good if you know the limit of each and you know what do you want to do with.

XNA is the latest MANAGED wrapper to DirectX plus some for the .NET platform.

C++.NET is managed code, so it runs in the same sandbox as any other .NET language once its compiled. The main benefit to managed C++ is port C++ code for easier integration (instead of dealing with interops, etc.) with other managed code. Or you are a hard-core C++ developer who needs to write managed code apps.

Quote from shadow2kx :You can do c++ and c++ .net. One use the framwork, the other don't.

Another good idea is using XNA. It's another microsoft langage oriented toward the game development.

Ah, yes, had missed that... been a bit too buried in other work that I haven't paid as much attention to XNA as I'd like. I'm sure now on the GarageGames forums there is a huge clammer on when their TorqueX will support the XNA networking.

Quote from GeForz :looks like xna 2.0 has some better networking code

#18 - wien
If your end goal is making games, what language you use to learn is wholly irrelevant. Yes C++ will probably give you more performance than C# if you use it correctly, but when learning that just isn't important. What's important is that you get the high level concepts used to build a game (creating a renderer, getting input, doing game logic, scene management, physics, that sort of thing). Once you get these and know how they all tie together you should be able to implement them in a language of your choice without too much difficulty, regardless of what language you used to learn in the first place.

Focusing on the language is just starting at the wrong end in my opinion as they all do pretty much the same thing. C# and the XNA framework is a very good starting point for games and you can progress onto the "harder" languages later if you feel you need the performance.
Quote from Gai-Luron :I don't say C# it's not good, i say only it's not adequate for graphic game and mcgas001 want to dev game.

That's not quite true. C# can be compiled from byte-code to native code at run-time. Even if that were not the case, the bulk of most 3d operations are done on the GPU these days, with CPU math operations relying on native modules.

As for garbage collection, that's really not an issue either. The Unreal Engine uses a garbage collection system, and games like GoW and Unreal Tournament seem to run just fine. Ok, so the Unreal Engine didn't run too well on something like the PS2, but then, the PS2 was a very particular beast and sensitive to cache thrashing.

If there's one thing that makes a game written in C# slower than something written in C/C++, it's the mechanism used for linking to other modules and a lack of being able to in-line code from external libs. I wouldn't write a rigid body simulation in C# because of this reason....I hate to think of the call overhead from all those XNA math functions, but it's a very good place to start learning to game programing as a hobby.
Here is what I consider to be an excellent book on C#

HEAD FIRST C# - Brain Friendly Guides

Andrew Stellman & Jennifer Green

Published by OReilly

Worth checking to see if the learning style is right for you. Don't just take my word, it's also highly rated on AMAZON as well.

pw
#21 - sun
HI

i did some game proggraming and i got the following error:

''Error 1 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\owen\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.cs 20 9 WindowsApplication1".

and it underlines the word 'void'.

here's the code.


[SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Collections.Generic;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.ComponentModel;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Data;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Drawing;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Text;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Windows.Forms;
[/SIZE][SIZE=2][COLOR=#0000ff]namespace[/COLOR][/SIZE][SIZE=2] WindowsApplication1
{
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]partial[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][SIZE=2][COLOR=#008080]Form1[/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#008080]Form
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] Form1()
{
InitializeComponent();
}
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] TinyTennis_Paint([/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] sender, PaintEventArgs e)
{
[/SIZE][SIZE=2][COLOR=#008000]//Work out how long since we were last here
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][SIZE=2] seconds
[/SIZE][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] gameTime = _timer.ElapsedMilliseconds / 1000.0;
[/SIZE][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] elapsedTime = gameTime - _lastTime;
_lastTime = gameTime;
_frameCounter++;

[/SIZE][SIZE=2][COLOR=#008000]//Perform any animation
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]//Draw the game objects
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]//Force the next Paint()
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].Invalidate();
}

now i'am reading those links what you sent me and i still cant find out whats wrong.

if you can help please post here.
[/SIZE]
Could you post that code again in [ C O D E ] tags?
Looks like you are missing a lot of spacees between the "public", "void", "class" etc....
#23 - sun
what do you mean ? 'code Tags' ?
Quote from sun :what do you mean ? 'code Tags' ?

Like this

[code][/code]
#25 - sun
ok here it is.

[SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Collections.Generic;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.ComponentModel;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Data;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Drawing;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Text;
[/SIZE][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Windows.Forms;
[/SIZE][SIZE=2][COLOR=#0000ff]namespace[/COLOR][/SIZE][SIZE=2] WindowsApplication1
{
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]partial[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][SIZE=2][COLOR=#008080]Form1[/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#008080]Form
[/COLOR][/SIZE][SIZE=2]{
[/SIZE][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2] Form1()
{
InitializeComponent();
}
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] TinyTennis_Paint([/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] sender, PaintEventArgs e)
{
[/SIZE][SIZE=2][COLOR=#008000]//Work out how long since we were last here
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][SIZE=2] seconds
[/SIZE][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] gameTime = _timer.ElapsedMilliseconds / 1000.0;
[/SIZE][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][SIZE=2] elapsedTime = gameTime - _lastTime;
_lastTime = gameTime;
_frameCounter++;
[/SIZE][SIZE=2][COLOR=#008000]//Perform any animation
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]//Draw the game objects
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]//Force the next Paint()
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].Invalidate();
}

-
(niall09) DELETED by niall09
1

C# Game programming?
(34 posts, started )
FGED GREDG RDFGDR GSFDG