Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

C# or C++ for 2D Game Environment?


Lee Everett

Recommended Posts

Would it be more convenient to use C# or C++ for a 2D game that has MYSQL implemented?

 

Is it better to use something such as Visual Studios/Eclipse or something like Unity? What are the advantages and disadvantages of both?

Link to post
Share on other sites

Ok, you are mixing a whole bunch of questions together.

 

Unity is a game engine. If you want to make a game, 2D or 3D, and you don't have experience with writing your own engine, yes, go with Unity. In that case, you are locked into C#.

 

VS and Eclipse are IDEs. Visual Studio also comes with its own compilers for C++ and C#. If you want to make a game with Visual Studio from scratch, you'll have to write your own game engine. See above.

 

 

If you are planning to write your own game engine, you really shouldn't have a question in your mind about C++ vs C#. They are completely different languages with very different strengths and weaknesses. In general, you loose too much performance writing in pure C# to be worth it. But it's very easy to write a hybrid engine using C# with either C or C++ in performance-critical parts of your code. This is particularly useful for a simple game produced by a small team, as it can save a ton of time on debugging if done right. And so long as only top level code runs in C#, the performance impact is negligible.

 

There are games out there written in pure C# simply because they don't need exceptional performance. Usually, however, they run through something like XNA that takes on some of the heavy lifting with graphics.

 

 

But again, based on the fact that you're asking this question, you should probably just go with Unity and C#. You'll save yourself a lot of tears.

  • Like 1
Link to post
Share on other sites

Can you recommend any good books in C# for game development?

 

 

Ok, you are mixing a whole bunch of questions together.

 

Unity is a game engine. If you want to make a game, 2D or 3D, and you don't have experience with writing your own engine, yes, go with Unity. In that case, you are locked into C#.

 

VS and Eclipse are IDEs. Visual Studio also comes with its own compilers for C++ and C#. If you want to make a game with Visual Studio from scratch, you'll have to write your own game engine. See above.

 

 

If you are planning to write your own game engine, you really shouldn't have a question in your mind about C++ vs C#. They are completely different languages with very different strengths and weaknesses. In general, you loose too much performance writing in pure C# to be worth it. But it's very easy to write a hybrid engine using C# with either C or C++ in performance-critical parts of your code. This is particularly useful for a simple game produced by a small team, as it can save a ton of time on debugging if done right. And so long as only top level code runs in C#, the performance impact is negligible.

 

There are games out there written in pure C# simply because they don't need exceptional performance. Usually, however, they run through something like XNA that takes on some of the heavy lifting with graphics.

 

 

But again, based on the fact that you're asking this question, you should probably just go with Unity and C#. You'll save yourself a lot of tears.

Link to post
Share on other sites

No, sorry. I would ask around on Unity forums.

  • Like 1
Link to post
Share on other sites

Would it be more convenient to use C# or C++ for a 2D game that has MYSQL implemented?

 

Is it better to use something such as Visual Studios/Eclipse or something like Unity? What are the advantages and disadvantages of both?

https://msdn.microsoft.com/en-us/library/bb203894.aspx?f=255&MSPPError=-2147217396

 

Getting started in XNA development. XNA is the set of libraries MS put out to be used to make Xbox games(as well as phone and other win/MS based apps). It is best to use C# when doing XNA projects.

 

The site even has easy to follow tutorials for doing your first 2D/3D game.

  • Like 1
Link to post
Share on other sites
  • 3 months later...

c#, or even something like Lua (love2D is quite good). C++ is difficult to learn, and tends to sidetrack people into thinking more about the language than the actual game. What's this about MYSQL? pretty much all languages can communicate with any database. If you are looking for a database for storing userdata and stuff I'd encourage you to start simpler, and program a few simple single player or hotseat multiplayer games first. If you are looking to use it to store data locally (like save files or whatever) I'd encourage you to checkout sqlite.

Link to post
Share on other sites
  • 2 months later...

Memory isn't the only problem with C# and Java. If you're writing anything that requires heavy CPU use, you'll run into performance issues. Both of these are byte-interpreted languages running on a VM. (CRT and JVM respectively.) Both rely heavily on JIT to try and make up some of that performance difference, but Java is designed to be very portable, so there is only so much JIT can do. C# is much better in that regard, but you still aren't going to write a good, modern physics or rendering engine in C#. You'll just bottleneck on CPU really hard.

 

So pure C# or Java are only good for relatively light games. Keeping in mind that on the heavy side of "light" in this case we have games like Minecraft running on Java and Space Engineers running on C#. So it's entirely possible it's all you'll ever need. But it's important to understand why sometimes C/C++ are the only options.

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
  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.