Multiple grids Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Multiple grids « Previous Next »

Author Message
Karl Scherer (Karl)
Posted on Saturday, August 03, 2002 - 9:12 am:   

I would like to take the opportunity to thank Jeff Mallet for introducing multiple grids to
Zillions!

My newest games are prime examples of how to make
good use of this feature:

The games "Rubic's Cube" and "Banded Cube"
each use six different grids.
Here the grids are used to visualize the third
dimension (views of the sides of the cubes).

Authors, please feel free to copy any of the code.
Cheers, Karl
Keith Carter (Keithc)
New member
Username: Keithc

Post Number: 148
Registered: 8-2000
Posted on Friday, June 06, 2008 - 3:12 pm:   

I am working on a game that uses nested selection screens to launch the zrf file with an AI manipulated for that combination of selections. Because each opponent makes a selection I am including a “random” choice option as well so the human player does not have to choose for the AI opponent. In the process I learned something about the limits of a grid of positions.

1. You can’t select a position that is only one pixel wide or tall with the mouse.
2. There is at least one combination of overlapping grids where positions from both grids can still be selected.

The problem that I had was that there isn’t any way to add code to what happens when the selection is made. Select a position and launch a specific zrf file. That is it. What I decided to do was to simulate randomness by having all 1936 pixels of a 44x44 button/area be positions in a selection menu. Each of the eight possible first player choices would be assigned to 242 scattered positions each. Since clicking on the 44x44 button would select a different pixel than the last such click the results would vary with every click and appear random. The selection of a position would launch a second menu that would set up the 44x44 button for the second player.

That was where I ran into #1 above. You can’t select a position that is made up of only one pixel. It seems that part of a position’s area is taken up by its border and the border is not selectable. In the case of a 1xN or Nx1 position there is nothing left of the position to select. I was trying to use 1x1. So I tried 2x2. These 2x2 positions blanketed the 44x44 button without any gaps. Now clicking on the 44x44 button would sometimes cause a selection to be made but most of the time the mouse click had no effect. At 3x3 clicking made a selection about 2/3 of the time. Still not reliable enough. At 4x4 things were better but with each increase in target position size the results became less varied and the “random” effect seemed less random.

The solution turned out to be two 11x11 grids made up of 4x4 positions. The two grids origin points were 2 pixels apart on both the X and Y axis. I can’t be sure but is seems like this overlap created a field of 2x2 positions and clicking on the border of one reached the other. The results were that clicking almost always makes a choice and it feels random.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: