Best thing to use for 2D Games.

Discussion in 'Mac Programming' started by MorphingDragon, Nov 6, 2009.

  1. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #1
    Okay, so some of my friends and I are designing a side scrolling game as a University example. (We want to take an advanced course and we need to show previous skill) They want me to make a Mac version but I don't have enough experience to answer my question myself. Whats better for a 2D side scroller. OpenGL or Cocoa Functions like CI/QE? In terms of performance really, I don't really care how complicated the code gets.

    EDIT:

    My friends and I got accepted into one of the best Universities in New Zealand. They let you skip some 100 level papers in the second semester if you show previous skill in a C derived language. We decided to do a side scrolling 2D game and develop on our own platforms of choice. Then we decided to get John to make the core logic while Jake and I finish off designing the game. Then we would write the Graphics rendering in the local libraries (.Net/Cocoa etc). We get about a year if we start now.
     
  2. macrumors 6502

    Joined:
    Sep 18, 2009
    #2
    Just make it OpenGL, so it'll be cross-platform.
     
  3. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #3
    That doesn't matter, I'm making the Mac Version, Jakes making the Windows Version in C# and John's making the Linux Version. Its for a portfolio, the University wont care.
     
  4. macrumors 6502

    Joined:
    Sep 18, 2009
    #4
    Yeah, but it _will_ be the same game, won't it? So if all of you combine your efforts and write your game using OpenGL with, say, C/C++, you'll save lots of time.
     
  5. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #5
    OpenGL and SDL all the way.

    Doing it the way you describe seems a massive waste of time. Why implement the same thing three times when you can all use a common code base?
     
  6. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #6
    This is going to come off as being harsh, but it sounds like this is clearly demonstrating a lack of "previous skill" if you don't even know where to start. It also seems like the 3 of you should agree on a cross-platform toolchain, then you can pool your resources for making 1 solid, complete product. Right now it seems like all the time you'll be spending is on platform specific code. I'd argue that you're making 3 different games.

    -Lee

    Edit: To try to be somewhat helpful: What prior skillset are you trying to demonstrate? Algorithms? Coding a particular language? Design principles? Software engineering skills? Game design skills? It may be better to figure that out and pick a project that is better suited to those strengths. If you don't know how to program using Cocoa, and you don't know OpenGL, trying to put this together using those is not going to make your project look impressive. Even if you have a great algorithm, but the implementation is awful, they're going to see an awful implementation.
     
  7. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #7
    My last languages was VB6. The Course requirements stated a C like language. So... duh I have not a lot of previous experience. Obj-C is the only C like language I know and I only started learning/using it about half a year ago. My last program on Obj-C was an In house prototype for a law firm. So I know how to use event driven, object orientated style programming at least. I don't know whats better because I haven't done anything past Aaron Hillegass' Examples in this area.

    Wouldn't OpenAL be better than SDL for sound?..

    Actually thats an Idea, What if the whole thing was coded in OpenAL/CL*/GL. With C#/Obj-C/QT front ends?

    *I remember AMD saying that OpenCL can be used to write CPU code.
    They all have C-Like syntax, and we have a whole year to do it.
     
  8. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #8
    Each comfortable on the their own respective platform no doubt.

    I'd also suggest showing some programming and team skills by doing cross-platform game code.

    Each one of you would then do your systems specific driver. Window message handlers, Mac Cocoa View Controller and whatever is required for the LINUX GUI of choice.
     
  9. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #9
    SDL is not just for sound. It is an input library as well as other things. Given what you have said I would say stick with SDL rather than jumping into OpenAL.

    Why do you think OpenAL is "better" than SDL for sound? You won't be doing anything approaching professional audio I would imagine so basically anything will do as long as it is cross platform (which SDL is) and is easy to learn (which OpenAL is not).

    Do you need to use OpenCL? There is no point in using it just for the hell of it.
     
  10. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #10
    No, but it would be unique. You need to do anything to stand out in the world of students.
     
  11. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #11
    Well its your project but bear in mind that Mac OS X is the only platform with a production ready OpenCL implementation. Nvidia I believe have released OpenCL beta drivers for Windows and perhaps ATI have too. Linux is quite a bit behind I believe.

    Also the more time you spend learning about technologies like OpenCL is less time spent working on your game which is actually your real project. It would be pretty stupid to spend a vast amount of time implementing a clever game using OpenCL only to end up with a rubbish game because you forgot to actually save some time for designing and implementing game play.

    How about just trying to make the best game in the class?
     
  12. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #12
    ATi is the only one left in Beta on other platforms and nVidia has already released its own SDK.

    Its not a class, its a project for special admission to an advanced paper. Plus we can skip some 100 level papers. We get a year to do it.
     
  13. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #13
    Nope.

    The only drivers from Nvidia which support OpenCL are the 195 series of drivers and they are still in beta.
     
  14. macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #14
    OpenCL would be a very strange choice for game logic. I don't expect it would work very well.
     
  15. macrumors regular

    Joined:
    Sep 9, 2007
    #15
    I would have to definitely say Box2D. its all in c++ & is cross platform.
     
  16. macrumors 68040

    Joined:
    Apr 22, 2005
    #16
    You guys do understand that the purpose of OpenCL is to use GPUs for things -other- than games/graphics, right? While I guess technically it is feasible to use it for parts of game logic or physics or something, that's not really what it is intended for, and using it for that while you also have graphics for the GPU to process would probably just slow things down.

    Regular old OpenGL graphics will already be accelerated by the GPU without OpenCL being involved.
     
  17. macrumors 68000

    savar

    Joined:
    Jun 6, 2003
    Location:
    District of Columbia
    #17
    I've seen enough threads like this over the last decade, that I can confidently say there is about a 2% chance this game ever actually gets built.

    The single biggest flaw is that you're already talking about what languages to build the game (hint: languages don't make a damn bit of difference) and you haven't talked at all about what the game will be like.

    I'm not criticizing... just pointing out that we've seen this pattern before.
     
  18. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #18
    OpenCL is a general language, it is just marketed as an alternative to CUDA. It can be used to program anything that can add 2 + 2.
    In all honesty I don't care, If I did well in the Scholarship exam I can skip level 100 papers altogether. I was just asking for an opinion. But I think you're right on the money for this going down the gurgler. They chickened out of the Scholarship exam, and all it was is basic theory and experienced programming.

    I haven't done any of the planning I've just been asked to make a Mac Version. I was thinking of Making games with my sister but I'd be better off making websites for money.

    Oh and just because I can, have you ever seen an advanced 3d shooter coded in Basic?
     
  19. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #19
    OpenCL is not a language. It is an API.

    Although it did require the addition of one or two things to the C language, calling it a language is probably taking it a bit far.
     
  20. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #20
    I call openGL a language too, its just habit. I suppose I should stop it when I go to Uni.
     
  21. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #21
    My previous post was made lacking some of the details you've provided since then. If you have a whole year, this seems a lot more feasible. You really need to exercise project management and design for a long project like this. Personally, I would decide amongst the three of you whose going to be the "lead", that will deal with tracking project milestones, etc.

    You need to set up source control, plan goals along the way (a single, 1 year goal of completing a game on 3 platforms is not realistic, you need to break the tasks down), divide the tasks up, etc. There's going to be a lot more than coding required to get this project done. There's going to be a lot more project management, design, engineering, etc. to get all of the pieces put together, etc.

    There are corollary tasks for a game that may be difficult. Level design, art design, etc. which really aren't skills that come along with being a good programmer. If you have some people you know that have some of these skills (Art is probably easier than level design...), recruit them to help. Maybe ask around at the art dept. of the school to see if they have anyone that could get some credit for providing digital art for such a project.

    I would spend at least a few weeks, if not a month or so, doing nothing but planning. Researching the tech that best suits a cross-platform project like this, deciding how you can use them together, deciding the "rules" for the game, how the collision detection should work, tracking of statistics (health, score, experience, whatever you want in the game), drawing up what the UI will look like, etc.

    This sounds very ambitious, but i hope you and your friends can pull it off. Good luck!

    -Lee
     
  22. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #22
    Yeah, I have a really bad habit of doing that. :eek:
     
  23. macrumors 68040

    Joined:
    Apr 22, 2005
    #23
    Actually, no. There is a very specific type of parallel computation that can be effectively accelerated by OpenCL, and it's not a type that is normally found in game logic. Basically you need to be able to represent your computation as a kernel function applied to a matrix or vector.

    OpenCL and CUDA are only "general purpose" in the sense that you can use them to reap the benefits of massively parallel GPUs for things other than just graphics...but they still have to be parallelizable computations.
     
  24. thread starter macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #24
    OpenCL can be used to program the CPU as well. For a Sidescroller it would be overkill but not for something that has incredibly complex Physics or AI it would be an option.
     
  25. macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #25
    I'd be interested to see which (if any) AI algorithms vectorize properly. Neural nets maybe?
     

Share This Page