Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411573 Posts in 69386 Topics- by 58444 Members - Latest Member: darkcitien

May 04, 2024, 12:52:04 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)C# + SDL.NET: Creating instances (In a way.. ?)
Pages: [1] 2
Print
Author Topic: C# + SDL.NET: Creating instances (In a way.. ?)  (Read 7376 times)
Noel Berry
Level 4
****


Yarr!


View Profile WWW
« on: May 07, 2009, 04:21:45 PM »

EDIT: OK, I have another question: http://forums.tigsource.com/index.php?topic=6125.msg198799#msg198799

I'm trying to do something a little object oriented (I have no idea how to do it otherwise), but can't get it working...


Original post:

Quote
Hi there.
I've been making games in Game Maker for over 3 years now, and, more for the fun of it than anything, I'm looking into trying out some C# or C++.
I already started some C# stuff, and have made a simple level editor, but am now interested in attempting to make a small 2D game.

I'm not particularly worried about C#/C++ being 'too hard'. I've been using Game Maker, and other programming languages (VB.NET, and like I said a bit of C# already), so I'll get the hang of it.

My problem is, I really don't know where to start. I need a few nice tutorials that explain things like loading in graphics and displaying them properly, and the like. (Possibly even some simple open source 2D games?)

I'm also not sure if I should be using C# or C++. I tend to hear that C++ is probably better when it comes to developing games, but don't know this for a fact.

Any help would be appreciated.

Cheers,
Drazzke.

« Last Edit: May 12, 2009, 08:42:43 PM by Drazzke » Logged

Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #1 on: May 07, 2009, 04:26:45 PM »

Start by having a look at this thread (learning new languages) in this very forum.

 Gentleman
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
Gold Cray
Level 10
*****


Gold Cray


View Profile WWW
« Reply #2 on: May 07, 2009, 04:32:19 PM »

C++ gives you a lot more control over the finer details, but it also gets a little tedious. I have never used C#, but I understand that it is a lot more high-level and is loaded with features that C++ doesn't have. If you already understand C++, then I don't see any reason not to use it. If you don't mind learning C++ first, then I don't see any reason not to use it. I am tempted to say that C++ is better, but in reality neither is better. They are just different.

As for where to start, I first learned some of the basic concepts from the Cone3D tutorials (C++ and SDL) and then just sort of made everything else up from there. There's a JNR tutorial out there that provides some good insight on collision detection, but you want to follow it down to the letter to start off or else you'll have problems.
Logged
Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #3 on: May 07, 2009, 04:49:46 PM »

I wouldn't get to hung up on which language to use, I'd focus more on the platform or framework you want to build for. Do you intend to create your own engine or is there an existing engine that you cna use right now to save you the time of rolling your own? Whether you choose to go with C or C++ or Java or Python or C# or VB etc, shouldn't be that much of a concern, you just want to make sure a library exists for the language you do end up choosing (unless your rolling your own of course).

I will say that you do gain a ton of functionality out of .NET, and you can use C# or VB your not limited to C# or anything, many people find VB to be much easier to use, it's personal preference really and if C++ is your thing cool. I agree with Gold Cray though, it get tedious and if you want to be more productive, I'd move to a more modern language. It's also worth pointing out, you might not need or even be aware of all those benefits and so they may not matter to you anyway, in general you can do any of it in C++ but you'll probably have to write alot of what C# offers out of the box, on your own or patch together a bunch of C++ libraries.

I would not say C++ or C# is better for making games (how many games does the choice of language honestly make a difference?), you can make games with any language under the sun, it's really about what your goals are. I would use C++ if I was making the latest and greatest game engine (speed primarily), but if your just making independant games in your spare hobby time, I would just move to C# given the option. While C++ probably does have a lot more support (it's just plain oldder), I've noticed in recent years .NET support for unmanaged libraries has soared, so I'd generally be suprised if you can't find a .NET version of many popular code libraries out there.
Logged

Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #4 on: May 07, 2009, 05:18:30 PM »

Thanks for the feedback.

Gold Cray, I'll check out those websites. They seem to have a lot of good information.

Skirvir, Yeah, I see where you are getting at. Currently, I'm just looking for something new to fool around with, that's a bit more complicated then Game Maker. I've been doing a lot of web development recently, but I feel like I want to get back into some Game Development now, and am just searching around on where to get started in a new language.

As of now, I know very little about C++ or C# and how they work. I'm not worried about which language I should use, as I know they both have their pros and cons, but I'm trying to figure out which one I should use when I develop 2D games.

As for already built engines, I really haven't looked into it all that much yet. I was planning on building my own, but I'm not sure how much time this would take, or how complicated it would be.

You can tell, I need to do some research Tongue
Quote
I would use C++ if I was making the latest and greatest game engine (speed primarily), but if your just making independant games in your spare hobby time, I would just move to C# given the option.
I'm not really aiming at making a really fast and complicated engine, but rather a simple 2D platform engine. It appears (from what I can tell), that to build a little platformer, I should maybe look into C# and the .NET version of different libraries.

Again, thanks for the feedback Smiley
Logged

Jesseyay
Level 0
***



View Profile
« Reply #5 on: May 07, 2009, 11:52:38 PM »

I've used both C++ and C# for developing games, and if you're not doing anything too huge and don't need the potential speed from coding in C++ I'd recommend C#. It's got a lot of nice features that you just don't see in C++ and while it may not be as powerful in terms of what you can do with it, it definitely has a better lines of code to work done ratio.
Also, messing around with memory management in C++ can give you a lot of headaches which you can mostly avoid by using C#.
Using C# gives you access to all of the XNA stuff which I find is a very useful framework to build your game upon as well as the great support in terms of community and examples/tutorials.
Logged
RC
Level 0
***



View Profile
« Reply #6 on: May 08, 2009, 12:08:14 AM »

I downloaded a shit ton of ebooks about C++, never fully read through them or anything, and I also looked at some source code of example programs and some game engines like Clan Lib and Irrlicht.

C++ was easier for me to learn than I expected with my knowledge of GML and PHP though, the only true pain in the ass came with Win32 programming, which I read the wikibook about at wikipedia.

I wrote a small 1 part tutorial for displaying a polygon in OpenGL and C++, but I'm not sure how much help you'd find it. http://rcsoft.free0host.com/opengl/chapter1.html
Logged

Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #7 on: May 08, 2009, 05:46:43 AM »

I've used both C++ and C# for developing games, and if you're not doing anything too huge and don't need the potential speed from coding in C++ I'd recommend C#. It's got a lot of nice features that you just don't see in C++ and while it may not be as powerful in terms of what you can do with it, it definitely has a better lines of code to work done ratio.
Also, messing around with memory management in C++ can give you a lot of headaches which you can mostly avoid by using C#.
Using C# gives you access to all of the XNA stuff which I find is a very useful framework to build your game upon as well as the great support in terms of community and examples/tutorials.

Well, I'm really not interested in making a fast engine or anything - I'm just looking at making some platform games. In which case, C# is looking like it may be the right thing for me at this time.
I'll have a look at XNA tonight, as well.

I downloaded a shit ton of ebooks about C++, never fully read through them or anything, and I also looked at some source code of example programs and some game engines like Clan Lib and Irrlicht.

C++ was easier for me to learn than I expected with my knowledge of GML and PHP though, the only true pain in the ass came with Win32 programming, which I read the wikibook about at wikipedia.

I wrote a small 1 part tutorial for displaying a polygon in OpenGL and C++, but I'm not sure how much help you'd find it. http://rcsoft.free0host.com/opengl/chapter1.html

I'll look into that as well. At this point, I might go with C#, but I'm still open for things in C++. I'll check out your tutorial the next chance I get Smiley


Logged

Gold Cray
Level 10
*****


Gold Cray


View Profile WWW
« Reply #8 on: May 08, 2009, 06:50:01 AM »

I'll have a look at XNA tonight, as well.
I'd recommend that you star away from XNA unless you really need it for something, because it tends to not work on a lot of computers.
Logged
Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #9 on: May 08, 2009, 09:06:58 AM »

I'll have a look at XNA tonight, as well.
I'd recommend that you star away from XNA unless you really need it for something, because it tends to not work on a lot of computers.

ah, OK. Are there any SDL or OpenGL libraries that work with C#?
Logged

Gold Cray
Level 10
*****


Gold Cray


View Profile WWW
« Reply #10 on: May 08, 2009, 09:11:51 AM »

The one I hear about the most is the Tao Framework.
Logged
Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #11 on: May 08, 2009, 09:14:27 AM »

That looks great, thank you. That should probably do the trick Smiley

So, I think at this point, I'll use C# and probably SDL.
Logged

Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #12 on: May 08, 2009, 11:15:18 AM »

I'd recommend that you star away from XNA unless you really need it for something, because it tends to not work on a lot of computers.

XNA targets the .NET framework and is primarily a Windows focused technology, what's neat about it is that it streamlines a lot of things pertaining to making games and you can eaisly make games for the Xbox 360 with it (plus there's a lot of public support out there for it), if your concerned with games that are OS independant, I'd recommend either Java, Flash or Silverlight (with Silverlight being an outstanding platform for making games) OR, using something like SDL, even if you use SDL.NET (Tao) you are only gonna be targeting Windows and some linux platforms (Mono), not Mac's and such.

Choices, choices, I know Wink
Logged

Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #13 on: May 08, 2009, 01:36:25 PM »

hehe, yeah, many choices.

At this time I'm not worried about cross-platform, I'm just aiming for windows. Perhaps in the future I'll move onto getting games running on other OS, but at this time I really couldn't care less Tongue

I'll probably be looking at flash a bit over the summer, but I'm more interested in trying C# or C++ (C# in this case, I think).

I'll try out SDL Tao first, and if that's not what I'm looking for, I'll check out XNA.

Smiley
Logged

Guillaume
Level 7
**



View Profile
« Reply #14 on: May 08, 2009, 02:47:15 PM »

Is XNA really that bad?


[inquisitive potential future XNA dev here]
Logged
Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #15 on: May 08, 2009, 05:10:21 PM »

I would argue no, XNA isn't bad at all, it's just not OS independant, your gonna need a Windows system, but it's a great framework for making games, there's lots of support and tutorials on the official XNA site as well as various sites around the net.

One of my favorite things that they've done with XNA is create very powerful game engines if you want to get up and running immediately, for example they have a little pre-packaged RPG engine as well as a racing game engine, your free to take them, compile them and tweak them, no need to roll your own engine really.

The best part of the whole XNA thing is that it's all free, unless you want to make games for the Xbox, then it'll cost you $100, other than that, your free to do what you want, I think that's pretty cool, stuff like this just didn't exist 10yrs ago, I'm happy to finally see a company such as Microsoft support gaming like this Smiley
Logged

Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #16 on: May 08, 2009, 06:07:19 PM »

Hmm.. Sounds interesting. I'm not sure which direction I should go! Tongue
For XNA though, you do need the 2005 version of C#, do you not? I have Microsoft Visual C# 2008 currently installed, although I'm sure it wouldn't be a problem to get the 2005 version.

For those people who have used SDL and XNA both for developing games, which would you say is better to start off with? I realize that, like many things, they probably both have their pros and cons.

Anyways, got a chance to mess around with C#, Tao SDL, and SDL.NET (which I found while Googling stuff for Tao SDL). This will definitely take some learning Tongue

I'm just wondering, is SDL.NET very good when it comes to game development? Or, if I'm going to use SDL, should I stick to Tao?
Logged

Jesseyay
Level 0
***



View Profile
« Reply #17 on: May 08, 2009, 06:26:10 PM »

For XNA though, you do need the 2005 version of C#, do you not? I have Microsoft Visual C# 2008 currently installed, although I'm sure it wouldn't be a problem to get the 2005 version.
Since XNA 3.0 has been released it has added support for Visual C# 2008.
Logged
Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #18 on: May 08, 2009, 06:27:31 PM »

Hmm, I think I'll need backup from some other knowledgeable folks but I'll try my best:

I'm currently using SDL.NET and C#, I personally use C# because it is my language of choice for anything (games, hobby stuff, professional work) and because I don't believe there's anything stronger than .NET out there right now, I also know .NET and C# quite well (so my comfort level is very high), I know how to do what I want to do with C# because I work with it so much.

I'm using SDL.NET because a) it's leveraging .NET and intellisense and I getta do things in Visual Studio, all things I'm very familiar with again. Also, I'm currently working on a 2D game and I only wanted 2D, I didn't want to deal with the complexity of 3D (XNA is all 3D for example, you can do 2D in it, but it's probably more work than it's worth).

If I wanted to focus on 3D, I wouldn't go with SDL, I'd go with DirectX/XNA. If I wanted speed and portability (theoretically anyway) I'd go with C++, if I wanted to go completely cross-platform, I'd probably go with Silverlight or Java or Flash. Each technology does have it's pros and cons and it's worth investigating and learning them before choosing your technology. In fact you need to know what your building THEN coose the technology that best suits what your after, unfortunately there's not usually a clear-cut answer.

SDL.NET is just a layer to create games on top of, it provides support for your graphics, input, sound, networking etc, you don't have to roll all taht stuff on your own and it's designed for 2D and does that really well, if you want to make a 2D game, my money is on SDL.NET.

(I don't know all about the Tao framework although SDL.NET needs it, I think Tao is a bigger framework with even more goodies, it has Lua scripting support and bunch of other stuff, someone else who knows more, please elaborate Wink

If you just use SDL, I believe that's cross-platform compatible, if you use SDL.NET, then your stuck in the .NET world, which is mostly gonna limit you to Windows, although as I've said, there is Mono in linux, and so it will work in linux, it's just never gonna be up-to-date with Microsoft's .NET implementation (which is okay).

Based on your responses, it sounds to me like C# and SDL.NET is a good avenue for you, I think you want to make 2D stuff, your not trying to make something serious or professional so you don't need the low-level strengths of C++ and you probably want to spend more of your time experimenting and having fun and C# lends itself really well to that. You could even use VB.NET if you wanted to, it's generally even higher level than C#, some people find it easier to learn or prefer it.

If you are more familiar and comfortable with C++, stick with that and use the SDL library, then you don't have to waste any time learning the .NET world.
Logged

Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #19 on: May 08, 2009, 07:02:03 PM »

Thank you, that really clears things up for me.

I'll use Tao and SDL.NET with C# then. I don't think I'll head towards VB.NET, as it's not quite what I'm looking for, I think.

And, yes, I am looking at making 2D games, just as a hobby and entertainment. So it sounds like C# and SDL are the right choice for me at this time.

I'll spend some time looking into SDL and C#, and see what I can come up with.

Thanks for the help! Smiley
Logged

Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic