dustin_00: (Default)
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!

Profile

dustin_00: (Default)
dustin_00

June 2022

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

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 17th, 2025 03:47 am
Powered by Dreamwidth Studios