Suic’s Model Editor (V2)

2024-05-31

Revision support: OSRS (latest and older versions until about rev 170), 317, partial higher rev support does exist but it’s not even close to finished and i am focusing on supporting OSRS and 317

Features:

– Coloring and Texturing triangles
– Animation viewer (both regular and skeletal) it also supports viewing multiple animations at a time (i.e. primary and secondary)
– Mass painting (coloring or texturing a specific material in one click rather than painting triangle by triangle)
– MQO Importer/Exporter (avoids color loss if possible, if it isn’t then it tries to pick the closest colors that exist in the palette)
– GFX Viewer
– Undo feature for painting (Ctrl z)
– Hotkey support (e.g. it is possible to switch edit modes or toggle on paint bucket mode etc by using hotkeys)
– Texture mapping support, this is a feature i spent a lot of time on and it’ll have it’s own section below
– Ability to render the model the same exact way the client does to see how it looks in game
– Finding linked animations to a specific animation, for example you can choose the stand animation for a npc and it will find and display all the animations that work on that npc (walk anim, attack anims, death anim etc)
– Lighting support that tries to match runescapes lighting (it is possible to change by the user as well)
– Save models in any format that OSRS or 317 supports | The model can be saved either to the cache or to the disk as a raw model file (.dat)
– Ability to load models from either the cache (default), a specific folder or just by simply dragging & dropping the model into the editor
– Ability to pack raw model files (.dat) to the cache
– Built in Item config/definition editor (more on that below)
– Built in Texture editor (more on that below)
– Exporting gfx to gif format
– RS Color picker (what the client uses for models) it is also possible to input a specific HSL value or RGB (in hex format) which will just find the closest color in the hsl palette for it, it also stores the last 12 used colors
– Ability to view item/npc/object models, it also applies the recolors/retextures if it uses any
– Ability to dump sprites, textures, models (in any format, it also organizes the models), model color data
Other/Misc:
– Rendering points at vertices
– Rendering edges (basically wireframe mode but while also drawing the faces)
– Rendering Vertex labels
– Rendering label ids
– Animate textured triangles
– Flat or smooth shading
– Packing new textures to the cache

* Texture mapping support *
First of all, i’d like to mention that in my old editor texture mapping support was quite limited compared to this editor, however it was still the best there is and it actually worked quite well
It worked by letting the user either pick any 3 points that would form the texture map or it would try to automatically generate it for a single triangle based on some parameters
This worked well enough for simpler models but for more complex ones it was tedious to make it look nice in game
It also assumed that you did some client changes that would allow textures to repeat rather than clamp, i did post a tutorial for it however it wasn’t really viable for people using the OSRS client and it wasn’t also that easy to implement in 317 for people that weren’t familiar with the client

The texture mapping support in this tool eliminates all of these problems as it works in a completely different way

I don’t want to get too technical, however to properly understand how it works in this tool, i have to mention some important things
The texture mapping algorithm present in OSRS, 317 and really any revision until late 700s or early 800s (early 500 rev iirc did add support for converting to per vertex UV’s but they still did their mapping using the ‘old’ technique) works the following way:
To map a texture onto a triangle (A, B, C), you have to define 3 points (P, M, N):
P defines the origin of the texture in 3D space
M defines the horizontal axis of the texture in 3D space
N defines the vertical axis of the texture in 3D space

PMN forms a plane and a parallelogram in that plane, note that for expected results, PMN needs to be parallel (or at least roughly parallel) to ABC
Then the parallelogram is basically ‘laid on top’ of ABC, so any point that intersects any point on ABC is textured with the texel of that point on the parallelogram
Note: This is somewhat simplified as i’d like this to be easy to understand while also being correct

Finally, how does texture mapping work in this tool and why is it so much better compared to my old tool?

It works by letting the user select a set of triangles that they want to texture
From the selected triangles it generates a texture coordinate that maps the texture onto the triangle without as little distortion as possible
It does this by first computing the average weighted normal (i.e. the normal multiplied by the area of the triangle)
Then it picks an axis (I picked the Y axis but i’ll likely make it possible to select it)
After that it tries to find the ‘extra’ angle that minimizes a bounding box created by aligning each triangle to the target axis
It then reverse rotates it back into position and from that the parallelogram can be easily calculated

In case this doesn’t make sense to you, i’ll explain how it actually works visually:
1) You select the triangles that you want to texture, this generates texture coordinates using the above method
2) You simply apply the texture to the selected triangles or you can apply it to more triangles (altho for best results the parallelogram formed by it should cover the other triangles too then)

If you don’t like the texture coordinates that it generated, e.g. the rotation isn’t quite what you want then these can be easily modified
It is possible to manipulate the texture coordinates in both 2D and 3D very easily

in 2D you can:
Translate the texture horizontally or vertically
Rotate the texture about the z axis
Scale the texture (supports both uniform and non-uniform scaling)
Flip the texture vertically or horizontally

in 3D you can:
Translate the texture in 3D space (xyz)
Rotate the texture in 3D space (xyz)

It is also possible to manually edit the texture coordinates (i.e. points P, M, N however in most cases it isn’t really worth doing it that way)

In summary, it is really easy to apply textures in any way you want onto any model (both simple and more complex models) because most of the hard work which generates suitable texture coordinates is done automatically

* Item config/definition editor *
The item editor can be used to change how the item looks like in the inventory
It’ll also have support for editing any other property of the item such as name, actions, equip/inventory ids etc

* Texture editor *
The texture editor can be used to very easily create recolored or tinted versions of an existing texture, e.g. creating a blue lava texture
The created texture can then be previewed and tested on a model and the user can then choose to pack it to the cache

Support (please read this if you’re planning to buy)
Once you buy the editor, i will send you the jar or source code and a detailed description that explains how to use all the features of the editor and how to use it efficiently
If you need any further help (e.g. you can’t figure out how to do something) you can ask me and i’ll be more than happy to help you with it as soon as i have time (very often in the same day of asking)
If you have a modified OSRS or 317 cache that has different decoders then i can likely easily add support for your cache, just ask me about it before buying
If you would like a feature to be added or want something to work differently, then feel free to ask
If you always use the latest OSRS cache and there is an update then the editor might need to be updated (in most cases it doesn’t, just when any of the decoders that i use change), these updates don’t take long and i check for updates once a day so in most cases it will be updated on the same day of the update
Even after i finish adding everything else i’ve wanted to add, i will still maintain it as long as possible, if at one point i decide to stop maintaining it (definitely won’t be within less than a year) i will provide source code and instructions on how to update it
If there is any other questions about buying, please ask me in discord

* Planned updates *
– Texture mapping updates (better random sampling and the ability to generate a coordinate that aligns with an existing one) (very high priority)
– Transformation gizmo for moving stuff in 3D space, this is actually already partially implemented (high priority)
– Item config editor changes to support adding new item configs and also editing of all properties (high priority)
– Npc config editor (medium priority)
– Object config editor (medium priority)
– Cache editor which should support packing most data (medium priority)
– Resizable support (medium priority)
– Blender plugin with animation editing support (low priority for now)
– Support for converting data to higher rev formats (planning to support a couple revisions between 550 and 742 atm) so that for example OSRS animations and models can be packed to a higher rev client without any client changes required (low priority)
– Features that people suggest in the discord (not all but the ones that multiple people want) (priority depends on what kind of feature it is)

Quick video showcasing most of the features:

YouTube video

https://www.virustotal.com/gui/file/b93e160a8484c2451f74814e89bbc0ce351cf71fa8a59e0742b947a87c1050fa