Most active commenters
  • thaumasiotes(4)
  • mwkaufma(3)
  • stavros(3)
  • jorvi(3)

←back to thread

163 points mariuz | 25 comments | | HN request time: 0.642s | source | bottom
1. mwkaufma ◴[] No.43618250[source]
On ABZÛ we ripped out multiplayer and lots of other cruft from AActor and UPrimitiveComponent - dropping builtin overlap events, which are a kind of anti pattern anyway, not only saved RAM but cut a lot of ghost reads/writes.
replies(6): >>43618358 #>>43618532 #>>43619035 #>>43619088 #>>43621863 #>>43624533 #
2. rc5150 ◴[] No.43618358[source]
Whoa! Didn't picture myself seeing a dev who worked on Abzu in the wild here on HN--I very much enjoyed that game, my thanks and high fives to your team for your work!

I'm having a kid-in-the-tunnel-meeting-Mean-Joe-Green-in-the-commercial moment, I just started my own game development journey about a week ago so it's neat getting to run across a full-on developer!

To stay on topic, I often thought how cool Abzu would have been with multiplayer but it's a good lesson to me that some features that might be desirable might also be a hindrance to some degree.

Okay, enough fanboying!

3. jayd16 ◴[] No.43618532[source]
What makes overlap events an anti-pattern?
replies(1): >>43618589 #
4. mwkaufma ◴[] No.43618589[source]
In principle it's a fine idea, but their implementation has so many footguns (race conditions, thundering herds, perf cliffs, etc) it was easier to impl your own simpler alternative.
5. thaumasiotes ◴[] No.43619035[source]
Your presence inspired me to try to look up what the circumflex on "abzû" is supposed to signify. As best I can tell, it's a marker of vowel length.

I wonder how that came to be used. It's a traditional way to distinguish eta and omega in transliteration from Greek, but it's not at all a traditional way to mark long vowels in general.

(I see that wikipedia says this about Akkadian:

> Long vowels are transliterated with a macron (ā, ē, ī, ū) or a circumflex (â, ê, î, û), the latter being used for long vowels arising from the contraction of vowels in hiatus.

But it seems odd for an independent root to contain a contracted double vowel. And the page "Abzu" has the circumflex on the Sumerian transliteration too.)

replies(2): >>43619371 #>>43625337 #
6. larstofus ◴[] No.43619088[source]
Oh, nice to see that there are real-life examples of this stuff, thank you very much :) Needless to say that I'll take a deeper look at the overlaps now :D
7. stavros ◴[] No.43619371[source]
"Abzu" is also the Greek onomatopoeia for a sneeze.
replies(2): >>43619474 #>>43622886 #
8. thaumasiotes ◴[] No.43619474{3}[source]
I was highly amused to learn that the ancient Greek verb for spitting is πτύω. (Compare English "ptooey".)
replies(2): >>43619484 #>>43619522 #
9. stavros ◴[] No.43619484{4}[source]
Yeah, and the modern is much the same ("φτύνω"). I'm sure it's onomatopoeic, and it's an amusing word.
replies(1): >>43623418 #
10. pandemic_region ◴[] No.43619522{4}[source]
Does the popular 'hawk' prefix for this also originate from ancient Greek ?
11. pwdisswordfishz ◴[] No.43621863[source]
What's a ghost read? Search engines are failing me.
replies(4): >>43621972 #>>43621981 #>>43622956 #>>43625739 #
12. dagmx ◴[] No.43621972[source]
Unnecessary reads that you can’t really control or observe well.
13. ◴[] No.43621981[source]
14. ◴[] No.43622886{3}[source]
15. mwkaufma ◴[] No.43622956[source]
Unused memory accesses thrashing cache
16. jorvi ◴[] No.43623418{5}[source]
It's funny how I can sort-of read the Dutch word in "τύν": spit "tuf" and spitting "tuffen". I can't find the etymology of it so it might be a false cognate

If it isn't a false cognate, I wonder what the function of "φ" and "ω" are..

replies(1): >>43623721 #
17. stavros ◴[] No.43623721{6}[source]
It is a false cognafe, it's not pronounced "oo", but "ee". It's just onomatopoeia, that's why it's so similar.
replies(2): >>43626724 #>>43627279 #
18. joshyeager ◴[] No.43624533[source]
Thank you for ABZÛ! My daughter has played it at least ten times. And when she wrote a letter to your team for a school project, you sent back a t-shirt and a soundtrack CD. We've listened to that CD for hours on road trips, it is a great soundtrack.
19. mananaysiempre ◴[] No.43625337[source]
Seems to be an older convention in linguistics. Romanizations of Japanese also switched from circumflexes (Tôkyô) to macrons (Tōkyō) at some point in time fairly long ago—I think the English-language Japanese journal I saw using that convention systematically was from the late 1950s, and its recent issues definitely don’t use it.

Perhaps a circumflex was easier to typeset, like with logicians switching from Ā to ¬A and the Chomskyan school in linguistics switching from X-bar and X-double-bar to X' and XP?

20. Veliladon ◴[] No.43625739[source]
There's two main things. First of all, when you load data into a register from an address in memory the CPU loads 64-byte cache lines, not words or bytes. AActor for instance is 1016 bytes. 16 cache lines. It's freaking huge.

So let's say you're going through all the actors and updating one thing. If those actors are in an array it's easy. Just a for loop, update the member variable, done. Easy, fast, should be performant right? But each time you're updating one of those the prefetcher is also bringing in extra lines, more data in the object, thinking you might need them next. So if you're only updating a single thing or a couple of things in the object on different cache lines you might really bring in 3-8x the data you actually need.

CPU prefetchers have something called stride detectors which can detect access patterns of N number of steps and stop the prefetcher from grabbing additional lines but at 16 cache lines the AActor object is way too big for the stride detector to keep up with. So you stride in gaps of 16 cache lines at a time through memory and you still get 2-3 extra cache lines after the initial access.

Secondly, a 1016 byte object just doesn't fit. It's word aligned but it's not cache line aligned and it's sure as hell not page aligned.

Best case scenario if you're updating two variables next to each other in memory the prefetcher gets both on the same cache line. Medium case scenario, the prefetcher has to grab the next line every so often. You'll get best most often and medium rarely.

Bad case scenario, the prefetcher has to grab the next cache line on the NEXT PAGE. Which only just became a thing on recent CPUs but also involves translating the virtual address of the next page to its physical page address which takes forever in data access terms. Bunch of pointer chasing, basically a few thousand clock of waiting.

The absolute worst case scenario is that the prefetcher thinks you need the next cache line, it's on the next page, it does the rigamarole of translating the next page's virtual address and you don't actually need it. You've done two orders of magnitude more work than reading a single variable for literally nothing.

So yeah. The prefetcher can do some weird ass shit when you throw weird and massive data structs at it. Slashing and burning the size down helps because the stride detector can start functioning again when the object is small enough. If it can be kept to a multiple of 64 bytes you even get page aligned again.

replies(1): >>43627531 #
21. jorvi ◴[] No.43626724{7}[source]
We pronounce it t-uh-f, as in "tough" without the o.
replies(1): >>43627306 #
22. thaumasiotes ◴[] No.43627279{7}[source]
Mandarin is 吐 /tʰu/.
23. thaumasiotes ◴[] No.43627306{8}[source]
Note that ν is an N, not a V. I think the standard transliteration of φτύνω from modern Greek would be "ftino".

(Note also that "tough" is pronounced t-uh-f /tʌf/, with nothing O-like anywhere in it.)

replies(1): >>43646450 #
24. Veliladon ◴[] No.43627531{3}[source]
*an exponent of 64 bytes

If it can be kept to a exponent of 64 bytes you even get page aligned again.

25. jorvi ◴[] No.43646450{9}[source]
I wonder if that's because of the two different ways you can spit: without windup ("tuf" sound) and with windup / breathing in ("hff-tuf" sound).