dustin_00: (Default)
[personal profile] dustin_00
Almost had a working turn, but then ran into this major bug:

 //$$$$$ todo: How to Save/Restore Rnd objects in toons???

Each Toon (Heroes and Armies) gets their own dice pool at creation. Once created these are put into the archive for the rest of the game to access.

Then I saw during turn processing that the battling Toons were rolling the same value every time. Very strange.

After some exploring around the Toon dice pools I realized that serialization/deserialization of the archive process was resulting in all Toons having the same dice pool.

The fix was to save the serialized binary state of the dice pool in the Toon. When the game accesses their dice pool, the state reconstitutes the Random object, provides the next die roll in the series, then serializes that new state instead of keeping the Random object.

Now each Toon is rolling its own dice.

Onward to reporting turn results to the player!

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

dustin_00: (Default)
dustin_00

June 2022

S M T W T F S
   1234
567891011
121314151617 18
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 12th, 2025 11:30 am
Powered by Dreamwidth Studios