#List of useful tools to Convert Assets (3D and 2D)

1 messages · Page 6 of 1

wicked gulch
#

In SC case the code must calculate each frame, because it's rendering each frame at a time...

sterile lantern
#

You can't avoid nesting loops

wicked gulch
#

but if you pre-process it you can do it in a single move almost...

sterile lantern
#

Don't, do it in the same way SC/retail do

#

You're prematurely optimizing and you're gonna cause problems for yourself

wicked gulch
#

because of the Matrices...

#

yup... anyway i'm taking the long way to actually have a deep understanding of the code at that level... so maybe we could improve it somehow...

#

for now I will again halt my own code, re-take the code translation... take my time and fully translating Battle.java...

#

maybe I could have more answers from that place...

wicked gulch
#

Monoxide, how correct is this documentation about GameVarParams?:

#

GameVarParams:\n This class depicts the parameters related to Game Variables.\n Can Get or Set Parameters inside the Variables of different parts of the Game Engine.

#

some of the cases I will be not implementing... because are not on my code scope, some examples:
get() -> case 61 -> Scus94491BpeSegment_800b.totalXpFromCombat_800bc95c;

sterile lantern
#

Yes, it's just engine variables that are accessible from the script engine

wicked gulch
#

what would happen if I divide an AtomicInteger?... I will have a reaction chain of Integer Fission that ended into a nuclear overflow?

sterile lantern
#

Guess you'll have to try and find out

#

What's the worst that could happen?

#

doommetal has left the chat

wicked gulch
#

I went too far into the rabbit hole... I wanted the framework to only execute the script... ending in other place that I don't need to... hahaha

#

I feel like I'm in a script that is endlessly looping... but not because I want... but because I need to literally translate from the Main(){} of SC to get what I want to... there is no other way...

#

is not fun re writing the code for something that I have already the code for doing the same in a single step... even if a Wall of Code...

#

and if I use my way the code from SC will be not usable to what I want.... because I have to replicate the exact same behavior in the exact same way

#

well I think... will take the coward approach... just convert the Models and Particles from DEFF... but the user will be on charge of setting up all the scene...

#

also this means the timing

vestal halo
wicked gulch
#

at least until two things happens:
1.- I will study and became a Software Engineer, so will understand the problem from other perspective.
2.- SC DEFF Code and Script in general came a little bit more easy to manipulate (for some unknown reason).
3.- Somehow I got illuminate with some godlike idea that will solve this mess.

sterile lantern
#

I think that's reasonable, imo you're trying to do something extremely difficult and time consuming and it would be a better use of your time to work on other tools

wicked gulch
#

I've halted the Sound conversion and Mapping... A LOT...

#

I promised two years ago to Drew to get my tool doing at least the basic of that... still didn't read a single class from SC to know specs from sound and soundbanks

#

But I will not fall like a tree making noise and get rotten... I will be defeated like a person who received a cannon ball in it's chest but still died standing

#

I will rename in my code the thing as "DEFF Object Conversion"...

cedar night
#

@wicked gulch I was having issues running the python version of the asset manager, however after some debugging and small patching, it works. It seems there were some syntax issues:

time_now = f'{'='*50}\nWork finished at: ' + str(datetime.datetime.now()) 
                     ^

SyntaxError: f-string: expecting '}'

It was incorrectly using brace syntax for f-strings, and in a few areas as well, mostly in conversion_interfaces.py

if you'd like I can share with you the py scripts i updated

cedar night
#

Im also not sure why the color data is coming out different on extracting the textures, trying to match up any of them with the retail color and sadly doesnt match up. Unless there is some color conversion with the deff file type that I'm not aware of

vestal halo
#

I had some issues with matching in the past, but I couldn't say if it was the same issue or not.

#

Are you a programmer in addition to modeling and animation?

cedar night
#

I dabble around, I do web dev and have done some stuff with C#/C++ and python

#

I've learned a ton of skills in the hopes to eventually create my own game, long term goal :b

#

From what I've seen so far, character colors closest to retail are Texture 0, however, there is a a strange thing happening with Reds and Blues specifically

I'm manually fixing the UV maps, but some of them were already fine. I'm going to investigate a bit more and see if I can come up with a solid answer for it.

cedar night
#

Okay, so TLoD uses multiple CLUT's per atlas, and often PS1 era was often BGR555 and we use RGB888 these days, so there is a bit of a color swap as I thought.

so there is a couple things that are/could be happening:

The indexed texture is interpreted as direct color

ORRRR

The wrong CLUT is being applied.

So, since the character uses the same texture atlas for every part of the character, each mesh of the character is running different CLUT's.

Which means that each material needs to be decoded for the indices of colors, apply the correct CLUT's (Color LookUp Table), and then export/output RGBA format

#

I havent looked at the export logic yet for the asset manager, if anyone knows how its being done atm for the asset manager I would love to know

vestal halo
#

When he is available, DooM will be happy to provide answers.

cedar night
#

Awesome! In the meanwhile, I'm going to try and convert the color encoding, and then sleep.... finally >.>

wicked gulch
cedar night
#

but i was testing on meru

cedar night
#

Alright, it seems that the only exports RGBA, but PS1 uses BGR555 and not RGB888; RGB888 is capable of 16,777,216 colors (2^256)

(i.e.: BGR555 is a 16bit color encoding system with its bits are flags. R = 0-4, G = 5-9, B = 10-14, and a semi-transparency flag for bit 15, able to render 32,768 colors (2^16). TLoD uses 4 and 8bpp. @4bpp (bits per pixel) and has only 16 colors (2^4) (index starting at 0) @8bpp (index starting at 0) and has 256 colors (2^8).

Format Bit structure Levels per channel Total colors
4bpp 4-bit index N/A 16
8bpp 8-bit index N/A 256
BGR555 5+5+5 32 32,768
RGB888 8+8+8 256 16.7M

Since TLoD uses both 4bpp and 8bpp, BGR555 happens anyway, since the PS1's GPU runs the BGR555 algorithm.

So if 4bpp is 2 pixels per byte, then

byte = tex_bytes [y * (width//2) + (x//2)] #since 1 byte holds 2 pixels
if (x & 1 ) == 0:
index = byte & 0x0F #low nibble (pixel 0)
else:
index = (byte >> 4) & 0x0F #high nibble (pixel 1)

#REMEMBER INDEX IS 0..15

wicked gulch
#

in my end is working just fine

#

I think you are using an old converter 😬

#

in which format/tool are you converting?

cedar night
#

oh snap i hope im not using an old one

#

im using the Asset Manager, convert battle models in single mode

wicked gulch
#

hmmm which version?

cedar night
#

pulling the gltf into blender, this shows v0.2

wicked gulch
#

hmmmm

#

are you using the binaries?

#

or pulling code?

cedar night
#

binaries from the gltf?

wicked gulch
#

nop of the tool

#

hehehe

cedar night
#

sorry wasnt sure what you were referring there haha

wicked gulch
#

ahhh hahaha

#

this one I mean

cedar night
#

ooooooooooo

#

i do indeed have that one it appears, i am tired lmao

wicked gulch
#

hmmmmm

#

weird thing...

#

In my end I have the correct textures for meru

#

except you are converting from mini models...

cedar night
#

whaaa

wicked gulch
#

minimodels are a... thing to say something hehehe

cedar night
#

are you meaning like world map models? cause I exported battle models

cedar night
#

ahh, nevermind, i was the big dumb

#

it appeared I was on the old version...

I still am having texture import issues on blender still

#

its getting animations, buffers, meshes, but not imaging textures/assigning materials into the gltf for some reason

#

is there a way to have it pack into a glb rather than a gltf?

#

some shennaniry

wicked gulch
#

hmmmm

#

this is weird

#

you configure your paths correctly?

cedar night
#

yup yup

wicked gulch
#

ahhhmmmm you are using Blender 5.0

#

hmmmm

cedar night
#

ye ye thats what i was thinking

wicked gulch
#

idk If they change something about how the glTF works...

cedar night
#

i know stuff was getting legacied idr what

wicked gulch
#

well Collada was one of the file formats

cedar night
#

maybe from a BSDF change? not sure if that could do it

#

im gonna install 4.5.2 LTS and see

wicked gulch
#

nop

#

something more simple

cedar night
#

oh? what i miss

wicked gulch
#

you didn't check the convert texture checkbox hehehe

#

check it...

#

or select the "Single Model Mode" from above and will check and convert everything

cedar night
#

but.... i did click texture check box...

wicked gulch
#

sure?.... hmmm try again but simply tap the Single Model Mode

#

should be a bug in the GUI pretty much sure of that.... because that is controlled using some 'under the hood' values that if not reset properly from my code sometimes get bugged... I found that bug but I think forgot to upload the fix...

#

Or if you can just try the batch mode...

cedar night
wicked gulch
#

anyway if you close the window and re open it should be working normally

#

ahhhhhhhhhhhh

wicked gulch
#

you are right

#

but... how it worked before?

#

that's weird

cedar night
#

technology :b

wicked gulch
#

in any case try to reload the tool and see if converting as intended...

cedar night
#

either way, it was a good dive into it! Still plan to make a custom model for each at some point.

yeah i'll try batch this time

wicked gulch
#

maybe had some weird bug going on, in my code... since I was working all alone this (coding and reverse some file formats from old games it's my hobby) so time to time I ask real coders like Monoxide, TFZ, Zychro, Icarus, Ink... how my tool is going....

cedar night
#

well on import this is what im brought with, rather than the materials having the images already assigned/packed in

wicked gulch
#

sometimes some people contribute in here too obviously... but most of the times we face some bug reporting hehehe

cedar night
#

haha yeah, if i find something I'll for sure let you know! the project is still coming along great man!

#

im having a lot of fun in the community here, and I'm glad I can be of some help to people when I can anyway :b

wicked gulch
#

if not problem... try with Blender 4.5

#

rn i'm checking how the nodes should look like hehehe

cedar night
#

yeah i will check for ya for sure! i have a feeling it is the bsdf

#

can you show me your nodes from 4.5.4?

wicked gulch
#

for some reason is taking you the color node

cedar night
#

yeah thats what i thought, blender 5.0+'s stricter pbr/bsdf rules are killing the pack im thinking

wicked gulch
#

yep

#

take the base color as a color attribute node

#

and the Texture now goes to another Node

#

since my tool do the automatic assigment to the base color node... this is a thing

cedar night
#

oh yeah i know how to setup nodes, i just mean blender isnt allowing the assignment

#

ya ya

wicked gulch
#

a real incompatibility

cedar night
#

thats for future implementation prolly

wicked gulch
#

yep have to be

cedar night
#

at least we got it down to blender version... I hope >.>

wicked gulch
#

it's good knowing that someone tested on 5.0... which is very good... rn I will add it to the TODO list

wicked gulch
#

thanks a lot for posting this... This save me real several hours* of finding out-coding and headaches hahaha

cedar night
#

yup!! i had nothing else to do today so it was productive for me nontheless

wicked gulch
#

also I was checking what you told about the color config from textures... you are right but also keep in mind that PSX Textures had several configurations

#

4bit*, 15bit, 24bit (real color?)

cedar night
#

oh yeah CLUT

wicked gulch
#

for Characters textures the configuration is 8bit...

#

64 CLUTs for coloring the model texture

cedar night
#

the BGR555 format to RGB888*

wicked gulch
#

ahh yeah did that conversion because need RGBA... because in PSX the fully black it's considered to be Alpha

cedar night
#

yeah its either clear or opaque

#

with some implement of semi transparent

wicked gulch
#

so need to convert the colors to add the alpha value and then convert into RGBA888(value) to export into png

cedar night
#

ya ya, if you want I can try to put together the algorithm

wicked gulch
#

even I achieve some speedup thanks to the ideas Monoxide give me about the texture processing... and speedup a lot hahaha

cedar night
#

yeah monoxide is cracked haha, im not that great at coding but I can get around

wicked gulch
cedar night
#

nesting is a nightmare for me, i never go more than 3 deep if i can help it

wicked gulch
#

In TLoD Engine you'll find at least 10 nesting deep

#

that are forked around several functions that works if they are connected by the Engine

wicked gulch
#

If you read my previous post I was doing some shenanigans to get Visual Special Effects to be converted as a single scene... that is taking me forever lol

cedar night
#

so converting their instance vector with spellID and assigning textures

#

something like that?

wicked gulch
#

hmmm a little more complex...

cedar night
#

i can imagine, that was a... simple approach

wicked gulch
#

if you look the Effects code in TLoD you'll understand why is not so simple that I would like to be... the main problem it's the auxiliary processing engine that TLoD had... the infamous Scripting Engine...

vestal halo
#

DooM and the others have been admirable in their efforts to parse the meaning of LoD's code. 108

wicked gulch
#

also we always try to simplify the code and the things so people won't get crazy in the future hahahaha....

#

we are the madman gatekeepers somehow lol

wicked gulch
wicked gulch
#

are you parsing the code with some AI or something?

vestal halo
#

Unrelated: Would you like me to advertise "Help Wanted" on the lod.org front page? Whether for Linux support or anything else. I want to signal-boost this project and get more eyes on it.

wicked gulch
#

{'='*50} that string shouldn't be in the code hehehe

wicked gulch
vestal halo
#

Tell me what's at the top of the priority or "stuck" list.

#

and what skills are required.

#

I'll add it to the right-hand blurb on front page, and link here.

cedar night
#

current code is fine for sure, but when I was on the old build i had to fix the syntax issues to get it to run

#

I followed the trail of debug logs

cedar night
# wicked gulch `{'='*50}` that string shouldn't be in the code hehehe

I added {'='*50} as a log indicator, just for easier spotting for myself, but I also didn't check my own

shows up like this, but I made a syntax error myself, but fixed it in the longrun, however, there was no need to continue on that track as you had added a lot from v0.2 to v0.2.7, which visually I tricked myself into thinking they were both the same build at first

==================================================
Work finished at: 2026-02-18 15:42:01

#

original syntax issue i ran into on the old build:

self.change_sc_folder_view.setText(f'{self.init_config.get('SC_Folder')}')   
                                                            ^^^^^^^^^        

SyntaxError: f-string: unmatched '('

wicked gulch
#

ahhhhh sorry hahahaha

#

I was a little more unexperienced in that time and the GUI code was created very much on the fly... in the next build I made (v0.2) I took more attention and rewrite almost all the logics behind the tool hehehe

#

also, suddenly I understood the OOP real meaning hahaha... well after I red Clean Code.... even doing that my code looks pretty amateur... and I'm aware of it... hehehe sorry 😅

vestal halo
#

It's alright. As you know we're all on the wacky journey of life, skills, etc. You have come a long way!

cedar night
vestal halo
true apex
#

popping in to see how the new tools is coming still can't wait to play with it

cedar night
#

currently works great, however, right now there is a color conversion we have to work out from BGR555 to RGB888

wicked gulch
# vestal halo <@210272460770246658> bump

sorry... about this... some desirable knowledge: Python, 3D/Animations principles, Binary and Data Structures Principles... anyway this is not 'exclusive'... any person*with guts and some good ideas also are invited to participate hehehe... but at least 1 of the skills is necessary... if not will be a little complex to get until I'm right now 😬

wooden jungle
#

Update from the Mac Side:

Sorry for the 3 month delay. Real life work took a priority and I have not had a chance to test the Mac Python Executable. I should be able to install Severed Chains and the asset manager to test the Mac Executable. It'll be available for use soon. I just need to play catch up on the messages in here.

wicked gulch
#

Thanks RamenRider... well in my case I'm in a similar situation, but also I get a little mad to some stuff that I've tried and didn't work, so also trying to relax my mind hehehe

wooden jungle
#

Successful test! It works good on other Macs. Turns out that when zipped, the python application is a 58 MB from 148 MB. So a better compression than I thought.

wicked gulch
#

oh yeah hahahaha... there are a lot of reasons that happens... first the background image is an uncompressed PNG... all the code is text... some of the loaded modules (libraries) are way to much (even for me)...

#

but if I have to bet, the heaviest module it's PyQt, since it's a whole implementation of C++ libraries hooked using python...

sterile lantern
#

What do you mean by uncompressed png? All pngs are compressed with zlib

wicked gulch
#

I selected compression == 0

#

so would be a compressed 0 zlib png or uncompressed png hehehehe

sterile lantern
#

Any reason why you did that?

wicked gulch
#

yep...

#

to get the best quality in the image

sterile lantern
#

PNG is lossless

wicked gulch
#

yeah... but why the compression?

sterile lantern
#

To make it smaller

wicked gulch
#

if lossless, but compressed* something it's taken hahaha

sterile lantern
#

No it's not, that's like saying zipping your files loses data

#

zlib is lossless compression

wicked gulch
#

well tomorrow will compress the file to maximum

#

and pull the fix

#

Hey Monoxide

#

are you here?

wooden jungle
#

From a look at the directory:

PyQt6 at about 55 MB
scipy at about 36 MB
numpy at about 6.7 MB

So it is definitely PyQt6 and scipy being the biggest contributors to the size.

wicked gulch
#

as I thought hahahaha

sterile lantern
#

😛

wicked gulch
# sterile lantern Nope

I will need a little guidance in some stuff I will be doing ok?, so I will start (again, duh...) to do some of my silly questions... it's 108 % related to conversion of TLoD Resources...

sterile lantern
#

Go for it

junior mantle
wooden jungle
#

Before I add this to the fork, I'm curious if the Python executable works on Windows and Linux. Any volunteers? I can provide the zip file.

I had some help on this. It seems like my app works when the zip/tgz file is transferred through HDD to another device instead of being downloaded. I need to reproach how this would work..

Thanks @vestal halo!

sterile lantern
wicked gulch
#

answer in the issue.... at I have listed the Dragoon Transformations and some other DEFF, anyway I will do it DEFF By DEFF

sterile lantern
#

Thanks, we're basically looking for this list so that we can easily check a bunch of LMBs or CMBs if we have to change that code to make sure we didn't break anything

smoky flare
#

Sorry it's been awhile since ive checked here so i missed a lot of the convo, but do you have a specific method yall use when fixing the colors on textures? I wanna check before I commit to my pixel by pixel method lol

wicked gulch
#

hmmm you mean how my tool get the correct texture for the face that it's being filled with that texture?

#

it's a little complex in code but in the explanation it's quite easy...
My tool what it does it checks the properties of the data in the face (Triangle or Quad) (since the original model have several properties written inside of each face, including the CLUT to be used), so what my tool does is matching the each CLUT of each face from the model to the corresponding CLUT of the Texture... it's very inefficient in speed but this 99% sure that you will get the correct texture for that face...
there is an 'speedy way' to do this too... what is 'assuming' that in an Object only 1 CLUT is used, in other words, 1 object == 1 CLUT assigned (and more of one objects could be assigned to the same CLUT) but this prove to be wrong, since some models uses different CLUTs for different faces in the same Object...

#

the classic "fidelity" vs "speed" fight hehehe

#

so if you use the TLoD Assets Converter (the last version) this should be done automatically (except a new bug raised hehehehe)...

smoky flare
#

I’ll get the latest update! Thank you!

wicked gulch
#

you are welcome!

wind veldt
#

What version of blender are you using? Did you get the colors?

wicked gulch
#

4.5

#

at 4.5 it's working just fine

wind veldt
#

Downloaded 4.5.4, Kongol is gray but the animations work. I don't really know what I'm doing I guess

wicked gulch
#

you selected the viewport shading at the 3D window?

#

at material preview

#

or Rendered

#

both of those are working well

#

if you have solid selected will look without any material/color/texture

wind veldt
#

I clicked the button that said rendered, I see shadow affects but no colors... Haven't used blender before...

wicked gulch
#

ahhh nop hehehe

#

in here

#

select in there

#

or next to your right

wind veldt
#

I was following a youtube video and got this far:

wicked gulch
#

ohhh

#

you are using the old way

#

hehehehe

#

use TLoD Assets Converter instead...

#

this new tool will allow doing everything in a single click hehehe

wind veldt
#

Yah, I'm using TLoD assets manager python script, in linux...

wicked gulch
#

that's weird... you should have the textures and everything on the character already

#

what?... you are right

#

this is not only interesting... but very weird

#

let me check something really fast

#

@wind veldt have you use multiple models for converting them?...

wind veldt
#

Yah

#

I used batch

#

Just tried single and multiple, same thing... Maybe it's linux...

wicked gulch
#

I Have the same issue right now...

#

but it's the tool I think

#

found it... for some reason is not taking the textures

#

I wonder why?... even it's happening to my tool on windows...

#

hmmmm

#

🙄

#

sorry Wall Crash but I'm resting from code just now... hmmm were like 16hs of pure coding and reading code... In any case tomorrow will find out what's happening and release a fix for it!

wind veldt
#

No problem, have a good night

wicked gulch
#

thanks a lot!

wicked gulch
wind veldt
#

Kongol learned Rollout:

wicked gulch
#

it's working!

#

now you have to go into the NLA track of Blender and select the proper animation for each of the Objects...

#

sorry but that was the better and only way that Blender uses to import this format hehehe 😬

wind veldt
#

That worked:

#

Do you have a list of what each animation does?

#

I will start watching your youtube videos

smoky flare
#

Did you make an armature for him?

wind veldt
#

I don't know how to use blender, I was just importing the file

smoky flare
#

Ah ok. I was thinking if you’re gonna do custom animations it might be easier to add a basic human armature and pair it to the model.

wind veldt
#

Eventually I will try that

smoky flare
#

I’ve only done it once but I’ll probably try again at some point

wicked gulch
# wind veldt That worked:

wow for some reason didn't read this wth? xD... sorry... I should do a list but actually will be very large... if you want to... you could try

wooden jungle
#

Updates on the MacOS side. I got the application working and figured out the Gatekeeping mechanism preventing the MacOS app from opening. The app is not signed with an Apple Developer ID certificate and notarized by Apple. Which can be rectified via a $99 with the Apple Developer Program membership.

Which I don't plan to get at this moment... it would make others feel safer but I don't find justification enough to do for just one application. Say if I did more applications outside of TLoD Asset Manager, then it would make sense.

There is a workaround to get the app working on MacOS to allow the app to be opened by the user discretion instead.

#

I'll add instructions to the Read Me. And I can now say that there is now an official MacOS port of the tool. I'll add a releases page for it sometime later.

vestal halo
#

Surely Apple doesn't require all software developers to pay $99 for their software to work on the system, right?

wicked gulch
#

well that would explain quite a bit what's going on...

wooden jungle
#

Here is the release! It's on the MacOS fork.

I still encourage users on MacOS to let me know how this is working. I've only got 1 other MacOS machine. More feedback is appreciated!