News:

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

Main Menu

Dissecting the Stunts files, trying to. Anyone know more?

Started by Cyberman, July 23, 2004, 08:15:12 PM

Previous topic - Next topic

CTG

I'm thinking on a custom menu bar with a cool design and the Knight Rider dashboard... both projects will start as soon as I have some time. ;)

Duplode

#211
Many comments to reply to... :)

Chulk: it seems Mark and Dstien covered all main points for a brief summary with their replies on Page 14, so that might be of help while a more formal document is to be made  ;)

Quote from: CTG on October 10, 2008, 02:51:03 AM
I'm thinking on a custom menu bar with a cool design and the Knight Rider dashboard... both projects will start as soon as I have some time. ;)

Seeing the first custom dashboard is something I'm looking forward to - every time I consider doing one of those for my cars I always find myself at a loss about how to make modifications which are good looking yet consistent with the rest of the game.

Quote from: dstien at stuntstools rev.30Context menu and actions for changing order, sorting, renaming, removing,
duplicating and inserting new resources.

That will be really useful for managing modifications while editing. Another nice use would be to insert read-me texts within the file as text resources.

Quote from: dstien on October 09, 2008, 09:18:59 PM
Quote from: CTG on October 09, 2008, 09:08:11 AM
Can you change the shape of the steering wheel?
The steering wheel is just a bitmap image that you can replace with anything you want, but I think the blue indicator will still move along a fixed arc.

The arc is actually editable, as a set of coordinates inside the *.RES. While from a contest manager point of view modifying the *.RES of a widely used car does not look like a good idea, as long as performance/physical behaviour parameters are left untouched replays won't become incompatible, save for the different steering wheel dot movement of course.

Quote from: dstien on October 09, 2008, 09:18:59 PM
Quote from: Mark L. Rivers on October 09, 2008, 03:46:02 PM
A question for dstien: upgrading the number of polygons related at shapes car1 and car2 (used during the race) can affect the fluidness of the game?
I haven't done any heavy testing, but it should only depend on the amount of available CPU cycles. If the framerate is ok when racing against an opponent with two official vehicles on the screen, there shouldn't be any difference using one vehicle with twice the amount of details. Another factor in addition to the number of polygons is the culling parameters that we haven't figured out yet...

Glad you asked that question, Mark, as it affects directly my experiments on the GT3 - the regular Corvette car1 shape has 53 polygons, while the downscaled car0 I'm adjusting to replace it has 201 (with a couple additional ones to cover the underside of the car). Unfortunately, quadruplying the polygon count seems to be a bit too much: With two equal cars on screen, the frame rate starts to suffer at about 16000 cycles, a value far too high for many pipsqueaks. Even with a single car the limit seems to be as high as 11000-12000. Since I always race at 20k cycles, I would never notice the difference by myself. That's a major blow to my current design approach... :( 

Mark L. Rivers

Quote from: Duplode on October 10, 2008, 05:57:32 AM
Quote from: dstien on October 09, 2008, 09:18:59 PM
Quote from: Mark L. Rivers on October 09, 2008, 03:46:02 PM
A question for dstien: upgrading the number of polygons related at shapes car1 and car2 (used during the race) can affect the fluidness of the game?
I haven't done any heavy testing, but it should only depend on the amount of available CPU cycles. If the framerate is ok when racing against an opponent with two official vehicles on the screen, there shouldn't be any difference using one vehicle with twice the amount of details. Another factor in addition to the number of polygons is the culling parameters that we haven't figured out yet...

Glad you asked that question, Mark, as it affects directly my experiments on the GT3 - the regular Corvette car1 shape has 53 polygons, while the downscaled car0 I'm adjusting to replace it has 201 (with a couple additional ones to cover the underside of the car). Unfortunately, quadruplying the polygon count seems to be a bit too much: With two equal cars on screen, the frame rate starts to suffer at about 16000 cycles, a value far too high for many pipsqueaks. Even with a single car the limit seems to be as high as 11000-12000. Since I always race at 20k cycles, I would never notice the difference by myself. That's a major blow to my current design approach... :( 

I'm not sure to have understood entirely your comment, Duplode, so I need a clarify.
1) Are you saying that a high number of polygons for car0 (showroom) affects the fluidness of the game?
2) Are cycles you talking the value that appears on the window bar of DOSBox?


And now a request for dstien and his wonderful tool!
Could Stressed be implemented so to:
1) delete and duplicate vertexes in the same way (right click) you can delete and duplicate polygons?
2) select the polygons even by clicking with the mouse over each of them?


Duplode

Quote from: Mark L. Rivers on October 10, 2008, 07:45:33 AM
I'm not sure to have understood entirely your comment, Duplode, so I need a clarify.
1) Are you saying that a high number of polygons for car0 (showroom) affects the fluidness of the game?
2) Are cycles you talking the value that appears on the window bar of DOSBox?

1) Not really - what I did was to downscale 1:20 the 'Vette car0 model in order to use it as car1, so we could have a more detailed car1 shape. car0 is never used while racing.
2) Yes, I meant that value. I lowered it progressively from 20000 (the default value I use) to evaluate the effects on slower computers (which usually require 10000-14000 cycles for fluid framerates).

CTG

I just started to learn the "howto" and crashed into a strange problem.

Car0: the carshow, most detailed
Car1: the game, semi-detailed
Car2: far view, "raw"

In a short try, I exported my car0 to .OBJ file and then imported back to car1. It worked - but with a huge size car on the track (16x bigger than expected). How to decrease the values of the coordinates without re-writing every single numbers manually?

Quote from: dstien on October 09, 2008, 09:18:59 PM
Quote from: CTG on October 09, 2008, 09:08:11 AM
- running red lights at the front of the car (if the mills can "move", maybe some car elements also can - if not, there's still the possibility to put a thick red line)
Cars can't have animations except for the hardcoded wheel transformations.

What about the the rear lamps when braking?

Mark L. Rivers

Quote from: Duplode on October 10, 2008, 05:52:15 PM
Quote from: Mark L. Rivers on October 10, 2008, 07:45:33 AM
Are cycles you talking the value that appears on the window bar of DOSBox?

Yes, I meant that value. I lowered it progressively from 20000 (the default value I use) to evaluate the effects on slower computers (which usually require 10000-14000 cycles for fluid framerates).

How I would like to drive in DOSBox at 20000 cycles....!  ::)   Over 9000 I have a drastical reduction of fluideness...  :-\ :(

Duplode

#216
Quote from: Mark L. Rivers on October 10, 2008, 10:10:48 PM
How I would like to drive in DOSBox at 20000 cycles....!  ::)   Over 9000 I have a drastical reduction of fluideness...  :-\ :(

Yes, indeed I'll have to rework the GT3 from ground up staring from car1 in order to make it feasible... BTW, 9000 cycles - I never managed to set up DOSBox perfectly on my old computer below 10000 cycles. Mark, could you please upload your dosbox.conf to the DOSBox Wiki article? Looks like it will be quite useful  ;)

Quote from: CTG on October 10, 2008, 07:17:39 PM
In a short try, I exported my car0 to .OBJ file and then imported back to car1. It worked - but with a huge size car on the track (16x bigger than expected). How to decrease the values of the coordinates without re-writing every single numbers manually?

Actually, it's exactly 20x bigger than expected - if you check the vertex list you'll see all numbers there are divisible by 20. The shortest solution to rescale the car0, which I used for my GT3 tests, is to open the exported .OBJ (it's just a plain text archive), copy the vertex cordinates table to Excel (in the .OBJ, they are the lines starting with v), divide all values by 20 there, then copy the new coordinates back to the .OBJ and finally import it back into stressed.

Quote from: CTG on October 10, 2008, 07:17:39 PM
What about the the rear lamps when braking?

My (unproven) theory to explain the rear lamps is that they are painted with specific materials (mostly #45, but also #12 and #14 for GTO) so that the game knows it needs to lit them up (that is, change to another shade of red, likely #47) under braking. Maybe we should paint the car body as a whole with #45 and check whether it glows when braking... ;D Anyway, the instruction to make the lamps glow is, in all likelihood, hard coded.

And nice Lada Niva there, CTG! For the historical record, it is the first new car-shaped model built from scratch... :) :)

CTG

Quote from: Duplode on October 10, 2008, 10:36:39 PM
Quote from: CTG on October 10, 2008, 07:17:39 PM
In a short try, I exported my car0 to .OBJ file and then imported back to car1. It worked - but with a huge size car on the track (16x bigger than expected). How to decrease the values of the coordinates without re-writing every single numbers manually?

Actually, it's exactly 20x bigger than expected - if you check the vertex list you'll see all numbers there are divisible by 20. The shortest solution to rescale the car0, which I used for my GT3 tests, is to open the exported .OBJ (it's just a plain text archive), copy the vertex cordinates table to Excel (in the .OBJ, they are the lines starting with v), divide all values by 20 there, then copy the new coordinates back to the .OBJ and finally import it back into stressed.

Well that was the automatical thinking from me too right after I posted that, but I had some weird problems with . and , characters (in Hungarian and so in Excel's Hungarian version we put , instead of . in fractional numbers), so it became a bit difficult for first. But it worked at last. ;)

Quote from: Duplode on October 10, 2008, 10:36:39 PM
And nice Lada Niva there, CTG! For the historical record, it is the first new car-shaped model built from scratch... :) :)

I kept only the wheels of Lada Niva, everything else was just a test with easy graphics. I decided to create a real Lada shape soon, my favorite from the 80's (not the Niva :D).

CTG

Zak: I suggest to open a new subforum for game editions, I think it deserves - and there will be plenty of new car projects soon!  ;)

After an hour of edition I was fed up with coordinates, so here is the first fragment of Lada VAZ 2105 (of course the colors will be modified if the bodywork is okay for Stunts)! :)


CTG

Problems again... making the car1 design of the new Lada, I crashed into an unexpected bug. When I try to use it in the game, several polygons are missing from the bodywork, getting visible only when I turn the camera angle (but then other polygons disappear). What can be the problem? :-\

dstien

Quote from: Mark L. Rivers on October 10, 2008, 07:45:33 AM
Could Stressed be implemented so to:
1) delete and duplicate vertexes in the same way (right click) you can delete and duplicate polygons?
2) select the polygons even by clicking with the mouse over each of them?
Mouse picking is implemented in SVN, it makes skinning a breeze. I'll make new Win32 build next time I boot into Windows. The vertex list is a fixed structure whose size depends on the selected primitive type. I guess I could make it more flexible, but you guys should really use a real modelling tool and use stressed only to finalize the shape and paint-jobs. :)

Quote from: Duplode on October 10, 2008, 05:57:32 AM
Quote from: dstien on October 09, 2008, 09:18:59 PM
Quote from: Mark L. Rivers on October 09, 2008, 03:46:02 PM
A question for dstien: upgrading the number of polygons related at shapes car1 and car2 (used during the race) can affect the fluidness of the game?
I haven't done any heavy testing, but it should only depend on the amount of available CPU cycles. If the framerate is ok when racing against an opponent with two official vehicles on the screen, there shouldn't be any difference using one vehicle with twice the amount of details. Another factor in addition to the number of polygons is the culling parameters that we haven't figured out yet...

Glad you asked that question, Mark, as it affects directly my experiments on the GT3 - the regular Corvette car1 shape has 53 polygons, while the downscaled car0 I'm adjusting to replace it has 201 (with a couple additional ones to cover the underside of the car). Unfortunately, quadruplying the polygon count seems to be a bit too much: With two equal cars on screen, the frame rate starts to suffer at about 16000 cycles, a value far too high for many pipsqueaks. Even with a single car the limit seems to be as high as 11000-12000. Since I always race at 20k cycles, I would never notice the difference by myself. That's a major blow to my current design approach... :( 
When you export the unknown culling values are discarded. When importing all bits are set. Maybe it helps to set these correctly? I think I've figured out roughly how the unknowns works, and stressed should recalculate these values automatically once implemented.

Quote from: Duplode on October 10, 2008, 10:36:39 PM
Quote from: CTG on October 10, 2008, 07:17:39 PM
What about the the rear lamps when braking?

My (unproven) theory to explain the rear lamps is that they are painted with specific materials (mostly #45, but also #12 and #14 for GTO) so that the game knows it needs to lit them up (that is, change to another shade of red, likely #47) under braking. Maybe we should paint the car body as a whole with #45 and check whether it glows when braking... ;D Anyway, the instruction to make the lamps glow is, in all likelihood, hard coded.
That's correct.

Quote from: CTG on October 12, 2008, 11:00:41 PM
When I try to use it in the game, several polygons are missing from the bodywork, getting visible only when I turn the camera angle (but then other polygons disappear).
Nice work on the Ladas, CTG! The problem you're having is most likely that you have drawn the polygons inside-out. Enable "back-face culling" in the 3d view to display only the front faces.

CTG

Oh then the order of coordinates (clockwise or not) is important too... It works now. Thank you, Master dstein! ;)

Duplode

#222
Quote from: dstien on October 12, 2008, 11:24:47 PM
Mouse picking is implemented in SVN, it makes skinning a breeze. I'll make new Win32 build next time I boot into Windows. The vertex list is a fixed structure whose size depends on the selected primitive type. I guess I could make it more flexible, but you guys should really use a real modelling tool and use stressed only to finalize the shape and paint-jobs. :)

I just updated by SVN, and mouse picking is really a godsend  :) As for the vertex list remarks, there is another relevant characteristic of Stressed 3D editor associated to that issue: when you pick a polygon and edit one of its vertex coordinates, what Stressed actually does is to create a new vertex and replace the original one in the chosen polygon, instead of updating the old vertex position. Not only that makes it necessary to adjust all adjacent polygons to displace a vertex, it also means large-scale edition of complex 3D shapes with ~200 vertexes (some of the more detailed car0 shapes, like Corvette and Audi, have about that number IIRC) is probably impossible under Stressed. And while modifying the program to displace vertexes instead of cloning them would be really useful, it probably calls for a significant rewrite... so for the time being major 3D modeling work is indeed better done at another tool (I must try and learn some Blender once and for all...)

Quote from: dstien on October 12, 2008, 11:24:47 PM
When you export the unknown culling values are discarded. When importing all bits are set. Maybe it helps to set these correctly? I think I've figured out roughly how the unknowns works, and stressed should recalculate these values automatically once implemented.

Well, I'll keep my current custom GT3 on hold until that gets implemented for further testing then - thanks  ;)

Quote from: CTG on October 12, 2008, 09:26:53 PM
Zak: I suggest to open a new subforum for game editions, I think it deserves - and there will be plenty of new car projects soon!  ;)

I second that - this thread will be overflowing with previews, screen shots and announcements very soon (It's already #9 on "Most Replies" stats :) :)) With a separate space for editing projects, this topic can be reserved for updates on Stressed and further hacking breakthroughs.

Quote from: CTG on October 12, 2008, 09:26:53 PM
After an hour of edition I was fed up with coordinates, so here is the first fragment of Lada VAZ 2105 (of course the colors will be modified if the bodywork is okay for Stunts)! :)

Ha, I know this car! A number of those funny-looking boxy sedans were imported to Brazil in the early 90's under the name "Lada Laika"  :D

CTG

Laika, LOL! (poor dog) ;D Lada 2105 was one of the most common cars in Hungary in the late 80's - early 90's and it's still quite popular. No surprise, we used to be a communist country... By the way it was the best car available for the Eastern European block, maybe only Skoda 120 (another target of my Stunts car designing ambitions ;D) was on the same level.


Chulk

Can you recommend a good 3d shaping tool? CAn we create custom paint jobs? I mean with drawings or names or anything like that?
Yes, it is me. No, I'm not back at racing (for now...)