After a bit of digging in the base.scs and going around in Zmodeler 3, i finally managed to extract a map... This being Arizona or Southwest (ingame), and here's how it looks.
I think the game runs a script for the XYZ positions for the objects because the objects such as trees,bushes and other props are missing here.
Materials for the meshes exist but they are all white. The textures need to be placed on each mesh individually.
The problem here is that you don't know which mesh uses which texture... I don't know which file stores the material and texture information for the meshes...
I only used 1 texture above as a demonstration as to how the map looks.
You can also export these meshes back into the PMD format however you'd probably need to place the changes into a specific chunk of the map if you wanted to load it.
The XYZ positions for the map meshes are all positioned correctly along with the UV maps.HU 2010 Map extraction
Re: HU 2010 Map extraction
I managed to fully transfer the target range into Godot. With all the objects and properly configured textures. Later, I abandoned this project. But I can share what I remember.
Objects
So, all the objects located on the map are stored in the files named "landscape.game.sii". In this file, there are entries like `inst` and `desc`. There are others as well, for environmental sounds, particles, etc., but `inst` and `desc` are the most common.
`desc` - is a descriptor; it describes the model and its properties.
`inst` - is an instance of the object; it sets the position.
A descriptor is created once for a single object, while an object instance can be repeated an infinite number of times (as much as the engine allows). Therefore, to find all "spruce" objects of a small size, you need to search for instances by their name: "_nameless.14C3.7DB8". In each instance, there is a line:
`placement: (&427baf75, &412cddec, &c35b1020) &3f890922 (&bee7fd94; 0, &3f64367c, 0)`
`427baf75` - is the value for the X-axis.
`412cddec` - is the value for the Y-axis.
`c35b1020` - is the value for the Z-axis.
All values are in hexadecimal format.
`&3f890922 (&bee7fd94; 0, &3f64367c, 0)` - these are likely rotation parameters. Possibly a quaternion. I don’t remember exactly the order of these values, but a quaternion uses WXYZ values.
Example code:
Since there are quite a lot of objects on the map, I used Notepad++ to simplify the work. First, I found all the object descriptors. It's simple. Press `Ctrl+F`, type " model_file:" in the search bar, and click "Find All in Current Document". We get a list of objects, which we can save separately. I think this part is clear.
Next, we need to find all instances for a single object we’ve chosen, for example, "/models/trees/spruce/small.ma".
Now, let’s proceed step by step:
1. Replace the entire line `"plant_desc : _nameless.14C3.7DB8 {"` with `</description>`.
2. Replace the line `ground_color:` with `</offer>`.
3. In `Ctrl+F`, go to the "Mark" tab and insert `</description>([\s\S]*?)</offer>`.
4. Click "Copy Marked Text".
5. Paste it into a new file.
6. In the new file, remove extra lines and spaces using "Replace" (leave the field empty to create blank lines).
7. Select "Edit" -> "Line Operations" -> "Remove Empty Lines".
I spent a long time figuring this out. A very long time)) Now we have a list of coordinates for all instances of the "spruce/small.ma" object, but they are still in hexadecimal format. Converting them manually would take a very long time, and transferring the map is already a slow process. I can imagine how much time it takes to open 100+ .pmg files in ZModeler. That’s why I wrote a Python script to convert these values for me. [Link to Github]
Now, all that’s left is to sit and meticulously place each object. I don’t have a solution for this. I made a script for Godot that would load objects and set their coordinates automatically, but it had many conditions, required an .obj file, an .ini file (where everything had to be specified), etc. In any case, I deleted it. Maybe something similar can be done for Blender.
Textures and Materials
This is the pinnacle of my achievements, as I have long since fully decoded the binary .lnd format. It took me half a year, but I can confidently say that at this stage of my research, I can create/transfer a map into the game. I have everything needed for this. I also decoded the collision (pmc), not fully, but it works correctly.
So, as far as I remember, for each mesh, you can track its material and textures. Also, in this file, there are scale values. I spent a long time racking my brain: why can you see seams on the textures, even though the UVs are definitely correct. In the end, I simply scaled the UV mesh in Blender to match these values, and everything fell into place.
All scripts and decoded formats can be found on [Github]. If you have an idea for a map that would be perfect to add to the game, feel free to suggest it. Maybe it will motivate me to move forward in this direction again. Good luck!
Objects
So, all the objects located on the map are stored in the files named "landscape.game.sii". In this file, there are entries like `inst` and `desc`. There are others as well, for environmental sounds, particles, etc., but `inst` and `desc` are the most common.
`desc` - is a descriptor; it describes the model and its properties.
`inst` - is an instance of the object; it sets the position.
A descriptor is created once for a single object, while an object instance can be repeated an infinite number of times (as much as the engine allows). Therefore, to find all "spruce" objects of a small size, you need to search for instances by their name: "_nameless.14C3.7DB8". In each instance, there is a line:
`placement: (&427baf75, &412cddec, &c35b1020) &3f890922 (&bee7fd94; 0, &3f64367c, 0)`
`427baf75` - is the value for the X-axis.
`412cddec` - is the value for the Y-axis.
`c35b1020` - is the value for the Z-axis.
All values are in hexadecimal format.
`&3f890922 (&bee7fd94; 0, &3f64367c, 0)` - these are likely rotation parameters. Possibly a quaternion. I don’t remember exactly the order of these values, but a quaternion uses WXYZ values.
Example code:
Code: Select all
plant_desc : _nameless.14C3.7DB8 {
model_file: "/models/trees/spruce/small.ma"
model_anim: ""
look: default
variant: default
unique_instances: 1
is_collidable: true
}
plant_inst : _nameless.1941.88D8 {
body_desc: _nameless.14C3.7DB8
placement: (&427baf75, &412cddec, &c35b1020) &3f890922 (&bee7fd94; 0, &3f64367c, 0)
ground_color: (&3f2524c0, &3f19a221, &3f0abd3a)
ground_normal: (&ba2176f9, &3f7fadbe, &3d4d2540)
ground_point: (&427baf75, &412cddec, &c35b1020)
}
Since there are quite a lot of objects on the map, I used Notepad++ to simplify the work. First, I found all the object descriptors. It's simple. Press `Ctrl+F`, type " model_file:" in the search bar, and click "Find All in Current Document". We get a list of objects, which we can save separately. I think this part is clear.
Next, we need to find all instances for a single object we’ve chosen, for example, "/models/trees/spruce/small.ma".
Now, let’s proceed step by step:
1. Replace the entire line `"plant_desc : _nameless.14C3.7DB8 {"` with `</description>`.
2. Replace the line `ground_color:` with `</offer>`.
3. In `Ctrl+F`, go to the "Mark" tab and insert `</description>([\s\S]*?)</offer>`.
4. Click "Copy Marked Text".
5. Paste it into a new file.
6. In the new file, remove extra lines and spaces using "Replace" (leave the field empty to create blank lines).
7. Select "Edit" -> "Line Operations" -> "Remove Empty Lines".
I spent a long time figuring this out. A very long time)) Now we have a list of coordinates for all instances of the "spruce/small.ma" object, but they are still in hexadecimal format. Converting them manually would take a very long time, and transferring the map is already a slow process. I can imagine how much time it takes to open 100+ .pmg files in ZModeler. That’s why I wrote a Python script to convert these values for me. [Link to Github]
Now, all that’s left is to sit and meticulously place each object. I don’t have a solution for this. I made a script for Godot that would load objects and set their coordinates automatically, but it had many conditions, required an .obj file, an .ini file (where everything had to be specified), etc. In any case, I deleted it. Maybe something similar can be done for Blender.
Textures and Materials
This is the pinnacle of my achievements, as I have long since fully decoded the binary .lnd format. It took me half a year, but I can confidently say that at this stage of my research, I can create/transfer a map into the game. I have everything needed for this. I also decoded the collision (pmc), not fully, but it works correctly.
So, as far as I remember, for each mesh, you can track its material and textures. Also, in this file, there are scale values. I spent a long time racking my brain: why can you see seams on the textures, even though the UVs are definitely correct. In the end, I simply scaled the UV mesh in Blender to match these values, and everything fell into place.
All scripts and decoded formats can be found on [Github]. If you have an idea for a map that would be perfect to add to the game, feel free to suggest it. Maybe it will motivate me to move forward in this direction again. Good luck!
Who is online
Users browsing this forum: No registered users