Having trouble with Masks

Discuss game box design and sharing.

Moderators: Ichibrothers, Cambronne

Post Reply
User avatar
spearjr
Posts: 13
Joined: 02 Aug 2007, 16:35
Contact:

Having trouble with Masks

Post by spearjr »

Hello,

I'm trying to make some hex counters and having trouble with the code. (I think).

Here is my gamebox.xml file code:

Code: Select all

<?xml version="1.0" encoding="windows-1252" ?>
<game-box 
	name="Hacienda"
	description="Hacienda by Wolfgang Kramer"
	copyright="Hans im Gluck and RGG"
	startup-scenario="dummy.zts"
	icon="icon.bmp">
	<map name="02-twisted-dogbone" image-file="map_02_asymmetrical.jpg" resolution="150 dpi" />

	<counter-sheet name="Green Counters"
		front-image-file="counters_green.png" front-resolution="150 dpi"
		front-mask-file="counters_mask.png"></counter-sheet>
</game-box>
Contents of my zummy.zts file:

Code: Select all

<?xml version="1.0" encoding="Windows-1252"?>
<game
	game-box="Hacienda"
	scenario-name="dummy"
	scenario-description="trial 1"
	scenario-copyright="VaeVictis - Histoire & Collections 2006">
	<layout board="02-twisted-dogbone"/>
	<layout board="Green Counters"/>
	<layout board="Wheel"/>
</game>
Here are the two images:
Image
Image

Ok, perhaps I just need to add some more black space at the top and bottom?
User avatar
Jerome
Site Admin
Posts: 974
Joined: 22 Jun 2006, 21:31
Location: France
Contact:

Post by Jerome »

Welcome spearjr!

I see that you sent a crash report a few minutes before you wrote this message. Good idea! :wink:
According to the report the size of your mask image was wrong. Mask images must have the same width and height as the counter sheet image.

This is puzzling because the images in your message have the same size: 240x48 pixels. :?
I don't understand what happened. Your XML files look fine. Are you sure the images in your game box are identical to the ones you posted?

Could you please send me the whole game box by mail so I can investigate? My address is dev...zuntzu.com (follow link to reveal).
Last edited by Jerome on 20 Aug 2007, 12:41, edited 2 times in total.
Jerome, ZunTzu developer.
User avatar
Jerome
Site Admin
Posts: 974
Joined: 22 Jun 2006, 21:31
Location: France
Contact:

Post by Jerome »

Hold on! There's a "Wheel" board missing from your game-box.xml file.
Could it be the cause of the problem?
Jerome, ZunTzu developer.
User avatar
spearjr
Posts: 13
Joined: 02 Aug 2007, 16:35
Contact:

Post by spearjr »

Jerome wrote:Hold on! There's a "Wheel" board missing from your game-box.xml file.
Could it be the cause of the problem?
I did have the wheel in the .xml file I just removed it to keep the file simple. I was concerned that I was doing something wrong with the images themselves, so I was trying to use ones that you'd provided. I just forgot to remove it from the .zts as well. But I do not believe this is the problem. (See below.)
Jerome wrote:Welcome spearjr!

I see that you sent a crash report a few minutes before you wrote this message. Good idea! :wink:
According to the report the size of your mask image was wrong. Mask images must have the same width and height as the counter sheet image.

This is puzzling because the images in your message have the same size: 240x48 pixels. :?
I don't understand what happened. Your XML files look fine. Are you sure the images in your game box are identical to the ones you posted?

Could you please send me the whole game box by mail so I can investigate? My address is developer at followed by zuntzu dot com.
The files I posted were after the crash report. When the counters were not behaving like counters, I was worried that only 1 pixel between the white areas on the mask was insufficient, so I moved them around to 5 pixels. I only did it on the green and the mask as a test, but I forgot to remove the other colors from the .zts file. So that is the cause for the crash, which I fixed.

I believe I figured out my error. I looked at the poker file for help and saw it was using masks. I then saw that I still need to list the card section information with coordinate information. Now that I realize this, it seems obvious, I never told the program how big the counters were, I was stupidly hoping that the mask file would do it for me. Oops.
User avatar
spearjr
Posts: 13
Joined: 02 Aug 2007, 16:35
Contact:

Re: Having trouble with Masks

Post by spearjr »

Update:
I've got it working now.
User avatar
Jerome
Site Admin
Posts: 974
Joined: 22 Jun 2006, 21:31
Location: France
Contact:

Post by Jerome »

spearjr wrote:Now that I realize this, it seems obvious, I never told the program how big the counters were, I was stupidly hoping that the mask file would do it for me. Oops.
No. Not stupid at all. Au contraire.
The current mask doesn't replace the coordinates grid. It simply indicates which pixels should be displayed and which ones should not.
However I've had a conversation recently with another user about an algorithm that would infer the location of the counters from the mask only. There will be no need for coordinates. So you see, you were just a few versions early! :)
Jerome, ZunTzu developer.
Post Reply