Misc

**NOTICE: We will now use the discussion tab on the home page for all notes, this page will be phased out over time, but we will leave it in place for people to browse the history. Please only use the discussion tab on the home page.**

Displacer

*In case you missed that, tag the history tab up there to go back and see how much of this was discovered. Just don't think ill of my questions, I can't program too good ;) {eye}*

The mindless rantings of the developers...

Ok, here is the highpool nibble map with graphic and grid co-ords: Disp

{disp} Odd thing, looks like if the game is running off the hard drive, it skips the check for a valid msq header. Wonder why?
I tested this by changing a 'msq' to 'fsq' and it loaded the map just fine.

{Kay} Regarding the transition data: How does the game know which map has which map number? The map number used in the transition data has nothing to do with the map index in the gameX files. And technically they are not "map numbers". They are more like "location numbers". location 128 uses the same map as location 129 (derilict building map of quartz) but they are differnet locations. So there must be a translation table somewhere. A table which maps location numbers to maps. Is this table already found in the EXE?

{eye} Kay, I would suggest looking at the helicopter tile in the Citadel? IIRC it lets you 'fly' to a number of different maps.

{Kay} Sorry, I don't see how this answers the question. The helicopter tile is just scripted to let me choose a destination and each choice points to a different transition code. So the question stays the same: Where is the translation table which can be used to look up which location uses which map.

The map numbers are sort of an id byte. It uses this byte in a lookup table to find the correct map msq, a second lookup table for the map size (32x32, 64x64). The maps do not have names per se, the name of the map is contained in the strings for that map

{eye} Oops, misread what you wrote kay, my mistake :)
Disp, can any MSQ blocks be collapsed? Say 4 32s into 1 64? If the space used by the resultant 64 was padded to end where the 4th 32 would have ended, as long as the table lookups you mentioned reflected the map as a 64 would it work? It seems you can't create a larger number of maps than the original number to keep the lookup table the same length or smaller, but this should allow the addition of a 64x64 map at the expense of 4 32s. Any hardcoded limits on this?

{disp} I would think it would work, there is only a 1 byte entry to determine the size of a map, so I would assume you could just change this byte to reflect the size of map you want, and adjust the offset table to point correctly to the new map setup.

Also I'll get to updating the check data page, you can see some of the new data, they start with unknown, but have a entry on what it does. Used this when I was sorting out the data, and need to remove the unknown and add some other things.

Also I just came up with something that may offer a glimmer of hope to modify this game further than I had originally thought. There is a ton of code that deals solely with running the game from floppys, actually it has code to run from floppys OR the hard drive. Now I assume we have no need in this day and age for using floppys, so if we strip out all of that code, we can place some custom code of our own, or maybe use the space for new map tables, would only need to alter the code to point to our new tables and maybe be able to add more content than originally thought!

{Kay} I know the MSQ block offset lookup table at SEG2:bc7a (for game1) and SEG2:bcca (for game2). But these tables just contain offsets to the MSQ blocks in the gameX files. So the map number used in the transition code can't be an index to this offset table because the maps are not in the correct order there. Example. The MSQ offset table has the following order (for the first 10 maps in game1):

0 = Worldmap
1 = Quartz
2 = Scott's bar
3 = Stage Coach Inn
4 = Ugly's hideout
5 = Building interiors
6 = Courthouse
7 = Desert Nomads
8 = Ag Center
9 = Highpool

But the map number in the transition bytes is different. The beginning is the same but after id 7 they don't line up anymore:

0 = Worldmap
1 = Quartz
2 = Scott's bar
3 = Stage Coach Inn
4 = Ugly's hideout
5 = Building interiors
6 = Courthouse
7 = Sleeper Base Level 1
8 = Desert Nomads
9 = Ag center

Map number 12 is Las Vegas, while offset 12 in the MSQ offset table points to the MSQ block of Needles. If the map number is the offset index in the MSQ block offset table then Vegas must have a much higher index because Vegas is in game2. And when it comes to the derilict buildings then it gets even nastier: Quartz uses map numbers in the transition code with values like 130, 131, 132, 133, and so on. All of them go to the building interiors map (Map #5) but they are different locations. If I leave a party member on location 130 then I can't pick him up at 131 which uses the same map as 130. If I go back to location 130 then the party member is still there.

So there must be another mapping table. Maybe a table which maps location ids to the indices in the MSQ block offset table.

What about Ian's PHP decryptor? It generates hyperlinks for all the transitions so Ian must have such a mapping table or must have found out how it works without one. Is it possible to get the sourcecode of the PHP decryptor so I can take a look how it works?

{Kay} Just in the case, that it's still not clear what I mean, I'll try it in a different way: Just start up Ian's PHP decryptor, go to the worldmap and click the [shaft tile]. You'll see this:

So the location id in the transition code is $2b (43) but the map id the PHP decryptor links to is 118 (game 1, map 18 (which is simply offset number 18 in the game1 MSQ block offset table at SEQ2:bc7a). And my simple question is if the location of the mapping table which maps the 43 to the 18 is already known. If yes, then Ian must already use it and I hope he can tell me where it is. If no, then Ian must use his own mapping table and this means I have to do the same for now. I hope it's now clear what I mean.

{disp} Ok, something is very screwy here. Highpool has a map id of 0Ah, which doesn't line up either. It appears theres more to this than I've found so I'll see if I can hunt down whats going on with this.

Well there seems to be yet another table for the maps, so there is a offset table, a size of map table and a third, yet unknown table, the byte in this new table has 2 flags (bits 7 and 6) and a number (bits 5 - 0). Will know more soon

Ok one of the flags (or maybe both) are which GAMEx file the map is in

{Kay} Yes! I think that's it! I searched for the table with the format you mentioned and found it. It is indeed the missing mapping table. But it does not explain the derilict building stuff. But for this no map is needed: If the location id has bit 7 set and bit 6 cleared (Locations 128-191) then the Quartz building is used. When bit 7 is set and bit 6 is set (Locations 192-255) then the Las Vegas building is used. But this leaves another mystery: While location id 255 is known (Previous location) there are two more special locations: 254 and 253. When I use them the game crashes.

{disp} Seems I overwrote my last post. It appears I got my map size and GAMEx flags mixed up, as they're both 40h/80h. So I don't get mixed up, here are the tables:
Table 1 is a size of map table
Table 2 is a split byte. Bits 6 and 7 are which GAMEx file the map is in, and the lower bits 5 - 0 is the offset in table 3 to use
Table 3 is the actual offset in the GAMEx file to the map. There may be actually 2 tables, one for GAME1, the other for GAME2

Also, about the map id flag , the high bit looks like its used to force the map to be a 32x32 map. Hmmmm wonder what this is all about? Could 64x64 maps also have the ability to contain a 32x32 map within its data?

{Kay} I don't know which flag you mean. I have extracted the values from the newly found table and wrote a short script to split the values into game disk number and map ids. I have used the output to write a translation table which can be found on the Transition Data page. It fits perfectly with the mapping I figured out manually. The upper two bits seems just to describe the game disk id. 01b is disk 1 and 10b is disk 2.

{disp} I'm talking about the map id byte. Quartz for example. All the abandoned buildings use id 05, but the id has the high bit set. When this high bit is set it forces the pointer table to be at 0600h (location for a 32x32 map). What I'm thinking here is map 05 is actually a map collection, as opposed to just one map. I'm still working on sorting it out.

Heres what I have so far. If the high bit of the map id is set, it does not check the size of the map from the table, it just sets the map pointer table to 0600h, which is for a 32x32 map. It then uses the entire id in a lookup table and gets a new map id from there and continues with the load. So if the high bit is set, it appears that this flags it as not a map id, but a POINTER to a map id! How bizzare!

{Kay] Ah, shit! A wiki is not meant to do discussions. You have just overwritten my last post :-) Here it is again:

All this id stuff gets confusing. Maybe we can define "map id" as a map index in the gameX files while "location id" is the id used in the transition data? If you mean the location id then you are thinking the same as I do. All location ids which have bit 7 set are somewhat "special". The lower 6 bits are not used to refer to a map. Instead the map is hardcoded to be 05 in game1. If bit 6 is also set then the map is hardcoded to be 01 in game2 (derelict buildings in vegas). At least this is what I found out while playing with the location id byte in transition map squares. Maybe it matches what you found out by looking at the code?

Ugg yea I know. Tell ya what, there is a way we can do this by live chat here, but it is insecure as hell. Let me set it up and we'll see if that works, should only be a minute

Got it, go to the Chat page

{Kay} Maybe I'm to silly but I don't see a chat link on the whole page. Or maybe it does not work with Firefox? By the way: Why are we not just using the discussion forum functionality this Wiki provides for communication? Or maybe we could setup our own mailing list if the Yahoo group is not the right place for it? Everything is better then adding comments to a very long wiki page.

{disp} Arg, posted a link here but it got stepped on. Theres now a link at the bottom of the main page

{Ian} Hey guys, sorry I missed all of this! Kay, you're right; I created my own translation table for the ID numbers to the GAMEx and Map offsets. I don't do assembly, so I am completely lost with the actual code. You guys are welcome to all of my PHP code if you like. I'll zip it up and post it tonight when I get back from work.

{disp} Hey guys! be sure to visit the new live chat we have set up! Link is on the main page at the bottom.

{disp} Ok, we have a vote on the floor. All members give your opinion on whether to continue using this page for our messages, or switch to the "discussion" tab contained on each page. My pros and cons:
Using this page:
PRO - everything is contained in a single location, no need to go looking for new posts on each and every page.
Posts on this page show up in the changes page, posts to the discussion tab do not.
Other people have come to rely on this page for info, and just to hear our rants.

CON - Stepping on each others posts
No time/date stamp
Need to type out your name at the beginning of each post
Need to constantly delete old stuff to keep the page from getting too long

My view on this is if the posts could be kept to one and only one discussion page, then it would be a good idea, if things are going to be posted on each and every discussion for the individual pages, then no as it would take all day to list each and every page to see if a new post was made.

{Kay} My vote goes to the discussion feature. But I agree that it's better to have just ONE discussion page. Searching for new posts on all pages is nonsense (even if it's possible to enable notifications). I suggest using the one on the main page of the wiki (Because that's the one I instinctively used when I first visited this wiki) and linking it into the main navigation bar on the left. More advantages of the discussion page: Because posts don't need to be deleted, they are available forever and are searchable. Deleted stuff on the misc page is only available with a specific look on the history page (which is not searched when using the site search). Another adventage is the grouping of the discussions into topics. Here on the misc page it's sometimes difficult to see who is replying to what question.

{disp} Ok guys, after reading that interview posted on squeezins, I got the idea to search for tunnels and trolls data, as he states in that interview that wasteland uses some of the rules. Heres one listing I found, look familiar?! Especially the formula for difficulty, that formula is in the code, as is the 2d6 roll!

## #Saving Rolls

In T&T, saving rolls are used all the time to attempt anything whose success depends in large part on your attributes. A target figure must be reached by adding 2d6 to the relevant attribute. If you roll a double, you keep that score and roll again. Several doubles in a row can thus allow a character to achieve feats that would nomally be beyond him. The target figure is determined by the \*\*level\*\* of the saving roll. If the GM tells a player to make a level 1 roll on Luck ("L1SR on LK"), he must reach 20 by adding the dice roll to his LK. Level 2 is 25, level 3 30, and so on, up in 5's. Another way of figuring this out is (5 x level) + 15. Broadly speaking, only novice characters are likely to fail level 1 rolls, whereas a level 5 roll (40) might well be challenging even for a level 5 character! (There is no real connection between the two uses of the word 'level' here - it's terminology designed to confuse!)
A final rule on Saving Rolls (\*\*SR\*\*'s) is that a player fails, regardless of his attribute, if his total dice score is less than 5. Given that doubles 'add and roll over', this can only be achieved 4 ways (1-2, 2-1, 1-3, 3-1) - so a player will fail to make a 'min. 5' about 1 time in 9.

{disp} Added a live chat link on the left menu bar, icon looks kinda crappy so if anyone can find a better one, please change it!

{Ian} My vote also goes to the discussion feature. On a side note, I've uploaded a .ZIP file of the current PHP code from my website. You can download it here: http://www.enigmalake.net/wasteland/phpmap.zip

{disp} Just started digging into the 06 nibbles, Its used to run custom bits of code, and also to run the special buildings, i.e. store, doctor, etc. The custom code list is at seg:002:A4EAh, and is a sort of jump table. The words contained here are the addresses of the code to execute. Looks interesting!

{disp} I'm updating some of the graphics to a cleaner look. If you don't like the new graphics, leave a note here and go ahead and replace the original

Ok, done for now. I replaced a few graphics with clearer ones, and brightened up the background color a bit. What do ya think? (also can someone find a replacement graphic for the chat? that one is lame but its all I could find...)

{Kay} What do you think of a completely new menu: http://kayahr.wikispaces.com/. The simple design of the menu buttons is stolen from wastelands geiger counter on the right. The icons in the buttons are very simple (like the wasteland graphics) and only use the 16 EGA colors (like Wasteland). Only exception is the Maps button. I have no idea how to visualize this menu item with 16 colors so it's currently a RGB colored mini map of the Wasteland.

The "maps" menu item is confusing anyway. On my first visit I thought I can find all the maps there (because the icon was already a map of the ag center). What do you think about removing this menu item completely? Then the "files" menu item is the one and only starting point for delving into the depths of the Wasteland.

{eye} Looks good to me on the pics. My philo is that if people don't like the changes, they change them back :)
Same goes with spelling, creating new links between pages to aid navigation, etc... I do like the maps link on the main page however, as it goes right into the map structure which is what you need to know if all you want to do is a simple mod of the game that does not require new graphic tilesets or other art/items.

The progress link is VERY outdated, and could use an update. In game routines is misleading, as most of the routines are stored other places, so I'll clean it out. Maybe move progress to a link on the home page instead of the side? This should clean it up a bit. I'll rename maps to map structure. Sound reasonable?

{disp} I was going with smaller icons so we can fit more on the menu bar, I have the smaller chat icon up for now, and it looks pretty good at that size. I'll look at other icons to replace the other ones, if anyone doesn't like how it looks, please let me know before I replace them all!