Stunts Forum

Stunts - the Game => Custom Cars with Stressed => Topic started by: Ryoma on March 12, 2022, 05:49:30 PM

Title: BMW Nazca C2
Post by: Ryoma on March 12, 2022, 05:49:30 PM
Not ready yet...in fact, I'm lazy to upload it and make better pictures.

I want to try to make the M12 and C2 version for the same car by playing with the color button.

Title: Re: BMW Nazca C2
Post by: Ryoma on March 12, 2022, 07:02:35 PM
New pictures
Title: Re: BMW Nazca C2
Post by: KyLiE on March 13, 2022, 03:24:22 AM
This looks great! :) I have fond memories of this car from Need For Speed II SE.  Is it not possible to have the timer display correctly?
Title: Re: BMW Nazca C2
Post by: Ryoma on March 13, 2022, 06:24:43 AM
I don't know. I used a white box for dast and dasm. If I use a red box for the first, it doesn't work. I did not try all the possibilities.
Title: Re: BMW Nazca C2
Post by: Duplode on March 13, 2022, 01:05:50 PM
Very nice, indeed  :)
Title: Re: BMW Nazca C2
Post by: Ryoma on March 18, 2022, 10:39:46 AM
Quote from: KyLiE on March 13, 2022, 03:24:22 AM
Is it not possible to have the timer display correctly?

Yes I found one trick !!!!!

I made some testing, only green works well :
blue:number->brown background->tranparent grey shadow->black
green:number->green  background->black shadow->no
red:number->grey background->red shadow->black
yellow:number->grey background->yellow shadow->black
brown:number->red background->red shadow->black
Title: Re: BMW Nazca C2
Post by: KyLiE on March 18, 2022, 04:06:12 PM
The green timer looks much better.  Excellent work! :)
Title: Re: BMW Nazca C2
Post by: Ryoma on March 18, 2022, 04:31:39 PM
Yes the question is how to anticipate the color in that case?
Title: Re: BMW Nazca C2
Post by: Daniel3D on March 18, 2022, 05:00:27 PM
It has something to do with colour value addition or substraction. Black on white becomes transparent.
So there is a clue in there.
Maybe CAS understands how it works.
Title: Re: BMW Nazca C2
Post by: KyLiE on March 18, 2022, 06:14:24 PM
I just tested it and I can see that background objects interfere with the timer.  Perhaps the best solution is to make it transparent.  The transparency mask for this is attached.
Title: Re: BMW Nazca C2
Post by: Ryoma on March 18, 2022, 06:22:27 PM
I don't know the green is like an HUD and the white like an hole.

With the green, we can make a sunshields (green tinted glass on the top)  like old car.
Title: Re: BMW Nazca C2
Post by: Cas on March 18, 2022, 08:33:26 PM
Uhm... I have to study which colour numbers result in what to give an exact answer, but what I can tell you is this:

- On every frame, Stunts will first paste "dasm" by performing an AND operator against the rendered background with the dasm values
- Next, it will paste "dast" by performing an OR operator on top. This is the fastest way to do masking with legacy hardware

The clock is drawn either before both or after both or in between. I guess it's before both. I would also guess that Stunts uses the same procedure to draw the digital speedometer numbers as it uses to draw the clock, but instead of using the car number font, it goes for the default system clock font. This procedure is designed for a full mask, just like the masking system in dasm/dast. The engine is supposed to first AND and then OR and the mask is supposed to only use values 255 and 0; otherwise, you get mixed colours.

My guess is that Stunts can tell if you use a roof that it has to move down the clock, but it never expects that you'll get dasm/dast to the top, so the clock stays at the same position. Notice you can exploit this to better accommodate the clock. If you would use normal masking (all 255 or 0 in dasm), you'd cover the clock and it wouldn't be visible. But if you use something else, you'd only be masking some bits out. The clock colours, I think, must be 15 for the numbers and 0 for the shadow; that's the four lower bits on for the lock and all off for the shadow. If you use a green (2) mask, you're letting only bit 1 through. When on top of that, dast has a 0, you're not changing the colour, so the numbers look green. The problem here is that, if there would be anything green in the background, it would get filtered in too. Not just that, but any background colour that has its bit 1 on will get into the clock and corrupt it. Try driving the car looking at different track elements. At some point, you may encounter something that uses such colour. The more bits you filter in, the greater the chance that this happens, so safest colours would be: 1, 2, 4 and 8. Greater than that, there'd be no clock, as the colour value is 15. But even these colours, none is completely safe.
Title: Re: BMW Nazca C2
Post by: Ryoma on March 18, 2022, 08:39:36 PM
Thanks cas, how I colorize with GIMP a color 1, 2, 4 and 8 ? I will try these 4 colors.
Title: Re: BMW Nazca C2
Post by: Daniel3D on March 18, 2022, 09:37:29 PM
Quote from: KyLiE on March 18, 2022, 06:14:24 PM
I just tested it and I can see that background objects interfere with the timer.  Perhaps the best solution is to make it transparent.  The transparency mask for this is attached.
I noticed that too. That is an unfortunate but kind of logical since the timer is behind the interior image.
One way I can think of to limit this is to make a mask for just the pixels where numbers can be, and make the rest solid.
Title: Re: BMW Nazca C2
Post by: Ryoma on March 18, 2022, 09:46:42 PM
Hey...good idea ;)
Title: Re: BMW Nazca C2
Post by: Ryoma on March 18, 2022, 11:53:19 PM
New tests
Title: Re: BMW Nazca C2
Post by: KyLiE on March 19, 2022, 07:32:34 AM
I still think the green on black looks best, but unfortunately I don't think it's possible to make it work properly.

Quote from: Daniel3D on March 18, 2022, 09:37:29 PM
One way I can think of to limit this is to make a mask for just the pixels where numbers can be, and make the rest solid.

This would be an improvement, but since the numbers are always changing, background objects would still interfere.
Title: Re: BMW Nazca C2
Post by: Ryoma on March 19, 2022, 07:52:12 AM
Yes the fourth picture is done with the idea from Daniel3D.  Consider it as a proof of concept. I update my mega.

For this car, it's not possible to decrease the dast because de will loose visibility.
Title: Re: BMW Nazca C2
Post by: Daniel3D on March 19, 2022, 09:46:01 AM
Quote from: KyLiE on March 19, 2022, 07:32:34 AM
This would be an improvement, but since the numbers are always changing, background objects would still interfere.
That is true. But only in the number segments. It's less noticeable.