Live data from Hacker News

Show HN: Strife, a 2D game library for Go

github.com

11–20 of 48 posts

Re: Show HN: Strife, a 2D game library for Go

#11
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

>? I'm generally curious because I figured Golang would be a no-go due to the GC...

Huh? Tons of GC languages are used for games. Heck, web games use JS. Not to mention the whole C#/Unity thing that even powers AAA games...

Re: Show HN: Strife, a 2D game library for Go

#12
post #11
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

> ? I'm generally curious because I figured Golang would be a no-go due to the GC... Huh? Tons of GC languages are used for games. Heck, web games use JS. Not to mention the whole C#/Unity thing that even powers AAA games...

Yeah that's true but I disagree it's a good idea. Most AAA shops still use non-GC languages because they need the full control/cannot waste ms on random GC pass.

Re: Show HN: Strife, a 2D game library for Go

#13
post #5
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

Go’s GC is extremely low latency and you can pretty easily avoid allocating using the same techniques as you would in C++.

You can't avoid allocating using the same techniques as in C++. In Go you have to know the intricacies of escape analysis to avoid allocation: objects are heap allocated "by default" and sometimes optimized to be stack allocated. In C++ there is no implicit heap allocation and usually no need for escape analysis.

As a practical example, capturing variables in a closure will usually cause them to be heap allocated in Go, but in C++ capturing has no effect on variable storage.

Re: Show HN: Strife, a 2D game library for Go

#14
post #11

Earlier quoted context omitted.

> ? I'm generally curious because I figured Golang would be a no-go due to the GC... Huh? Tons of GC languages are used for games. Heck, web games use JS. Not to mention the whole C#/Unity thing that even powers AAA games...

Yeah that's true but I disagree it's a good idea. Most AAA shops still use non-GC languages because they need the full control/cannot waste ms on random GC pass.

Game dev here. Unless you are making GTA or some high fidelity 3D game. You are wasting your time using a language like C++. You are going to spend more time dealing with memory than actually making your game which is pointless in a 2D game.

Re: Show HN: Strife, a 2D game library for Go

#15
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

The biggest problem with doing CPU-intensive work in Go is not the latency of the GC but rather the lack of maturity of the optimization pipeline compared to GCC and LLVM, the lack of good support for things like SIMD, the relatively poor throughput of the GC, the large overhead of cgo (which matters quite a lot for graphics!), etc.

Re: Show HN: Strife, a 2D game library for Go

#16
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

The current Go is great for writing a 60fps game server. The pauses are very low, and the qualities that make it great for a server also make it great for a game server.

I'm close to implementing hot code update -- in my Go game servers!

Re: Show HN: Strife, a 2D game library for Go

#17
post #11
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

> ? I'm generally curious because I figured Golang would be a no-go due to the GC... Huh? Tons of GC languages are used for games. Heck, web games use JS. Not to mention the whole C#/Unity thing that even powers AAA games...

Once you get past a certain point of developing a complex game in Unity, one of the optimization techniques is to keep runtime allocations at 0 bytes in order to prevent a GC pause from ever happening. This was a huge pain back when Unity was on Mono 2.10.8 (released Dec 2011) but it's a bit better now.

It's a fight against the GC typically

Re: Show HN: Strife, a 2D game library for Go

#18

It's great to see things happening in the Golang/2D gaming space, but having looked at your Github page and website, I have no idea what the value proposition of your framework is. There's an example featuring a text editor on the front page (how does this relate to gaming?), and nothing telling me what I'd get out of adopting Strife. Have a look at the https://phaser.io/ for an example of solid marketing around a ga…

To be honest, the project is kind of mimicking Slick2D which is a simple Java framework that introduced me into graphics programming in the first place. My kind of dream project here is to maybe make a little tutorial series on how to use the library making a small game with it. Maybe inspire a few young people to get into graphics/game programming to show how simple it is - in the go domain specifically. The library…

Honestly, I’d love to see a project like GoRails but for game programming, maybe with quarterly topics on eg making a FPS, RTS, etc. I would definitely pay a subscription for that.

Re: Show HN: Strife, a 2D game library for Go

#19
post #4

Rendering text at 60fps is a far cry from rendering a dynamic scene at 60fps. Any examples of this being used for something non-trivial? I'm generally curious because I figured Golang would be a no-go due to the GC...

The biggest problem with doing CPU-intensive work in Go is not the latency of the GC but rather the lack of maturity of the optimization pipeline compared to GCC and LLVM, the lack of good support for things like SIMD, the relatively poor throughput of the GC, the large overhead of cgo (which matters quite a lot for graphics!), etc.

I didn’t realise that Go didn’t use LLVM when Swift a much complex language uses it. Is there any specific reason for Go not using LLVM.

Re: Show HN: Strife, a 2D game library for Go

#20
post #18

Earlier quoted context omitted.

To be honest, the project is kind of mimicking Slick2D which is a simple Java framework that introduced me into graphics programming in the first place. My kind of dream project here is to maybe make a little tutorial series on how to use the library making a small game with it. Maybe inspire a few young people to get into graphics/game programming to show how simple it is - in the go domain specifically. The library…

Honestly, I’d love to see a project like GoRails but for game programming, maybe with quarterly topics on eg making a FPS, RTS, etc. I would definitely pay a subscription for that.

you might enjoy my video series. you will probably want to skip ahead to where we set up SDL2

https://gameswithgo.org/

Post reply on HN