Live data from Hacker News

Making games in Go for absolute beginners

threedots.tech

31–40 of 78 posts

Re: Making games in Go for absolute beginners

#31

I've been working on a game over the past year in Go using https://github.com/g3n/engine . I picked Go because I like the language and wanted to learn it. I picked g3n-engine because I wanted to work in 3d after making a few 2d games in the past. Making games is so much more challenging and rewarding than almost all of the work I've done for pay. There's always so much more to learn that doesn't feel like just relear…

This is great, the dificulty goes up rapidly. I only got to level 3 before quickly dying (playing on mobile Firefox)

Re: Making games in Go for absolute beginners

#32
I am a fan of Go due to the focus on simplicity in the language... but why Go for game dev? The purpose of the language was to tackle backend services previously written in C++ focusing on junior developers, not game dev.

It's not really a popular tool for the job: Python, which is a simpler language, has a much larger community of gamedev noobs. Or maybe better yet: start with Godot and GDScript

Re: Making games in Go for absolute beginners

#33

I've been working on a game over the past year in Go using https://github.com/g3n/engine . I picked Go because I like the language and wanted to learn it. I picked g3n-engine because I wanted to work in 3d after making a few 2d games in the past. Making games is so much more challenging and rewarding than almost all of the work I've done for pay. There's always so much more to learn that doesn't feel like just relear…

It's really a nice project. It's really too bad that it doesn't compile for mobiles.

It's the one point preventing large adoption of go as a gaming language I think. I haven't found a 3d lib that supports building for mobiles.

And it's really too bad, because go would be perfect for writing games.

Re: Making games in Go for absolute beginners

#34
post #32

I am a fan of Go due to the focus on simplicity in the language... but why Go for game dev? The purpose of the language was to tackle backend services previously written in C++ focusing on junior developers, not game dev. It's not really a popular tool for the job: Python, which is a simpler language, has a much larger community of gamedev noobs. Or maybe better yet: start with Godot and GDScript

> ... but why Go for game dev? The purpose of the language was to tackle backend services previously written in C++ focusing on junior developers, not game dev.

I'd say using any language for game development should be embraced, not discouraged.

Imagine if William Crowther had thought, "Why Fortran for game development? The purpose of the language is to tackle scientific computing." Thankfully, he did not think like that.

All Crowther had with him was PDP-10, Fortran, a teletype that probably looked like https://en.wikipedia.org/wiki/File:ASR-33_at_CHM.agr.jpg, some sheets of paper, and a sense of fun! Without being bothered about what these tools were really meant for, he went ahead and developed Colossal Cave Adventure thereby introducing the genre of text-based adventure games into the field of computing. A player had to type their input into the teletypewriter and wait for the computer to print the output on, well, physical paper! Still it was fun. It is nice to have fun and write games with whatever technology we have got.

Re: Making games in Go for absolute beginners

#35
post #28

While writing games in any programming language is a very rewarding experience, I have found HTML5 Canvas and JavaScript to be very effective for writing games as absolute beginners too. If sound is needed, there is Web Audio too, all available right within the web browser. It is quite possible to write simple games without using any external JS libraries by sticking to first principles only, e.g., drawing simple sha…

Seconded! Especially if you only have keyboard controls. Once you have mouse events there is no mapping between mouse position and an object in game, which makes it a bit harder. If so, you may wanna use svg. It makes it easy to handle mouse events, rendering is “free” and you can also do smooth animations with CSS. The main downside imo is that svg has more browser inconsistencies for some reason.

Example: https://loz.payload.app/

Re: Making games in Go for absolute beginners

#36
post #9
post #8

I always wondered if Go would be a good language to make a game in due to its concept of goroutines. Maybe one of these days I’ll give it a shot.

Unfortunately, garbage-collected languages have historically not been great for real-time action games. Throughput and performance can be excellent, but without control over the garbage collector pauses can wreck the experience. For any game that doesn't require smooth frames for the experience, the best language is the one you're most comfortable with (modulo some base level of game dev community) Edit: on the other…

> Unfortunately, garbage-collected languages have historically not been great for real-time action games.

I’ve heard this a lot and even parroted it myself, but in all honesty I would be surprised if this is true today. First, GC does not mean “no control at all” over GC pauses. Secondly, GC pauses are incredibly short in some languages, unless you have to deallocate a lot.

Without first-hand experience, I would assume that GC is not an issue for games today, given that you are aware of how allocations work, and you have access to a good profiler if necessary.

As usual, the best language is most likely the one with the best ecosystem (libs, tooling, docs) around the domain that you’re working in.

Re: Making games in Go for absolute beginners

#37
post #15
post #9

Earlier quoted context omitted.

Unfortunately, garbage-collected languages have historically not been great for real-time action games. Throughput and performance can be excellent, but without control over the garbage collector pauses can wreck the experience. For any game that doesn't require smooth frames for the experience, the best language is the one you're most comfortable with (modulo some base level of game dev community) Edit: on the other…

Didn't stop Notch to become rich, even with some hiccups.

Also lots of games have been written in C#/XNA.

Re: Making games in Go for absolute beginners

#38
post #37
post #15

Earlier quoted context omitted.

Didn't stop Notch to become rich, even with some hiccups.

Also lots of games have been written in C#/XNA.

Indeed, just recently I discovered that Capcom has their own .NET fork, and used it on Devil May Cry for the PlayStation.

Check their developer channel on YouTube.

Re: Making games in Go for absolute beginners

#39
post #34
post #32

I am a fan of Go due to the focus on simplicity in the language... but why Go for game dev? The purpose of the language was to tackle backend services previously written in C++ focusing on junior developers, not game dev. It's not really a popular tool for the job: Python, which is a simpler language, has a much larger community of gamedev noobs. Or maybe better yet: start with Godot and GDScript

> ... but why Go for game dev? The purpose of the language was to tackle backend services previously written in C++ focusing on junior developers, not game dev. I'd say using any language for game development should be embraced, not discouraged. Imagine if William Crowther had thought, "Why Fortran for game development? The purpose of the language is to tackle scientific computing." Thankfully, he did not think like…

[flagged]

Re: Making games in Go for absolute beginners

#40
I tend to write fireworks or simple particle simulations in a new language / graphics api to test for performance as my first step (aka learning how to place a pixel on the screen, double buffer or whatever, do some simple logic / math, and learn the compilation pipeline). It's always a fun task and an easy benchmark: how many pixels can I move per frame?

I did this in 2021 in GO and Ebitengine and I was blown away by the performance the screen was mostly white with pixels, how easy it was to get the context running, and how many pixels I could move on the screen at 60fps... I was truly impressed. I've been using this approach for the last 30 years I guess ;-) We're a long way from moving a few hundred pixels on a 16 bit CPU per frame... greybeard out

Post reply on HN