• Welcome to SC4 Devotion Forum Archives.

Base/Overlay Textures for Puzzle Pieces

Started by ebina, July 30, 2009, 05:16:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ebina

Chrisim gave a hint of this method in his post. I just tutorial-ized his method.

This is the way to add second texture to existent part of S3D models. Although the title says puzzle pieces this method can be applied to all model based network pieces. A mod I showed in the NAM Development thread was created using this method.

Advantage of this method is that you don't need to manually combine roadway texture and sidewalk texture again and again in image editing tool to cover all possible combinations of custom sidewalks and roadways. By inserting sidewalk texture as a base texture, it can be swapped independently from roadway texture.


I use the first tile of the road WRC S curve piece in this tutorial. Copy an S3D file you want to modify and paste it to a new blank dat. If a network piece uses separated models for each zoom level it would be better to pick a model for zoom 5 (usually the eighth digit of instance ID (IID) assigned for z5 model is 4).

After copying S3D file click the copied S3D file in the left pane. In the right pane click the Anim tab (it should be opened by default, though).



Right click somewhere in the right pane and select Add Group. Now you should have the second group. You might want to give a name to a new group.

Click + of both the first group and the second group. Copy existent group's values by pressing [ Ctrl ] + [ C ], then paste it to new group by pressing [ Ctrl ] + [ V ]. (Since this S3D had only one group, all values are 0. As new group always receive 0, you don't need to copy values in this case.) Base texture and overlay texture refer to the same vertex block, index block and prim block, since they will be pasted onto the same part of model.





You need to change value of mat block to load different texture, value of mat block corresponds to group number in the Mats tab. Since lower groups always override upper groups, a base texture (sidewalk) should be set to the first group and an overlay texture (roadway) should be set to the second group.



To reduce number of procedures I gave 1 to the first group and 0 to the second group. So replacing an already defined texture in the Group 0 in the Mats tab is not needed.

Click the Mats tab. Existing texture (Group 0) should be roadway texture. Here I add a texture for the second group defined in the Anim tab. Right click and select Add texture, then right click on the new group (Group 1) and select Set texture.





Change Instance/Name dialog opened. Enter IID of a sidewalk texture to the Instance. Textures of group ID 0x1ABE787D can be used. IID I used here (0x0820000*) is the same as the medium wealth texture used for the draggable road type networks. If you wanted to adjust colors of sidewalk texture on puzzle pieces to match regular sidewalks, you would need to use new IID. If you are not sure IIDs you will assign are safe to use then please contact the NAM Team.

Name can be left blank, though, I prefer to give a name to remember what this texture is. Click OK to close dialog.



Change the Group 1 (sidewalk)'s setting to the same as this image. This is almost same as the setting used for the Maxis overpasses where heavy rail intersects with elevated networks. But disabled alpha test option since this is a base texture (this is not necessarily needed for a base texture should have no alphamap, even if you enabled this option you will not get problem). And changed the Wrap Mode to clamb.



For reference, this is the setting for the Group 0 (roadway). Since this texture is an overlay you need to check alpha test option to enable alphamap of texture.



Don't forget to click Apply button after modifying an S3D file.



If you need to modify more piece repeat the same procedures for each piece. Finally save dat and test it in the game.

This is the result.


ABC
Modified S3DA + Mas71_SideWalkTexture_01.dat (HD texture)B + SFBT Euro Road Textures Mod

As said in start of the topic I didn't use any image editing tool to combine textures. Game combines sidewalk and roadway like Lot Editor creations.

If you didn't find any errors then duplicate the dat and edit that duplicated dat for other zoom levels. Open the duplicated dat, change the eighth digit of IID by using the Reader's TGI Editor and replace IID of textures in the Mats tab. You can skip the last steps if a network piece uses only one model for all zoom levels.

Please note that this method is not for allowing model based network pieces to be wealth dependent. You need to take different method for that purpose.

If you have any questions or problems with using this method please post here.