Jump to content

Komojo

Member
  • Posts

    9
  • Joined

  • Last visited

  1. I'm starting to decode the models for the Cape Cod expansion! I've got basically all of the model data for the first map, but I don't have the color palettes yet. The game has multiple palettes for different weather conditions and so far I only figured out the one for the first map. It think it looks pretty cool so far, though. This screenshot shows the first map from the Cape Cod expansion (with a few missing polygons I need to fix.) There's something interesting I didn't notice earlier: There's a whole island in the corner of the map that you normally can't get to! Unless there's some cheat that I'm not aware of, it's too far to get over the water so normally the player would never see it. I got all the object models to show up and I was hoping there might be something there, but unfortunately there's nothing on the island except empty roads. Now you know! For anyone else interested in hacking the data, here's where I found the model locations in the files: I don't know if there is any object data for the title screen map. I suspect it might be empty. At least, I can't find anything that looks like a player start. Bonus: If you have the Cape Cod expansion and you want to replace the player car model with an X-Wing, open SCENE02.DAT with a hex editor and edit one of the following locations: 0x11034 (map 1) 0x22476 (map 2) 0x2715a (map 3) 0x292a7 (map 4) 0x2e763 (map 5) Change 01 to E4 to set it to an X-Wing, and change it back to 01 to set it back to normal. Try setting it to something else and seeing what happens.
  2. Some technical info: The indices for the objects in the first map are in SCENE01.DAT starting at 0x11121. The header looks like this: 84002D003400 "84" is the total number of objects. "2D" is the number of moving objects, and "34" is the number of objects with multiple levels of detail. After the header are the indices for the objects. First there are moving objects, then static objects with multiple levels of detail, followed by smaller objects with one LOD. Each object ID has two bytes. The first byte determines which model is used, and the second byte defines the behavior: 0x00: Static decoration 0x10: Static decoration (multiple LODs) 0x20: Player car 0x22: Vehicle 0x62: Opponent car 0x63: Opponent car 0x27: Vehicle 0x28: Vehicle (train car?) Immediately after the header there is "0120" which refers to the player's car. If you change the 01 to something else, you can replace the player's car model, so you can drive around as a police car, a train engine, or even a large building! If someone finds the object data for the Cape Cod expansion you should be able to hack it to drive around as an X-Wing!
  3. Shouldn't take long? {Checks calendar} Well, I didn't think it would take very long, but I sort of got stuck on a technical problem and gave up temporarily. I eventually got back to it and figured out what I was doing wrong. (I was trying to decode one of the car models and the game kept overwriting some of the vertices for the windshield wiper animation, which confused the hell out of me.) Anyway, I eventually figured it out and I managed to export the rest of the models! I was able to export everything from the first map. I'm going to try to find the data for the other maps as well. I put this in a Blender file, and I was able to set up a shader to show a checkerboard pattern with two different colors. It's more accurate to the original game, but I think I like the solid-color version better. You can download the Blender file for the first map from HERE. Feel free to use it as you wish. It's slightly modified from the original data; Some polygons weren't showing up correctly because they were on the same plane as other polygons, so I moved them ever so slightly to make them visible. I also extruded the lines into 3D objects, which aren't necessarily as wide as they appear in the game. Each face has a special property that determines if it's a triangle, quad, line, or disc shape. I tried to figure out the pattern by trial and error, and I may have missed something but I think I got at least 99% of the model data. I'm having fun with this. Time to try the other maps!
  4. ^^^ I think there is a hotkey to increase the emulation speed in DOSBox. I just made some progress with the model decoding. I was able to find where all the data is for one of the models with multiple levels of detail, and now I'm going to try to load it in 3D and then find the other ones. It shouldn't take long now.
  5. If you get the models to work, try using this for the color palette:
  6. That looks pretty similar to what I have, so it seems like it should be working. Maybe double check that the file buffer has the right data (e.g. the model at 0x32F9A should start with "0B 12") In the switch statement that checks the polygon type, 0x60 is also used for lines. That's the only thing I notice that's different. I did have to do a bit of cheating to get the windows on the house to show up correctly. Unlike the terrain models, the objects sometimes have multiple polygons overlapping on the same plane, so if you just draw them normally you get a lot of "z-fighting." I wrote a function to try to detect these polygons and shift them forward slightly so they are visible. You might need to do something similar once you get the models to load correctly.
  7. I've also got a map update. I've been working independently on this and I finally got a bit further in decoding the model data. I'll upload my source code somewhere eventually. In the mean time, here are some screenshots I made showing the models: I've only decoded the first map so far. I've got information about the map tiles, but I'll just talk about the objects here. Object Data The object models use the same format as the map tiles. The objects are stored in a list where each object can be repositioned anywhere as opposed to being tile-based. There are 71 models in the first map. I got that by counting the file offsets, but I'm not sure where this number is stored. There are separate arrays in the file for each object property: X (2 bytes) Y (2 bytes) Z (2 bytes) Index (2 bytes, only the first one is used) Rotation (2 bytes, only the first one is used) The position data is located here: X: SCENE01.DAT 0x11411 Y: SCENE01.DAT 0x112d1 Z: SCENE01.DAT 0x11551 Index: SCENE01.DAT 0x11191 Rotation: SCENE01.DAT 0x11691 Here's where the model data is: I can't find the model for the railroad crossing. I think I might've seen it in an earlier version of my search algorithm, though. That's the one model that's still missing. Other Objects I was able to find most of the models, but not all of them. There are a few other special models that use a different format, such as a large barn building. Luckily, I figured out how to hack the model locations in the game so it shouldn't be too hard to find out where the data is. If you want to see one of the special models, you can move it in front of the player by modifying SCENE01.DAT with a hex editor, like so: To set the X position, go to 0x11409 and change "80 1E" to "BC 11" To set the Y position, go to 0x112C9 and change "00 46" to "00 0A" (The Z position is at 0x1154A but you don't need to change it.) This will move the barn to the same position as one of the road signs near the starting point. Now you can change the model index. The indices for the special models show up just before the regular model indices, and the one for this model is at 0x11189. Normally it's "30 10" but if you change the 30 to a different index you can change the barn to something else: Large buildings A station wagon? It shows the model but the car doesn't move. Here are all the special model indices: 0x11: Police car 0x12: Train engine 0x13: Train car 0x14: Flat train car 0x2E: Pickup truck 0x2F: Blue minivan 0x30: Police car 0x33: Barn 0x34: Black & white building 0x35: Cyan building 0x37: Station wagon 0x38: Chicken 0x39: Dead chicken Just like with the regular models, the index only uses the first 6 bits so it repeats after 64. I couldn't tell what was different about the models at first, but I just realized that all of them have multiple levels of detail. Some of the details disappear when the objects get far away. Anyway, that's what I've got so far. With this information it shouldn't be too hard to figure out where the model data is. I'm going to look for it myself, but I also thought I'd share this here in case one of you wants to take a crack at it. Also, Ross mentioned hacking the map for Eternam in his followup video...I wouldn't normally be interested in that game, but now I kind of want to do that.
  8. Thanks! Both the Python script and those color charts should come in handy. This is correct. The 'X' (0x58) is the number of vertices, and the byte just before it at 0x7669 is the number of polygons. Here's an excerpt of the model rendering code. I'll post the whole project once I get it to load the full maps. I'm also not sure where it's getting the color palette from. I just figured it out through trial & error: Here are the offsets to the models: SCENE01.DAT DATAB.DAT
  9. I just saw Ross' Test Drive 3 video and I couldn't resist the challenge of trying to extract the map data. I saw this thread and I was not surprised to find out that someone already beat me to it. It looks like you're still missing a few things, though; the maps are missing some of the models and it looks like you're getting the data from memory using a hacked DOSBox rather than loading it directly from the files? I started looking into it myself and I'm hoping to extract all of the data from the files including the extra models. The link to that Python script appears to be dead, so I decided to try to figure it out on my own, based on ripa and Veyrdite's advice. Here's what I've got so far: These are models loaded from SCENE01.DAT and DATAB.DAT. I'm halfway there but I don't have the data for the actual map layout yet. I was able to decode one of the models based on Veyrdite's post, then once I figured out the format I wrote a function to search the files for data that looks similar. I was able to find most of the models, but it was just a brute-force search algorithm; I don't know how the game is actually determining the file offsets when it loads the level. I was able to find a lot of non-road models this way: I found most of the models, but playing through the game I can see there are a few missing ones. I couldn't find the lighthouse, some other background buildings, the other cars on the road, or the cows. I have some ideas for how I might be able to find them. I did find some interesting quirks with the car models: * There are no polygons underneath the cars, they're just thin shells of polygons going over the top. * There are actually several huge gaps in between the polygons where you can see through the model, but it's so low-res that you can't see it in the game. * What's that gray diamond on the hood of the Diablo? Did I do something wrong when I loaded the model? Nope! If you look at the windshield, it looks like it would be made from two triangles and a quad, but they were really stingy with the polygons, and they just modeled it with two quads that stick out past the hood. The only reason it looks correct in the game is because the z-ordering makes it draw the hood over the windshield. Most of the time, anyway: Finally, I found a few errors in the Mythos model. Here's something that is hard to notice in the game but if you're obsessive-compulsive it might drive you crazy: For one thing, one of the vertices in the very front sticks out more than it should. But also, the glowing polygon for the headlights is asymmetrical! It comes out the bottom of the right headlight and the top of the left one! Anyway, that's what I've got so far. I'm going to try to decode the rest of the level data. If you could re-host that Python script it would make it a lot easier, otherwise I'll continue with the strategy of "blanking out parts of the file and seeing what happens." If anyone here wants to see my model loading code, I can upload it somewhere once I clean it up a bit. I'm using C++ and OpenGL to render the models.
×
×
  • Create New...

This website uses cookies, as do most websites since the 90s. By using this site, you consent to cookies. We have to say this or we get in trouble. Learn more.