Spoiler tag

Saturday, June 20, 2020

JSRF ModTool: Open Source

Hey,

I am making the JSRF ModTool open source, I wanted to do this for a while but wasn't very confident about my code, either way its best to put it out there once and for all.

If you're a programmer and are interested in modifying the tool for personal use, or contributing, I am all for it, I am also all ears if you have feedback on my coding, bad practices etc I would love to hear it so I can improve.



 Cheers!

Saturday, May 30, 2020

JSRF ModTool 2.6 - Model importing fixes


Hi, here's a new version of the tool with fixes for model importing.


Changelog:
-Fixed support for new materials manually added when importing, before it would not load nor add the new materials to the imported model.

-Fixed UVs getting messed up when importing.

Thursday, May 21, 2020

Tutorial: character model swapping

Hi there, here's how we can swap player models by almost any model, in this case we're going to take a non playable "enemy" model and paste it into a "player" (.dat) file.

First let's choose which model we're going to take, for instance go to the "Enemy" folder and open Armed.dat, then inside NORM[3] and select the first MDLB.



Under the dark grey bar with text "Armed.dat"click the "copy" button, now what is selected is copied to the clipboard memory.

Now on the list of folders and file(on the left) go to the "Player" folder and select the Beat.dat file.
Thenselect the first MDLB as in the following image:


Then click "paste"


We've pasted the MDLB from Armed.dat into a Beat.dat's MDLB.

You'll notice we also need to replace the texture, but first we're going to make some parts of the Beat model, invisible, such as the head and hands models, because the model we're replacing already has those parts integrated in the first model.


Here's how the contents of a player.dat file is structured:


Inside the NORM [13], go to each head and hand model (MDLB) and click "Collapse vertices", this button moves all the model's geometry points to the same position, making the model invisible.


If the player model you selected has "Jiggle" models(such as clothing, chains or hair that moves), you can remove those by selecting one and clicking the "empty" button, but using "empty" might cause the game to crash, as the game expects to find those model parts, it's original bone hierarchy and to apply animation or the "jiggle" effect.

So instead of using "empty" we use "collapse vertices" for the hands, head models and jiggle models.



Finally lets get the texture from the original model, copy and pasting within the JSRF Tool won't work for this, because the textures have a unique ID number, so instead we're going to replace the image data through an image editor so the texture ID is preserved as the original.

Load Enemy\Armed.dat, select the texture and click "Edit texture"


Now open Player\Beat.dat and select the second texture and click "Edit texture"

In your image editor, copy the texture of Armed.dat, into the window of Beat's texture, save and then go back to the JSRF Tool with the beat texture selected and click "save changes".


 

That's all!

And the result ingame:


Sunday, April 12, 2020

JSRF Modding: how to import custom songs, by Yayo de la Riva

Hey all, here's a tutorial on how to change the music/songs in JSRF done by Yayo de la Riva



Click here to check out his channel for all kinds of tricks and JSRF speedruns.

Monday, March 16, 2020

JSRF ModTool 2.5.9 (Model importing fixes)

Hey

Quick blog post just to let you know I have fixed some bugs in the model importer, for instance before when adding or removing materials from the list in a model, after recompiling it would always reset to the number of materials the original model had, there's some other small bug fixes that I can't remember off the top of my head.

3 May 2020: 
-fixed and added support for some models that have the materials defined in a different manner, that would cause an ingame crash after importing certain models.
-fixed error message when trying to open a texture file with paint.net or Gimp 
-fixed imported models UVs being inverted or shifted on the V axis.





Also here's a little mod in an attempt to get SEGA to get us a proper JSRF HD port.

And a panoramic of the Garage

Saturday, February 1, 2020

JSRF - Artstyle analysis


Deconstructing the JSRF Artstyle


JSRF is known for its "cell-shaded" style, which is achieved through texture, shading, lighting as well as post-process screen effects.

I believe JSRF uses a technique called lightwarp-shading to shade the models.

The lightwarp shades the 3D model with a gradient of different brightnesses and color tones.
Here is a
similar example of this shading technique as seen in the game Team Fortress 2.

The right side is the lightwarp shading.

TF2 pyro lightwarp texture:






JSRF lightwarp:


This is the JSRF main lightwarp texture, actually the lightwarp in JSRF is stored in (the following) larger texture file which appears to have more images that are likely used to fake reflections and/or specular highlights.




 To get a better idea of how models are shaded, on the left image I have made the textures of the character Corn almost white, so we can clearly distinguish some parts of the body using a different shading, color and reflectivity.



 Here is what Corn's textures for the body and face/hat look like:



 Here is another comparison, shaders only (with a white flat texture) vs shaded + texture:




JSRF player models use various materials, to get a better look at the materials in the following picture I have turned the player model into spheres each with a different material.


  


Shadows

The game uses multiple ways to render shadows:  real time shadows, pre-baked shadow volumes, flat 3D meshes as shadows and decal texture shadows.

Its unclear and I can only speculate on if the shadow techniques were chosen for performance optimization purposes and/or was an artistic choice, as for instance the level's shadows volumes are simplified, that might have been deliberate to avoid visually noisy shadows that more realistic shadows would cause and/or also a less performance demanding technique to cast shadows.

Let's go through the different types of shadows.

                                                   Decal casted shadows



On average the level of detail for pedestrian models are all around 200 triangles per model.

The crowds of people in JSRF use a faked decal shadow that is projected over the floor and stretched/oriented depending on the direction of the sunlight and animation, its just a rectangle (using two triangles) with the shadow texture on it and using opacity to blend it with the surface its projected on.


   As you can see, the blue texture on the bottom of this picture is what gets projected underneath the pedestrians to fake a shadow, its simple, cheap, elegant and effective.
After all there's so many pedestrians in JSRF that using real time shadows would definitely tank the framerate on an original xbox.


Real time shadows

Real time shadows are mainly used on playable characters,  important characters models or animated objects.
The player's model file contains a simplified version of the visual model that is used to cast the shadow.
 
 





There's Yoyo, his shadow is a bit more "blocky" than the visual model, though this is not really noticeable while playing and a nice optimization.


Shadow volume meshes

For the levels, JSRF uses pre-baked aka pre-calculated shadow volumes.
The volumes of the shadows are baked into a 3D model that are overlay-ed over the level's visual models and darkens/tints the areas it covers or any moving object that goes inside it.

In the following image you can see the shadow volumes in blue for the garage level, on the top right image I have made the shadow volumes semi transparent so you can get a better idea of how these shadow volumes overlay over the level's visual mesh and darken+tint the areas inside the shadow volume model.



 
Casting real time shadows for the scenery is most likely too taxing performance wise (at least for the original xbox) so instead it seems the developers decided to use shadow volumes which are far less expensive for the game to run.

Its unclear if the shadow volumes were auto generated, or made manually, or a mix of both, because  the shadow volumes seem to have been simplified since they do not contain all the shadows for every object in the level, it's mainly only buildings and medium sized objects that are in the shadow volumes.

Besides the performance/optimization boost by using shadow volumes instead of real time shadows, much of the shadow detail is simplified with this technique and lends itself to a far less noisy and more readable environment than if every tiny shadow was cast for the smaller details.




Well, I think that covers the main things and its only a little glimpse into the many things that make this game a piece of art.

That's it for now, I am sure more could be said about the game as it is full of details I might have glossed over, if so feel free to let me know and I can edit this post or make a second part.