Garry's Mod

Garry's Mod

Orbital Friendship Cannon
ErrorM3_997 14 Sep, 2020 @ 10:44am
Consecutive beams bug
When two beams are shot in a timeframe shorter than 1 second, the first one will fail to disappear. This is likely due to both rays using the same UUID (Universally unique Identity/ID).

Why it's a 'universally' unique ID is simple. In raw code, the game needs to read an entity by its UUID first, regardless of further classifications.
If the only entity class is say, a crab zombie, you can only identify it by UUIDs.
If you have crab zombies and civilians, the game will still use the UUID first, then the mob class, then generic names, etc. Which is why you can have 10000 Miku NPCs, and 1 civilian also called "Miku" without breaking the game, because they all have different UUIDs :)

There's a similar bug in smash-hit game Minecraft, where two entities with the same UUID will also bug out the game, causing the first entity to not register its own death, as that death is registered wth its UUID duplicated entity.

A solution would be to assign a new UUID for every new instance of the OFC laser with a "random number/ random value" generator. The generator also needs to be instructed with the correct kind of value. Minecraft uses hexadecimal values (I think. Java does its math in those).
hexadecimal means there are 16 base numbers instead of 10, which is just decimal.
The French use 20 base numbers when telling time (which is a B**** to get used to, but more useful than using 10 base numbers in a 60 tick period.) 12 is dodecimal,etc.

<3 keep up the good work.
< >
Showing 1-3 of 3 comments
Foxe  [developer] 7 Jan, 2021 @ 12:32pm 
How did I miss this post? You'd think it would notify me of this kind of thing.. Thank you for the input, I'll have to look into that. Makes a lot more sense now... Now to google how to implement it...
ErrorM3_997 8 Jan, 2021 @ 5:37am 
You're welcome :D
GnomeXD 2 Sep, 2023 @ 2:04pm 
this mod sucks balls good day to you
< >
Showing 1-3 of 3 comments
Per page: 1530 50