Programming

Started by Wonkyth, Thu 23/04/2009 11:53:26

Previous topic - Next topic

Wonkyth

Over the last twelve months or so I've been learning to program. Nothing formal, just looking at various tutorials and buying the occasional book. Also, around about the time I started my self-tutoring I had an Idea for a game, one I reckoned I could make with AGS( the only Programming related thing I then knew about). I gave it a try, but as my game wasn't an Adventure Game, quickly realised that having to fit everything into rooms would make it impossible to do.
So, I started learning C#. it all worked, until I got to graphics.

Basically, this thread is to ask if anyone could point me to a good tutorial or something similar, it doesn't really matter what programming language, as having messed about with a few object-oriented languages, they all seem similar enough that I wouldn't run into any trouble.

Thanks.
"But with a ninja on your face, you live longer!"

Ghost

#1
Gamedev.net is a good place to start. It has a good collection of game programming articles, and since games *tend* to use graphics, there're some good starter tutorials to find there.

I advise against using C# in general; if you want an all-purpose C dialect, go C++.

Wonkyth

Thanks!
The reason I chose C# is that I was told that it was easier to learn and not so complex to use. It certainly seems to be the case, as the few attempts I've made to understand it haven't really worked.
"But with a ninja on your face, you live longer!"

bicilotti

Quote from: wonkyth on Thu 23/04/2009 11:53:26
Over the last twelve months or so I've been learning to program. Nothing formal, just looking at various tutorials and buying the occasional book. Also, around about the time I started my self-tutoring I had an Idea for a game, one I reckoned I could make with AGS( the only Programming related thing I then knew about). I gave it a try, but as my game wasn't an Adventure Game, quickly realised that having to fit everything into rooms would make it impossible to do.
So, I started learning C#. it all worked, until I got to graphics.

Basically, this thread is to ask if anyone could point me to a good tutorial or something similar, it doesn't really matter what programming language, as having messed about with a few object-oriented languages, they all seem similar enough that I wouldn't run into any trouble.

Thanks.

As Ghost pointed out, C++ may be a better choice (more support, wider community, more free thingies/libraries, etc.).

Allegro is a very flexible, nice and simple game programming library for C++ which I enjoy most. Also, the Allegro community is active and friendly.

You can get a great tuorial here.

I enjoy much writing stuff in C++, it gives you a sense of freedom that AGS does not (despite having a solid and very flexible script-language).
But I do think that almost everything is scriptable in AGS, the only drawbacks being speed (somewhat) and the lack of dynamically allocated memory.

Anyway, good luck with your project!


Ghost

A great drawback of C# is that you limit yourself to one OS. That doesn't sound very important, as you can safely say that programming for Windows will enable your programs to run on a LOT of computers, but for an indie developer it counts a lot to have good cross-platform support. C# is also quite a resource hog, and it isn't that much easier to learn. You get better WYSIWYG tools, but that's about it. Depending on how serious you are about learning a programming lingo, it is generally agreed that C/C++ are standards you can't ignore.

Bic did well to point you towards Allegro btw, you can find a lot of neato stuff there. For a more modern, yet not so large community, try ClanLib (http://clanlib.org/) and see what they have to offer.

lemmy101

#5
Quote"A great drawback of C# is that you limit yourself to one OS. That doesn't sound very important, as you can safely say that programming for Windows will enable your programs to run on a LOT of computers, but for an indie developer it counts a lot to have good cross-platform support. C# is also quite a resource hog, and it isn't that much easier to learn. You get better WYSIWYG tools, but that's about it. Depending on how serious you are about learning a programming lingo, it is generally agreed that C/C++ are standards you can't ignore."

I couldn't disagree more. Sure you're limited to only Windows (and XBox, of course!) But C# is an incredible language, MUCH MUCH MUCH easier to learn than C++, not is not *that* much of a resource hog unless you're running a Pentium 166 or something...

I've been programming games in C++ in the games industry for over 10 years, and at this time I pretty much NEVER want to do C++ again if I can help it because I love C# so much. :D

And learning C# will make it a cinch to move over to C++ once you've got that figured out.

As a language I can't recommend it enough. XNA is also completely amazing in every respect*.

*Except for a bit of a faff making an installer that works on everyone's machines, and Shader 1.1 requirement, but they're a small price to pay for the opportunity for XBox homebrew.

All the anti-M$ crap has clouded a lot of people's minds IMHO. Speaking from experience C#/XNA is the best game development platform ever made by a factor of 10, and if you're gonna fumble through archaic Allegro just because you don't want Microsoft to have your 'custom' then that's a real shame.

I should also point out that the guy who MADE Allegro has since abandoned it and was himself involved in the development of XNA at MS, and he is an amazing resource for XNA developers. The community is great, there's a TON of libraries already and more all the time.

I think it's an ideal choice for your first language. Perhaps the most ideal as it combines power, ease of use, with a highly elegant and proper object orientated language that's gonna learn you good programming disciplines. All these reactionary 'cooker cutter' arguments against it I see all the time, and few of them hold water and are in my experience largely uninformed.

thezombiecow

QuoteAll the anti-M$ crap has clouded a lot of people's minds IMHO.

This is completely true. C#/ XNA are so incredibly user-friendly, powerful and beautiful. It's also insanely easy to make something look genuinely special with bloom and scaling and what-have-you. For indies/ homebrew guys, it's an absolute godsend. It's like Allegro++.


Ghost

Lemmi, thanks for correcting me there. I do admit I am a bit oldfashioned, though not Anti-MS in any way.

lemmy101

#8
NP ;) Sorry if I get overly vocal on the subject. It pains me so many are missing out / not giving MS their dues for C#/XNA/.NET Framework. It's the best thing they've ever done by a massive massive margin, and evil corporation or not, I'll defend them to the hilt on this one as they've done a top job with it in practically every single respect.

JimmyShelter

Anyone got any experience with PyGame?

I really like the Python language, so if the PyGame library is any good, that's a great option.

Pumaman

Quote from: thezombiecow on Thu 23/04/2009 14:49:52
This is completely true. C#/ XNA are so incredibly user-friendly, powerful and beautiful. It's also insanely easy to make something look genuinely special with bloom and scaling and what-have-you. For indies/ homebrew guys, it's an absolute godsend. It's like Allegro++.

I third this. If you're just getting into programming then definitely go with C#, not C++. It makes everything so much easier -- you don't have to worry about memory leaks, buffer sizes or Windows API calls (for the most part). What would take a day to code in C++ can often be done in a couple of hours with C#.

You're not limiting yourself to Windows either, as the Mono project provides a .NET Runtime for Linux.

The only benefits of C++ these days is that it is faster, and people don't have to have the .NET Framework installed. But as time goes on, those benefits become worth less and less.

lemmy101

Quote from: Pumaman on Thu 23/04/2009 19:48:09
What would take a day to code in C++ can often be done in a couple of hours with C#.

Exactly. :D and to take the estimations further, what can take a year to code in C++ can often be done in a couple of months in C#. ;D

I'll never look back... not unless I have to anyway.

Vince Twelve

You guyz have obviously been bought out by Micro$oft.  Or should I say, MicroSUCK! Booyah!  C++ FOREVS!!1!

Gilbert

Assembly is undoubtedly the best and there should be no objection, unless you are brave enough to just enter machine codes directly. :=

lemmy101

Bleh. ;) Let's put it this way: No one will ever be coding holo-deck simulations in assembler. :p

monkey0506

Binary for the win. 8)

Personally I prefer C++ to C#, but that may be because the first programming book I ever read was "Beginning C++" (which I still have) and that was one of the first languages I ever programmed in.

While we're on the subject...I was just wondering, does C# have the limitation for ... parameters that you may only pass POD types? As part of one of the exercises, I was writing a custom string type. The exercise was simply looking for basic constructors and operators, but I of course wanted to provide a full class. The only snag I ever really hit was in that I couldn't pass my type through ... without having to retrieve the internal char*.

In any case, when I've tried looking at C# it just makes my brain hurt and I can't make any sense of it. It might help if I tried starting at the beginning though instead of trying to dive into the language with no prior knowledge of anything to do with it.

Then again, I did win first place in that Java competition...and I admittedly know nothing at all about Java (because it's the devil and I choose to abstain from such iniquity). Reportedly, a written exam over the language is much more difficult than programming in it. ::)

lemmy101

#16
Quote from: monkey_05_06 on Fri 24/04/2009 08:37:15
While we're on the subject...I was just wondering, does C# have the limitation for ... parameters that you may only pass POD types? As part of one of the exercises, I was writing a custom string type. The exercise was simply looking for basic constructors and operators, but I of course wanted to provide a full class. The only snag I ever really hit was in that I couldn't pass my type through ... without having to retrieve the internal char*.
You can do this in C#:

void MyMethod(params string[] names)
{
    foreach (string name in names)
    {
         Console.WriteLine("The Name is:{0}.",name);
    }
}

MyMethod("bob", "tom", "harry");
MyMethod("bob", "tom");
MyMethod("bob");

Furthermore you can do:

void MyMethod(params MyThing[] objects)
{
    foreach (MyThing obj in objects)
    {

    }
}


thezombiecow

Quote

void MyMethod(params string[] names)
{
    foreach (string name in names)
    {
         Console.WriteLine("The Name is:{0}.",name);
    }
}

MyMethod("bob", "tom", "harry");
MyMethod("bob", "tom");
MyMethod("bob");

I'd play that game!

monkey0506

That's interesting to know. Thanks for the input Lemmy.

As far as the foreach, does it support a way of getting the key (like PHP's foreach does)?

Just for the record, I've also thus far stuck with C++ because "see-sharp" is a very silly name for a programming language. :P

Wonkyth

Thanks you guys!
I'll probably stick with C# for the moment, though I'm planning on learning C++/C at some point, but I'll have to see, as this is currently only a hobby( It wont necessarily stay that way, as I haven't chosen Career-Path as of yet).
A friend  of mine likes to use a language called Lazarus, I think its supposed to be  "Free Delphi" or something. I think it still has alot to work on, as I don't think its hit its first version yet. Does anyone here use it?

One other thing, for all the helpful advice, My original question hasn't yet been answered.

Also, it should actually be "C-Hash", as the vertical lines on a sharp symbol are not diagonal.
"But with a ninja on your face, you live longer!"

SMF spam blocked by CleanTalk