Go gamedev patterns Prerequisite ✅ Go 1.18 (we need generics) ✅ Ebitengine ✅ Legendary tolerance for my English Go gamedev overview Ebitengine vs Godot impressions Cons: ● It’s much harder to become productive ● Much smaller community ● Ebiten provides no “framework” to shape your game ● The ecosystem is not mature enough Ebitengine vs Godot impressions Pros: ● Go as a first-class language ● Full go toolchain benefits: tests, benchmarks, profiling ● You can help the ecosystem to get better You need more than just Ebitengine Ebitengine Input Nodes/ECS Res. manager Math utils Collisions Slots/signals UI Layers Camera Tiles Scripting Premium content! $$$ Some core ideas ● Port the code and ideas from Godot (C++ -> Go) ● Start from the simpler, small games ● Browse awesome-ebiten for packages and inspiration Why many Go gamedev libs are not mature? In my opinion: ● They’re created to solve a specific task at the moment of the game creation ● Most lib authors are interested in creating games, not libraries Some other issues ● Libraries don’t play well together ● It’s hard to become the #1 library Some other issues ● Libraries don’t play well together ● It’s hard to become the #1 library Vectors & Math Vec2 use cases ● Velocity, force and other vector-like units ● Simple positions, points in space (X, Y) ● Normalized (unit) vectors for directions type Vec2 struct { X float64 Y float64 } Why float64 ● Float literals in Go imply float64 type ● Go math library works with float64 ● Most ebiten APIs work with float64 Only GPU-related things may require float32 Why float64 ● Float literals in Go imply float64 type ● Go math library works with float64 ● Most ebiten APIs work with float64 Only GPU-related things may require float32 Why float64 ● Float literals in Go imply float64 type ● Go math library works with float64 ● Most ebiten APIs work with float64 Only GPU-related things may require float32 Vec2 representation kvartborg/vector uses slices to represent vectors. This is not efficient because most vectors in 2D game have exactly 2 components. Godot is open-source, you can roll the implementation based on its source code. Vec2 representation kvartborg/vector uses slices to represent vectors. This is not efficient because most vectors in 2D game have exactly 2 components. Godot is open-source, you can roll the implementation based on its source code. gmath library Vec2, radians and other gamedev math helpers. Inspired by Godot math library. Positions / data binding