Live data from Hacker News

Wi Flag (2002)

asheron.fandom.com

11–20 of 217 posts

Re: Wi Flag (2002)

#11

tl;dr: players get attacked based on monster targeting RNG that's supposed to take an interval [0,num_players], assign players to subintervals that are shorter or longer based on a bunch of factors, and then roll a random number somewhere in that full interval. Whoever's subinterval the number ends in, they get targetted. Instead, the code assigned subintervals and then rolled a number between 0 and 1, instead of 0 a…

> A unit test could have caught this

I've always wondered the best way to write tests for "This event should happen x% of the time."

Obviously we could re-run the test 100 times and see if it happened close to x%, but not only is that inefficient, how close is "close"? You'll get a bell curve (or similar), and most of the time you'll be close to x but sometimes you'll be legitimately far away from x and your test will fail.

You could start from a known seed, but then are you really testing the percentages, or just checking that the RNG gives you the same output for the same seed, which you already know?

Re: Wi Flag (2002)

#12

tl;dr: players get attacked based on monster targeting RNG that's supposed to take an interval [0,num_players], assign players to subintervals that are shorter or longer based on a bunch of factors, and then roll a random number somewhere in that full interval. Whoever's subinterval the number ends in, they get targetted. Instead, the code assigned subintervals and then rolled a number between 0 and 1, instead of 0 a…

Is it so important? I think this made the community and game world more interesting. It's emergent behavior. As a game developer, I hope I can make things complicated enough to have emergent behavior, even if that's just from my bugs.

Re: Wi Flag (2002)

#13
post #5

I love the "lore" that this sort of bug creates, especially in these sorts of large scale multiplayer environments. Players claiming to be cursed, and the curse was real! A very different sort of event that it reminds me of is the old World of Warcraft plague: https://en.wikipedia.org/wiki/Corrupted_Blood_incident

My theory for why people think they are being "shadowbanned" or otherwise targeted by a social media company is often because of bugs like this. They are weird and almost like gaslighting in the way you experience them and people who don't understand how these bugs can exist assume sinister motives.

Re: Wi Flag (2002)

#14

I've seen a similar mistake in a rushed "feature flagging"/phased rollout system. User IDs were random UUIDs. Let's say we want to release a feature to ~33% of users; we take the first 2 characters of the UUID, giving us 256 possible buckets, then say that everyone in the first 1/3 of that range gets the feature. So, 00XXX...-55XXX... IDs get it, and 56-FF do not. This works fine. However, if we then release another…

One easy way to avoid this problem is to give each feature its own independent space of “dice rolls” by hashing the user ids with feature-specific constants before interpreting them as dice rolls:

    feature1_enabled = hash(user_id + "-feature1") / HASH_MAX 

Re: Wi Flag (2002)

#15

What does "Wi" stand for in the stamp? Would have been better to have a flag of freshmeat.

Apocryphal but as valid as anything when it comes to MMO terminology:

https://forums.ddo.com/forums/showthread.php/264543-Wi-Flag-...

> Anyone who played Asheron's Call probably heard of the AI bug associated with monster Aggro where a person name "Wi" was forever cursed with getting the aggro no matter what.

Re: Wi Flag (2002)

#19

Why does weighted randomness seem so difficult for games? Are there any libraries that simplify this? I couldn't find any for JS. So I created my own "algorithms" for things like randomly choosing which type of plants spawn in the world. It weighs them by the local frequency of each land-type. Eg if there's more swamp nearby, it's more likely to spawn cattails. It's awful. Not intuitive. Weights have to be passed in…

In Python:

    random.choices(population=['A', 'B', 'C', 'D'],
                   weights=[3, 2, 5, 7])
https://docs.python.org/3/library/random.html#random.choices

Re: Wi Flag (2002)

#20

tl;dr: players get attacked based on monster targeting RNG that's supposed to take an interval [0,num_players], assign players to subintervals that are shorter or longer based on a bunch of factors, and then roll a random number somewhere in that full interval. Whoever's subinterval the number ends in, they get targetted. Instead, the code assigned subintervals and then rolled a number between 0 and 1, instead of 0 a…

> A unit test would have caught this, but didn't.

Unit tests for things with probability are hard. I've written one recently, and among other reasons, it convinced me to write the selection differently so it was both more 'fair' and more easily tested.

Post reply on HN