Sign in to follow this  
randyeich

Development Using C#

Recommended Posts

Hi folks, my first gamedev related topic here.

Ok, basically I've just recently began learning programming. I chose C# as my first language to learn based on several different things, leading of which is I'd like to focus on software development for Windows. There are many developer positions for C# here in my city. A lot more than Java, and there are virtually 0 C++ positions available. It was more of a toss up between Java and C#, so I looked at both a little and decided C# was better for me. In my opinion based on a lot of reading I've been doing I think C++ may be on it's way out, at least for software (non gaming). Definitely is not needed here at least.

I've been playing around with C# for a couple months now. I'm also working on a piece of software I will be using as my own business' initial launch program. It's a niche based one, not too terribly hard coding wise, and is business oriented, and I actually have several vendors for my niche that have already agreed to place it in their shops.

I'm sure you're wondering, why if I want to focus on software, am I here? Well, I would also like to get my feet wet pretty deeply in game development. I want to develop games as well. Not my primary thing, but I would like to have good enough knowledge over the next few years so I could develop a decent game. I also want to have enough knowledge because with my company I plan on having it branch to have a game development team as well (not huge of course, maybe 2 or 3 people). Now this is all dependent on how the business app end is going for me. I have a business plan already written out (it's about 10 pages at the moment not counting market research and competition).

What I'm here to ask right now is, where should I go to get started for game development using C#, such as game engine (preferably written in C# if there are any free ones available).

Share this post


Link to post
Share on other sites
For game development in C# you should go with Microsoft's XNA. Check out the lessons on XNA in the XNA section of this site. I don't know which game engines are available, but XNA is a game library and will provide you a lot of the functionality you will need.

Share this post


Link to post
Share on other sites
Thanks. I'm actually in the middle of installing MS XNA Game Studio 4.0 lol. I went on Dreamspark.com and downloaded it. Thanks Eric. I found visual3d.net however it's not free :( (for a game engine). Any open source C# ones out there? I ask for that because I can look at the code and start figuring out what everything does. I've found this a big help on my quest for learning C# so far.

Share this post


Link to post
Share on other sites
Definitely XNA. The beautiful thing about XNA is, it has the game loop set up for you. :D

It has "functions" that the engine loops through. So if you learn XNA, you learn the game loop. It also has really easy to understand types for anything you could need for game development.

Texture2D is for sprites. It is easy to set and holds information on the width and height of the image for you.
Vector2 is for (X,Y) positions.
SpriteFont is for custom fonts
etc etc

It's a really easy system to pick up if you can learn the function override and component system.

Share this post


Link to post
Share on other sites
[quote name='SubGrizzly' timestamp='1298142154' post='4776380']
Thanks. I'm actually in the middle of installing MS XNA Game Studio 4.0 lol. I went on Dreamspark.com and downloaded it. Thanks Eric. I found visual3d.net however it's not free :( (for a game engine). Any open source C# ones out there? I ask for that because I can look at the code and start figuring out what everything does. I've found this a big help on my quest for learning C# so far.
[/quote]

I wouldn't worry about an engine. You need to learn about the loop, and the logic behind game design before you rely on an engine to hide it from you XD.

Here's a starting point for you:

[list][*]create a new XNA windows project[*]at the top, under SpriteBatch spriteBatch; type "Texture2D image;"[*]In the solution explorer there should be two solutions: the project and the projectContent (Content)[*]right click the content one and click Add->Existing Item ... choose any image (suppose it's called bla.png)[*][*]in "protected override void LoadContent()" add "image = Content.load<Texture2D>(@"bla");[*]replace "bla" with your image name WITHOUT THE EXTENSION[*]add this line to the Draw() function:[*]spriteBatch.Draw(image, new Rectangle(0, 0, image.Width, image.Height), Color.White);[/list]
Compile and run.

Work from there. Add controls, make it move. Think to your self, "What would make this closer to looking like a game?"

You don't need a game engine. ^^

EDIT: er surrond the spritBatch.Draw with :spriteBatch.Begin(); and spriteBatch.End();

Share this post


Link to post
Share on other sites
Thanks guys. I found out ogre has a .NET version...it's still C++ but it provides an easy way to integrate it with wrappers. It's called mogre.

Where is a good resource for me to learn from that gives tutorials much like a book format? Assuming no programming experience whatsoever. I find that it's easier for me to learn that way. When I learned PHP I did it through resources that assumed zero experience with anything, even though I had developed some in python and javascript. I used to be a web developer.

slynk, I hear what you're saying. But imo, it's always good to have all the tools around you for use whenever you're ready for them. Also, I hate not having something that I need when I need it lol. Never know when the internet may go out :/ stupid computers lol.

Share this post


Link to post
Share on other sites
[quote name='SubGrizzly' timestamp='1298146766' post='4776410']
Thanks guys. I found out ogre has a .NET version...it's still C++ but it provides an easy way to integrate it with wrappers. It's called mogre.

Where is a good resource for me to learn from that gives tutorials much like a book format? Assuming no programming experience whatsoever. I find that it's easier for me to learn that way. When I learned PHP I did it through resources that assumed zero experience with anything, even though I had developed some in python and javascript. I used to be a web developer.

slynk, I hear what you're saying. But imo, it's always good to have all the tools around you for use whenever you're ready for them. Also, I hate not having something that I need when I need it lol. Never know when the internet may go out :/ stupid computers lol.
[/quote]

A game engine isn't a tool set. It's just pre programmed functions and data types. It doesn't give you a tile editor or an effects generate. So I don't get what you mean?

An engine has some things like gravity and collision already coded for you. But you should really understand how it was accomplished to effectively use it...

What would you get online if you weren't using an engine? Tutorials to do specific things? You'd still have to get tutorials to learn to use the engine.

Share this post


Link to post
Share on other sites
I generally download all documentation I can.

No worries.

Do you know any good resources for starting C# game design from a beginner programmer's perspective?

Share this post


Link to post
Share on other sites
[url="http://create.msdn.com/en-us/education/roadmap"]http://create.msdn.com/en-us/education/roadmap[/url]
[url="http://create.msdn.com/en-US/education/catalog/"]http://create.msdn.com/en-US/education/catalog/[/url]
[url="http://create.msdn.com/en-us/education/documentation"]http://create.msdn.com/en-us/education/documentation[/url]


Shh... I didn't make this google code listing but there are some good pdfs on it ;)
[url="http://code.google.com/p/summerofxna/downloads/list"]http://code.google.com/p/summerofxna/downloads/list[/url]

I found it searching for an XNA book and it was on google XD

Once you get the language down, start with a clone. Make something simple that you played as a kid (the simpler the better). Go for pong if you want super easy. My first clone was space invaders. Then work your way up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this