Spoiler tag

Tuesday, August 27, 2019

JSRF ModTool 2.5 - Model importer improvements + High resolution texture importing

Hey, here's an update for the tool, I have improved the model importing, fixed some bugs, and added support for a model type(player character head models) that are different from the common model setup.

For learning the basics on how to use the tool, see this post and also this post

It is now possible to import scaled up textures, meaning you can for instance edit a 512x512 texture, scale it up to 1024x1024 in the image editor, save, and then import with "Save changes" in the JSRF ModTool Texture Viewer tab, the tool will import the texture with the new resolution.

This will be useful for some of you out there who want to re-create some of the UI textures which are quite pixelated and low resolution and could use an HD remake, looking forward to those mods.

The tool maximum texture resolution import is limited to 2048x2048, I haven't tested higher resolutions and really for JSRF I would recommend sticking to 1024 as the maximum in general.

And as always, don't forget to clear (delete the files) in the cache, that is the X Y Z, HDD partitions, so the game reloads your modded files.


JSRF now playable in HD on PC with the cxbx-reloaded emulator

You can now play JSRF in high resolution with the emulator cxbx-reloaded




The emulator runs JSRF flawlessly, you might need a fairly powerful CPU and/or GPU to run it at a good frame-rate depending on the resolution you chose in the options "Settings > Config Video".

To run at higher resolutions set the "Display resolution" and "Render Resolution" to something higher than the default.


You can download the latest version of cxbx-reloaded by clicking on "Latest Development Build" in this page.

I of course own a DVD copy of the original JSRF game (and an original xbox) and so should you if you're going to play on the emulator, as I don't advocate piracy, you'll have to figure out on your own how to get the files of the game to run it on cxbx-reloaded.


You can support the development on cxbx-reloaded here on Patreon as while it may very well run JSRF, there's still lots of work to be done to get other xbox games running and the amazing developers could use our support.


We might not have gotten an official JSRF port, but we have this amazing emulator now, have fun!

Thursday, July 18, 2019

JSRF ModTool 2.4 - And character model importing

Hey there, here's the new version of the tool that can import models of the type named "MDLB" (characters and objects).




For learning the basics on how to use the tool, see this post and also this post

While its now possible to import models, keep in mind if you want to do so you will need to have some 3D modelling, uv mapping and rigging skills if you want to make a brand new character and import it.

Therefore this is not going to be a tutorial on how to do 3D modelling as that's a separate gigantic topic, you can find various 3D modelling apps and tutorials online, you might however be able to try doing simple edits on models like changing proportions of the body if you follow this example.



Three new buttons have been added to the top right of the model viewer to import/export models.
The JSRF ModTool will export and import models as .SMD model file format.


The "Collapse vertices" button will move all the model's points to the origin position (0 0 0) making the model invisible, this can be useful to hide parts of the original model such as the different facial expressions the game switches through as the character is animated.
If you don't want to bother making separate models for each facial expression, you can have the body and head model all contained in the first imported MDLB and then you could just make all the other original head models invisible by using the "Collapse vertices" button.


As for the tiny buttons "Expt." and "Impt." they let you export or import the selected item(block of data) as a binary file if you want to take a look with a hexadecimal editor to mod some particular data manually.



Anatomy of a JSRF character .dat file

Here's how playable character models are organized in the .dat file






                          Exporting a model

Just select an MDLB item and click "Extract MDL", it will let you select a folder where you want the model to be exported as .smd files, give it a name and click Save.

The tool also exports the lower level parts of the model which have to have the same naming as the main model so when importing the tool can find the lower parts of the model to import as well to rebuild the model properly.






Using Blender (2.79) to edit a model

Since the JSRF ModTool exports the models in .smd file format, for Blender you will need the Source Tools here  to import the model(s).
Installation instructions for the plugin are on this page

Once the plugin is installed and enabled you should be able to import .smd files by going into the menu File > Import > Source Engine



In this example I am going to make a small edit to the body of Beat, which I exported as "beat_body.smd"

First thing you'll notice is you need to rotate the model 90 degrees on the X axis.
Also note that the models comes inverted on the X axis, unfortunately I don't have the math/trigonometry etc knowledge and skills to code something so the JSRF Tool would sort these issues,luckily you won't need to turn it front 90 degrees again as the SMD exoprting tool can manage that for you.







Unfortunately with the SMD file format I haven't searched a way to have the models export with its texture(s), so you'll need to export them, select a texture and click "Edit texture", the texture will be extracted in the JSRF ModTool folder "resources\tmp"
Then assign the texture(s) manually in blender.


Made some edits to the model here:



Since I am barely familiar with blender, I just make some simple edits for demonstration, making his skates tubes ridiculously long and his shoulder spikes longer.

Once you are done with your edits, go to the top right panel where you see the list of the objects in the scene, right click on "beat_body_skeleton" and "Selected Hierarchy"







Blender and SMD export settings


Now before exporting we need to setup a few things in the Source Engine export panel.

Click on the  third button highlighted by the red circle, to display the
Source Engine export panel with which we can export the model back to SMD format.


Under "Source Engine Export" there's a few things to setup.

1-Set the export path, to the folder where you extracted the models (same folder where you extracted with the JSRF Tool)

2-Set the export format to SMD

3-Set the Target Up axis to Y


4-Now click the "Export" button, that's it!


Importing a model on the JSRF ModTool

Go back to the JSRf ModTool and with the original MDLB selected click  "Import MDL"
Select the first model on the list, in my case "beat_body.smd" and click Open.

This window should show up if there are no errors with the model files.
The lower level models (p_0 p_1 p_2) should be also loaded automatically if the naming is as on this example.



There are many settings here that you'll most likely never will need to modify but I am going to explain them anyways:

-Vertex definition size: size of the block of data defining a vertex(point) and other properties depending on the size, such as UV, Normals, sekeleton/bone ID,
bone deformation factor etc

-Global draw distance
: distance at which the model disappears (for performance optimization)




Materials

A JSRF player model usually has multiple materials/shaders that define the shading style.

Your model's materials groups should be named "mat_" and the corresponding number you want the material to be.

You can change the color and transparency of the material with the RGBA values, though this might depend on the type of "Material ID", this seems to be mostly used on models for the menus where they used a flat/solid color, and so the RGBA seems to work mainly on materials types dedicated to menu/UI models.


Material ID: this defines the type of shading for this material group (mat_0), there are many many more material IDs in other models that will show up as a number since I haven't researched them all to give them a name.

Float: this is an unknown parameter, it rarely changes, if you figure out what it does, don't hesitate to post in the comments.

You can remove materials by clicking the [x] box on the top right, and add materials from the button on the top right.



Importing

Now that all is setup click "Import", if everything about the model is properly setup it should import without giving any error messages.

Please note that JSRF models are limited to 2 deformers(bones) per vertex


There's the modified model imported, recompiled and ready for the game. 

And there it is ingame.


Some info and tips for full custom character mods

 You must keep the original bone hierarchy, modifying it or replacing it might cause animations to get messed up or even cause a crash.

If you're going to rig a different model, a new model, or ported mesh from some other game, note that you can move the bones around quite a bit(if the proportions differ from the JSRF's original character model) and the game engine will tolerate and will compensate for it anyways, so you can make a character shorter or taller moving bones around.

As you might notice, the exported character model's bones do not have a rotation, they are set to 0 0 0, it seems the rotation is completely dependent and applied by the animation data(which I haven't reverse engineered), some animations seem to be shared between characters and they all share the same or very similar rig(bone hierarchy and placement).



Well, I think that's more or less all there is to it, if you have any questions don't hesitate to ask in the comments.

Cheers

Tuesday, June 4, 2019

JSRF : model importing, custom character models now possible

Hey everyone, so I reverse engineered more of the model format and managed to code a model importer for JSRF (for characters and objects).

Here's some examples of custom player model imports:

 


I still have more work to do on the Mod Tool for model importing, I will post the tool as soon as its ready.

That's all for now, see ya!