256x256 worldmap and 'missing corner'?

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, Chris H

Post Reply
rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

256x256 worldmap and 'missing corner'?

Post by rld » Wed Jun 23, 2010 1:57 pm

According to the documentation, and the prompts within the region map editor, if you create a 256x256 regular world map (not custom), there will be a 16x16 section 'missing' from the northwest corner.

I tried this out in the editor with a new game, importing one of the standard kits, and this appears to be the case. In the map editor, if I try to move the cursor into the (1,1)-(16,16) region, it immediately 'wraps around' as if I had moved beyond the edge of the map. So, if I have the cursor at 1,17 and I move left, it will jump to 1,256.

However, the Ultima parody game also has a 256x256 worldmap. When I look at this map in the ACK editor, I see what appears to be a different set of rules. In this case, I can move the cursor into the upper left corner, and even edit tiles, but the content is 'mirrored' between two regions. The (1,1)-(16,16) region displays the same content as the (241,161)-(256,176) chunk, and modifying one will affect the content shown in the other.

Is there a reason for this difference, or is there some map editor setting that I don't know about?

Heather Harrison
Posts: 44
Joined: Fri May 21, 2010 8:40 pm

Post by Heather Harrison » Wed Jun 23, 2010 6:35 pm

I'm making 256X256 world maps in my Ultima II remake. The way to handle this in a different way is to create a custom world map.

Note that there are only 255 possible cells, so you will have to duplicate one of the cells. The world maps I have created so far have had a lot of water on them, and there are plenty of 16X16 regions of deep water. I just duplicate one of those cells.

Use ALT-C and ALT-W to convert back and forth between normal and custom world maps.

Heather

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld » Thu Jun 24, 2010 8:40 am

Ok, I think (after experimenting a bit with the U4PART2 map and poking around the data files a little) that I have a better handle on how this works now.

'Normal' worldmaps and 'custom' worldmaps appear to be stored the same internally (as 16x16 cells); the difference between the two is how the worldmap is created and viewed.

When you create a normal worldmap, ACK populates the cells of the map starting from the lower right corner and increasing right to left in each row, sweeping from the bottom to the top of the map. So if you create a 64x64 worldmap (4 cells x 4 cells) the cell numbers will be set as shown.

Code: Select all

16 15 14 13
12 11 10 9
8  7  6  5
4  3  2  1

In the 'normal' worldmap viewer, the cell numbers are hidden, but they still exist. If you create a custom worldmap and then hit Alt+W to 'convert' it to a standard worldmap, the cell numbers do not appear to change; everything remains the same, but you can no longer view/edit the cell numbers directly.

Similarly, if you create a 'normal' worldmap and then switch over to custom mode by hitting Alt+C, you will see the default cell numbering as shown above.

This also means that it is possible to change a map's size after it has been created. Switch over to custom mode, add new cells as needed, and then switch back. All worldmaps are stored with a maximum internal size of 512 x 512 (32 cells by 32 cells), but as the documentation indicates, only 255 of those cells may be unique.

When creating a 256x256 normal worldmap, ACK populates the cells as described above, and then leaves the top-left cell undefined (as indicated in the docs and the editor). However, this is only the default setting. You can change this cell to a defined cell number, which causes it to mirror the contents of the other cell. This is what was done in the U4PART2 map; the upper left cell was set to point to cell 81.

When editing the map in the normal scrolling mode, if you move the cursor into an undefined cell, it will wrap around to the next defined area.

In the data files, the Ax file appears to contain the actual cell data (so for region 3, it would be <game>.A3). The <game>.RGN file appears to hold the ordering of the cells for all regions (along with the region names).

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop » Thu Jun 24, 2010 2:56 pm

Good stuff!
Which of you is interested in my fine wares?

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld » Thu Jun 24, 2010 5:27 pm

Of course, if you export the REGIONS.TXT file (which I didn't try until after I spent a while poking around files with a hex editor) and take a look at it, most of this is fairly obvious.

REGIONS.TXT lists out a cell map for all worldmap regions (custom or 'normal'), along with creature lists and other helpful things.

Garth lurker

Post by Garth lurker » Sun Nov 21, 2010 5:02 pm

OMFG! This cant be right. Ive been workin on calculating the dimension restraints i have to work with for creating as large a worldmap as i can and how many tiles i can actually put down on one map and I came up with a wopping huge 65,280 tiles!!!

Is this right? Surely I made a mistake somewhere

255 possible unique cells in one map...
each cell being 16 by 16 tiles...
16x16 tiles = 256 tiles
255x256=65,280!

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld » Tue Nov 23, 2010 8:32 am

Garth lurker wrote:OMFG! This cant be right. Ive been workin on calculating the dimension restraints i have to work with for creating as large a worldmap as i can and how many tiles i can actually put down on one map and I came up with a wopping huge 65,280 tiles!!!

Is this right? Surely I made a mistake somewhere

255 possible unique cells in one map...
each cell being 16 by 16 tiles...
16x16 tiles = 256 tiles
255x256=65,280!
You have it right. Another way to calculate it is that the maximum size of a worldmap (without repeating cells) is 256 by 256, but since you can only have 255 unique cells, you have to subtract 16x16=256 tiles for the 'missing corner', so the number of tiles on the map is

256 x 256 = 65536 tiles - 256 missing corner tiles = 65280.

Post Reply