1) I never found that, so things will work without changing it for each file, but it makes sense as a final step for if something is at such a far distance it shrinks to a single pixel.
2) The width of the original image is always a power of two, and each sub-image is half the previous, so yeah. On the height, make sure to round up - but when you do color recalculations, don't include the blank rows you add in.
Big update - I was able to build a working version of the tool which can do the following: 1) unpack/repack a tracks.dat file, 2) convert mips to bmp, 3) convert bmp back to mip, 4) create a point-in-time backup of a .dat file. It has no real UI at the moment, just a very basic set of menus like a DOS program.
Scaling turned out to be less of an issue because I was able to utilize the Python Imaging Library which has functions to resize images and apply a palette.
Of course, the true test is - could I do something useful with it? I was able to use the tool to update some graphics at Laguna Seca. Check out the result and a brief glimpse of the tool, attached.
I will keep trying to do different things with the tool, such as painting cars and such, before working on a better UI.
(02-16-2019, 04:01 PM)checkpoint10 Wrote: Big update - I was able to build a working version of the tool which can do the following: 1) unpack/repack a tracks.dat file, 2) convert mips to bmp, 3) convert bmp back to mip, 4) create a point-in-time backup of a .dat file. It has no real UI at the moment, just a very basic set of menus like a DOS program.
Scaling turned out to be less of an issue because I was able to utilize the Python Imaging Library which has functions to resize images and apply a palette.
Of course, the true test is - could I do something useful with it? I was able to use the tool to update some graphics at Laguna Seca. Check out the result and a brief glimpse of the tool, attached.
I will keep trying to do different things with the tool, such as painting cars and such, before working on a better UI.
I'm liking it! What does this need to run? (Dos, Windows, etc...)
(02-17-2019, 05:47 AM)samsepi0l Wrote: I'm liking it! What does this need to run? (Dos, Windows, etc...)
Right now the tool exists in the form of Python code which requires a Python interpreter to run. After I get a GUI in there, I would probably compile it as a Windows executable to make the installation more hassle-free for most users. But I will make the code available too, so that folks can improve on it or extend functionality or whatever.
One thing I just realized I may need to code: for car liveries, I believe I need to make the tool only use the colors 32-175 in the palette. I think otherwise it may create conflicts with the other colors that show up in the sunny.pcx palettes.
(02-18-2019, 12:12 AM)CowtownBob Wrote: For cars I hard-coded the palette. For the section that does track graphics it uses the track's palette.
I went ahead and coded the tool to avoid colors 0-31 and 177-255 for cars... in fact, if the user accidentally uses those colors, it will convert those colors to the closest colors between 32-176. I have tested this by painting an awful looking car (see attached) using illegal colors, and noting that after I imported to .mip and re-exported to .bmp, the colors have indeed been corrected.
Question about number of subimages. I believe generally it is based on the width of the image, so that 2^n = width, where n = number of subimages. Can you confirm?
width 16 = 4 images
32 = 5
64 = 6
128 = 7
256 = 8
512 = 9
I will have the tool automatically decide the number of subimages, but leave open the option to manually specify this.
Yes, that's the math on the number of images. There's no need to have a manual option; the game is going to be expecting subimages down to two pixels wide.
Quick update - I found that with carsets, my tool didn't create a .dat file that was readable by the Paintkit. The reason seems to be that my tool would reshuffle the files within the .dat file (which the game itself can still load), but the Paintkit requires the files to be in certain order.
I also looked into the car 3do file and I mostly understand where the colors are:
Panel 1-21 - car panels, except:
3, 12, 22-30 - unsure what these colors represent, they are outside the selectable palette, maybe suspension/engine parts?
48-77 - crew uniform
78-85 - helmet
I started learning how to make a GUI using Tkinter but having a little less time lately. I will continue to clean up the code in the text-based version of the program and I might release that first, in case I can't make quick enough progress on the next part.