HomeForumsWhat's newResources 
 
 
JoEngine: Out of Mem trying to import a Tekken 2 texture char
celsowm - Aug 24, 2024
 celsowm Aug 24, 2024
Hi !
I tried to import King from Tekken 2 (source: PlayStation - Tekken 2 - King - The Models Resourc...)

No problems at all when I tried without textures:



But when I try to apply (converted on jo engine map editor):

C:
  
jo_sprite_add_tga(JO_ROOT_DIR, "KING.TGA", JO_COLOR_Transparent);

I got this:



How can I fix this?

 nando Aug 24, 2024
use 8 bit paletted textures instead of RGB - it helps also if they all fit on 1 palette, but you will have to align all the palette indexes.

basically ever quad is it's own sprite, so that is a lot if they are all RGB. I think that the Jo engine tool likely duplicates them too, which is worse. but it's a good place to start and learn at least..

 celsowm Aug 24, 2024

nando said:

thanks for your hints,
so I converted it using image magick:

convert KING.png -colors 256 -depth 8 KING.tga

Is was from an 1.500kb TGA to a 385kb TGA ! Nice

Unfortunately, still giving me Out of Memory

 slinga Aug 24, 2024
Expand Jo Engine's heap size.


  
	
	
#define LWRAM 0x00200000 // start of LWRAM memory. Doesn't appear to be used
#define LWRAM_HEAP_SIZE 0x100000 // number of bytes to extend heap by



  
	
	
// increase the default heap size. LWRAM is not being used
jo_add_memory_zone((unsigned char *)LWRAM, LWRAM_HEAP_SIZE);


Jo Engine's default heap is not that big. Obviously it's up to you to make sure you aren't using that region of memory. Also LWRAM is slower and has some other constraints...

 celsowm Aug 25, 2024

slinga said:



thanks but, I do not know why, the result was this:



maybe an incompatibility with zoom factor?



its strange because when I try ROCK.tga, I got a rockyish king...

 nando Aug 25, 2024
did you split up the original texture into individual quads? because Saturn doesn't have UV mapping.

 celsowm Aug 25, 2024

nando said:

I dont know, I just used the method
jo_sprite_add_tga(JO_ROOT_DIR, "KING.TGA", JO_COLOR_Transparent);

 Frogbull Aug 26, 2024
You need to split the texture into multiple smaller ones and convert as many as possible to 4-bit (with a maximum of 16 colors)

 celsowm Aug 26, 2024

Frogbull said:

sorry for being so naive (at least in gaming programming), how can I do that?

 Frogbull Sep 2, 2024

celsowm said:

You need to reshape the 3D model to reduce the polycount by merging two triangles into one quad where possible.

After that, assign one material to each polygon. You can reset the UV mapping (unfortunately, the Saturn doesn't support UV mapping). The only modifications allowed afterward are rotating or mirroring the UV map to simulate the Saturn's capabilities. If a polygon uses only one color, that's even better, as pure color polygons are less costly than textured polygons.

 celsowm Sep 4, 2024

Frogbull said:

Oh...thanks
I do not even know how to do that but I am gonna try to find a tutorial or something like that.
In your experience porting psx games, what is your approach ?

 Frogbull Sep 18, 2024

celsowm said:

It's a mixed approach, but the first step for me is to import the model into Blender, remove all duplicate vertices, and try to quadify the model as much as possible. After that, I split the texture into multiple textures, detect all rotated/mirrored textures to avoid wasting memory, and once that's done, assign each texture to a material.
The more quads made of a single color, the better. The final step is to properly reduce the color depth of the textures to 4-bit (with or without dithering) and reduce the resolutions where it's possible. You can also slightly reshape the model to squeeze in some unimportant faces.

Good luck, 3D modeling for the Saturn is time consuming and not easy