SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => General Custom Content Discussion => Topic started by: nerdly_dood on January 09, 2009, 07:16:09 PM

Title: UV map tweaking
Post by: nerdly_dood on January 09, 2009, 07:16:09 PM
A while back I tried to make a police van skin for the Maxis police van model that had less blank space in the light bar so that more of it would be red or blue light than plain gray not-light (like this:                         ) rather than more not-light than light (like this:                         ) like the Maxis police van usually has, because about the only light bars I've ever seen that are mostly just an opaque plastic box with little tiny colored lights on the ends are mostly on German police cars (http://upload.wikimedia.org/wikipedia/commons/c/c0/German_police_car_(Golf_IV_Variant).jpg) (but they're being phased out lately on newer models i think (http://farm1.static.flickr.com/24/47691854_cb5a5a89ed.jpg))- most lightbars around the world have more colored light-part than useless space in between (like this (http://www.ci.port-hueneme.ca.us/Police_Department/Police%20Car.JPG)) and many have lights all the way through (like this (http://www.seanmdavis.com/violations/Violation09022006a1.jpg))

But what to my wondering eyes did occur... ??? but the center part of the light bar (which shows up white on the Maxis police van but i'd widened the colored parts) was flipped on the front and top of the light bar and the back part was fine!
Meaning that on the top and front it looked like this:                         
The back side (and what i had meant the whole light bar to look like) was this:                        

So that's the problem with the lightbar model that I'd like to fix.

I was recently exploring various automata models and textures in Reader today and I came across the UV-map editor. &idea I soon realized that I could use it to fix the aforementioned problem with the light bar on the Maxis police van model, so I began playing around with it. I eventually found that the rectangle-thingy that affects the top and front sides of the lightbar is separate from the rectangle-thingy that affects the rear side - but three of its corners are at precisely the same location so that when i select them to move them on the texture background, the corners for the top/front and the back are moved together. The fourth corner was just very slightly offset, which enabled me to be sure that the rectangle-thingy for the back is flipped sideways and vertically (the diagonal lines helped with this finding - one endpoint for the diagonal lines happens to be at the 4th corner that was slightly offset, and the other is in the middle one of the three joined corners) which led to the discrepancy in how the texture is properly displayed.

Gawd ... I can hardly put what I'm thinking into words...  &Thk/(

What I'm trying to do is make it so that the rectangle-thingy for the top/front and the back sides aren't flipped relative to each other yet sharing the same corners in the wrong places in order to make the texture show up properly on the automata model, hence the small bits of red and blue on the wrong sides, next to larger bits of blue and red on the correct sides. In summary I've been able to separate one of the corners in the two joined rectangle-thingys, but in order to properly orient them, i have to separate the other three, which are at precisely the same locations meaning that i can't select a only one from a single rectangle-thingy at a time and move it independently from the other.

I hope that makes sense... ???

Also, is a UV map part of the FSH texture or the S3D model itself? I'd like to attach whichever one has the UV map so I can move the rectangle-thingy to a separate location in the texture so i can point out the 5 separate locations for 8 separate corners of the 2 rectangle-thingys.

My 1,000th post at SC4D! ;D

P.S. Something tells me I'm getting into advanced modding and I have almost no idea what i'm talking about... :D but at least i know enough to post what i have above.
Title: Re: UV map tweaking
Post by: buddybud on January 10, 2009, 01:53:16 AM
Quote from: nerdly_dood on January 09, 2009, 07:16:09 PM
Also, is a UV map part of the FSH texture or the S3D model itself?


The uv map is part of the s3d model. But it does control how the texture wraps around the model. You can see this by exporting the model from reader and reimporting it. The UV settings will save but not the textures.

As for the rest i have no idea. I've been struggling with it myself, but have only had to deal with flat rectangles and triangles. The settings are very uniform for that. I am curious to see other responses.

Cheers
Bud
Title: Re: UV map tweaking
Post by: Orange_o_ on January 10, 2009, 02:28:37 AM
Sorry nerdly, but my english is so bad. And I don't understand your explain but perhaps i have a solution. If you can make picture, i think i can help you
&mmm


Orange
Title: Re: UV map tweaking
Post by: nerdly_dood on January 10, 2009, 08:11:44 AM
In the pictures I linked to below, I've tried to put the situation into visual terms.

In the image "zoomout.jpg" [link (http://i460.photobucket.com/albums/qq330/nerdlydood/zoomout.jpg)] I have a screenshot of Reader open, with the rectangle-thingy moved up, away from its original location within the lightbar part of the skin. The yellow arrows point at the corresponding corners of the two rectangle-thingys that aren't joined together; the red arrows point at the three corresponding corners of the rectangle-thingys that are joined toghether and which I would like to be able to separate. The screenshot is somewhat zoomed out so you can see the big-picture part of it. You can see that the center part of the lightbar on the van model itself is black in the S3D preview because the rectangle-thingys for the front/top and back of the center part of the lightbar has been moved into blank black space in the skin.

In the image "zoomin.jpg" [link (http://i460.photobucket.com/albums/qq330/nerdlydood/zoomin.jpg)] I have simply zoomed in so you can see the rectangle-thingys I'm trying to fix - red arrows point at the corners I'd like to separate; yellow arrows point at the corners I've already separated because they were not at precisely the same location in the original UV-map.

In the image "whatswhat.jpg" [link (http://i460.photobucket.com/albums/qq330/nerdlydood/whatswhat.jpg)] I have moved the rectangle-thingys down into the lightbar part of the skin and widened it a bit (in the original UV map the rectangle-thingy for the center part was entirely in the white center area so you couldn't see that the one for the top/front was flipped relative to the one for theback part) and flipped it sideways so that rather than the front and top being oriented wrong, the back is now oriented wrong. In this image, blue arrows point at the corners I've managed to separate and orange arrows point at images I haven't been able to separate. In the 3D preview you can see the problem on the lightbar.

EDITED - Forgot to attach images initially; images too large to attach so I linked to them in my photobucket.
Title: Re: UV map tweaking
Post by: Swamper77 on January 10, 2009, 01:17:26 PM
Nerdly,

That's a lot of text when a few images would suffice for my understanding :D

First of all, the "rectangle-thingys" are the triangle polygons that make up the model. All SC4 models are a collection of triangles that form the shape of the intended model, in your case the police van.

Second, you shouldn't be making edits on the game's DAT files, which it looks like you are from the long list of filetypes on the left in your images. It is much safer to copy the specific model you want to edit to a new DAT file, and then make your edits to it.

As Buddybud stated, the UV maps are part of the S3D models themselves and only tell the game how the images are wrapped around them. There is one set of UV maps for each frame. Since the Maxis police van model has 100 frames, you will see quite a few repeats of the different groups of UV maps. Fortunately, if you edit one UV map of a particular group of the model, you edit the entire set. So one change in one of the "flat_bed" UV maps will edit the rest of the "flat_bed" UV maps, but not any of the other UV maps.

Since you are having issues getting the police van UV straightened out for your purposes, I will fix the model on my end so that back panel of the lightbar is not flipped like it currently is. I'll also try to separate the corners of the polygons for the lightbar so you will have an easier time working with it. Please give me some time to do so.

And for future reference, you can always ask me directly about these sorts of modding questions. Given the vehicles I have made, I can most likely answer your questions about automata and the modding of them.

-Jan
Title: Re: UV map tweaking
Post by: nerdly_dood on January 10, 2009, 01:28:40 PM
Thank you Swamper - and I'm not saving the changes I'm making to simcity_1.dat, if i was going to send a file contained within I'd export the 3DS as a separate file...

I've also found a way to change the lightbar colors on the Maxis fire truck model, but considering that the model is already mediocre at best, I figure it's not worth modifying it.

Also, since the Maxis police van and ambulance models are almost identical, I've found that they have the same UV-map problem in the same location as the Maxis police van.