Replay code was not prepped for adding/removing RNG classes yet. Oops!
G_CompatLevel was not put on the changes from the previous commit, as we are planning on breaking all the compat for the new TA changes anyways. Just preventing this being a problem in the future.
PR_ITEM_ROULETTE is explicitly meant only for K_FillItemRouletteData, and nothing else is ever meant to use it.
May possibly be the cause of the dedicated overtime desync, but I am not convinced it is.
- TehRealSalt and Lat` are currently preoccupied, so handle their credits
- Correct some accidential copypastes of existing boilerplate into new files
- Add a handful more of mine
- Consistency for Kaito Sinclaire's online handle
Fixes several things to do with the boss healthbar.
- Makes its randomised jitter work with interp/pause
- Constantly calling the external PRNG tanks performance, at least on Windows, so this solves that too
Done as a special non-netsynced random class so the author of this commit wouldn't have to create a third suite of duplicated Random functions.
- MT_BATTLEUFO_SPAWNER args[0] is the ID
- Spawn a random UFO from the list spawner at the start of
Battle
- UFO spawns 200 units above the spawner
- After destroyig a UFO, wait 25 seconds before spawning
the next UFO (next ID in the list)
- Replaces Chao audience entirely
- Convenient, because one of the two default follower types used in the audience is Chao
- Can provide one follower, or a list of followers, on the stringarg1 (seperated by spaces/commas) and it'll pick randomly between them
- If not provided, uses the mapheader follower list
- Can provide one skincolor, or a list of skincolors, on the stringarg2 (seperated by spaces/commas) and it'll pick randomly between them
- If not provided, uses the follower's default color
- If the follower's default color is Match/Opposite or the user provides "Random" in stringarg2, pick a random skincolor
- If arg3 is set, floats in the air
- MTF_OBJECTSPECIAL in binary format
- If arg4 is set, faces the closest player
- MTF_AMBUSH in binary format
- Uses some funny mathematical tricks to avoid checking on the same frame as every other audience member at once
- Don't clamp all RNG calls to [0, FRACUNIT-1]. Only does this for P_RandomFixed now.
- Use rejection sampling for any clamped RNG calls, to remove modulo bias.
- Because of this, P_RandomRange ranges >= FRACUNIT are no longer undefined behavior.
- Added P_Random/M_Random to grab RNG output directly.
- Shuffle M_Random's RNG as well, since OS rand can be [0,INT32_MAX] instead of [0,UINT32_MAX].
- Instead of picking over numskins and adjust the number if it picks an already used skin, build and shuffle a list of allowed skins and pick over that instead.
- Fixes some issues with increased weighting towards the skins immediately after your rivals' skins.
- Use PR_RULESCRAMBLE instead of PR_UNDEFINED.
- Why am I doing it in this branch? I'm getting re-acquainted with how bots are handled between matches in advance of disabling them for bonus events without losing or corrupting data.
Previously it was using P_SetRandSeed, which sets both initial and current seed to the same thing, since it's meant for level load init. It first set all RNG seeds to the current seed, and then it set all of the seeds to their initial value. The comment about this just says its "stupid and hacky", and I have no idea how it even worked before.
Now we send over both init seed and current seed independently and set them both. Hopefully this will fix the desyncs.
P_RandomChance is now a macro for something that should happen a
certain percentage of time.
P_SignedRandom was moved to a macro. Nobody cared.
# Conflicts:
# src/p_inter.c
This actually passes most diehard tests, as opposed to the old RNG.
It's also similarly fast.
Internally the PRNG generates a fixed point number from [0,1) now,
which makes P_RandomKey and P_RandomRange much easier to
calculate. P_Random is just a simple shift, as well.
Also, the lack of floating point math in P_RandomKey and
P_RandomRange now is probably for the best.