2023-10-14 snapshot (Updated on 2023-10-29)
Re: 2023-10-14 snapshot
is there a way we can get /toggledecals back up and working again? its a real pain in the you know what just to save track then exit the game, pull the decals file out and then open the game back up just to put tile down haha
-
- Posts: 143
- Joined: Mon Oct 21, 2019 9:06 am
- Team: District D|Brainsick
- Location: Western Australia
Re: 2023-10-14 snapshot
Is it a possibility to get 2 stroke smoke in the next update? Could be like a particle box in blender or something and it moves billboards that are the smoke texture inside that box? or could just some sort of box that is named in blender to assign with some script that is used when the game loads up and reads the bike frame.jm?
Re: 2023-10-14 snapshot
so many other things that are needed other than 2 stroke smoke my guy ☠︎☠︎Hayden_Scott wrote: ↑Thu Oct 19, 2023 2:41 pm Is it a possibility to get 2 stroke smoke in the next update? Could be like a particle box in blender or something and it moves billboards that are the smoke texture inside that box? or could just some sort of box that is named in blender to assign with some script that is used when the game loads up and reads the bike frame.jm?
-
- Posts: 305
- Joined: Wed Oct 08, 2014 1:25 am
- Team: Late Night Crew
- Location: San Diego, California
Re: 2023-10-14 snapshot
Would be a cool feature to have, just these little things will really freshen the game up nicely. Tread marking is already a great step.Hayden_Scott wrote: ↑Thu Oct 19, 2023 2:41 pm Is it a possibility to get 2 stroke smoke in the next update? Could be like a particle box in blender or something and it moves billboards that are the smoke texture inside that box? or could just some sort of box that is named in blender to assign with some script that is used when the game loads up and reads the bike frame.jm?
-
- Posts: 143
- Joined: Mon Oct 21, 2019 9:06 am
- Team: District D|Brainsick
- Location: Western Australia
Re: 2023-10-14 snapshot
thats what im saying i dont think it would be toooooo hard to do. But i am not a game developer so idkScrubDatMx wrote: ↑Thu Oct 19, 2023 8:30 pmWould be a cool feature to have, just these little things will really freshen the game up nicely. Tread marking is already a great step.Hayden_Scott wrote: ↑Thu Oct 19, 2023 2:41 pm Is it a possibility to get 2 stroke smoke in the next update? Could be like a particle box in blender or something and it moves billboards that are the smoke texture inside that box? or could just some sort of box that is named in blender to assign with some script that is used when the game loads up and reads the bike frame.jm?
Re: 2023-10-14 snapshot
Yes. I have a fix for it. I have one other thing to fix and I'll upload an update.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: 2023-10-14 snapshot
It wouldn't be too hard to do but things like that turn into death by a thousand cuts. I want to focus on bigger things. The next big update will be the culmination of the terrain rendering optimizations. After that I'm not sure but probably shading via HDR environment maps.Hayden_Scott wrote: ↑Thu Oct 19, 2023 11:44 pm thats what im saying i dont think it would be toooooo hard to do. But i am not a game developer so idk
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: 2023-10-14 snapshot
i love this update - looks really clean. the number of turn tracks ive already carved out...
is there a way to toggle the tread decals on/off in-game?
is there a way to toggle the tread decals on/off in-game?
Re: 2023-10-14 snapshot
You can set "treadmark limit" to 0 to disable dropping the treadmark decals. No way to hide/show already dropped treadmarks though.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: 2023-10-14 snapshot
Great update JLV. Is there a way to save the treadmarks you create on the track like decals? I'd like to use them to make single track trails and actually save the marks for my next session.
-If you like riding my tracks please donate to the cause https://www.paypal.me/jgmtbike
-Thanks so much for all your support of my tracks.
-Thanks so much for all your support of my tracks.
-
- Posts: 1184
- Joined: Fri Nov 24, 2017 3:16 am
- Team: Phil's
- Location: Cold
- Contact:
Re: 2023-10-14 snapshot
I made a track script that essentially allows you to do this by logging the decals with their coordinates, angle, size, aspect, etc to lastlog.txt. You have to change what treadmark decals associate with what tile number.
You also have to get rid of the date logs, usually doing it with:
Code: Select all
grep -o '@@@<TREAD_NAME>.*@@@' lastlog.txt > treads.txt
Here's the script if anyone wants to save treadmarks. If anyone actually uses this and wants me to modify it to meet jlv's treadmark code, then I can do that.
Code: Select all
// Position and velocity variables for riders rear tire
var rearTirePos = [], rearTireVel = [];
// Running order variable
var globalRunningOrder;
// Change the name to your track folder
const trackFolderName = "@TRACKFOLDERHERE";
const decalsToLog = [
{
name: "tread",
size: 6.000000,
aspect: 1.0000000,
texture: trackFolderName + "/decal/tread.png",
spacing: 2.5,
tileNumbers: [0, 1, 2, 3, 4, 5, 6, 7, 11],
minSpeed: 5, // minimum speed needed to log a decal in ft/sec
lastDecalLogged: [],
},
{
name: "disturbed",
size: 10.000000,
aspect: 1.0000000,
texture: trackFolderName + "/decal/disturbed.png",
spacing: 10,
tileNumbers: [0, 1, 2, 3, 4, 5, 6, 7, 11],
minSpeed: 5,
lastDecalLogged: [],
}
]
function logDecals() {
/* Since this loop goes through the running order, decals should overlap correctly.
If second happens to place a decal on top of one close to first's it will be on the layer above */
for (var i = 0; i < globalRunningOrder.length; i++) {
var slot = globalRunningOrder[i].slot;
// Loop through each decal in the decals to log array
for (var j = 0; j < decalsToLog.length; j++) {
// if there is no coordinates stored for this slot and decal yet add them
if (decalsToLog[j].lastDecalLogged[slot] == undefined) {
const rearContactMade = mx.get_rear_contact_position(slot, rearTirePos);
if (rearContactMade == 1) {
// Check to see if the tile number the rear tire is on matches the tile number in the decals to log tileNumbers array
const tileNumber = mx.get_tile_number(rearTirePos[0], rearTirePos[2]);
if (decalsToLog[j].tileNumbers.indexOf(tileNumber) === -1) continue;
// store the X and Z variables if the rear tire has made contact
decalsToLog[j].lastDecalLogged[slot] = [rearTirePos[0], rearTirePos[2]];
// get the rear contact tire velocity and use it as a normal vector for calculating the angle of the tire in world space
mx.get_rear_contact_velocity(slot, rearTireVel);
// Calculate the rear tire velocity and put it in range of 0 to 2pi and rotate 270 degrees counterclockwise
const rearTireAngle = ((Math.atan2((-1 * rearTireVel[2]), rearTireVel[0]) + Math.PI * 2) + (3 * Math.PI / 2)) % (Math.PI * 2);
mx.message("@@@" + decalsToLog[j].name.toUpperCase() + "[" + rearTirePos[0].toFixed(6) + " " + rearTirePos[2].toFixed(6) + "] " + rearTireAngle.toFixed(6) + " " + decalsToLog[j].size + " " + decalsToLog[j].aspect + " " + decalsToLog[j].texture + "@@@");
}
}
const rearContactMade = mx.get_rear_contact_position(slot, rearTirePos);
// if the rider is in the air we don't want to log a decal placement
if (rearContactMade == 0) continue;
// Check to see if the tile number the rear tire is on matches the tile number in the decals to log tileNumbers array
const tileNumber = mx.get_tile_number(rearTirePos[0], rearTirePos[2]);
if (decalsToLog[j].tileNumbers.indexOf(tileNumber) === -1) continue;
// calculate distance from current tire contact vs last decal placed and check to make sure it's greater than the minimum distance between decals
const differenceFromLastPlacement = distanceCalculation2D(decalsToLog[j].lastDecalLogged[slot][0], decalsToLog[j].lastDecalLogged[slot][1], rearTirePos[0], rearTirePos[2]);
if (differenceFromLastPlacement > decalsToLog[j].spacing) {
decalsToLog[j].lastDecalLogged[slot] = [rearTirePos[0], rearTirePos[2]];
// get the rear contact tire velocity and use it as a normal vector for calculating the angle of the tire in world space
mx.get_rear_contact_velocity(slot, rearTireVel);
const magnitude = Math.sqrt(Math.pow(rearTireVel[0],2) + Math.pow(rearTireVel[1],2) + Math.pow(rearTireVel[2],2));
if (magnitude < decalsToLog[j].minSpeed) continue;
// Calculate the rear tire velocity and put it in range of 0 to 2pi and rotate 270 degrees counterclockwise
const rearTireAngle = ((Math.atan2((-1 * rearTireVel[2]), rearTireVel[0]) + Math.PI * 2) + (3 * Math.PI / 2)) % (Math.PI * 2);
mx.message("@@@" + decalsToLog[j].name.toUpperCase() + "[" + rearTirePos[0].toFixed(6) + " " + rearTirePos[2].toFixed(6) + "] " + rearTireAngle.toFixed(6) + " " + decalsToLog[j].size + " " + decalsToLog[j].aspect + " " + decalsToLog[j].texture + "@@@");
}
}
}
}
function distanceCalculation2D(x1,y1,x2,y2) {
return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));
}
function frameHandler(seconds) {
globalRunningOrder = mx.get_running_order();
logDecals();
}
mx.frame_handler = frameHandler;
Re: 2023-10-14 snapshot
No way to save them currently. It merges all the different treadmark textures into one atlas texture for the sake of efficiency. That makes it difficult to save them since it'd have to keep an index mapping the atlased textures back to their original files. I took the easy way out and just skipped saving them.
Looks like Jakob has a pretty good way to get the same effect.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: 2023-10-14 snapshot
Thanks a bunch bro!!!!!!Jakob Hubbard wrote: ↑Sat Oct 21, 2023 11:39 pmI made a track script that essentially allows you to do this by logging the decals with their coordinates, angle, size, aspect, etc to lastlog.txt. You have to change what treadmark decals associate with what tile number.
You also have to get rid of the date logs, usually doing it with:where <TREAD_NAME> is the name of the decal in the track script. It will output to a file in the same directory named "treads.txt" Then you can remove the @@@'s in notepad or any other text editor. The only downside to this script is it doesn't have the customization that jlv's has with different speeds dropping different decals and choosing whether to do front or rear or both wheels (it only does rear wheel). I could easily modify the script to do this but not sure how useful it would be.Code: Select all
grep -o '@@@<TREAD_NAME>.*@@@' lastlog.txt > treads.txt
Here's the script if anyone wants to save treadmarks. If anyone actually uses this and wants me to modify it to meet jlv's treadmark code, then I can do that.Code: Select all
// Position and velocity variables for riders rear tire var rearTirePos = [], rearTireVel = []; // Running order variable var globalRunningOrder; // Change the name to your track folder const trackFolderName = "@TRACKFOLDERHERE"; const decalsToLog = [ { name: "tread", size: 6.000000, aspect: 1.0000000, texture: trackFolderName + "/decal/tread.png", spacing: 2.5, tileNumbers: [0, 1, 2, 3, 4, 5, 6, 7, 11], minSpeed: 5, // minimum speed needed to log a decal in ft/sec lastDecalLogged: [], }, { name: "disturbed", size: 10.000000, aspect: 1.0000000, texture: trackFolderName + "/decal/disturbed.png", spacing: 10, tileNumbers: [0, 1, 2, 3, 4, 5, 6, 7, 11], minSpeed: 5, lastDecalLogged: [], } ] function logDecals() { /* Since this loop goes through the running order, decals should overlap correctly. If second happens to place a decal on top of one close to first's it will be on the layer above */ for (var i = 0; i < globalRunningOrder.length; i++) { var slot = globalRunningOrder[i].slot; // Loop through each decal in the decals to log array for (var j = 0; j < decalsToLog.length; j++) { // if there is no coordinates stored for this slot and decal yet add them if (decalsToLog[j].lastDecalLogged[slot] == undefined) { const rearContactMade = mx.get_rear_contact_position(slot, rearTirePos); if (rearContactMade == 1) { // Check to see if the tile number the rear tire is on matches the tile number in the decals to log tileNumbers array const tileNumber = mx.get_tile_number(rearTirePos[0], rearTirePos[2]); if (decalsToLog[j].tileNumbers.indexOf(tileNumber) === -1) continue; // store the X and Z variables if the rear tire has made contact decalsToLog[j].lastDecalLogged[slot] = [rearTirePos[0], rearTirePos[2]]; // get the rear contact tire velocity and use it as a normal vector for calculating the angle of the tire in world space mx.get_rear_contact_velocity(slot, rearTireVel); // Calculate the rear tire velocity and put it in range of 0 to 2pi and rotate 270 degrees counterclockwise const rearTireAngle = ((Math.atan2((-1 * rearTireVel[2]), rearTireVel[0]) + Math.PI * 2) + (3 * Math.PI / 2)) % (Math.PI * 2); mx.message("@@@" + decalsToLog[j].name.toUpperCase() + "[" + rearTirePos[0].toFixed(6) + " " + rearTirePos[2].toFixed(6) + "] " + rearTireAngle.toFixed(6) + " " + decalsToLog[j].size + " " + decalsToLog[j].aspect + " " + decalsToLog[j].texture + "@@@"); } } const rearContactMade = mx.get_rear_contact_position(slot, rearTirePos); // if the rider is in the air we don't want to log a decal placement if (rearContactMade == 0) continue; // Check to see if the tile number the rear tire is on matches the tile number in the decals to log tileNumbers array const tileNumber = mx.get_tile_number(rearTirePos[0], rearTirePos[2]); if (decalsToLog[j].tileNumbers.indexOf(tileNumber) === -1) continue; // calculate distance from current tire contact vs last decal placed and check to make sure it's greater than the minimum distance between decals const differenceFromLastPlacement = distanceCalculation2D(decalsToLog[j].lastDecalLogged[slot][0], decalsToLog[j].lastDecalLogged[slot][1], rearTirePos[0], rearTirePos[2]); if (differenceFromLastPlacement > decalsToLog[j].spacing) { decalsToLog[j].lastDecalLogged[slot] = [rearTirePos[0], rearTirePos[2]]; // get the rear contact tire velocity and use it as a normal vector for calculating the angle of the tire in world space mx.get_rear_contact_velocity(slot, rearTireVel); const magnitude = Math.sqrt(Math.pow(rearTireVel[0],2) + Math.pow(rearTireVel[1],2) + Math.pow(rearTireVel[2],2)); if (magnitude < decalsToLog[j].minSpeed) continue; // Calculate the rear tire velocity and put it in range of 0 to 2pi and rotate 270 degrees counterclockwise const rearTireAngle = ((Math.atan2((-1 * rearTireVel[2]), rearTireVel[0]) + Math.PI * 2) + (3 * Math.PI / 2)) % (Math.PI * 2); mx.message("@@@" + decalsToLog[j].name.toUpperCase() + "[" + rearTirePos[0].toFixed(6) + " " + rearTirePos[2].toFixed(6) + "] " + rearTireAngle.toFixed(6) + " " + decalsToLog[j].size + " " + decalsToLog[j].aspect + " " + decalsToLog[j].texture + "@@@"); } } } } function distanceCalculation2D(x1,y1,x2,y2) { return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2)); } function frameHandler(seconds) { globalRunningOrder = mx.get_running_order(); logDecals(); } mx.frame_handler = frameHandler;
-If you like riding my tracks please donate to the cause https://www.paypal.me/jgmtbike
-Thanks so much for all your support of my tracks.
-Thanks so much for all your support of my tracks.
Re: 2023-10-14 snapshot
Updated 2023-10-23:
Linux users: https://mxsimulator.com/snapshots/mxbin-2023-10-23-1662
- Fixed toggledecals.
- Fixed upsampling to use bilinear filtering when treadmark color/norm/spec maps have mismatched sizes. Previously used point sampling
Linux users: https://mxsimulator.com/snapshots/mxbin-2023-10-23-1662
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: 2023-10-14 snapshot
This does look great after seeing it on the Owens Valley track!
I had some flashbacks, somehow still had it bookmarked. Is this related to this old script? https://forum.mxsimulator.com/viewtopic ... 332#p73332
I had some flashbacks, somehow still had it bookmarked. Is this related to this old script? https://forum.mxsimulator.com/viewtopic ... 332#p73332
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.