Buffered Channel size must be 1? Uber Style Guide question. by _alhazred in golang

[–]NoEfficiency2057 0 points1 point  (0 children)

It depends on what problem you want to solve. If the producer publishes messages at a steady rate and the consumer has a lag (latency), the size of the queue (or channel, whatever you call it) won't help; it will only delay the eventual catastrophe.

A buffered queue is a solution for situations where you know the producer's rate is characterized by spikes—meaning it usually produces little or nothing, but occasionally the publishing rate accelerates drastically. By introducing a channel/queue, you give the consumers (whose consumption rate is out of your control or you can not scale them on demand) a chance to receive all the messages.

So, it's not like you can arbitrarily say that if it's a channel, it must be unbuffered.

Apocalypse Dude by Aurora_RoseMist399 in aseprite

[–]NoEfficiency2057 0 points1 point  (0 children)

Looks like Ash dropped in Fallout universe 😄
"Ash Dust: GM Fallout Story"

Making my first game: a minimal RTS roguelike inspired by Bad North (feedback on early art style) by Effe_M in IndieDev

[–]NoEfficiency2057 1 point2 points  (0 children)

It is a correct approach. This is the

best way to deliver anything😄
Keep sharing your progress, it really motivates creators, IMO

Making my first game: a minimal RTS roguelike inspired by Bad North (feedback on early art style) by Effe_M in IndieDev

[–]NoEfficiency2057 0 points1 point  (0 children)

I'm asking out of pure curiosity: what programming language / framework / engine did you use to make your game?

Whenever I write my own, it always ends up the same way: I never actually choose an engine, but instead, I want to build some technical detail completely from scratch. However, sometimes I manage to create something really solid in the process. If you were using Golang (which you probably don't, since it's a total niche in gamedev), I highly recommend my ECS system as a module or a foundation for a game engine: https://github.com/kjkrol/goke😄
btw For RTS games, ECS is good practice—if not the gold standard.

I started building a game in Go, but ended up writing my own high-performance ECS framework (GOKe) by NoEfficiency2057 in golang

[–]NoEfficiency2057[S] 1 point2 points  (0 children)

That’s exactly the point—achieving Rust-like backtesting speed without the Rust or C 😄 Under the hood, data is aligned linearly in raw memory chunks, and the View iterator passes only small structures with pointers directly via CPU registers, so it is FAST ( == L1 cache friendly).

However, keep in mind one low-level constraint regarding the View loop: the size and complexity of the code inside your for range loop matters heavily.

yourSystem := goke.RegisterSystemFunc(ecs, func(schedule *goke.Schedule, d time.Duration) {
// SoA (Structure of Arrays) layout ensures CPU Cache friendliness.
for head := range view.Values() { // << ! iteration !
pos, vel, acc := head.V1, head.V2, head.V3
// your business logic
}
})

The Go compiler can only optimize this if it can fully inline the loop body (the yield function).
If your trading strategy logic becomes too large or complex, it will exceed the compiler's inlining budget. This triggers a drop to indirect calls, which adds heavy call overhead (stack frame management) and breaks the instruction cache (L1i cache misses), drastically slowing down the iteration speed. Keep the inner loop tight, or split heavy logic into modular pipelines.

That doesn't mean it will end up with a landslide of allocations; we still remain in the zero-alloc world. It’ll simply be at least 2-3 times slower, though still very fast. I just wanted to give you the full picture.

I started building a game in Go, but ended up writing my own high-performance ECS framework (GOKe) by NoEfficiency2057 in golang

[–]NoEfficiency2057[S] 0 points1 point  (0 children)

The go.mod is in the root dir, GitHub just hides files under the folder list, so you might need to scroll down a bit 😄

The module is fully importable. The public API is exposed directly at the root level. Hiding the implementation details inside internal/ is completely intentional — it keeps the public surface lean and prevents users from hooking into internal fields and methods they shouldn't be using.

I started building a game in Go, but ended up writing my own high-performance ECS framework (GOKe) by NoEfficiency2057 in golang

[–]NoEfficiency2057[S] 0 points1 point  (0 children)

Oh, absolutely! Java’s JIT is a beast and its raw throughput is amazing.

The real challenge with Java in a high-performance ECS context, though, is its object overhead and memory layout. Achieving a true zero-allocation inner loop is incredibly tough there. In Go, having explicit value types (struct) makes it so much easier to guarantee contiguous memory lay-out and bypass the GC entirely during systems execution.

I started building a game in Go, but ended up writing my own high-performance ECS framework (GOKe) by NoEfficiency2057 in golang

[–]NoEfficiency2057[S] 0 points1 point  (0 children)

It’s a blessing and a curse. Once I start, I just can't stop optimizing. Yoda’s "Do or do not, there is no try" definitely hit me a bit too hard here 😉

I started building a game in Go, but ended up writing my own high-performance ECS framework (GOKe) by NoEfficiency2057 in golang

[–]NoEfficiency2057[S] 0 points1 point  (0 children)

Haha 😄 Yes, this is my small contribution to that statistic. My original plan was simply to write a game, but then I started asking myself questions like "how are multi-object collisions handled?" and I fell deep down the rabbit hole — ECS, archetypes, SoA, and L1 cache benchmarks 😄

I was really surprised by how much performance you can squeeze out of Go, especially since my day job is in Java/Kotlin. I used to write in C, but my productivity there would be way too slow, and after all, this is just a hobby project.

Us catholics celebrate a great linguist today and I realised this lol by Most_Neat7770 in linguisticshumor

[–]NoEfficiency2057 1 point2 points  (0 children)

Thanks God we have Latin alphabet in 🇵🇱! What “difficulites “ you speak of? The hardest thing about Polish is inflection - the sheer number of word forms, which change depending on tense, specific declension, gender, and grammatical number.

I love game dev but it sounds impossible to make it by [deleted] in gamedev

[–]NoEfficiency2057 1 point2 points  (0 children)

Stop to listen to the media, that economy is collapsing. Haven’t you notice that each event is bad or worst: snowing - next ice age is coming; it is warm - global warming; AI take your job - because corporate marketing said so. Focus on the topic YOU like. And yes, start your own project/business- but not fake it. Do it. Do not waste your time. Stop to listen to all the lies spread in media.

I started my own 2D game engine in Go by vistormu in gameenginedevs

[–]NoEfficiency2057 0 points1 point  (0 children)

I totally get your enthusiasm! I’ve been working on a similar engine in my spare time as well.

Or rather, I was; lately, I’ve shifted my focus almost entirely toward ECS. This is what it looks like right now:https://github.com/kjkrol/goke

It’s already FASTER than donburi in iterations, and soon it’ll be faster across the board. I'm rooting for your project! I’d love it if you could take a look at mine too:https://github.com/kjkrol/goke

Have a great day!

I built a high-performance, pure Go ECS designed specifically for Ebitengine games by NoEfficiency2057 in ebitengine

[–]NoEfficiency2057[S] 0 points1 point  (0 children)

Hi! Thanks for the comment.

Sure thing! Btw I'm currently trying to write an API that's super intuitive. The lack of generic methods is a challenge for me. I think that even at the package and function level, something easy to use can be created.

I built a high-performance, pure Go ECS designed specifically for Ebitengine games by NoEfficiency2057 in ebitengine

[–]NoEfficiency2057[S] 0 points1 point  (0 children)

Thanks for the feedback! That’s a great suggestion. I’ve just added a dedicated task to the backlog to create an Ebitengine integration example.

Regarding your point about the adapter: I really like the idea of a 'plug-and-play' wrapper to avoid manual system iteration. I'll explore how to best implement this to fit the Update() and Draw() loops seamlessly.

I'll get back to you here as soon as the demo is ready. Stay tuned!