Converting Tin Vogels's TTEP M2 textures

Have a question, suggestion, or comment about Aleph One's features and functionality (Lua, MML, the engine itself, etc)? Post such topics here.
Post Reply
Ian-avatiacom
Spazeroid
Posts: 3
Joined: Jun 9th '21, 13:36

Hello.
I'm trying to convert Tim Vogel's TTEP textures for Marathon 2, to play with some old single player map.
I know there is a newer project
http://simplici7y.com/items/community-f ... -walls-m2
but I still wanted to try.
I started with the water set. I copied the Gorens Water Set folder, renamed it to Vogels Water Set, and deleted the original DDS, replacing them with TTEP DDSs.
Then I edited the MML and XML files. TTEP does not include other files than simple textures, without glow or other additions, so the resulting MML file has this pattern:

Code: Select all

<marathon>
<opengl>
<!-- Collection 17: Marathon 2 Water Textures  -->
<texture coll="17" bitmap="0"
normal_image="00.dds"
type="0"
/>
<texture coll="17" bitmap="1"
normal_image="01.dds"
type="0"
/>
and so on up to bitmap 29.
Then I changed textures 16 and 19 to get transparent liquids :

Code: Select all

<texture coll="17" bitmap="16"
normal_image="16.dds"
opac_type="1"
type="0"
/>

<texture coll="17" bitmap="19”
normal_image="19.dds"
opac_type="1"
opac_scale="0.6"
type="0"
/>
and then I changed the name in the xml file to "Vogels M2 Textures".
After launching Aleph One, I have disabled everything except Vogels M2 Textures, via the Preferences / Plugin menu.
Selecting a map for M2 ("The Search") everything worked fine, except that the liquids were not transparent. By enabling Gorens Water Textures instead, the textures were the Infinity ones, but the liquids were regularly transparent.
I don't understand where the problem is, can someone help me?

--------
Ian Avatiacom
Aleph One 1.4 on Mac OS 12, NVidia GT 120, OpenGL renderer
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

First off, there’s already a plugin for Tim’s textures on Simplici7y. I have to confess I don’t fully understand the point of this exercise, unless it’s just to familiarise yourself with how MML and/or plugins work.

In any case, it’s probably worth explaining how Aleph One deals with transparency. Usually images are saved as RGBA, where the alpha channel signifies the opacity of the image. White is purely opaque; black is purely transparent. There's an alpha channel baked into Goran’s water texture which, if I’m reading that code excerpt correctly, it’s scaling down to get the transparency (i.e., it changes 100% opacity to 60%).

Does Tim’s 19.dds have an alpha channel? If it doesn’t (and I suspect that it doesn’t, but I don’t know which version of his images you’re even using – there are several), then I don’t think Goran’s code will work.

A quick hack you can use if you don’t feel like modifying the image is something like:

Code: Select all

		<texture coll="17" bitmap="19" type="0"
			normal_image="19.dds"
			opac_type="3" opac_scale="0.5" opac_shift="0.5"
		/>
However, this will increase memory usage and loading time. A better solution is just to re-save the image as a DDS file with an alpha channel (the XBLA version uses pure white if you want to duplicate that). If you’re saving with Nvidia’s Photoshop plugin, make sure to use DXT5 and not DXT3; strange things are known to happen with DXT3. Re-saving a DXT1 image as DXT5 should not noticeably affect image quality (in fact, if my understanding of how DXTC works is correct, it won’t affect image quality at all).

If you save the image with a solid fill of hex code #999999 as the alpha channel, it’ll be roughly 60% opaque, which would be roughly the effect you want, I think. Then you don’t even have to bother with the opac_scale stuff and can just use:

Code: Select all

		<texture coll="17" bitmap="19" type="0"
			normal_image="19.dds"
			opac_type="1" />
16 in the water collection isn’t a liquid; it’s a grate. Is it also not showing up transparent?
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
Ian-avatiacom
Spazeroid
Posts: 3
Joined: Jun 9th '21, 13:36

The Man, many thanks for the explanation.

My goal was to create a system that would allow you to change the map format from Infinity to M2, enabling or disabling only two plugins.
Using one plugin for each set, you need to change the state of 10-12 plugins each time (unless you know exactly which sets a map uses) and that's pretty boring.
So I tried TTEP, which has only one plugin to change all textures, and I noticed that the memory consumption increased, the program had some hesitation at the start of the game, and the liquids were no longer transparent.
I suspected it was all due to the long lines of the TTEP scripts, so I broke them into smaller lines.
From what I learned, the problem is instead caused by the fact that Aleph One with TTEP has to load all the textures, fragmenting the memory; and in addition some textures are defective.

My project is now canceled; in any case, it only served as a "training" for a much more ambitious thing I have in mind: using M1A1 with the same version of AlephOne.
With previous versions, I had to use two copies of the program, each in its own folder, and change the name of one from AlephOne to M1A1: this created two different preference files - at least, this happens in MacOS, the system I use - and I had to just copy the right files into each of the two folders: the two applications coexisted without harm.
Today I don't know if this is still possible, with the changes in the operating systems, however it is a waste of disk space and a "dirty" solution anyway. I would prefer to have all the AlephOne scenarios in one folder.

Oh, anyway: I know the M1A1 has a lot of detractors, but I liked Claude Herrera's changes, like the elevators in "Colony Ship for Sale", and would like to play it again.
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

No problem.

The TTEP uses way more memory because the textures are 1024 x 1024 pixels², whereas the textures that come with downloads of M2 and Infinity are each 512 x 512 pixels². (The XBLA textures are actually available as 1024x1024, but the 1024x1024 textures are not bundled with Aleph One by default.) Other things being equal, this would be four times the memory consumption. (Other things are not exactly equal, as it turns out; Goran’s textures have some things like glow maps that I don’t think Tim’s textures used, but it’s been so long since I used them that I couldn’t say for sure; two of Goran’s collections also include parallax maps, which the engine didn’t even support when Tim made his textures. However, even with these inclusions, the difference in texture size still dwarfs the added memory from the parallax maps and glow maps.)

From personal experience, I can say that 1024x1024 is extreme overkill for the vast majority of textures on a 1080p display, and it eats up memory fast. (According to people who have higher-res displays, 512x512 even looks pretty good at 1620x2880 or 2160x3840.) It’s beneficial to use 1024x1024 for switches, terminals, rechargers, and doors, but unless the player’s face will routinely be mashed up against the texture, there’s really no reason to use anything higher than 512x512, particularly with Aleph One memory consumption being what it is.

In any case, it should be relatively easy to combine all of Goran’s wall collection plugins into one, and likewise for the M2 plugins. (Actually, the XBLA plugin that comes with M2 downloads right now already does that, but the CFP version doesn’t.) I’m actually kind of surprised that someone hasn’t done that already.

M1A1 was a valiant effort, but the physics differences are awful enough to make it unplayable for me. It’s barely even possible to get out of the Deprivation Chamber in “Never Burn Money”. Just awful. If someone went to the trouble of fixing the physics, I might be persuaded to play that.
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
Post Reply