-4
\$\begingroup\$

I'm used to make my games in Java. Java is an awesome language but to launch .jar files you need a good updated JRE. So I thought: "I'm just going to make my games in C# or C++!" Unfortunely, I can't find the logic behind all those libraries like OpenGL etc.

My question is: Is it achievable to make a game in C# or C++ from scratch?(So no libraries) And where can I find any guidlines or tutorials?

Thanks!

\$\endgroup\$
7
  • \$\begingroup\$ Nah, it's impossible. You need to use some libraries. Standard library contains no GUI/graphics/sound-related stuff. I recommend you to use SDL (which is for C/C++, but I think there is a port for C#). With plugins it contains everything you need for a simple game: window, input, graphics, sound, network, file formats parsing. But for any good-quality game you need better setup. For example, I use SDL + OpenGL (+ GLEW) + OpenAL + zlib for my games. SDL is for window and input, OpenGL (and GLEW) are for graphics, OpenAL is for sound and zlib is for compression of assets. \$\endgroup\$ Dec 9 '15 at 12:30
  • \$\begingroup\$ My advice: Go and learn C++ on cplusplus.com. Then learn SDL using official wiki and some tutorials at the beginning. Also, your question is off topic for this site and probably it will be closed soon. \$\endgroup\$ Dec 9 '15 at 12:31
  • 1
    \$\begingroup\$ Re: "it's impossible" -- someone had to write those libraries. So obviously it's not impossible. \$\endgroup\$ Dec 9 '15 at 13:23
  • 7
    \$\begingroup\$ What is this "no libraries" thing I keep seeing? USE LIBRARIES! \$\endgroup\$
    – Almo
    Dec 9 '15 at 13:26
  • 1
    \$\begingroup\$ It's certainly possible, just not practical. \$\endgroup\$
    – MichaelHouse
    Dec 9 '15 at 15:15
9
\$\begingroup\$

The obvious answer to this question is to sit down and watch through the entire archive of Handmade Hero.

It is exactly what you are after. It is literally a tutorial on how to make a game from scratch, without engines or libraries. Obviously it is very long.

\$\endgroup\$
2
\$\begingroup\$

Unless you want to spend a couple of years writing your own drivers, you'll need at least a graphics library. I'm all for making things from scratch and while that can be fun, making EVERYTHING from scratch is frustrating, annoying and pointless.

The logic behind using libraries like OpenGL is to avoid complicated tedium that has a general solution and it lets you focus on the game.

As for where to learn?

This is impossible for us to answer, as there isn't just one skill that has to be gained, my advice is to start with a game idea and learn as you go.

\$\endgroup\$
2
\$\begingroup\$

Sure you can! Just, probably not very well on PC. You can pretty much forget about graphics card acceleration. To quote Patrick Hughes' answer to another question:

[PC is like the] wild west, barroom brawls and your OS is the sheriff keeping everyone from getting shot.

[...]on home PCs you have to support tens of different chipsets that have to work flawlessly against millions of programs written across the past decade or more? Personally I think that it's a miracle that the house of cards keeps standing!

As a business venture there's just too much going on there for you to be able to confidently support much more than your own PC, let alone the variety of quirks that crop up on other people's systems. But, if you're just interested in learning things about low level tricks (which in today's world only come up if you're working on drivers/middleware/APIs - things studios don't really do) and thus don't care too much about compatibility check out some of the code released from demoscenes, at ie The Great Demoscene Sourcecode Giveaway.

Or, as a technical exercise, writing a game from the ground up targeting a simple platform like Arduino is completely achievable. Since it's essentially just a flashable chip, you'll have to decide on the parameters of your game. Maybe you skip the screen and do sound only? Strange controller? It would be a good setup for getting into console development.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.