Adding Scenarios, Hash problems, null reference

Do you need help installing or using ZunTzu? Would you like to report a bug?

Moderators: Ichibrothers, Cambronne

Post Reply
tycho216
Posts: 13
Joined: 12 Feb 2009, 19:53

Adding Scenarios, Hash problems, null reference

Post by tycho216 »

Hi,

So I made a gamebox of Memoir 44 with all the bells and whistles and have started making scenarios for it. However, whenever I make a new scenario, change it's extension to .zts, and add it to the gamebox, all of a sudden ALL my scenarios stop working. I get a reference error ... object references to a non-object.

I have been messing with this for a couple days and finally figured out that every time i add a scenario to the gamebox, I have to manually update the "hash" line in EVERY scenario to the "hash" string of text found in the one i'm adding. That's quite a pain... has anybody had troubles with this? Anyone know what's causing this or how to fix it? What is the "hash" line anyway... ZunTzu seems to have added it to my code. If i take it out, they don't work either....

Thanks,
Tom
User avatar
Jerome
Site Admin
Posts: 974
Joined: 22 Jun 2006, 21:31
Location: France
Contact:

Re: Adding Scenarios, Hash problems, null reference

Post by Jerome »

tycho216 wrote: What is the "hash" line anyway...
Hi Tom!

Here is an explanation of the "hash" statement and why it's causing you trouble.

When two players are playing a game, ZunTzu keeps exchanging data through the Internet to tell each computer what the other player is doing on the other computer. For instance, one of the computers could send a message such as this:
"the other player has moved piece #17 to position (x=1203;y=1567)".

Now if the players were using slightly different gamebox files then piece #17 could designate a different piece for the other player's computer. Strange errors could occur, that would be difficult to track or understand.

To prevent that, ZunTzu enforces that both players use identical game box files. It does that by computing a number called a 'hash' value based on the content of each game box file and by comparing both hash values. If the hash values are identical then ZunTzu knows the gamebox files are identical. If they are different then ZunTzu knows the files are not identical.

There's an additional benefit: your opponent can't cheat by marking playing cards because any change in the game box would alter the hash value.

The hash value is also used to know which gamebox to use when loading a saved game. The hash value of the game box is stored as part of the saved game file. That way you don't have to worry that you open a game file with the wrong game box.

The trouble comes when you're designing a game box and trying to reuse saved games between changes made to the game box file. Can you see why ZunTzu won't let you do that?

What you need is a conversion tool, but such a tool doesn't exist. Here is a tip though: if you haven't changed the counter sheets at all - apart from the image files or the addition of more counter sheets -, then it's OK to reuse the saved game file by opening the file with Notepad and manually changing the hash value at the beginning of the file. One more thing: don't bother changing the hash value for scenarios embedded in the game box file because the hash value is not checked for those files.
Jerome, ZunTzu developer.
tycho216
Posts: 13
Joined: 12 Feb 2009, 19:53

Thanks

Post by tycho216 »

Wow, thanks for the speedy and detailed reply, Jerome! As a new developer, I have had to learn this all by trial and error, but I think I've finally gotten the hang of it. Can I just say that this platform is AMAZING! I can take my existing games and have the freedom to expand upon them and participate in the game-design process myself. It allows me to go to a whole new level. Kudos!
Post Reply