Stunts Forum

Stunts - the Game => Stunts Questions => Topic started by: Matei on February 05, 2024, 02:39:31 PM

Title: Other games?...
Post by: Matei on February 05, 2024, 02:39:31 PM
Hi there, nice to see that this game is still played in 2024, but it does have some serious limitations, especially concerning the tracks. After you've seen 4 or 5 of them, they all start looking the same. I also saw a discussion about the "physics":

https://forum.stunts.hu/index.php?topic=4189.0

The main problem is that the car moves too much in predetermined ways, not just when it starts sliding, but also during jumps, when it appears to pitch at a constant speed, which is most likely the reason why it can't go backwards. Those predetermined moves just wouldn't work. Also, the image is shaky because of the low resolution combined with low precision integer arithmetic, but this is part of the game. With properly drawn high resolution graphics, the game would most likely not be very entertaining, as a rather unsuccessful remake found at http://ultimatestunts.nl/ suggests.

Aside from that, I have 2 games which, besides being free (as in freedom), have a few things in common with Stunts, such as the fact that they look somewhat similar (and better, I would say) and the fact that they can run on relatively old computers (i.e. Pentium II, without 3D acceleration). If anyone's interested, I could certainly use some help with them. More details are on my site:

https://matei.one/

https://matei.one/idxscr.html

Stunts also runs in Dosemu, btw.

http://www.dosemu.org/
Title: Re: Other games?...
Post by: dreadnaut on February 05, 2024, 04:13:24 PM
Hello Matei! Welcome to our forum, and thanks for letting us know about your games.

One piece of feedback, if I may: when you to introduce yourself to a retrogaming community, starting with "your game is boring" might put people in the wrong frame of mind. Not the best marketing strategy ;D   Acknowledging it here, so we can move ahead and talk about your games instead.

I tried SimCar for a bit, and it's interesting! It feels more like a "need for speed" game with a fixed track, without the "open world" of Stunts, but that allows for interesting geometry. The main issue I had with it is that all four cars seems made of paper, and fly and flip very easily. Luckily, some have a decent grip event when sitting on their roof, so it's possible to drive into another object and flip them again.

I did bump (no pun intended) into a bug that sent me flying in the sky at 300+ km/h, and eventually falling into the void.

Overall, not really a game yet, but more than a tech demo. Thanks for bringing it up!
Title: Re: Other games?...
Post by: Mate on February 05, 2024, 05:58:55 PM
I never encountered any bug that sends the car flying in the air at 300+ km/h, but the track is indeed surrounded by the void. If you fall, you can just restart. Only the first car can reach 300+ km/h and I think it's possible that you might have bumped into something else, like the start of a bridge, for instance. The viewing distance can be increased, btw, but the track should be redesigned a little to look good in that situation. I'm going to improve both games, but if no one is helping, it will take a while. Stunts is not that boring, I played it quite a bit myself and it's better than what most people are playing these days, but if you want something to work on and develop, in my opinion it's a dead end. Most likely, the cars from Simcar seem made of paper because their power is unlimited and a constant moment is applied to the wheels, regardless of their speed. If you want to do stunts, this doesn't seem like a bad idea to me. In Skunks I limited the power and the game is a little more developed.

Aside from that, posting messages here is quite difficult, because even if I answer the questions correctly, I have to try at least 2 or 3 times.
Title: Re: Other games?...
Post by: Matei on February 05, 2024, 06:09:38 PM
And I also got my name wrong in the process.
Title: Re: Other games?...
Post by: dreadnaut on February 05, 2024, 06:31:56 PM
Quote from: Mate on February 05, 2024, 05:58:55 PMAside from that, posting messages here is quite difficult, because even if I answer the questions correctly, I have to try at least 2 or 3 times.

Sorry to hear that. The "guest" features in the forum software are indeed a bit rough, it's definitely easier for those who have an account.
Title: Re: Other games?...
Post by: Cas on February 05, 2024, 07:17:24 PM
Hello, Matei!

I had come across Skunks at some point. We've been noticing different approaches at games that either resemble Stunts or have a relatively similar objective. I have to agree with Dreadnaut there, you know, this is a Stunts-loving community. Nobody here consider Stunts even "a little boring", ha, ha.

Anyway, Skunks looks really good and it's nice to see it running and giving a feeling similar to that of Stunts in many aspects. We have wanted to extend Stunts in many ways for years and to some degree, we managed to do it. We can make our own cars and also tracks that would not be allowed by the original games, we have some mods. But there are things we always dream of and we don't have. Like, tracks always have two layers and three levels, that's it. And they're always 30x30. We haven't been able to add new track elements without replacing existing ones and borrowing their physical models. Things like that.

Of the things we like the most about Stunts as it is, probably one of them is how unique cars can be and what they can do. In spite of the crazy physics we get sometimes, racing in Stunts is a lot of fun, allows for the development of skills that make a great difference and get you to really feel the vertigo sometimes. I'm sure the other guys can make a long list of their own favourite things about Stunts.

But if you don't like racing Stunts, this can still be your place. Feel free to join us. See... I do like racing, but I'm a pretty awful pipsqueak myself. I usually do more programming and socials here. I also enjoy making roller-coaster-y tracks. My programming style is very different from the usual trend, but like you, I love free software and that's another thing we'd like from Stunts if it were possible. I have worked on a 3D engine that follows the style of Stunts... and I don't just mean its looks, I mean, that's written from scratch, draws by software, etc. It's kind of a pain, but it has its charm. Now I wanted to develop physics, also the same way, from scratch, no 3rd party code. Maybe I ask myself too much and that's why I'm stuck, ha, ha, but then if I get to do it, I'll be very happy.

I like how you want to keep everything free and try to avoid dependencies. I see you're a GNU/Linux guy too!  Very good!  8)
Title: Re: Other games?...
Post by: Matei on February 05, 2024, 08:12:07 PM
I do like Stunts, but there's no racing in it, since a race requires more than one car. TORCS has computer controlled cars, but the tracks are much simpler and last time I played it, the simulation wasn't even 3D. "Roller-coaster-y tracks" are exactly what my games are for. Did you make the track rendering program from https://raceforkicks.com/projects/engine.html? I tried it today, but I could only use the executable, because it's in Freebasic. If the 3D models could be extracted from the original files and converted to some more accessible (text) format, maybe I could do something with them, but I don't know what their copyright situation is. Simcar already has some cars and tracks from TORCS in it.

I first made a 3D rendering program like the one you describe (i.e. from scratch) in 2007, then I made a game with no (or very simple) physics in 2010 (Simcar 1.0.0-4.1.0), then a game with Open Dynamics Engine also in 2010 (Skunks) and after that I figured out how to make a game with physics written from scratch (Simcar 5.0.0+), but I'm also keeping Skunks, because what I made is not quite like Open Dynamics Engine. Then in ~2012 happypenguin.org disappeared, tablets and phones appeared and (almost) no one was interested in this kind of stuff any more. Anyway, now I'm putting the stunts mostly in Simcar and making Skunks a somewhat more realistic simulation. You can obviously use everything I made. The latest graphical functions are documented, so it shouldn't be very hard, but the 3D part is only with triangles (no lines).

I figured out what the problem with the questions was. I was writing "Lightning by Alan Rotoi" instead of "Lightning".
Title: Re: Other games?...
Post by: Cas on February 06, 2024, 01:15:16 AM
We have the 3D model format very well documented. You can use Stressed or CarWorks to turn it into OBJ, but then you lose some things that can't be represented there. My engine, the one you saw, has had some additions more recently, but it's essentially the same thing. It reads the actual 3D models from Stunts, but you'll see some glitches. These occur because, while both my engine and Stunts use a Painter's Algorithm, I can't possible guess the exact details they used and then, some things are rendered differently. This can be solved by re-creating some of the models. Also, re-creating them would rid us from licensing problems, so eventually, that could be a solution.

I've been using FreeBasic mostly because of its very small and portable graphics and real-time input library. I would like to work in C, but libraries I found are unnecessarily huge and can't be statically compiled. The way I work, I only need very basic functions from it, because I do mostly everything by hand. I like to make my software so that you can just copy it somewhere and run it without having to install dependencies. I love GNU/Linux, but that particular thing is often one of its weaknesses.

I would like to make a complete graphics+physics engine for Stunts that still looks like Stunts, only native resolution and maybe a few more features (such us more drawing depth, like what I've done) and have it read the original files, so that we still feel we're playing Stunts. And then add modularity to it so that it can grow and be free software. My skills are growing, but there's still a long way to go. So I really admire where you've been able to get to.
Title: Re: Other games?...
Post by: Matei on February 06, 2024, 07:06:37 AM
SDL has everything you want. Also:

https://sourceforge.net/projects/simple3d/

"Documentation and compilation instructions inside, for GCC and Open Watcom;

Software rendering, no 3D accelerator required; images can be displayed with SDL-1.2, SDL-2, or saved in a *.bmp file;"

A few people actually asked me whether my game can read original tracks from Stunts. I can use *.OBJ files, so I will try Carwoks (Freebasic again :-"). Thanks.
Title: Re: Other games?...
Post by: Matei on February 06, 2024, 08:12:20 AM
Ok, Carworks didn't work and it seems to be only for cars anyway, but I have some suggestions about https://raceforkicks.com/projects/engine.html

You wrote that you only need very basic functions, but you used the function "Line" from Freebasic, which means you can't use a Zbuffer. Anyway, if a track element is close to a terrain element (like the one under it, for instance), you could always draw the terrain before the track. From what I saw, this should solve all the problems. If you want to make a game that looks and plays like Stunts, I suggest you don't try to figure out how the original "physics" work but start with something simple, i.e. some functions for keeping the car parallel to the ground and basic steering and acceleration and then experiment with jumps and other things until you like the result. I noticed a small problem though:

https://www.freebasic.net/forum/viewtopic.php?t=25026

"You have to use some 3rd-party library that implements this as it's not included in the FreeBasic runtime or graphics library."
Title: Re: Other games?...
Post by: Daniel3D on February 06, 2024, 11:07:39 AM
Quote from: Matei on February 05, 2024, 08:12:07 PMI do like Stunts, but there's no racing in it, since a race requires more than one car.
Then track mania isn't a racing game either. 8)

But you are partly right.
Stunts in it's bare form is not a game in today's standards.
It a fully functional game engine and not limited by additional "game features".

The game is shaped by the competitions and because stunts is unlimited, nothing you need to unlock, it is therefore equal for everyone.

That gives online competitions the freedom to set the rules and boundaries.

The lack of inbuilt limiting features (And the inclusion of a track editor obviously) is the reason it is still played.
Title: Re: Other games?...
Post by: Matei on February 06, 2024, 11:38:25 AM
That's right, Trackmania is not a racing game, but I just noticed something else. If the program from https://raceforkicks.com/projects/engine.html can display all the track, maybe it can save all the triangles and their colours into a text file. If someone were to give me such a text file with all the triangles, I could use it in Simcar right now, just like I did with the tracks from TORCS, and since the tracks from Stunts are very small anyway...
Title: Re: Other games?...
Post by: Cas on February 06, 2024, 07:51:53 PM
What Daniel3D mentions about Stunts is very true and reminds me of something I frequently say about DOS when I compare it to modern OSs. I like saying that "the greatness of DOS wasn't in what it would give you, but in how much it wouldn't stop you from doing". Stunts today isn't just the game that came in the box, it's the game, plus what we've created on top of it and I don't just mean software, but the things we like doing with it... like live races, for instance. So... it's the same software, but we've made it a better game.

My little engine is based on a Painter's Algorithm. I did that because that's what Stunts does. This sort of algorithms can be very fast once optimised and if you make your models for it, they can work well. Yet, no Painter's Algorithm is perfect. It is always possible to make them fail. They are a simplification of rendering, a trick. Z-buffer is the "right" way to render 3D graphics. It is much slower, but if very optimise, it can work even in software and in high resolution on modern machines. Now, models made for a Painter's Algorithm won't look good on a Z-buffer in general. You have to recreate them. Z-bias strategies have to be implemented otherwise.

I would love to write a Z-buffer engine for this, but I do think it's worth to also complete my work on this PA-based engine because it's so easy to make it run fast. My code is currently very far from optimal. As you pointed out, I've been using the Line function instead of a blitting routine and it still runs very fast. The Line function is terrible for this purpose: its coordinates are double precision floats and it's designed to draw diagonal, not horizontal, lines, so it make a lot of unnecessary calculations as it draws. My idea is to eventually replace the whole triangle drawing routine with an assembly based one and allow to fall back to this high level one in case you want to compile the game on something other than x86 processors (don't think it will happen). For Z-buffer, this is absolutely required.

What I need from a graphics and real-time input library is:
- Ability to copy a block of memory onto the screen or graphic window
- Ability to read mouse X and Y and buttons at any time
- Ability to retrieve the current status of the keyboard at any time

Anything else is just bloating it. A library like this should take some 500k or less statically linked. Yet, that has been the holy grail I've been looking for for a very long time.

I've made a little game with sound that runs on GNU/Linux on Windows in FreeBasic before. I didn't exactly include a third party library, although the OS API is itself a library, so in a way, it does call a library I didn't write, but that doesn't count because ALSA is practically guaranteed to be found on every GNU/Linux freshly installed. So I read some code another guy had used and created my own little library based on it. It does do something weird with the sound channels, though, I don't know why, but it sounds perfectly OK.

Yep, CarWorks is a little buggy, especially the 3D part... but not because of the rendering. It's because the arrays that handle the primitives are a mess there. I have to rewrite that part. And yes, it's only for cars. But we have Stressed, that can handle other shapes. It's not hard to produce a text file from 3SH files... It'll be a lot larger and slower to load and parse, but it could give you an idea of the structure. If I get the time, I'll try to do something like that for you. Until then.... https://wiki.stunts.hu/wiki/Resource_file_format#3d_shapes

This is the format spec we've developed.
Title: Re: Other games?...
Post by: Cas on February 06, 2024, 08:21:19 PM
Sorry, guys, I'm making it too long!

But I forgot to answer this technical thing Matei mentioned. One of the glitches you can see in my engine there is that large objects placed on top of hills or water sometimes experience Z-fighting, as pointed out by Matei.

You were saying, Matei, that I could just draw all terrain first. I have already thought of that, but it isn't that simple. I'll explain the technical details. You'll see that general the 1x1 track elements don't have this Z-fighting problem. This is because I calculate the distances by averaging the four corners of the base of track elements and then I lift that up a little bit to make it closer to somebody looking from the top. That is enough for elements that size. The problem is that bigger elements that are, say, 2x2, have their centre further away and so the centre of the 1x1 hilltop or water "wins the fight". If I force all terrain to be drawn first regardless of distance, I will be able to see objects through hills, so I need to find an intermediate solution.

I can think of many possibilities. One is to create a new object that's 2x2 but actually made of 1x1 hilltop sub elements and place it whenever there's a large object on top. It would work, but I don't like it much because it makes my engine even more dependent on Stunts' grid. Currently, my engine is a little more free than Stunts. For example, you can place objects that are not aligned with the grid and rotate them at any angle around the vertical, not just multiples of 90 degrees. I don't want to lose this freedom.

Stunts clearly solves this by placing everything on a grid. My engine only uses the "grid" when loading the track. After that, all is free. I wanted it to eventually allow for adding more features.

I could also be more "subjective" and add a distance threshold and then, when sorting objects, terrain objects always lose if the distance difference lies within that threshold. It can fail, but it would improve the things.

The real solution to everything is Z-buffering, I know.
Title: Re: Other games?...
Post by: Matei on February 06, 2024, 09:49:58 PM
I never wrote that you should draw ALL the terrain first. Anyway, can you adapt the program to output a text file with the parameters of all the triangles of a track, which now it only displays? I suppose it shouldn't be very hard. If you can make a program in C to do that, I will include it in Simcar-5.3.0 and mention your contribution and of course the address of your site(s). I still have to adapt the game to use the latest graphical functions, but that will be Simcar-6.0.0... If you don't want to do it (at least in Freebasic), I will try to figure it out myself from "engine3.bas" and if I succeed, I will mention that you didn't help :P
Title: Re: Other games?...
Post by: Cas on February 07, 2024, 12:19:38 AM
Ha, ha, ha... Yeah, these are the tasks I like doing, so I would like to. Only I feel soooo lazy!  But at least I can try to get you the 3sh-to-text thing if I have some time.

There is a slightly newer version of the engine. I've been very untidy with it and it's always attached to something else. The version I posted in Race For Kicks contains a track viewer. The other version is more interesting, but harder to use, but I wanted to post it after some touches to make it more friendly. It can actually replay "multi-player" races and sort of allows you to make a video out of them. It can draw cars... cars without wheels, ha, ha, but cars.

For just printing all the coordinates and colours of or triangles in a frame, I suppose I can just hack on the triangle drawing function and have it write to a log. Or do you mean all 3D triangles, that is, prior to rendering?  That's somewhat more complicated, though possible.

I think if we discuss these things enough, we might be able to find a way to do some team work here. We work very differently, but in the end, we are heading more or less in the same direction.
Title: Re: Other games?...
Post by: Matei on February 07, 2024, 12:58:08 AM
I mean all 3D triangles because I need all the track, so just put them in a position in which they would all be rendered and save their coordinates and their colours in a file instead of drawing them on the screen. I managed to run FreeBasic in DosBox and it compiled engine3.bas, but the graphics don't work. The main problem is that even if I get some tracks working, the 3D models don't have a free license, so I can't include the tracks in the game, although I can put them in a separate archive on my site.
Title: Re: Other games?...
Post by: Matei on February 07, 2024, 09:47:20 PM
I'm not in any rush, and if you want to do anything, you should have my email, and my site has a contact page. There is, of course, a better way to do things, i.e. convert all the 3D models that compose tracks into text files that I can use and also create a text file with the positions and (horizontal) rotations of all elements in the track, because the file with the track from my game(s) contains a list of the files with the 3D models followed by a list of the track elements, where the position, rotation and 3D model used for each element are specified. I think I should be able to do it, but it would obviously take me a lot longer, especially since I don't know anything about FreeBasic nor the models in Stunts yet. Anyway, if you want to use FreeBasic to make a game, it will never run anywhere near as fast as if it was written in C. I looked at engine3.bas and it seems quite well written already. I think that sorting triangles rather than using a Zbuffer should have an advantage if you have transparent triangles, but as far as I saw, you don't...
Title: Re: Other games?...
Post by: Cas on February 08, 2024, 09:10:33 PM
Maybe I can do some of that this weekend. This week's work and a strong wave of heat and humidity here are a killing team.

FreeBasic actually uses GCC as a back-end so algorithm speed should be similar. Now I can't talk about the efficiency of the internal graphics library, but it's the only simple one I've found that I feel comfortable with. I've been interested in finding a good way of using it in C. Since the library was written in C originally, it has to be possible, but I have to do some research. The other idea would be to just read the source and see how the individual OS calls are handled for graphics and make my own, even simpler graphics library.

Not sure what you mean by transparent triangles, but I do handle 1-sided and 2-sided triangles. 1-sided triangles are only drawn when the orientation is positive and are eliminated from sorting at an earlier phase. My engine also decomposes polygons from Stunts to triangles. It does it in a rudimentary way, but because Stunts doesn't seem to use concave polygons in its models, it works well.

About licensing, my thinking goes like this: Stunts is like "freeware without papers". I'm OK with people redistributing it, it's on my site (Race For Kicks), but I'd immediately take it down if I were told to by any authority. I openly ask for anybody owning it to engage in communication with us and I'm willing to do anything legally required to be allowed to distribute it the right way. Only reason that hasn't been done is because we haven't been able to get in touch with anybody official. And if they don't want to allow it, I'd take it down. With my software (which is always free software), I wouldn't distribute it, because it'd violate my own license. On the other hand, creating free software that works with Stunts is perfectly legal. Say, I can make an engine that reads the original files and I can distribute the engine without the original files. Finally, if the moment comes when we want to have free models, it's not hard to make new models that will resemble those of Stunts enough to serve the same function and they would be legal.

For the 3D, I think it'd be simpler for me to make it the second way, that is, to extract the individual elements and turn them into text files and then give another text file with the offsets and rotations for those elements.

Oh, about the engine in DOS. I haven't tried to compile it there, but surely the problem is about the screen resolution. You need to change that near the top of the code to a resolution DOSBox supports. My engine uses 32bit true colour, so The maximum resolution you can use in DOSBox is 800x600. Otherwise, you'd have to look for the place where the screen resolution is set (it says ScreenRes) and set the third parameter to 16, which will bring the colours down to 16 bit high colour. Then you can apply a resolution of up to 1024x768. Resolutions in DOS have to be exact.
Title: Re: Other games?...
Post by: Matei on February 08, 2024, 11:30:39 PM
If you can make a program without any graphics in FreeBasic, it should run in DosBox, which means I could distribute it with the game and without any problem, because it would be for converting tracks from Stunts, which requires DosBox anyway. All that I will have to do is compile an executable file for DOS. As I said, there's no rush, the first version of Simcar is from 2010, the last one is from 2014 and I'm working on other things right now. Anyway, if the models and the tracks are in text files, everything will become very easy to modify and extend.

I think my functions should be simple enough and have everything you need though, except for 3D lines. The project is even called "simple3d" and it comes with free technical support.

https://sourceforge.net/projects/simple3d/

"SDL_grf - functions for 2D/3D graphics (lines, circles, discs, rectangles, triangles, text and 2D or 3D models composed of triangles), sound and input, written in C;"

"1-sided and 2-sided triangles" are called "selective backface culling" there, but it's the same thing, and i used a Zbuffer, not sorting. You should take a look. A transparent triangle is a triangle through which you can see, so it should be drawn after the triangles behind it, some of which may also be transparent. I don't have any of those anyway. 3D models from TORCS and *.OBJ files also have polygons that have to be decomposed and I never encountered any concave polygons either, but I made separate programs to do that and convert the models.

Speaking of triangles, the ones I use for physics are all "2-sided", whereas the ones in Open Dynamics Engine are "1-sided" and I never managed to get a triangle mesh with more than 1 triangle to work properly there, I don't know why. Anyway, if the track is made of triangles, then you can drive on it in Simcar, although it won't be like Stunts, obviously.
Title: Re: Other games?...
Post by: Cas on February 09, 2024, 06:44:19 PM
Here I'm posting a little program I made that will output all the contents of a 3sh file as text. You can thus read a custom car. If you want to read the original Stunts shapes, whether cars or track elements, you need to first unpack the P3S file into a 3SH file. This you can do with the stunpack tool that's part of the Stressed project. I don't remember where the repo was. Sure somebody can point us.

Anyway, to me, it's a lot more complicated to parse a text file than to pull a binary stream, but it can be convenient if you just want to see what's inside.

It looks like I will have to overcome my laziness one day and sit to understand these physics. Game physics can be divided into collision and kinemantics. Not sure if this library does both, but my thinking is that the hardest part is collision, yet it's the part that's more similar between games, whereas kinematics can change wildly.
Title: Re: Other games?...
Post by: Matei on February 09, 2024, 07:59:57 PM
Ok, it worked, thanks, looks like I can use it. I'll let you know when I have something. I didn't understand what "culling front" and "culling back" means, so I'll just skip that, at least for now. I have the *.3sh files that came with engine3.bas.

Reading text:

https://matei.info.ro/idxsys.html

This is my second site, which I started making this year, and it's in Romanian. Some functions written in C that read text approximately in the same way are included in SDL_grf (address is above). A video about game physics (the second one, cstCtruck3D.webm):

https://matei.one/games.html#video

Also:

https://matei.one/idxcn.html#math

However, I didn't understand which library you referred to.
Title: Re: Other games?...
Post by: Cas on February 10, 2024, 04:22:36 AM
That's interesting work!  I have to take a closer look. It's incredible how I can more or less read your language even though I've never learnt any of it. Our languages are closer than I could've guessed!

Stressed is a program a community member made some years ago to edit Stunts data files. "Stressed" stands for Stunts Resources Editor. It allows for reading and saving uncompressed chunk-based files of the format Stunts uses, which includes 3D shape files, but there are many more. The thing is Stunts often provides these files compressed, so a companion program was made by the same author to decompress these files, then the main program uses it to read the files that are compressed. This little program is called Stunpack.

This week of work has left me super tired. I think I will be going to bed very soon
Title: Re: Other games?...
Post by: Matei on February 10, 2024, 02:10:11 PM
I converted all the models, but the colours are wrong (maybe they can be fixed by modifying defmat.txt) and at least so far there are only triangles, no lines, and of course some more adjustments are needed to get the axes and the scale right. How do I send it to you?
Title: Re: Other games?...
Post by: Cas on February 10, 2024, 05:47:00 PM
Defmat.txt I created based on our wiki page for shape materials. Maybe you'll find it useful:

https://wiki.stunts.hu/wiki/Shape_materials

If it's images, you could post them here, or else, you can write to me at xlucas@mailo.com.
I think I'll soon upload my new garage program to R4K and casrepo.org :)
Title: Re: Other games?...
Post by: Matei on February 10, 2024, 06:35:47 PM
I figured out what the numbers in defmat.txt mean, but maybe you can take a look at the program. I just sent you the file.
Title: Re: Other games?...
Post by: Cas on February 10, 2024, 07:11:36 PM
From a quick look, I think you have red and blue swapped, but not 100% sure. In defmat.txt, there are also indications of some "textures" that exist in Stunts. Most materials are just a solid colour, but some are semi-transparent. I've downloaded the viewer, but still haven't figured out how to compile it. Not used to SDL. But yes, for now, I'd say try that.
Title: Re: Other games?...
Post by: Matei on February 10, 2024, 07:59:04 PM
Both viewers are also available as executable files for wInd0w$ and compilation instructions are inside. The program I sent you doesn't require SDL. I don't have semitransparent triangles, sorry, but the lines can be turned into 3D models made of triangles. As I wrote before, there's no rush. I think the problem with the colours is a little more complicated, I already tried that. Many models will need modifications. For instance, the dashed line on some road elements is under the road, if you can believe that.
Title: Re: Other games?...
Post by: Matei on February 10, 2024, 11:57:02 PM
Actually it wasn't complicated. Modify line 118:

mod.r[mod.nt]=r[w+1]; mod.g[mod.nt]=g[w+1]; mod.b[mod.nt]=b[w+1];

And while you're at it, you can add "freetok();" at line 34, after "}". The colours are fine now.
Title: Re: Other games?...
Post by: Matei on February 11, 2024, 09:37:24 AM
Fixing the models won't be very difficult. I just have to make a program that moves the vertices of all the triangles which have a certain colour, in some direction. Has anyone noticed that Romania rhymes with Trackmania?...
Title: Re: Other games?...
Post by: Cas on February 11, 2024, 04:30:28 PM
Quote from: Matei on February 11, 2024, 09:37:24 AMHas anyone noticed that Romania rhymes with Trackmania?
;D

Yes, I was able to compile your program. It was the viewer that I saw I had to compile and didn't have the energies to do that, ha, ha.

But yes, I've been looking at the models in Stunts previously many times and they are not very "diplomatic". What I mean is, one would normally make a rendering engine with its quirks, but would try to make sure it can render mostly everything that's well-behaved in the expected manner. At the same time, whoever designs the models would try to make them well-behaved, so that the special quirks of whatever rendering engine will not bring their personality up to view. Instead, only what the renderer has in common with every other renderer will be seen.

This is not the case with Stunts. Models exploit the engine quirks with complete impunity. So then, when you try to render them with something else, you're bound to see some differences. There's a flag for rendering bias. It clearly serves that purpose, but it's not clear how. Many triangles are unnecessarily 2-sided. Line segments are used sometimes directly attached to walls (like inside tunnels or at the Joe's sign), which is problematic because they can't be 1-sided, as they have no "normal", so it's impossible to sort them against the background surface. So it's either guess how the original engine handles these quirks and do exactly the same or simply recreate some models to avoid this. The only thing I've seen that Stunts models do well is I've never seen a concave polygon in any of the built-in models. Great, because it's not clear how they should be rendered to look the same as they would in Stunts.
Title: Re: Other games?...
Post by: Matei on February 11, 2024, 06:07:57 PM
The models are easy to fix, but I will do it after everything else is finished. If you have at least a Pentium 4 CPU, we can leave all triangles "2-sided" without any problem. I just sent you another file. If you can give me a program that converts the track into a text file with the positions and rotations of all models, that's all I need.
Title: Re: Other games?...
Post by: Cas on February 11, 2024, 10:59:30 PM
2-sided triangles can be drawn anyway, but it's a waste of CPU. Having 1-sided triangles helps in sorting when using a Painter's Algorithm. I think even if the machine can handle it, it's bad practice to use 2-sided for PA when it's not needed. For Z-buffer, of course, this doesn't matter much. I would like to implement Z-buffer myself. I had also thought of dynamic material shading. This is, that the same material will look a little brighter or darker depending on the orientation of the car. This would look great, but I have to do some good tests with vector products and I'm feeling too lazy for that.

For the whole track, it's more work to do the reverse-rendering. Most of what you have to do is just placing the objects in the grid, but some track elements do get transformed.

Do you do the actual Z-buffer and then just tell SDL to draw the result or does SDL do the Z-buffer?  Right now, I think I'd concentrate more on solving the physics problem, then maybe I can try to improve the graphics. For rendering, I have a little problem with near clipping. It becomes more clear when rendering a race from inside the car.
Title: Re: Other games?...
Post by: Matei on February 12, 2024, 05:33:39 AM
Do you want to drive on the track or not? You already made a program that renders it. I need a file which looks like this:

objtypes n
name_1
name_2
...
name_n

objects m
o_1 x y z rot
o_2 x y z rot
...
o_m x y z rot

where name_j can be the model's name or number (anything by which I can identify it), o_i is the model number from the first list (1 < o_i < n), x, y and z are the coordinates of the track element and rot is the horizontal rotation, which you can write anyway you want, I'll figure it out. What you already did seems much more difficult than that. 1-sided triangles can be solved later.

[edit]
About "Do you do the actual Z-buffer and then just tell SDL to draw the result or does SDL do the Z-buffer?":

https://sourceforge.net/projects/simple3d/

"images can be displayed with SDL-1.2, SDL-2, or saved in a *.bmp file;"
[/edit]
Title: Re: Other games?...
Post by: Matei on February 12, 2024, 12:25:01 PM
Edsger Dijkstra (https://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html):

QuoteIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

BASIC is not so bad for 8-bit computers, though. I used it a little. Mr. Linus Torvalds also has something to say about the C language:

https://matei.one/gnlx.html#start
Title: Re: Other games?...
Post by: Daniel3D on February 12, 2024, 01:55:57 PM
Quote from: Matei on February 11, 2024, 09:37:24 AMHas anyone noticed that Romania rhymes with Trackmania?...
Hahaha, no. We do know that there was a French stunts remake being made called "STUNTS Mania" . His last update post was about solving a physics issue. Not long after he went silent Track Mania was launched.
Title: Re: Other games?...
Post by: Matei on February 12, 2024, 02:25:59 PM
It must be a coincidence, because Trackmania doesn't have any physics. Or maybe he didn't solve it and gave up. I played with a gratis version a little, more than 10 years ago. Not very good, but it had some nice ideas in it, like the track suspended over the ground, which greatly simplifies track editing for the programmer(s).
Title: Re: Other games?...
Post by: Daniel3D on February 12, 2024, 03:58:18 PM
It has very different arcade like physics indeed. But it has the same replay system, the first version lacked stunts but had all other stunts track elements and asphalt or dirt road variations. It has a single player time trial just like STUNTS.
I had the original TM, it's very difficult to find online, but I believe it even had different cars...

Found a video of it (https://youtu.be/SoMSSZXel2E?si=jEFcChhjS-HEF09I)
Title: Re: Other games?...
Post by: Matei on February 12, 2024, 05:42:48 PM
DethKarz and Pod were better than any version of TrackMania.

https://en.wikipedia.org/wiki/POD_(video_game)
Title: Re: Other games?...
Post by: Daniel3D on February 12, 2024, 06:24:24 PM
Quote from: Matei on February 12, 2024, 05:42:48 PMDethKarz and Pod were better than any version of TrackMania.

https://en.wikipedia.org/wiki/POD_(video_game)
Obviously...
I love POD, it one of the few games I still have the disk from.. (somewhere)..
Title: Re: Other games?...
Post by: Matei on February 12, 2024, 07:35:16 PM
I no longer have the disk with POD (Gold), but I remember it, it was the first CD with games that I got. It also had Need for Speed II SE, Quake II, Tomb Raider III, Mortal Kombat 4 and Unreal on it. A file in Mortal Kombat 4 contained a virus called Win95 CIH, but I found it before it caused any serious problems. After I got rid of the virus, Need for Speed III also started to work, but that was from another disk, obviously.
Title: Re: Other games?...
Post by: Cas on February 12, 2024, 10:41:51 PM
I'm reading my code to try to find the best way to create that output text file. There are some complications. Stunts applies some transformations to ramps when they're on a hillside. This isn't represented anywhere in the shape files. My engine does it on-the-fly. I can hook on the LoadTrack function and generate a text file with the position of the elements and their rotations, but sometimes, there will be an element that's a processed ramp. It's not trivial. I guess you could sort this up by actually developing the transformed shape and load it separately.

EDIT: Here it is. I'm uploading it. It's not exactly the same format, but should be pretty straightforward.
Title: Re: Other games?...
Post by: Matei on February 18, 2024, 11:27:44 AM
And now that all the technical details are solved, thanks to Mr. Cas, I must mention that I already have replacements for many of the 3D models found in Stunts. If we replace all of them, we will have a 100% free (as in freedom) game with hundreds of tracks already available. It won't be like Stunts, but that's the idea, because there's no point in having 2 identical games anyway. The models which compose the terrain are made of 1 or 2 triangles, so we can keep those and, of course, the option to use tracks with the original models will still exist. I will eventually do it myself anyway.
Title: Re: Other games?...
Post by: alanrotoi on February 18, 2024, 12:49:18 PM
Is it possible to export the cars to another game?
Title: Re: Other games?...
Post by: Matei on February 18, 2024, 01:20:28 PM
Only the 3D models, but I have enough of those, some made by me and some which I took from TORCS. Have you looked at my games?
Title: Re: Other games?...
Post by: Daniel3D on February 19, 2024, 11:47:35 AM
Quote from: Matei on February 18, 2024, 11:27:44 AMIt won't be like Stunts, but that's the idea, because there's no point in having 2 identical games anyway.
I still would like to have a game exactly like stunts, but running in high resolution on Windows or Linux.
Title: Re: Other games?...
Post by: Matei on February 19, 2024, 12:42:29 PM
https://redirect.invidious.io/watch?v=qz2guQrVYwU

Answer is at 1:30.
Title: Re: Other games?...
Post by: Daniel3D on February 19, 2024, 08:07:44 PM
Quote from: Matei on February 19, 2024, 12:42:29 PMhttps://redirect.invidious.io/watch?v=qz2guQrVYwU

Answer is at 1:30.
Either, i don't get it, or you just made an insult to me or our game,
So. Please. Don't answer in riddles.
Title: Re: Other games?...
Post by: Matei on February 19, 2024, 08:59:04 PM
Further explanations are on the singer's blouse:

https://redirect.invidious.io/watch?v=X6wJc-VPv3I
Title: Re: Other games?...
Post by: Daniel3D on February 19, 2024, 09:06:29 PM
I give up.
Nevermind.
Title: Re: Other games?...
Post by: Matei on February 19, 2024, 09:30:16 PM
In the movie scene, the winner of the race was going to win the opponent's car, as they had made a bet. At 1:31, the girl says "Herbie, please, I want to win that car!". The car (Herbie) felt upset and stopped, forfeiting the race. In this context, I guess this could have been interpreted in a few ways:

1. After I came here and gave you something that I made, you just wrote that you want something "exactly like stunts", so I felt a bit like the car character in the movie. Other than that, making something exactly like Stunts would be a waste of time.

2. If something exactly like Stunts is made, what are we going to do with the original game and especially with DosBOX? Besides, you can just write "scaler=2xsai" or "scaler=hq3x" in dosbox.conf.

The singer's blouse has "give me a break" written on it.
Title: Re: Other games?...
Post by: Daniel3D on February 19, 2024, 11:25:13 PM
What makes you think that we want anything else than STUNTS?
I mean, we are aware of your work for a very long time.
See the first mention of your site and work  (https://forum.stunts.hu/index.php?msg=65813)
But there is a reason why we still play STUNTS. And will continue to, unless the same gameplay is featured in a newer game.
Since that hasn't been the case. We stick with what we have.
We like your work. And appreciate it. We will support and help you wherever we can. But don't expect us to leave STUNTS behind in favour of your work.
Title: Re: Other games?...
Post by: Matei on February 20, 2024, 12:10:50 AM
Thanks for the link. I never suggested that you leave Stunts behind, but quite the contrary. You seem to want to leave it behind, because that's what something "exactly like Stunts" means. I actually play with Stunts myself, as well as with other old games for DOS, sometimes. What's new compared to 2014 is that now I can use tracks from Stunts in Simcar (it will take a while but I just got everything I need), I have some improved graphical functions and thanks to those, since 2018 Skunks has a menu, which quite a few people asked me to do... before 2012.

From Amtix magazine, 13 November 1986, page 84:

QuoteDid you get a lot of help from Braybon and Bell who wrote the original?

Oh yeah - a 6502 hex dump - just a pigging list of numbers. In the end we wrote our version by playing Elite on a Beeb and making ours look the same.

AN EASY JOB

Was it an easy job?

Far from it. When you normally write a program, if something doesn't work, you just throw it away and try something else. But we had to produce something that looked the same.

But at least you had a framework.

Yes but things that just sort of happened in the Acorn version were really an effort to copy for the Spectrum. We had to mimic what were really bugs!

This is about Elite for ZX Spectrum:

https://worldofspectrum.net/item/0001601/

[edit]
I don't know if anyone noticed, but I already have 2 games and there are significant differences between them. Even if I wanted, I couldn't make one of them play exactly like the other one, although I made both of them.
[/edit]
Title: Re: Other games?...
Post by: Daniel3D on February 20, 2024, 08:27:46 AM
Of course we noticed your games. And several of us played them. I will to when I have the time (have not played anything for months now since I just bought a new house and it takes a lot of my free time).

The point with stunts is that we like the physics and collision engine, its a strange mix of arcade and simulation driving in pseudo physics. We wanted to port it all to C to be able to just upgrade the graphic engine. That is a Mammoth task and we are with a small group.
Our current goal is to try and isolate the engine core and place it in a new shell.
To keep the essence but upgrade everything around it. And reverse compatible with the original if possible.
Title: Re: Other games?...
Post by: Matei on February 20, 2024, 08:46:30 AM
I noticed your tendency to focus on the least important parts of my messages. Anyway:

https://forum.stunts.hu/index.php?topic=2482.0

https://forum.stunts.hu/index.php?topic=3760.0

So you're interested in reverse engineering. As I understand, Chinese people are really good at that.

https://www.popularmechanics.com/military/aviation/g23303922/china-copycat-air-force/

If you want to use software rendering, I can help you with the graphics.
Title: Re: Other games?...
Post by: Daniel3D on February 20, 2024, 09:46:16 AM
I have a strange working mind. So I often miss things other find important. Even after reading back i don't see it. So I'm sorry about that. One track mind I guess.

I'll check out the link to China later. .
As for graphics, we sort off have that covered with CAS his graphics engine. It can already generate gameplay videos from replay dump files.
The difficult part is doing 'the same trick' in live gameplay. You used bullet physics if I'm not mistaken. I think we want to try and build something like that with the stunts game core physics model. Not an easy feat. But not impossible either.
You could for instance plug it into your game as an optional feature.
You have a lot of knowledge about game making on the level we are. I personally consider that an asset if you are willing to help with this. Share your expertise, and maybe we can help you with getting your games to the next level as well.

And looping back to your email from 2014.
Stunts is not freeware. It is abandoned. The right are (just as prince of Persia) owned by Ubisoft. Ubisoft owns TrackMania now. So as long as we don't threaten that game we are quite safe.
Title: Re: Other games?...
Post by: Matei on February 20, 2024, 12:54:30 PM
I used Open Dynamics Engine for one game and some functions made by me for the other one. Stunts doesn't have a physics model. With a physics model, on those tracks, this is how you have to drive:

https://redirect.invidious.io/watch?v=fboYtJTuLMc
Title: Re: Other games?...
Post by: Daniel3D on February 20, 2024, 02:47:26 PM
Stunts has a physics model, it is just very simplified because of the hardware limitations at the time. But it's a clever setup and is many ways ahead of it's time.
It may not meet your standards, but the game has a physics and collision engine. It has pathfinding for the automated opponents. A very powerful track editor for it's time that can make millions (not a joke) of different tracks.
It supports car engine parameters almost straight from the car manual for gear ratios among other things.

Try not to down talk stunts so much. We are passionate about it and your ignorance could be taken badly by some.
I apologise for misremembering the of the shelf physics engine you used.
Title: Re: Other games?...
Post by: Matei on February 20, 2024, 03:12:14 PM
I don't think the physics model is very simplified because of the hardware limitations, I think it's because people who play driving games don't want realistic physics. I mean look at the driving games made after 1995 and until now. How many of them have decent physics models? I'm pretty sure that what Mr. Simon Hasur describes in the second video here could have functioned perfectly on a 286 CPU:

https://matei.one/games.html#video

...considering that:

https://worldofspectrum.net/item/0004969/

When I was using Window$ 98 I had tens of driving games and none of them was good, except for Wild Metal Country, which wasn't with cars.
Title: Re: Other games?...
Post by: Daniel3D on February 20, 2024, 03:30:39 PM
Quote from: Matei on February 20, 2024, 03:12:14 PMI don't think the physics model is very simplified because of the hardware limitations, I think it's because people who play driving games don't want realistic physics. I mean look at the driving games made after 1995 and until now. How many of them have decent physics models?
First, stunts is a 1990 game. Physics engines didn't exist yet.
Secondly,
QuoteI think it's because people who play driving games don't want realistic physics.
realistic or not, that is a matter of taste. It's still a physics model.
And stunts feels more realistic than many games that came behind.
Thirdly, I'm sure there are games with better physics now that could function on a 286, but that knowledge wasn't there in 1990.
Title: Re: Other games?...
Post by: Matei on February 20, 2024, 03:44:35 PM
Actually, physics simulations existed much earlier than that:

https://fshistory.simflight.com/fsh/index.htm

The knowledge is even older:

https://en.wikipedia.org/wiki/Newton's_laws_of_motion

https://en.wikipedia.org/wiki/Hooke%27s_Law

But that was exactly my idea, that Stunts is more realistic than most driving games that came after it, which gives it a historical significance.
Title: Re: Other games?...
Post by: Chulk on February 20, 2024, 03:57:26 PM
Quote from: Matei on February 20, 2024, 03:12:14 PMI think it's because people who play driving games don't want realistic physics.
You shouldn't speak as if you knew every answer to every question only because you posted about it in your blog. I don't think there is one thing in this world you can name and 100% of people would agree, and that is even more true when talking about leisure activities and what people find fun. Heck, you can't even get 100% asking people "do you want to live?".
Also, you keep saying "this or that is better". Better is completely subjective and while many people may think X is better, other may say Y is better. And they are both entitled to their opinion.
We are here because we think Stunts is better than most (if not the best) racing game, whether you like or not.

So please, be a little more careful about the words you choose and how you phrase your opinions. Remember they are opinions and not universal truths.
Title: Re: Other games?...
Post by: Duplode on February 20, 2024, 04:17:22 PM
In any case, I don't think there's anything on the table here to justify a passionate argument. On the one hand, it's obvious that Stunts doesn't provide a comprehensive, realistic physics model; on the other hand, it does incorporate a number of aspects of car dynamics, perhaps more than would be expected for an arcade racing game of the era. There's no need to argue semantics, it's clear enough what everyone means.
Title: Re: Other games?...
Post by: Overdrijf on February 20, 2024, 04:19:18 PM
Quote from: Matei on February 20, 2024, 03:44:35 PMActually, physics simulations existed much earlier than that:

https://fshistory.simflight.com/fsh/index.htm

Actually, would Deltar (https://en.wikipedia.org/wiki/Deltar) count? It was a purpose build analog computer, first put in use in 1960 but with prototyping going back as far as 1944, in which electrical current, voltage, resistance and capacity were used to model the equivalent principles in water. It ran simulations/calculations for building the Delta Works, the famous Dutch dike system in the province of Zeeland. I've always thought that was a cool bit of simulation, if distressingly lacking in a way to race in it. The graphics presumably sucked too.

Although I guess if I'm counting that I may have to count the computers the US army and navy pursued during WW2 for ballistics calculations as well. That might cross the border from simulation into just calculation though.
Title: Re: Other games?...
Post by: Matei on February 20, 2024, 04:27:37 PM
Deltar doesn't count, because the simulation method used there wouldn't work on a 286 CPU, to which we were referring, while the method used in the flight simulator would and actually did, because there were versions for IBM PC.
Title: Re: Other games?...
Post by: Daniel3D on February 20, 2024, 08:06:12 PM
Flight sims and racing sims are very different. I dare to say that a flight sim is easier.

But to give a bit of perspective in what made stunts I'll summarise some bits and pieces from elsewhere on the forum.
It started with another project by other people. They designed a driving simulator that they wanted to sell as instructional setup. It had a real cabin and controls and was very expensive.
It worked, but they couldn't sell it. Until they were asked to make a game of it. It went into the arcades as "hard driving".
It was a hit. Well worth the heavy investments. But it was bound to the arcades.
When home computers evolved and became "strong enough" to run something similar several companies tried to make one for home computers.
Stunt driver is one, it's ok. Didn't last.
DSI started a game with the title "skid marks" and in an early promotion it has a track that is very similar to hard driving with even the barn in the right place.
Before the release they added more track elements and changed the name to STUNTS.
But the inspiration that was taken from hard driving is unmistakable.

Hard driving was ported to pc later. But in my opinion is STUNTS still the best racing game of that time.
Title: Re: Other games?...
Post by: Matei on November 03, 2024, 04:18:08 PM
https://sourceforge.net/projects/simple3d/

Latest version with just my tracks and the version with tracks from Stunts is here and not at sourceforge.net, because those tracks are not free:

https://matei.one/idxscr.html

To make them entirely free I should change all the track elements and no one is apparently interested anyway... and Sourceforge started having problems with Cloudflare...
Title: Re: Other games?...
Post by: Matei on January 25, 2025, 06:42:01 PM
http://libsdl.org/

"Get the current stable SDL version 3.2.0"

Bad news because my game supports only SDL 1.2 and SLD 2, but:

https://github.com/libsdl-org/sdl12-compat/releases

https://fedoraproject.org/wiki/Changes/SDL12onSDL2

sdl12-compat is for SDL 2,

https://github.com/libsdl-org/sdl2-compat

and sdl2-compat is for SDL 3, so fortunately I don't have to make any game modification for SDL 3. Fedora 41 still has the executable file for SDL 2 from the start without downloading it separately, btw.