Elvas Tower: Route Riter source code - Elvas Tower

Jump to content

  • 7 Pages +
  • « First
  • 4
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

Route Riter source code Rate Topic: ***** 2 Votes

#51 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 807
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted 21 March 2023 - 02:53 PM

I suppose if I was already some sort of a developer... I would have these extra pieces parts... but I'm not and I don't.

#52 User is offline   David Webb 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 36
  • Joined: 05-January 20
  • Gender:Male
  • Simulator:OpenRails, ZR
  • Country:

Posted 28 March 2023 - 12:19 AM

View Postscottb613, on 20 March 2023 - 03:53 AM, said:

Hi Folks,

If anyone comes across the code in RR on how it's used to covert ACE to BMP - I'd appreciate it - been looking for a way to do this via the command line - for a long time. Obviously - RR figured this out and must be using some external tool.

Regards,
Scott


I have C routines for reading ace files and I've found some C routines for writing bmp files. If you are happy with C and can let me know exactly what you need, I should be able to package them togeather.

#53 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 28 March 2023 - 04:46 AM

View PostDavid Webb, on 28 March 2023 - 12:19 AM, said:

I have C routines for reading ace files and I've found some C routines for writing bmp files. If you are happy with C and can let me know exactly what you need, I should be able to package them togeather.


Hi David,

Just a quick summary.

I made a tool - Bash - to support my TERRTEX painting in TSRE. When TSRE saves a "painted" tile - it doesn't create any MipMaps. So you get Moire - especially if you have parallel lines such as crops painted on the texture. You need to add MipMaps somehow.

I prefer to work with DDS - so I use NVidia NVDXT to convert my TERRTEX to DDS and add MipMaps at the same time. The issue is I can't feed ACE files into NVDXT. Route Riter has an ACE to TGA routine - which doesn't seem to work anymore. Fortunately - Route Riter - ACE to BMP does work. Every time I run my script I have to manually launch Route Riter to perform the graphic conversion - not a huge deal - just a chore when you take the time to script everything.

I had thought Route Riter had been using some external tool to do this conversion - that I could tap into. I'm familiar with TS Utils and I don't think it performs any graphics conversions.

Ideally - I just need a command line tool to call - that takes a "source ACE" and "destination BMP/TGA" argument - individual files or whole directories would be helpful. TGA or BMP would be fine - any lossless graphical file format.

That said - it's probably not worth your time and effort for custom coding. It's a small inconvenience and your work probably wouldn't benefit anyone but me. I GREATLY appreciate your interest and generous offer - though.
:sign_thanks:


If curious - here's my full Bash script:
Attached File  CreateDDS.zip (1.39K)
Number of downloads: 6


Regards,
Scott

#54 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 807
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted 28 March 2023 - 05:13 AM

So, what you are saying is that we now need the source code to TGATOOL2... :)

#55 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 28 March 2023 - 05:23 AM

View Postpwillard, on 28 March 2023 - 05:13 AM, said:

So, what you are saying is that we now need the source code to TGATOOL2... :)


Hi Pete,

LOL - I'm sure it would be nice - as it would be for all our tools - but this is a pretty insignificant hurdle for me. I only run the script a couple times a night - at most - when I'm painting TERRTEX.
:)

Regards,
Scott

#56 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 28 March 2023 - 07:47 AM

View PostWeter, on 28 March 2023 - 07:15 AM, said:

Really, Scott: TGA Tool2 (RR had it's enhanced version, which also could compress aces) does aces export to BMP/TGA.
For reverse conversion make ace/AceIt is needed.


Hi Weter,

"TGATool2A.exe" has a Command Line Interface (CLI)? I don't see a "help file" with it - and I don't recall seeing any reference for it? I don't need compression.

I'm familiar with AceIt (CLI) and use it all the time:

Quote

AceIt

Syntax:
aceit.exe <input file> [output file] [options]

Input File
As with the standard interface, the input file must be an image of any of the following types:

Kuju ACE (*.ace)
Direct Draw Surface (*.dds)
Truevision Targa (*.tga)
Joint Photographic Experts Group (*.jpg)
MS-Windows Bitmap (*.bmp)
Device-Independent Bitmap (*.dib)
Tag Image File (*.tif)
Portable Network Graphics (*.png)
Portable Pixmap (*.ppm)
The input file can be a local file, or can be specified with either a relative or absolute path. Use quotation marks to enclose a path/file that contains spaces.

Output File (optional)
AceIt will only output Kuju ACE files. If a filename is not specified, the output ACE file will be in the same directory as the source file, with the same filename, except with a ".ace" file extension. If you specify a filename without a .ace extension, AceIt will add one. A directory path (without a filename) can also be specified so long as it ends in a backslash. The filename will be the same as the input, except for the extension.

Options (optional)
The options are for contolling the type of the ACE file outputted. If no options are specified, the defaults are used. As with the standard interface, for any input other than an ACE file, AceIt defaults to RGB opaque with ZLib compression. The output will have MIP maps as long as the image is square with dimensions 2n (512, 256, 128, etc.). For ACE file inputs, the output will be the same specifications as the input file, except that ZLib compression will be applied unless explicitly disabled.

The following options are available. They are specified by using a dash or a slash ('-' or '/') in front of the option.

dxt (or d)
This specifies that the output will be in the DXT1 format. This can only be used if the image is square dimensions 2n. If an alpha channel is present on the source, transparency will be applied to the output. You will receive an error if the input image does not meet these criteria. Click here for a more detailed explanation of the DXT1 ACE format. This cannot be used with trans, alpha, or cab.

uncompressed (or u)
This specifies that the output file will be not be ZLib-compressed, which is the default.

trans (or t)
This specifies that the output will be 24-bit RGB color, 1 bit alpha (or 'trans'). Click here for a more detailed explanation of the RGB ACE format. This cannot be specified with alpha or dxt.

alpha (or a)
This specifies that the output will be 24-bit RGB color, 8 bit alpha (or 'alpha'). Click here for a more detailed explanation of the RGB ACE format. This cannot be specified with trans or dxt.

cab (or c)
This specifies that no MIP maps will be added to the output image, like for cab bitmaps. This is always on for non-square, non 2n images. This cannot be specified with dxt.

optimize (or o)
This specifies that a 16-bit dither optimization will be applied to the output file. This cannot be used with the DXT1 format. More info is available in the Other Info section.

quiet (or q)
This specifies that the dialog box that normally appears upon the successful generation of an ACE file will not appear. There will be no notification if the operation is successful. This is useful if another program or script is calling AceIt and you do not wish to receive multiple messages.

filter:<filter> (or f:<filter>)
This is used to specify the filter to use when producing MIP maps. There are three valid parameters for <filter>: box, linear, or point. Use a colon between the option and the parameter, i.e. filter:linear. Explanations of the filter types are available on the standard interface page.

Examples
aceit.exe input.tga output.ace /alpha

This will take input.tga in the calling directory and generate output.ace as a ZLib-compressed RGB with 8-bit alpha ACE file in the calling directory.

aceit.exe input.ace

This will cause AceIt to rebuild input.ace with the same settings. This is useful for correcting ACE files produced by makeace or makeacewin.

aceit.exe "c:\my documents\input.bmp" "c:\my documents\output\" /dxt /quiet /filter:linear

This will generate a ZLib-compressed linear filtered DXT ACE in c:\my documents\output\ by the name of input.ace. It will not display a notification after completion.

AceIt > Usage > Command prompt


Regards,
Scott

#57 User is online   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 6,993
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 28 March 2023 - 09:14 AM

Ah, yes: that must have been TGATl2a. But I didn't seen anything, related to command line too. I've just have meant opening every file manually, than export it - untill desired solution would be eventually discovered.

Where this text was taken from? (I'd like to see, what mentioned there links show)?
Is it from AceIt! Help?

So, it makes Aces only, but not opposite convension possible?

#58 User is offline   David Webb 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 36
  • Joined: 05-January 20
  • Gender:Male
  • Simulator:OpenRails, ZR
  • Country:

Posted 29 March 2023 - 09:26 AM

View Postscottb613, on 28 March 2023 - 04:46 AM, said:

Hi David,
Just a quick summary.
...


I've generated an 'ace2bmp file_in.ace file_out.bmp' utility and uploaded the code it as a zip file in a new 'ace2bmp' topic. I did this because the code has been developed on a linux computer. I really need feedback to make it more windows compatible and such feedback would only clutter up this topic.

#59 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,359
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 29 March 2023 - 10:53 AM

Whoa, I didn't know AceIt had all of those options. I've been using TGATool when I have an alpha. THANKS for posting that Scott! Very useful!

#60 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 29 March 2023 - 01:54 PM

View PostDavid Webb, on 29 March 2023 - 09:26 AM, said:

I've generated an 'ace2bmp file_in.ace file_out.bmp' utility and uploaded the code it as a zip file in a new 'ace2bmp' topic. I did this because the code has been developed on a linux computer. I really need feedback to make it more windows compatible and such feedback would only clutter up this topic.


Hi David,

Thanks so much - - - I'll take a look.
:sign_thanks:


View PostGenma Saotome, on 29 March 2023 - 10:53 AM, said:

Whoa, I didn't know AceIt had all of those options. I've been using TGATool when I have an alpha. THANKS for posting that Scott! Very useful!



Hi Dave,

Happy to help.

Yeah - I use scripts to process my models from the initial export - to process all the textures (AceIt and NvDXT) - fix animations (shape file edits) - create individual units (shape file edits) - and copy them to the production environment. It saves a great deal of time when you're doing hundreds or thousands of exports over the development life cycle of a model. I used AceIt before I moved to NvDXT for DDS.

Just a quick example on how you could use AceIt in a "bat" file:

@echo off
set "workpath=C:\Users\N63503\Documents\3DCrafter 9.5\MyWork\USRA_Mikado\"
set "expath=C:\Users\N63503\Documents\3DCrafter 9.5\MyWork\USRA_Mikado\SCO_USRA_Mikado\"
set "ace_exe="E:\MSTS Tools\AceIt\aceit.exe""

REM Make Ace
echo Process ACE 2048x "282Prime1"
%ace_exe% "%workpath%282Prime1.tga" "%expath%282PRIME1.ace" /Quiet

echo Process ACE 2048x "282Prime2"
%ace_exe% "%workpath%282Prime2.tga" "%expath%282PRIME2.ace" /Quiet

echo Process ACE 1024x "282AlphaCab"
%ace_exe% "%workpath%282AlphaCab.tga" "%expath%282ALPHACAB.ace" /Alpha /Quiet



Regards,
Scott

  • 7 Pages +
  • « First
  • 4
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users