The Gamer Corner
Continuing to defend your point is not an exit strategy, or else we'd be out of Iraq
chaoscat
Lost your password?

Phase 2: The Map

Phase 2: The Map – July 19, 2010 7:42 PM (edited 7/19/10 3:42 PM)
Talraen (2373 posts) Doesn't Play with Others
Rating: Not Rated
Getting the general system working is going to take a while, especially with the user management and such, but eventually this thing is going to have an interactive map feature as well. You can never start designing too early!

• The map background will be a single image, which can be tiled. The map size is independent of the image size (it will be tiled if it is larger)
• You will be able to create text elements to place on the map, which will be in a rectangular box of variable size
• You will also be able to create graphical images to place on the map, images which users can upload for this use. They can be scaled to any size
• The map can allow either free-form movement of objects, or they can snap to a grid of arbitrary size
• All objects will be movable by GMs. GMs can specify which objects players can move

Now the one big issue that will be very hard to do, but is important, is fog of war. I see three ways it could be done, and they're not mutually exclusive:
1.) Have a grid of black boxes which can be toggled on and off by a GM. The problem with this is that each one would likely have to be clicked individually, or maybe you could click and swipe over the area. However, having a more complicated interface than this may prove impossible with javascript.
2.) Allow for the creation of "fog of war" elements, arbitrarily-sized black rectangles. The problem here is that they are rectangular, which may mean you need a bunch of them to uncover a given room. However, it's better than clicking each box individually.
3.) Use a semitransparent black image that can be removed. This allows fog of war of any shape, but also requires creation of an image.

It's also worth noting that there's no practical way to stop players from peeking at the full map anyway, short of dividing it into small files, square by square. (Which is doable but will severely hamper load times.) One way or another, fog of war looks like it's going to leave something to be desired, so I'm open to ideas.

--
There is no Mythril Sword in Elfheim
Re: Phase 2: The Map – July 19, 2010 8:17 PM (edited 7/19/10 4:17 PM)
Debonair (259 posts) Lurker Extraordinaire
Rating: Not Rated
Instead of breaking it down into individual images, why not create a DM side that would have a translucent gray box over their image, then allow them to "cut out" from the gray. Figure you should be able to get points in JavaScript. Then using PHP, take the full map image, and anything outside of the "cut out" sections, fill with black. From what I recall, certain elements of PHP's image modification are fairly easy to work with. This map is the new default viewable map until the DM updates the cutout. This maps the map modification occur server side which means that unless the players get access to the original image location, they only see what the DM wants them to

Re: Phase 2: The Map – July 19, 2010 8:34 PM (edited 7/19/10 4:34 PM)
Talraen (2373 posts) Doesn't Play with Others
Rating: Not Rated
Two reasons: first, if the map is tiled, this wouldn't work unless I arranged the (very small sized) tiles into one (very large) image file. Also, players would need to re-download the full map each time it was changed, which when we're talking about a 3000x3000 image (which is entirely possible for this) gets ridiculous fast.

--
There is no Mythril Sword in Elfheim
Re: Phase 2: The Map – July 20, 2010 1:03 PM (edited 7/20/10 9:03 AM)
Cuzzdog (1522 posts) Head of Gamer Corner R&D
Rating: Not Rated
As for the fog of war option, I would go with option 1, but make it less painful to get rid of the fog of war. For instance, you could implement "tools" that removes the fog in a shape (like a 20' radius circle for torches). You could also allow for click and drag tile removal (Click once, drag the mouse over 5 tiles, all 5 tiles disappear).

Two questions:

1) Do you plan on implementing a zoom feature to your map?
2) When you say:
Someone wrote...
You will also be able to create graphical images to place on the map, images which users can upload for this use. They can be scaled to any size

Does this mean a player can upload any funny shaped image (say 22X13) and that image will automatically be stretched to a standard grid size (10X10, 20 X 10, 20X20...)

Re: Phase 2: The Map – July 20, 2010 1:06 PM (edited 7/20/10 9:06 AM)
Talraen (2373 posts) Doesn't Play with Others
Rating: Not Rated
To #1, no, although I suppose there's no technical reason not to have a zoom. Because of how HTML image tags scale, it would work fine. At least, it would with single images, not sure if you could do that with tiles. I'll have to look into that. (Worst case, I can always generate the image file, and hope it doesn't get too large)

As for #2, I mean you can upload any image and specify how big it is, and how you want to scale it. So if it's 22x13 you can set it to 44 pixels wide (which would make it 26 pixels high), or 44x44 (which would stretch it), or 1.5x its usual size, or set it in terms of grid tiles, or whatever.

--
There is no Mythril Sword in Elfheim
Re: Phase 2: The Map – July 29, 2010 1:05 PM (edited 7/29/10 10:01 AM)
Talraen (2373 posts) Doesn't Play with Others
Rating: Not Rated
All right, the map is now included in a mockup, so it's time to develop some features. Here's what I can think of so far, help me add to the list:

• The ability to remove creatures from the map. I'm thinking the simplest way to do this is to click and drag them to some sort of "trash" area, or use a right-click context menu
• Other context menu commands: hide creatures (from players), rotate images (really only useful if they aren't square, but you can come up with some cool stuff I guess), lock a creature in place (useful so you don't accidentally grab decorative images)
• The ability to add creatures to the map. For this, I'm thinking of a floating window that lets you select from pre-flagged icons (specified on the create game room page, which I will be mocking up at some point), or expand the list to all icons you've used in the campaign, or specify a URL of an image, or upload one. In all cases, you'll be able to specify an image size, either in pixels or grid squares. You'll also be able to choose whether the creature belongs to a player or the GM (which will be useful when players have move rights)
• The ability to center images that aren't exactly the right size. Everything I'm using now is 60x60, which is the grid size, but requiring such strict image sizing is no good, and resizing with HTML will stretch things and potentially break the aspect ratio. Fixing this is simple enough, but I'm not sure what the UI for it should be. Maybe a "resize" select that allows for "full image size," "original size," or "stretched (preserve aspect ratio)"?
• The ability to remove all creatures from the battlefield, with a confirmation so you don't do so by mistake.
• The ability to change the background map (with an option to remove all creatures as you do so). This selection would work similarly to the selection for creature icons.
• The ability to toggle text boxes identifying each creature with a name (and the ability to edit that name)
• The ability to change on the fly who has which creature moving rights, on a per-player basis or in general

--
There is no Mythril Sword in Elfheim
Re: Phase 2: The Map – July 29, 2010 1:16 PM (edited 7/29/10 9:16 AM)
Cuzzdog (1522 posts) Head of Gamer Corner R&D
Rating: Not Rated
What's the difference between Full Image Size and Original size? I also see you're planning on a stretched option, but I think a shrink option will be more handy where you can specify how many grid squares you want the image to take up.

Also, have you thought about the fog of war implementation yet, or is this still too soon to explore that?

How about an option to zoom in and out?

Re: Phase 2: The Map – July 29, 2010 1:34 PM (edited 7/29/10 9:34 AM)
Talraen (2373 posts) Doesn't Play with Others
Rating: Not Rated
Well I'll give an example. Let's say you have a 60x60 grid, and you're using a 100x80 image. If you choose a 1 square size, then "full size" makes that 60x60, squashing the image and breaking the aspect ratio. "Original size" would center the 100x80 image on a 60x60 square, and it would overflow into other squares (20 pixels on each side and 10 vertically, to be exact). "Stretch" would scale the image to 60x48, then center it in a 60x60 square, leaving six pixels of empty space at the top and bottom.

If you took the same image and put it in a 2x2 square, "full size" would stretch it to 120x120 (again breaking the aspect ratio), original size would center the 100x80 image in the square (leaving 10 pixels on each side and 20 vertically of empty space), and "stretch" would resize the image to 120x96, leaving 12 squares of empty space vertically.

Zoom is another issue entirely, as I mentioned earlier. Zooming individual elements is no problem, as I can just across-the-board scale all of their images and divs, but HTML backgrounds aren't scalable. (Actually that's not entirely true, there is a background-size in CSS3, but only Chrome actually supports it.) That said, I could make the background an actual image rather than technically a background, but then tiling the background becomes very difficult, since you can't tile non-background images in html. You can just zoom in or out on your browser, but that changes everything else and makes the jquery kind of wacky.

Fortunately, most of these issues can be addressed after the fact, so I don't need a firm decision right now.

--
There is no Mythril Sword in Elfheim
Re: Phase 2: The Map – July 29, 2010 2:30 PM (edited 7/29/10 10:30 AM)
chaoscat (452 posts) Ambassador of Good Will
Rating: Not Rated
Being able to just scale the grid size would be so vastly helpful as to completely negate any annoyance about background scaling in my opinion. I can't imagine a tiled background being game-relevant, and for atmosphere purposes, I don't think it matters if it's not in the same scale as the grid.

I'm looking at the site on my laptop right now, and the 60x60 grid is way too large - it takes up most of my available screen real estate at the moment. Besides that, while the graphics are pretty, I don't really care all that much. 30x30 would be fine for me. I know not everyone will feel this way, so scaling seems like the best option. As you've already said, customization is the key.

On that note, it'd be handy to be able to save multiple settings profiles - for example my 13" laptop screen is going to have very different settings than my 24" desktop screen.

_________________________________________________
Syllabic (4:14 PM): tozzi are you like dowd's jiminy cricket
Re: Phase 2: The Map – July 29, 2010 2:59 PM (edited 7/29/10 10:59 AM)
Talraen (2373 posts) Doesn't Play with Others
Rating: Not Rated
The GM will be able to set the grid to any size they want, regardless of scaling. Still, I see your point... I'll have to look into it.

You will definitely be able to save multiple layouts, including stuff like what's minimized, zooming, etc. I think I'll put up a few samples to load a bit later.

--
There is no Mythril Sword in Elfheim
Active Users: (none)
no users viewing | Refresh