Hacker News new | ask | show | jobs
by rezashirazian 3565 days ago
I've always advised against being introduced to programming through game development.

As much as game development is appealing and fun, the process is complicated and requires advanced knowledge of some fairly complicated algorithms even for fairly trivial games.

Also you can find yourself spending hours shuffling sprites and designing levels which is time spent not learning programming.

Also engines like Unity provide a false sense of security when infact you have no idea what's going on behind the scene and when something goes wrong you don't know where to begin and end up discouraged.

Start slow, build your foundation, learn your bits and bytes, data structures and sorting algorithms first then venture out.

9 comments

    > Start slow, build your foundation, learn your bits and bytes,
    > data structures and sorting algorithms first then venture out.
Maybe that works if you've already convinced yourself that you're going to learn to program no matter what. That certainly wasn't me, though.

In my experience, the challenge for beginners is that they lose interest and make no progress at all, not that they take some suboptimal path.

It's like picking up a guitar. You can come up with the Perfect Five-Year Roadmap and preach about how someone should first learn music theory and proper form before taking a crack at it. But for most people, that's dull and they'd never learn guitar if they had to do that before jumping in and just trying.

I think beginners should optimize for doing anything at all, and nothing should be advised against as a suboptimal route. The optimal route is the one that compels them, even if it amounts to faking it til they make it with a game framework and devoting 75% of their time to things completely unrelated to programming.

Sorting algorithms? Bits and bytes? Seriously? I started dozing off during that sentence and I've been programming in some form for at least 10 years. That's not how you're going to woo most people into programming.

> You can come up with the Perfect Five-Year Roadmap and preach about how someone should first learn music theory and proper form before taking a crack at it.

Oh come on now. That's hardly the same thing as suggesting someone could put in a few hours with a decent resource and see where they get without needing it to be in game format, for goodness sake.

I think learning to code by writing a game is perhaps not the greatest method to learn to code, and definitely not a great way to learn computer science, but it does have its advantages.

A visual feedback loop can be useful to those unfamiliar with computer concepts. Being able to think about complex algorithms with concrete examples (think graphics, physics, game state machines, dialogue scripting) can help reign in the abstract concepts.

Additionally, being exposed to multiple forms of art can be useful to find a creative outlet you may not have considered before e.g. music, art, writing, design.

That being said, I think making games is really hard. I think a lot of people want to make games and don't realize how difficult it really is. I think everyone should try it at least once.

I typically recommend Processing[0] to young hopefuls.

> Also engines like Unity provide a false sense of security when infact you have no idea what's going on behind the scene

And that's okay. Maybe that's a lesson that can only be taught the hard way. Maybe you care deeply about what is going on behind the scenes, maybe you couldn't care less.

Also, most successful games are not written from scratch. Unity and friends have had a staggering impact on the indie game industry. I wouldn't be surprised to learn that plenty of game developers have never used anything else.

I think the most important thing is that no matter what you do you should enjoy doing it. If you really want to make a game but you have no idea how to code, and you find it intimidating, maybe this is for you.

[0] https://processing.org/

Yes, processing is great. I like that it lets you explore graphically and creatively without a win/lose mentality. (Competition is highly motivating for some people, not so much for others.) If you're a Python fan, there's a Python mode for Processing [0], and if you prefer JavaScript, there's p5.js [1]

[0] http://py.processing.org/

[1] https://p5js.org/

Another engine aimed at beginners is GameMaker[0]. It's been on the rise as some successful indie 2d games were made with it. The latest offering, Hyper Light Drifter, also seems to be getting some traction.[1]

[0] http://www.yoyogames.com/gamemaker

[1] https://www.youtube.com/watch?v=nWufEJ1Ava0

I find the opposite to be true.

Sure writing an entire game is a lot of work. But starting with the typical "print "Hello world"" then looping. Then text input. Then average 5 numbers = Students quit out of boredom.

Where as inside a game you get instant visual feedback. You start possibly with a simple exiting game and start modifying. Whether it's Pong or Breakout or a simple space shooter. All of those can teach the same core elements and yet the instant visual feedback means students are far less likely to be bored and far more likely to explore other ideas.

Similarly creative coding (processing, p5.js, etc.) often go the same way. The instant visual feedback leads to excitement and exploration for many more than the "learn these 100 foundational things before you can actually do anything interesting"

I feel like you could make a distinction between "making a AAA title game" vs. "modeling game logic in a terminal".

There are a lot of great learning opportunities for building a game without a graphics layer / engine. A new developer trying to build a Tic Tac Toe game in the terminal will be exposed to some challenging but not impossible challenges that will have a wide scale application.

Plus for many people, these types of games are already a familiar domain. For people new to coding I try to encourage them to build what they know. If that's a DOS-era blackjack game, it will be much more engaging to them than trudging page to page through an algorithms book.

Don't get me wrong the materials you listed in your last sentence have their application, but the sorting algorithm section of a learn programming book / video is (while useful!) less engaging for someone looking to get hooked on a new skill/hobby/career.

I think this actually used to be easier. Back in the QBasic days, throwing some graphics up on the monitor was as easy as SCREEN 13, and then PSET, LINE, and CIRCLE away.
Processing has been mentioned upstream, and is easy enough to do most of what you put forth.

Racket is also good for this [1,2]:

    #lang slideshow
    (circle 10)
or in 3d:

    #lang racket
    (require pict3d)
    (sphere origin 1/2)
I have been in a time vortex playing with Raylib [3], a C-based game environment that is cross platform, easy to setup and comes with plenty of examples. I have modified the included game examples, and created a Windows .exe, an Android apk, and a web-based version (via Emscripten) with no hassles.

Disclaimer: I am not a gamer, but the area of games brings a lot of the things I am interested in to study. I am also interested in NetLogo for simulations and the subject of 'serious games', or 'applied games', which are not a bash on recreational gaming, but a name for games used in things like civic planning, scientific exploration, or basically simulations vs. entertainment.

I am now onto putting some long-forgotten knowledge to use again in reimplementing AI search algorithms, sorting and data structures. It is motivating. Raylib is a pretty simple, yet functional setup for me.

[1] https://docs.racket-lang.org/pict/

[2] https://github.com/ntoronto/pict3d

[3] http://www.raylib.com/

I learned programming in flash with as2 a little and then as3, and I feel that is still the easiest way to learn programming, you convert your symbols into classes and bam, in two seconds you're doing OOP, setting properties and calling methods (like play() stop()), it even helped me find the use of sines and cosines because it wasn't clear how trigonometry was useful back in school. I find it easier to learn the concrete stuff first, and then go to the abstract.
It's fairly easy now with a little Javascript and some html knowledge.
Agreed. Implementing even a trivial game like chess or Pac-man requires either a huge amount of knowledge re: programming concepts or an equally huge amount of hand-holding from the game engine and tutorials.

In fact, I would rate game programming as one of the most difficult software domains of all. I can't think of any other domain where you're immediately hit with the same level of algorithms, performance concerns, design questions, etc.

I learnt by coding games. Granted, my first games were "find a number" and some text adventures full of gotos but still. When you are young you need some reasonably fast gratification. While I was hacking at my games (one unfinished after another) I was not aware about algorithms or what did the weird ^ symbols (in pascal) actually meant. But I saw pixels move on the screen and it was magical.
I can program (mainly C++, Java, Perl, Ada, SQL) and I had difficulties to improve my weak level in Python because I had (still have) few opportunities to practice. I have followed an easy MOOC (https://www.coursera.org/learn/interactive-python-1) that uses game development. It was very motivating and a good reminder that game programming can remain simple.
I agree. Game dev is a very different way to learn to code, and one that's more accessible when you don't have specific guidance.

If you just want to do indie game dev, it's great, but it doesn't transfer and it teaches bad habits without the basis you mention in bits & bytes, data structures & algorithms.

While programming in general is highly abstract & often requires you to form a roughly analogous model of the situation in your head, game-dev programming usually involves you working directly on that model. It's very physical. Move this to that location, shrink those, animate the other, fade that out of existence. It's much easier to see the effect of your code in a game engine than through programming a sorting algorithm and logging the results to console.

For that reason, it's a great way to see if programming might be something you enjoy. It's not a great way to learn programming.

edit: apologies, I didn't see xyzzy_plugh's comment before making my own.

Games are fun. Here I'm teaching to code one without any engine stuff. Straight up programming: http://buildanappwithme.blogspot.com/2016/01/build-your-firs...