News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Combining two tracks into one

Started by mrdries, May 27, 2023, 11:47:10 AM

Previous topic - Next topic

mrdries

This idea suddenly popped in. Not sure it has been done before.

Suppose you were to make two Stunts tracks. And these tracks would perfectly overlap. So if you would put the map of track 1 over the map of track 2, they'd overlap all the way.

Now suppose you had some kind of software that would allow you to play both tracks simultaneously. So you'd run one instance of Stunts to play track 1 and another instance of Stunts to play track 2. But what if this software would allow your keyboard input to go to both instances? So if you'd press the left key, you'd turn left on both tracks.

Now this would be already quite a challenge. You had two look at two screens at once and manage to complete both tracks.

But what if it would be possible to combine the visual output of both instances into one screen?

Well, then you'd be able to look at one screen. But you'd also see remarkable things. You might see road blocks in a tunnel. And you're not supposed to ignore the road blocks or the tunnel... cause you're supposed to complete both tracks.

You might see road blocks on a bridge, if these road blocks were on a hill, at the same height and location of the bridge.

You might see an icy road or a muddy road in a bridge or tunnel.
You might see a pipe with the roof of a tunnel.

So you'd kind of have new track elements. The tricky thing would be to find a way to combine the two visual outputs of both Stunts instance into one coherent visual output. Perhaps it could be done by analyzing both tracks beforehand. Don't know if it's possible. The visual output of one the tracks, would have to only contain the actual road... and not the grassy terrain around it. And both instances would have to be kept in sync...:-)

mrdries

#1
One alternative idea would be to get the necessary data out of Stunts when you drive.
I'm sure this is also difficult but if you'd have the data containing the direction and position of the car from Stunts, as you drive a track on Stunts, then you could use this data to simulate the physics of Stunts into another program.

This program may look similar to Stunts, it may preserve the original graphics as best as possible, it would be like some kind of mod. May have the same track elements, and perhaps even more track elements than Stunts. But the physics of Stunts would be used in that program.

So the idea would be that you'd have two overlapping tracks once more. The input of the keyboard would be sent to Stunts. The data of the car, direction and location, would be sent to this second program. This program would have this overlapping track. And you'd see the visual output of that second program, based on the data from Stunts. So you'd basically be driving a Stunts car with Stunts physics but the visual output would be from that second program. The Stunts car and physics would be basically be imported into that program. And that program may contain different track elements, like road blocks in a tunnel, for example, and that program would determine whether you'd have crashed or not, based on the trajectory you took with that car.

Though I guess it may be pretty hard to get that data out of Stunts. It's a bit like using Stunts' cars and physics as a plugin for a different program. Not sure this is what has been considered before.

One issue would be the difference in the collision data from both tracks. If you'd have a tunnel in track 1 in Stunts and if track 2 in the second program, overlapping track 1, would have a tunnel with road blocks inside at that same position, then this second program couldn't allow you to drive very gently against these road blocks without crashing. Since if these roadblocks aren't there in Stunts, the car would go right through as if they're not there. However, if the second program would decide that you'd have crashed, however gently you drive against such objects, then the issue would be circumvented.

Cas

The first idea reminds me of the movie "Déjà vu", with Denzel Washington, in which the protagonist drives a car on the highway while he's seeing the past through his goggles!  I don't know who came up with that idea, but it's genius.

The second one, we've been talking about recently. I was considering "tunneling" physics information from Stunts through DOSBox out to the host system like it was done by another Stunts fan, who managed to have two cars play together through sending each other's information and placing it in the opponent's car. Daniel3D and I suggested back then that this tunneling could be used to play with my graphics engine without having to develop a physics engine, but it really isn't a comfortable thing and it's not easy to do because the input still has to be sent to DOSBox. Yet, if it were easy, it'd be a very interesting experiment.
Earth is my country. Science is my religion.

mrdries

#3
Okay, thanks for explaining. Very cool stuff that has already been tried out.

I had a third idea though I didn't mention it because you already told me about the limited amount of slots in Stunts.

But it would be possible to change the track elements in Stunts visually. You might, for example, add a wall to a road. Since it would only change the track element visually, you'd be able to drive right through that wall.

However, you might use a second program to check whether you'd have driven against that wall either while you drive or afterwards. I suppose that if you could check it afterwards, by checking the replay data, it would be the easiest. In that way, you would approach that wall as a real obstacle and you'd effectively have a new track element. You wouldn't have to check it every time, after all, you could check it if you'd really want to or for some competition.

The cool thing about this approach, is that you keep the original Stunts in place. Which I personally like as well. Though as you mentioned, the slots are limited. So its use might be limited. Though I guess one could make a second Stunts executable with different track elements if someone wanted to do so.

I guess it may motivate people to start designing new track elements. If you'd be able to play such new track elements already, you could feel the immediate benefit. And this may motivate people to find better ways of handling these track elements in the future. Like, by porting it to c.

I feel like I'm going on like crazy about these track elements. Though I guess people understand that it is what has been missing. You have made all these new cool cars. Yet our tracks are still made up of these same elements. Once you had different ones, it would be a totally different game. And not necessarily a worse one. Perhaps one that has become much more interesting once more.

I guess I could try to make my own track element.

mrdries

How hard would it be to put the graphics of road blocks on a flat bridge?

Daniel3D

Without collision, easy, but you have to change the bridge model. So it would become standard for every time that piece is used.

I thought of adding some roadside scenery. Like boulders and bushes alongside the road.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

mrdries

Cool! So I see that the visual data is stored in Game1.P3S and Game2.P3S
I read that the visual data for track elements, is the same as the visual data for cars. I could do it using Stressed. But I couldn't open it. I'm on... umm... Windows XP. Do I need Stressed? Not sure how I could open P3S files. The visual data for the road blocks is already there so I don't really have to build anything yet.

Man... I'm really no expert in any of this.

Cas

It's not as straightforward until you're familiar with the files in Stunts. The binaries for Stressed should run well on your system. The track element graphics are stored in the GAME?.P3S files. These files are packed. Stressed includes a program called stunpack, which reads P3S, but I think it can't save in the same format, so after you modify these files, you'll have to rename them out or something and place the GAME?.3SH files in their place. When Stunts cannot find the P3S files, it will look for the unpacked 3SH counterparts instead.
Earth is my country. Science is my religion.

mrdries

Thanks. I'm lacking the Stunpack program. I didn't get it while downloading it Stressed20210307. I found the source in the Github. But then I'd have to compile it myself. I'll give that a try.

Daniel3D

#9
Quote from: mrdries on May 29, 2023, 10:18:42 AMThanks. I'm lacking the Stunpack program. I didn't get it while downloading it Stressed20210307. I found the source in the Github. But then I'd have to compile it myself. I'll give that a try.
stressed has You cannot view this attachment. integrated. it will automatically unpack a packed resource (extentions starting with P are packed)
When saving you have to use the unpacked extention equivelant.
P3S = 3SH
PRE = RES
PVS = VSH
PES = ESH < not supported yet

Packed files are looked for first. to test your work you have to move the original file to a different directory.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

mrdries

#10
Alright! I'm running the older stressed 0.2.1
I can see the shapes from Game1.P3S
Also downloaded Stunpack.

I think the newer version of Stressed might not have been Win32. That's the error I got.

Thanks for the help.
Very cool but what I don't understand is how I might transfer one of these shapes to a certain track element. All I seem to see is a list of shapes used by Stunts.

Oh yes... I guess I just have to manage to add those road blocks to the shape of a bridge...or a tunnel.

mrdries

Golden road blocks.  :)  Looks kind of wrong. Just playing around.



I tried exporting the road blocks shape and then importing them to the tunnel shape. But then the tunnel shape is gone. Haven't found an easy way to combine them. I did notice I could open the road blocks shape, once exported, as a text file. And it gives sensible data. Perhaps I could combine them this way.


mrdries

#12
A banked road. Don't think it looks as good as the original. But it is kind of fun when you drive over it at high speeds.



In case anyone wants to check:

You cannot view this attachment.

mrdries

Managed to combine a tunnel and roadblocks. I exported the tunnel shape and the road blocks shape with Stressed. Then I converted them to text files. I tried combining them into one text file. This gave something totally wrong. I noticed I had to edit one of them because of indexes to the coordinates. I manually did it. Converted it back to a .obj file, imported it into Stressed. Not sure there is a better way. It doesn't look totally fine either. A bit of the tunnel wall appears in front of the road blocks.


Cas

The merging looks good. The effect you notice might have to do with how Stunts handles Z-bias. Track elements have been designed taking this in mind and when you combine them, then these flags may not be the best anymore. For some reason, the people that made Stunts didn't use 1-sided polygons all that often. They are the single best way to prevent incorrect overlapping without having to resort to Z-biasing. I would've left Z-bias as the last solution.
Earth is my country. Science is my religion.