Textures?

All about making tracks for MX Simulator
Post Reply
BoNalls
Posts: 28
Joined: Wed Dec 12, 2007 9:18 pm

Textures?

Post by BoNalls »

JLV, we need some more information on editing the tilemap file.

1. What file type should we save it as after we edit (change to a .raw)?
2. What Black % corresponds with certain terrain textures?
3. Should the size of the map be the size of our terrain map -1?
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Post by jlv »

The values in the tilemap are defined by the file "texturelist". Here is what the texturelist from the blank track looks like -

Code: Select all

dirt.ppm
1 20 50 grass.ppm
dirt-grass-0001.ppm
dirt-grass-0010.ppm
dirt-grass-0011.ppm
dirt-grass-0100.ppm
dirt-grass-0101.ppm
dirt-grass-0110.ppm
dirt-grass-0111.ppm
dirt-grass-1000.ppm
dirt-grass-1001.ppm
dirt-grass-1010.ppm
dirt-grass-1011.ppm
dirt-grass-1100.ppm
dirt-grass-1101.ppm
dirt-grass-1110.ppm
dirt-grass-1111.ppm
dirt-alt1.ppm
grass-alt1.ppm
Each line can have just a texture, or it can override the default friction and rolling resistance. So the the first line just uses dirt.ppm and the defaults, but the second line uses grass.ppm with a coefficient of friction of 1.0, low pressure rolling resistance of 20 and high pressure rolling resistance of 50.

The tilemap entries index into this list, so 0 would be dirt.ppm, 1 would be grass.ppm, 2 dirt-grass-0001.ppm, and so on.

What the gray values should be would depend on the editor. I would have guessed 0/255 - 18/255, but it sounds like photoshop stretches it to 0/18 - 18/18.

For 1025x1025 terrain, "tilemap" should be 512x512 (262144 bytes). edit - wrote "textures" meant "tilemap"

For now, it might be best to just paint the dirt green using shading.ppm if you just want to mark the track layout.
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Post by jlv »

Here's the command line tool I use to make the tilemap: texindexer.exe
And the color to texture table image (just a 2x1 ppm file, brown and green): colortotextable.ppm

It is a bitch to invoke. I run it from make, but a bat file would work too. Here's the line from my Makefile:

Code: Select all

texindexer >tilemap textures colortotextable.ppm textures.ppm texname dirt.ppm texname grass.ppm texname dirt-grass-0001.ppm texname dirt-grass-0010.ppm texname dirt-grass-0011.ppm texname dirt-grass-0100.ppm texname dirt-grass-0101.ppm texname dirt-grass-0110.ppm texname dirt-grass-0111.ppm texname dirt-grass-1000.ppm texname dirt-grass-1001.ppm texname dirt-grass-1010.ppm texname dirt-grass-1011.ppm texname dirt-grass-1100.ppm texname dirt-grass-1101.ppm texname dirt-grass-1110.ppm texname dirt-grass-1111.ppm texname dirt-alt1.ppm texname grass-alt1.ppm
For a 1025x1025 terrain, "textures.ppm" should be a 512x512 ppm image. Paint green where you want grass and brown for dirt.
BoNalls
Posts: 28
Joined: Wed Dec 12, 2007 9:18 pm

Post by BoNalls »

Yes i understand all this JLV....MCM1's track editor used to use a very similar technique to assign tiles....

The only way to edit the tilemap file is to add a .raw (or similar) extension so that photoshop can read it. However, the game does not see tilemap.raw and thus doesnt even boot up.

Im stumped here... ive tried everything. Whats the answer :lol:
rewrew421
Posts: 1421
Joined: Thu Dec 13, 2007 12:41 am
Team: Privateer
Location: West Kentucky, USA

Post by rewrew421 »

remove the .raw, but i know some people cant do that including my self but another person i know can so he does my "textures" (not gonna release his name because im sure he doesn't want everyone hounding him for textures :P)
D.Eckels #421 "The O-G"
BoNalls
Posts: 28
Joined: Wed Dec 12, 2007 9:18 pm

Post by BoNalls »

Well JLV, i finally figured it out.... i had to disable the "Hide extensions for known file types" in the folder options so i could erase the extensions.

For anyone else having the same problem.... follow this....

FOR ADOBE PHOTOSHOP:::

Click on "tilemap" and rename it to "filemap.raw".
Open up this file in photoshop.
Follow the following color options....
---- 0%=Dirt
----5%=grass with friction
----33%=Grass no friction
----50%=Grass no friction
And paint your track path....

Make sure you the image size is that of your hieghtmap value.... (if 7, it would be 2^7 = 128x128 pixels.
Save the file as tilemap.raw (just click save in photoshop).

Go to the folder of your track.... and do the following....
1. Open Folder Options in the Tools menu
2. Go to the View tab
3. Scroll down and there will be a checkbox with "Hide extensions for known file types"
4. Uncheck that and hit OK.

Then click on your tilemap.raw file and click rename... and now you can remove the .raw extension and the game will read it.

Hope this helps.
Last edited by BoNalls on Wed Dec 19, 2007 10:41 pm, edited 1 time in total.
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Post by jlv »

If you've saved it as "tilemap.raw" you'll have to rename it to just "tilemap" (with no extension). Make sure it doesn't have values higher than the number of texture types in texturelist. I'd have a look at it with a hex editor first just to make sure it's ok.
nickmx
Posts: 443
Joined: Sat Dec 01, 2007 8:35 pm
Team: Privateer
Location: TEXAS
Contact:

Post by nickmx »

im learning something new everyday. :lol:
BoNalls
Posts: 28
Joined: Wed Dec 12, 2007 9:18 pm

Post by BoNalls »

Ok apparently theres something screwed up....

The textures are looking nothing like how i painted my tile map... its all messed up.

Heres an example...click to enlarge
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Post by jlv »

What are the dimensions of your heightmap and what is your file size for "tilemap"? It looks like you have a bunch of out of range values for the first half, and the rest defaulted to 0.

My advice would be to use the texindexer utility.
hondaboy12
Posts: 30
Joined: Tue Jan 22, 2008 4:45 am
Team: Privateer
Location: STorm Lake Iowa
Contact:

Re: Textures?

Post by hondaboy12 »

I dont understand any of this.....
Image
Post Reply