Which language to learn?

Started by BlueAngel, Mon 20/09/2010 12:52:33

Previous topic - Next topic

Ryan Timothy B

Here's the 3D primitives tutorial that XNA offers. If someone could tweak that for me to use a camera matrix and a world matrix, I would give you cookies and hugs.

I'm completely lost with this example script and the viewing matrix of it all. So confused. :-\

I just want to make myself a little basic game for shits and giggles. I'm going to go off and cry now.  :'(

Clarvalon

Another vote for C#/XNA.  The XNA framework is pretty well thought out and C# has a more friendly learning curve (and much less quirks) than something like C++.  There are a handful of performance issues but they're usually not hard to work around you're not likely to be affected if just programming for Windows.   

Plus Visual Studio is excellent for debugging and refactoring code, a reason why it is hard to recommend a HTML5/Javascript combo for a beginner.

It's also possible to target platforms other than Windows and the Xbox360 using some open source projects (Silversprite, MonoXna, XnaTouch) though these only support 2D at present.  It does add some complexity to your project but it's worth the effort.
XAGE - Cross-Platform Adventure Game Engine (alpha)

GarageGothic

Maybe I'm just not very sharp in the legal department, but I really have tried my best to understand the licensing terms for Mono and yet I'm still uncertain what the deal is. From what I could gather, the Mono API is free and open source, yet in their on-line store there's the proprietary Visual Studio Mono tools and also the MonoTouch devkit that only seems to run on Mac OS X. Is the latter really a requirement for developing iPhone/iPad apps? I mean, I don't mind paying to license a useful product, but I'm not planning to buy a Mac within this lifetime.

I would be very grateful if somebody could please clarify what the terms for using Mono for a commercial product are, and what if any limitations in platform support the free version has. Thanks.

Clarvalon

Mono is free and allows you to target Windows, Mac, Linux etc.  Novell products like MonoTouch and MonoDroid (for iPhone and Android) are built upon Mono and subject to licensing.  MonoTouch is $399 for a single developer, which is quite steep but within the means of most indie developers.

There is an non-expiring evaluation version which which lets you run on the iPhone/iPad emulator, but you still need a Mac for this unfortunately.
XAGE - Cross-Platform Adventure Game Engine (alpha)

GarageGothic

Thanks for the answer, clarvalon. Mono is starting to look more and more attractive, though I'm beginning to feel that my grand plans for writing a cross-platform feature-extended (but editor-compatible) AGS runtime would be to reinvent the wheel now that you're so far into developing XAGE.

I really don't know where to go from here - there's so many creative AGS'ers writing ports, like you, or extending the engine's feature set with plugins, like Calin's been doing. It's awesome that this is happening, and I too want to take part in the community driven improvement and expansion of the engine, but it's slightly worrying that many of these advances are mutually exclusive. Doesn't help that CJ is so secretive about his vision for the future of the engine either, but I do understand he'd rather not appear to make any promises or keep being asked when a specific feature will be implemented. I digress, I know, but I just feel slightly anxious about the future of the game engine I intend to base my livelihood on for the next five years or so :)

Anyhow, many thanks for the explanation. It does suck a bit that you need a Mac OS X system to develop for Apple platforms, but I suppose I would need one to test Mac ports of my games on anyway :)

InCreator

#25
I doubt that Javascript will stick around much longer... considering how slow it is, it's showing its age.

For C#, mix it with NeoAxis Engine and its web player, and you have one helluva way to make something AAA-class. With NA, you can make a simple shooter with no coding whatsoever, and knowing any bit of C# makes you almighty.
It's free to non-commercial use, $95 for Indie License lets you sell anything that doesn't profit over $100 000, and commerical license comes at $395.

Snarky

Quote from: InCreator on Wed 06/10/2010 12:38:43
I doubt that Javascript will stick around much longer... considering how slow it is, it's showing its age.

Javascript is only becoming more and more important, and together with HTML 5 and the push from several companies to get off Flash, will almost certainly play a central role in web development for the next couple of generations at least. And Javascript optimization is a major focus for browser developers, which has led to great improvements in the last year or so.

In general, execution speed pretty much never leads to a popular programming language being abandoned (as computers get faster and compilers and runtime engines more optimized, why should it?). People have been saying that about Java for 15 years, and it hasn't happened.

Wonkyth

To Ryan and anyone else out there who might find this useful: This is a collection of the best XNA tutorials I've seen to date. They are all written by the same person, so he knows what you know when.
It may or may not solve your problem. :)
"But with a ninja on your face, you live longer!"

GarageGothic

Bookmarked! Thanks, wonkyth - only took a quick look on the front page, but just the attention to site structure make me feel this will be very useful.

Ryan Timothy B

Well I've been making some progress on my little 3D programming experiments. :P  And I'm actually enjoying XNA quite a bit.

But I have a few questions for c# / xna that I don't quite understand yet.

Here's the first question:
Code: ags

namespace WindowsGame1
{
    public class Slice
    {
         [...etc...]
    }

    public class Game1 : Microsoft.Xna.Framework.Game
    {
         Slice[,] Pizza = new Slice[10,10];

         [..etc..]


I have a class called Slice and I'm making an array called Pizza containing that class. Now from what I understand, every variable in the Slice class would act just like a struct in AGS. Correct?

How do I find out what array index that I'm accessing?

For instance if I was accessing a function within the Slice class called Boob, like so:
Code: ags
     Pizza[2, 4].Boob();


How do I find out that it was 2, 4 within the function? Without having to create 2 ints that store the indexes the moment I create the array.


Also, stupid question, how do I make a variable accessible to both of those classes? I tried declaring them outside the classes and namespace but it throws an error.

Khris

I could be completely wrong, but as far as my experience with oo-programming in general goes:

If you need to know it is element [2,4] then yes, you have to store these values in members of the instance.
Think of .ID, the AGS equivalent. Same thing. How else could you get them, and how to distinguish between [], [,], [,,], etc.?

I'm not sure about how c#/xna handles this, but with java at least you have to create the elements separately anyway. I.e. declaring an array isn't enough, you have to call the constructor method of every single element, otherwise every element points to null. As I take it you already know, that's the point where you assign the grid coordinates.

Pseudocode:
Code: ags
  public class Slice
  {
    int i, j;

    Slice(int i, int j) {   // constructor
      this.i = i;
      this.j = j;
    }
  }

  [...]

    Slice[,] Pizza = new Slice[10,10];

    for (int i = 0, i < 10; i++) {
      for (int j = 0, j < 10; j++) {
        Pizza[i, j] = new Slice(i, j);    // create actual Slice instance and write i,j while at it =)
      }
    }


You don't have to do this; it depends on what you need the coordinates for. If you want Minesweeper fields to calculate their number of surrounding bombs; why not calculate it in some other class and use the array elements purely for storage?

As for the global variable, define it as a member of another class:
Code: ags
namespace WindowsGame1
{
    public static class GV  // global variables
    {
        public static int total_number_of_boobs;
    }

    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GV.total_number_of_boobs = 22;


Like I said, all this applies to Java (I hope ;)); if something I said is wrong, please also ignore the rest of my post.

Ryan Timothy B

Yeah, that's what I was afraid of. I figured it was completely OO. Damn diddly dang it.

QuoteGV.total_number_of_boobs = 22;
And how did you know I was going to make a game with 22 boobs in it? Damn it, back to the drawing board. :P

Calin Leafshade

Hmm i would discourage the use of a global variables class.

Try to keep your globals as static members of the relevant classes.

so instead of

GV.numberofboobs;

it would be

Boob.Count;

It doesnt make a whole lot of difference but its much neater and more intuitive.

as for the pizza/slice thing I dont think you should really need to reference the position of the slice within the class.
the slice class defines a slice which has no knowledge of its position in the pizza (i.e its parent) and so it shouldnt need to rely on that information.

AGS isnt really a good example since its not fully OO but a ViewFrame doesnt know which Loop its in and a Loop doesnt know which View its in. The same should apply for italian food.


Ryan Timothy B

Interesting points there Calin. I really should organize things per class, even if only for organization.

Quote from: Calin Leafshade on Wed 03/11/2010 17:48:35
AGS isnt really a good example since its not fully OO but a ViewFrame doesnt know which Loop its in and a Loop doesnt know which View its in. The same should apply for italian food.
Well, the way I see it, Italians are bad with directions which is why you must tell them where they are. :P

Paper Carnival

My favourite feature of object orientation is polymorphism. It has made my life as a game programmer a whole lot easier. Do check that out if you don't know what it is, or ask for more information.

SMF spam blocked by CleanTalk