What's up with development

only_a_ptr

Infamous Developer
Administrator
Developer
Joined
Jan 31, 2018
Messages
167
Location
Prague, CZ
Greetings.

I never really post any dev news because I work quite chaotically, I have more than a dozen things going at any given time and I switch between them based on personal conditions. But I've just been "interviewed" about it by Max98 on Discord and with his permission, I'm reposting the chat here because the info may interest others as well.

Max98 — 02/18/2022
I’ve lost track of ror’s dev, what’s the priority? What is being worked on?
only_a_ptr — 02/18/2022
Zentro+tritonas00 are hard at work with https://github.com/RigsOfRods/rigs-of-rods/pull/2850, I'm just slumping
Max98 — 02/18/2022
Interesting
That’s quite a thing tbh
only_a_ptr — 02/18/2022
Sure is, and they did it almost without me
theyre CURL experts by now
my priority, uhh.... fixing Unicode on Windows. I fixed almost everything but somebody always complains
Max98 — 02/18/2022
Yeah, you can’t make everyone happy lol
I’ll dive back into the source code after nodesnap 2
Oh and by the way, it uses rust
only_a_ptr — 02/18/2022
that doesnt bother me, but theres something Unicode-wrong lurking somewhere, possibly in the deps. OGRE is already fine but PagedGeometry, Hydrax, Caelum are still suspect
Max98 — 02/18/2022
I have something else to ask
Don’t you think it’s wise to make a new ror?
‘Make’ as clean up the current source, remove anything irrelevant
Make sure everything is good
And new start
only_a_ptr — Yesterday at 11:38 AM
I'm glad you ask that, it comes to mind of every programmer.
The answer would be: absolutely not. Not because RoR would already be up to some standard, but because such efforts are known to be more harm than good.
First, many devs in history gave in to the urge to "rewrite from scratch". It always ends either poorly or not better than the original. Very good read on that: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
Second, there's my personal experience with the approach of "I'll just write a new parser + spawner, the old stuff is mixed and messy". I failed miserably at that and the git history documents that clearly... in 2013 I piled a lot of crap and then spent years iteratively removing it, and the WIP https://github.com/RigsOfRods/rigs-of-rods/pull/2829 concludes that.
I'm already doing a cleaning up as you describe - I remove anything that isn't actively being executed, even if it's just a GetValue() type function.
I'm firmly convinced that in software, only one thing matters - user satisfaction. Even hacky and buggy code can make users a lot happier than clean stable code. It's not my original idea - I learned it working here. Nobody ever appreciated my sweaty big internal refactors and hailed Ulteq's simple hacks providing new gameplay feat. I grumbled over it until I realized the problem is entirely in my head - the computer doesn't give a damn, and code isn't really any less stable or harder to work with - it just feels that way. Feelings are misleading.
only_a_ptr — Yesterday at 12:14 PM
(ad 'New Start')Already hapenned, actually. We have new domain, new website, main menu, settings/controls UIs, MP lobby and overall consistent and clean UI (no offense :D). Now the guys did the Repo UI and they won't stop there. After years of decline when I did nothing but to fight my own parser mistakes, we're on a slow but steady rise.
only_a_ptr — Yesterday at 12:31 PM
Oh right and after suggestion by AnotherFoxGuy we changed the version scheme. That's pretty much a moment when we cut the ribbon to open a new era.
Max98 — Yesterday at 8:35 PM
Alrighty
I'm just waiting for the anglescript scripting per truck and the 'slot' system
that will open a hell of a lot of doors to modding
By the way, about the GUI
Don't you think it's wise to remove everything associated with ogre mygui, and just use cef and imgui?
cef for the main stuff and imgui for the rest
That will make it much easier to design the UI, also opens a lot of ideas to be made
It may seem like i'm saying stuff that are done in beamng, but it's just the way to do it
90% of games now just use cef
2/ What about OIS
That was a problem when compiling in MacOS
Since it is not supported anymore and no versions recent enough works with macos
3/ Graphics
Any news about that?
I don't think we need 'wow' ish graphics but something more modern and eye candy will do
Is there anyone on the team that's good with shaders and stuff?
(ofc, using ogre)
only_a_ptr — Today at 11:13 AM
"angelscripting per truck" - that can be coded in 10 minutes, just extend https://github.com/RigsOfRods/rigs-of-rods/pull/2840 a little - put new field 'TRUCK' to https://github.com/RigsOfRods/rigs-of-rods/blob/master/source/main/scripting/ScriptEngine.h#L43-L48 and add some hook to truck file format which will call loadScript() - but with current API, there wouldn't be much to do with that. What feature specifically are you looking for?
only_a_ptr — Today at 11:16 AM
"GUI" - I'm on that, MyGUI is only around for the new truck HUD and I'm remaking that: https://github.com/RigsOfRods/rigs-of-rods/pull/2764
only_a_ptr — Today at 11:24 AM
"CEF" - I hate the idea, I have no technical arguments but it feels lame and tasteless to apply such a complex solution on a trivial problem such is a game UI. Especially with DearIMGUI around and it's bindings to AngelScript - you can draw GUI as well as diagnostic overlays with it. Feel free to debate this on the forum, but until there is actuall demand and vision from the modding community, I'm against CEF
"OIS" - yes that's a showstopper for Mac* support, and I intend to replace it with SDL2 which has exellent Mac* support afaik. But it's not a pressing issue
only_a_ptr — Today at 11:42 AM
"shaders and stuff" - THAT is the question 💀 🎭 🤴 I dunno but if there is, they make good job of hiding. Honestly at this point I'm just waiting for the community to stop being lazy and actually research what OGRE can do, because we're not even using 50% of it's capabilities. Sure, I haven't done much to improve this situation but I'm still just one guy without modding background. All questions that ever come up are irritatingly shallow like "why not 10% cooler" - I can't work with that. I'm being serious - the only thing holding our graphics down are assets
 
Last edited:
Max98 — 02/18/2022
Don’t you think it’s wise to make a new ror?
only_a_ptr — Yesterday at 11:38 AM
I'm glad you ask that, it comes to mind of every programmer.
The answer would be: absolutely not. https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
I just wanted to say - thank you for an interesting/enlightening read. Old article, but still applies today. This really changes how I will look at my own work from now on.
I'm very happy that RoR is in experienced/rational hands.
 
Just to give an update on some projects that are in mind

- Parser cleanup/revert to its original state
- Update to Ogre 13 (almost done) and remake materials/shadows/lights. Also Ogre 13 fixes the Windows/Unicode issue.
- MP collisions - character to vehicle (almost done) and vehicle to vehicle
- Complete the new online API (the one repo panel uses) and login via username instead of token
 
Last edited:
I wish I could get my head round shaders. I try and try and always mess something up.

A default set of shaders would be absolutely amazing for modders, and somewhere somehow a lot of them are in RoR, but not exposed to users. I don't know enough about the code to figure out where?

The water has a fairly good approximation of Fresnel, which would be great to apply clearcoat and glass.

The terrain has bump, normal and parallax which would be great to apply to any in game .mesh

There's a shader that allows transparent objects to cast and recieve shadows on the Ogre forum, which is supposed to work with PSSM and it can be made to work with trees, but it creates more problems than it solves (with unshaded grass).

I think some of my issue is to do with being on Linux and .cg support etc.

Though since switching to the Snap version of RoR from the itch.io version AngelScript and other features work "out of the box" and generally the full features of the game are available, I always seemed to have something broken otherwise.

I changed hardware recently and even my old ass gear can run Community Map at playable speeds now, a few issues with vegetation exceeding my GTx1050s 2Gb vram on e.g. mudterrain, but mostly I lock the FPS to my 50Hz monitor and my processor doesn't even go in to turbo mode. I've tried a few different CPUs and RoR scales pretty linearly with the single core speed. I usually have one core at 100% and the rest idling.
 
@rents1977 I can't really write shaders fluently but once I made a working vertex shader which simply moved everything 1 meter to the side and pixel shader which painted everything bright yellow. I suggest you build OGRE samples, pick one which already uses shaders and then pull some wires to see what happens. An output of vertex shader is always vertex position (at least) and output of pixel shader is always exactly RGB color. Passing parameters to shaders is the tricky, engine-specific part, but for the basic doodles you don't really need those.

In RoR, most shaders are done the OGRE way - they live in their source files, they're declared in OGRE .program files and referenced by OGRE .material files. The OGRE manual explains it here: https://ogrecave.github.io/ogre/api..._002fGeometry_002fFragment-Programs-in-a-Pass. In the codebase, Caelum sky shaders are in https://github.com/RigsOfRods/rigs-of-rods/tree/master/resources/caelum as files like I wrote. Hydrax water shaders are embedded in https://github.com/RigsOfRods/rigs-of-rods/blob/master/source/main/gfx/hydrax/MaterialManager.cpp as strings, the binding is done in code but works the same way. Our PSSM shader + bindings is here: https://github.com/RigsOfRods/rigs-of-rods/tree/master/resources/managed_materials and the classic Nicemetal.cg is here: https://github.com/RigsOfRods/rigs-of-rods/tree/master/resources/materials - not all files there are used I think.

RoR has actually 2 sets of ready-made shaders. The first is "managedmaterials" feature of truck format, described https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#managedmaterials. It uses the PSSM or Nicemetal shaders based on configuration in RoR.cfg (gfx_classic_shaders). The second is OGRE's RealTimeShaderSystem (RTSS) which nobody really uses but it's very powerful, see the docs https://ogrecave.github.io/ogre/api/latest/rtss.html

Oh yes, and there's the separate OGRE Terrain's shader generator which doesn't have a file format and must be used from code, see docs: https://ogrecave.github.io/ogre/api/latest/group___terrain.html#details We have a custom fileformat for it: https://docs.rigsofrods.org/terrain-creation/terrn2-subsystem/#ogre-terrain-page-config-otc

My current development plan:
* finish upgrade to OGRE13.x - the code is almost ready - https://github.com/RigsOfRods/rigs-of-rods/pull/2858
* ditch our custom PSSM Cg shaders, use OGRE's integrated PSSM from RTSS.
* ditch our custom Nicemetal Cg shader, use OGRE's integrated "metal_roughness" effect from RTSS - new in OGRE13 - https://ogrecave.github.io/ogre/api/latest/rtss.html#autotoc_md248.
* create a miniature meshed terrain to showcase RTSS features
 
I tired to use the inbuilt bump mapping using rigs-of-rods/resources/materials/general.material, but I obviously do something wrong, as although I get the bump mapping I don't get the PSSM shadowing. I don't know how to combine the bump effect in general.material with the RoR/Managed_Mats/Base pass?

This gives the shadeless bump maps:

import * from "general.material" material Bump: ppx_shadow_sel { set_texture_alias diffuseMap AmbientOcclusionMap.png set_texture_alias normalMap NormalMap.png }

Obviously if I can use built in shaders like this it would save including the .cg and .program in each terrain mod zip file.

I think will just wait for the use of the RTSS and inbuilt Ogre stuff though :)
 
It's going to be something around multiple passes and shadow casting/receiving directives. I can't really work with it. Honestly this is the first time I'm even looking at "general.material", so you're already a step ahead. Keep trying, you'll get there.

The current OGRE version we use already has the RTSS PSSM, I just haven't learned to use it yet.
 
Last edited:
An update on something we working currently. In-game AI with user defined waypoints, easily by clicking on the survey map.

kk.png


There are some early testing vids on discord, in development channel.
 
Will RoR officials make vehicles or maps in the future? The official RoR vehicle looks great.
 
An update about the upcoming AI. RoR can now fetch (download) waypoint presets from a json list on github. Its possible to have multiple presets for the same map, or different maps, all in one file. Everyone can contribute to the json list (i will add a tutorial, its very simple and straightforward) and as soon as the file is updated on github, RoR will show the new presets automatically, nothing needed on user's side.

kk1.png


kk2.png
 
Last edited:
Back
Top