Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
drygnfyre

Is it possible to change the pseudo-RNG values?

Recommended Posts

Given the release of the source code and presumably the portions of the code that determine the psuedo-RNG values, can these be changed to other numbers? I realize it would drastically change aspects of the game, but that would be the fun (for me, anyway).

Share this post


Link to post
Posted (edited)

I know for some source ports you can simply hex edit the table if you've got a hex editor, but I'm not sure if that applies to every port. Theoretically it should, you'd just have to find the 256 bytes of the EXE that store the table.

 

Give this video a watch, I've cued it up to the part relevant to your interests. Note that the addresses will change depending on port, so you're better off searching for the end sequence of 0x88 0x78 0xA3 0xEC 0xF9.

 

 

I do think it'd be a bit interesting to have a customizable RNG as a feature for an engine though.

Share this post


Link to post
2 minutes ago, Dark Pulse said:

I know for some source ports you can simply hex edit the table if you've got a hex editor, but I'm not sure if that applies to every port. Theoretically it should, you'd just have to find the 256 bytes of the EXE that store the table.

 

Give this video a watch, I've cued it up to the part relevant to your interests.

 

 

Interesting, that seems to answer my question. One thing I had long been interested in doing was modifying values in such a way that instead of having a fixed range of numbers that get picked, instead any number within a range can be picked (i.e. instead of 3, 6, 9, or 12, anything between 3-12 is picked). The idea was I wanted to make things even more random to an extent. I guess it is possible to a degree.

Share this post


Link to post
49 minutes ago, drygnfyre said:

One thing I had long been interested in doing was modifying values in such a way that instead of having a fixed range of numbers that get picked, instead any number within a range can be picked (i.e. instead of 3, 6, 9, or 12, anything between 3-12 is picked). The idea was I wanted to make things even more random to an extent.

You can do that with DECORATE.  For projectiles, instead of Damage 3, which would result in the damage being 3 * Random(1, 8), use parentheses to specify your exact formula, like this: Damage (Random(3,24)) or even better, Damage (Random(1,8)+Random(1,8)+Random(1,8)), which would give the same 3 - 24 range, but weighted so the middle numbers are more likely than the high and low ends, as if you rolled three 8-sided dice.

 

For hitscan, you need to use the FBF_NORANDOM flag to tell it to use the exact damage forumula you specify.

https://zdoom.org/wiki/A_FireBullets

Share this post


Link to post
32 minutes ago, Empyre said:

You can do that with DECORATE.  For projectiles, instead of Damage 3, which would result in the damage being 3 * Random(1, 8), use parentheses to specify your exact formula, like this: Damage (Random(3,24)) or even better, Damage (Random(1,8)+Random(1,8)+Random(1,8)), which would give the same 3 - 24 range, but weighted so the middle numbers are more likely than the high and low ends, as if you rolled three 8-sided dice.

 

For hitscan, you need to use the FBF_NORANDOM flag to tell it to use the exact damage forumula you specify.

https://zdoom.org/wiki/A_FireBullets

Cool, thanks for the info. My goal was to make a more RPG-like environment where certain weapons are clear upgrades over another (i.e. something like an auto shotgun always outputs damage in a higher range than the standard shotgun). I guess kind of like how there are weapon upgrades in Brutal Doom/Project Brutality. I'll look into this.

Share this post


Link to post
5 hours ago, Dark Pulse said:

I know for some source ports you can simply hex edit the table if you've got a hex editor, but I'm not sure if that applies to every port. Theoretically it should, you'd just have to find the 256 bytes of the EXE that store the table.

 

Give this video a watch, I've cued it up to the part relevant to your interests. Note that the addresses will change depending on port, so you're better off searching for the end sequence of 0x88 0x78 0xA3 0xEC 0xF9.

 

 

I do think it'd be a bit interesting to have a customizable RNG as a feature for an engine though.

Beaten to the punch!

Share this post


Link to post

You can edit the RNG tables in the source code and re-compile it. Works with almost everything as long as they are open source.

Share this post


Link to post

I would like to modify the random values to decrease randomness, allowing for more skill in games. Specifically to decrease the randomness to the movement of the monsters. Should I instead write my own movement functions for the monsters?

Share this post


Link to post
On 4/16/2019 at 12:27 PM, Pegg said:

You can edit the RNG tables in the source code and re-compile it. Works with almost everything as long as they are open source.

 

It should be noted that no relevant advanced port uses the RNG table for normal gameplay anymore. Even Boom replaced it with a more standard random number generator when not playing back demos and that has filtered down to nearly everything that derives from it.

 

Depending in any way on the original RNG's quirks is simply no longer a viable option with the current set of ports.

5 hours ago, Hell_Pike said:

I would like to modify the random values to decrease randomness, allowing for more skill in games. Specifically to decrease the randomness to the movement of the monsters. Should I instead write my own movement functions for the monsters? 

 

The term "Decreasing randomness" lacks context. Just altering the RNG's output does not guarantee anything because the code using these values is doing various different things with them and uses different formulas to process it. So yes, you'll have to write your own functions.

 

Share this post


Link to post
6 hours ago, Hell_Pike said:

I would like to modify the random values to decrease randomness, allowing for more skill in games.

From this post I get that you like to blame the rng for your own mistakes, doom has a pretty high skill ceiling already and the randomness adds to it cause the player has to adapt to the different situations on the spot, yet from my experience cases where you depend on rng to beat something are extremely rare, and far more rare than this forum usually suggests.

 

And for the topic, it seems what you really want is to modify the weapons, as modifying the rng table wont make a pellet be able to do 4 dmg, but yes with decorate or dehacked for classic ports you can do any weapon you want.

Share this post


Link to post

I would be interested in trying a mod which averages out the damage ranges into single, consistent, values just to see how the game feels. I'm actually surprised that hasn't been done yet, last time I checked. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×