English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   project.CARE (https://eab.abime.net/forumdisplay.php?f=58)
-   -   Custom cars for 4D Sports Driving (aka Stunts) (https://eab.abime.net/showthread.php?t=113800)

earok 03 March 2023 00:09

Custom cars for 4D Sports Driving (aka Stunts)
 
I've started investigating how to bring some of the numerous custom cars made for the DOS version of Stunts across to Amiga.

A car has a four character ID and there are four files that represent a car:


CAR####.RES - Contains a text description of the car as well as all of the performance/physics settings.

Getting these to work on Amiga basically just involves reversing the order of the longwords and words of data to cater for the M68K processor.


STDA####.PSH and STDB####.PSH. Visuals for the dashboard. The format on the DOS version is either VSH (raw) or PVS (compressed). I'm assuming PSH is an Amiga specific compression format. I haven't looked into these and I've assumed they're quite different between DOS and Amiga, given the difference between VGA and OCS.

ST####.p3s is the 3D shape file. This aligns with the format of the compressed DOS file (uncompressed is 3SH). Though compression varies between formats - so far as I can tell the DOS compression is custom, and the Amiga compression is RPck and can be decrunched with XFDDecrunch.

Where I got stuck is this: the actual 3D formats appear to be different between the Amiga and DOS versions.

According to https://wiki.stunts.hu/index.php/Res...rmat#3d_shapes the format is:

Main strcture

Code:

uint8    numVertices
uint8    numPrimitives
uint8    numPaintJobs
uint8    reserved // Always == 0

VERTEX    vertices[numVertices]
uint32    cullFront[numPrimitives]
uint32    cullBack[numPrimitives]
PRIMITIVE primitives[numPrimitives]

uint8    terminate[...] // 1-3 NULL-bytes for data alignment

Additional structures

Quote:

struct VERTEX {
int16 x
int16 y
int16 z
}
Code:

struct PRIMITIVE {
  uint8 type
  uint8 flags
  uint8 materials[numPaintJobs]
  uint8 indices[...] // Size depends on type.
}

Comparing the Amiga and DOS version of the Corvett, the first four bytes are a little different:

DOS: E4 C3 07 00
Amiga: E4 BC 07 06

While the number of vertices and paint jobs appear to be the same, the number of primitives is slightly different, also the last byte is "06" whereas according to the DOS specification, this is meant to be zero.

What gets weirder is the vertex values that immediately follow it. It appears that the Amiga version has an extra word of data per vertex. If we have a look at the first two vertexes on the Corvett:

Code:

DOS (words flipped to match M68K data)
X    Y    Z        X    Y    Z
FE5C 003C 03FC ---- 01A4 003C 03FC ----

AMiga
X    Y    Z        X    Y    Z
FE5C 003C FBF0 0101 01A4 003C FBF0 0100

As we can see, X/Y correlate exactly, but at a glance there's no correlation between the Z values. I can't work out what exactly Z means on Amiga - I'm assuming they used a different kind of data for Z in order to pad the size of a vertex from 6 bytes to 8 bytes, but I can't make any sense of it. Maybe they used a floating point format? In any case I'm not sure how to convert the DOS value of 03FC to match the Amiga value of FBF00101.

That's where I got stuck.

----

Even if we don't work out how to convert 3D models across, there might still be some value with modifying the files anyway:

- Zapper's car pack is the original car pack, with the physics/performance settings tuned to more closely match "real world" performance. I could look at bringing those resource files across.

- It should be relatively easy to edit the Amiga 3D files so the low detail models match the high detail model (basically making it so that the car in-game is always the same level of detail as the car in the car selection screen, this might be cool to see on a high end Amiga or emulator settings).

earok 03 March 2023 10:07

I got it working!

https://cdn.discordapp.com/attachmen...8576/image.png

https://cdn.discordapp.com/attachmen...5296/image.png

It turns out that I was wrong about Z having a different format - what confused me was that (for whatever reason) the actual order of vertices is different between DOS and Amiga cars but otherwise they seem to be almost identical. The additional word of data after Z seems to be junk, presumably just there to keep Vectors aligned with multiples of 4.

Next step is to look at the dashboards - this may be "too hard" to take care of if the formats are just too different between Amiga and DOS (and they're not strictly needed since there's a variety of dashboards from the original Amiga cars that could be substituted), but it's worth a look.

Edit: I'll skip the dashboards, at a glance the Amiga dashboards appear to be crunched in a bespoke format, it's well beyond my ability to decipher.

Reynolds 03 March 2023 10:15

How can be custom car built for the game? What (designer) program is required?

earok 03 March 2023 10:18

Quote:

Originally Posted by Reynolds (Post 1600041)
How can be custom car built for the game? What (designer) program is required?

I don't really know anything about actually making cars, but there's a whole wiki dedicated to Stunts modifications. This page here might be a good starting point - https://wiki.stunts.hu/wiki/CarWorks

gimbal 03 March 2023 13:00

Cool. But do you really want to play the Amiga version of this game? :)

jotd 03 March 2023 15:06

that's great work!

earok 04 March 2023 00:34

@gimbal The Amiga version of the game isn't too bad, admittedly it does feel a bit sluggish.

@jotd cheers!

https://github.com/earok/Stunts_DOS2Amiga

I've posted a rough alpha version of the tool here. I'm not sure I'll do any more on it but the source is there, it's fairly trivial so it could probably be converted from Windows to Amiga or Mac or Linux easily enough.

Note that I've had some crashes running custom cars that have been converted (particularly when giving the car to an opponent - not so much when just driving the car myself). It's possible my conversion process is buggy, or the cars themselves are buggy, or they're just too heavy for Amiga 4D Sports Driving (presumably they're all designed to run on Stunts on at least a 486), or some combination.

Tutorial for installing a the Bus to 4D Sports Driving (Windows required to do the conversion, after that you should be able to run on WinUAE or copy to a real Amiga):
  • Make a backup of your 4D Sports Driving install.
  • Download the conversion tool into the 4D Sports Driving folder (under "data" if using WHDLoad)
  • Download the Ikarus 260 from Mark Ceccato's site into the same folder and unzip there.
  • Run the EXE, you should get the following prompt.

Code:

Make sure to have a backup of everything before starting!
Car ID i260 appears to be a DOS Stunts custom car. Do you want to convert to Amiga format? y/n

  • Press y. You should now get the following prompt to copy an existing dashboard.

Code:

We need an Amiga formatted dashboard to add to our custom car. Enter the dashboard to use
1: Acura NSX
2: Audi Quattro
3: Corvett ZR1
4: Ferrari GTO
5: Jaguar XJR9
6: Lamborghini Countach
7: Lamborghini LM-002
8: Lancia Delta
9: Porsche 962
10: Porsche Carrera 4
11: Porsche March Indy

  • We'll choose the Lamborghini LM-002 Dashboard.
  • You should get this message.

Code:

Converted i260 to Amiga format
Success! 1 cars converted

That's it! Close the window and enjoy your new car.

https://i.imgur.com/QpOiKbB.png

https://i.imgur.com/XpzsQ64.png

gimbal 04 March 2023 01:02

Ha ha :) Under a bus the tires look even more like cardboard cutouts.

Striker01 14 May 2023 15:37

1 Attachment(s)
Hello earok, just discoverd the notification and this thread. Awesome!!! https://forum.stunts.hu/Smileys/default/cheesy.gif One question, which Version of .NET Framework does your converter need to run? I would like to convert and test some cars at once. https://forum.stunts.hu/Smileys/default/cheesy.gif
There comes no further CMD or a screen after allowed Windows 10 to start your program.
EDIT: Thank you earok .NET 7.0 SDK did the job. :)
https://dotnet.microsoft.com/en-us/d...-x64-installer

Striker01 14 May 2023 21:43

Simply freaking AWESOME job earok! Custom Cars for 4D Sports Driving / Stunts! :D


Thank you!!! Hope some more cars will be playable soon. :)


https://youtu.be/3kzGOOQshTo

EDIT:

Can we make a list to sort out which custom cars are working and which not?

;D
Working:
Audi V8 Quattro DTM
BMW M3 E30 DTM
Ferrari 512 TR
Fiat 500 Abarth
GMC General '84 FLAG Truck Semi - Knight Rider !!!! :D
Ikarus 260 BUS
Jaguar XJ220
Lamborghini P114 Bravo
Lotus Esprit Turbo SE
Mercedes-Benz 190 E DTM
Porsche 959


:-\
Working in Showroom but NOT working on the road:
Alfa Romeo SE048SP (LeMans) -> - Abnormal Termination - Shape Not Found
Ferrari F40
Ferrari Testarossa
McLaren MP4/4
Ponitac Firebirt KITT - Knight Rider

Striker01 11 August 2023 13:36

I have again tested a few custom cars from Stunts for 4D Sports Driving on the Amiga.
Have fun with the cars. Todos are of course even better conversions or bug fixes for the non-functioning cars, dashboards and car sounds.

Here the download link to CarPack1&2 and a WinUAE config:
https://drive.google.com/file/d/1Rjv...ew?usp=sharing


Alternative download:
https://forum.stunts.hu/index.php?topic=4105.15


List of the cars:
Car Pack´s mit 28 Autos funktionieren!!!
Achtung 29 Autos können schon zu viel sein.
Es kommt sonst im Showroom zum Fehler Exception "Illegal Instruction" ($10) at ... occured.

Liste der getesteten/funktionierenden Stunts / 4D Sports Driving Custom Cars am Amiga:

Car Pack2:
==========
Alfa Romeo 164 ProCar
Bugatti EB110
Citroen CX25 GTI Turbo
Cizeta V16T
Ferrari 288 GTO
Ferrari 328 GTB/S
Ferrari 408
Ferrari F512M
Ferrari GTO Evoluzione
Ferrari Modulo 1970
Ferrari Pinin
Ford Ranger Pickup 1988
Ford Sierra RS Cosworth
Jaguar XJR9 LM
Suka1.1 - Superkart
Toyota Corolla GTI
ZR1 GT3 (Corvette)


Car Pack1:
=============
Audi V8 Quattro DTM
BMW M3 E30 DTM
Ferrari 512 TR
Ferrari Mythos
Fiat 500 Abarth
Ford Thunderbird 1957
GMC General '84 FLAG Truck Semi - Knight Rider !!!! https://forum.stunts.hu/Smileys/default/cheesy.gif
Ikarus 260 BUS
Jaguar XJ220
Lamborghini Diablo
Lamborghini P114 Bravo
Lotus Esprit Turbo SE
McLaren F1
Mercedes-Benz 190 E DTM
Plymouth Fury 1958
Porsche 911 Turbo_final
Porsche 959

Standard Autos (11):
===============
*Lamborghini Countach
*Ferrari GTO
*Jaguar XJR9 IMSA
*Lancia Delta HF Integrale 16V
*Lamborghini LM-002
*Porsche 962 IMSA
*Porsche Carrera 4
*Porsche March Indy
*Corvette ZR1
*Acura NSX
*Audi Quattro Sport

Nicht funktionierend:
====================
Alfa Romeo SE048SP (LeMans) -> - Abnormal Termination - Shape Not Found
Audi Quattro Sport S1 -> Auto startet in der Luft, danach Exception "Integer Divide by Zero" ($2014) at $9B66C0 (ExpMem $846C0) occured.
Chevrolet Impala 1959 -> Funktioniert im Prinzip... Bei ganz wenig Ram sogar in der Aussenansicht mit wenig Details. Bei normaler Konfig aber Exception "Illegal Instruction" ($10) at... (ExpMem $477CC) occurred, sobald man mit C die Kameraperspektive wechselt.
Ferrari 308 GTS Quattrovalvole -> bereits im Showroom, auch ohne Extra-Autos installiert, Exception "Illegal Instruction" ($10) at $9798BE (ExpMem $478BE) occured.
Ferrari 637 Indy -> - Abnormal Termination - Shape Not Found
Ferrari 641 (F1) -> - Abnormal Termination - Shape Not Found
Ferrari F40 -> Auto startet in der Luft, Windschutzscheibe springt, Game Over.
Ferrari Testarossa -> Kurz nach dem man auf der Strecke ist: Exception "Integer Divide by Zero" ($2014) at...
McLaren MP4/4 -> - Abnormal Termination - Shape Not Found
Pontiac Firebird Turbo T/A KITT - Knight Rider -> - Abnormal Termination - Shape Not Found
Porsche 962 C Lemans -> Abnormal Termination, Shape not found!
Speedgate XSD -> stürzt im Showroom ab, Exception "Illegal Instruction" ($10) at $A occured.
Toyota Sprinter Trueno -> funktioniert beim ersten mal, verursacht danach aber (auch ohne Extra-Autos installiert) eine Exception "Address Error" ($200C) at $2F00A9 occured oder mit anderen Autos eine Exception "Illegal Instruction" ($10) at .. (ExpMem $4781A) occurd.
Xylocaine XF -> - Abnormal Termination - Shape Not Found

-----------------------------------------------------------------------

4D Sports Driving (am PC als Stunts bekannt) mit vielen Custom Tracks (meine persönliche Reinhold Strecke) und insgesamt !!29!! Autos!
Nicht vergessen im Optionsmenü -> Set graphic level -> Full einzustellen! https://forum.stunts.hu/Smileys/default/smiley.gif

A = hoch schalten
Y = runter schalten
C = Camera

1) how many cars the game allows at max? PC: 32, Amiga: 28
2) how many tracks per folder the game allows? PC: 128, Amiga: ?
3) how many replays? PC: 128, Amiga: ?

earok 11 August 2023 14:24

Ah, that's so cool! Thanks for putting the tool to a good test.

I think the dashboard was going to be too hard to do because the format is very different between Amiga and PC, but at the Stunts forum they did suggest an improvement I am yet to do (I should make it so that, when you substitute a dashboard, it also uses the Amiga dashboard's data rather than the data of the custom car's dashboard - that will make dashboards less glitchy).

Striker01 11 August 2023 15:22

Hi earok,
glad you like my testings with your great converter. :)
I am motivated to work on CarPack 3 for 4D Sports Driving. :) Any improvments with your converter are most welcomed. Would be awesome just to have the dash and gearbox graphics from the custom car to Amiga some day. PS: find the all in one (one click) portable WinUAE pack on stunts.hu :)

fryguy 11 August 2023 16:14

cool :)

I used to play this game in school on PC.

Seiya 12 August 2023 14:51

as some of you had succefully installed the car pack, do you share your full install game + car pack?
yes, i could install myself, but i'm so lazy

edit:
but in the archive "All_cars" are already converted car ready to be copied into install dir?

Striker01 12 August 2023 15:08

All_cars.zip are the cars for the PC version.
If you are lazy head over to the link I gave to stunts.hu and get my portable 1 click WinUAE version. With this you only need a PC. All you need with this package is a Workbench with whdload. You don't have to install anything. I did it all for you. ;)

kriz 12 August 2023 15:35

Really cool! Great tool Earok and nice work Striker01 for the pack!!

Striker01 12 August 2023 17:25

Thank you very much kriz. Glad it worked and you like it. PS: with 68040 you have minor sound glitches but best frame rate/playability

Seiya 12 August 2023 17:36

Quote:

Originally Posted by Striker01 (Post 1635794)
All_cars.zip are the cars for the PC version.
If you are lazy head over to the link I gave to stunts.hu and get my portable 1 click WinUAE version. With this you only need a PC. All you need with this package is a Workbench with whdload. You don't have to install anything. I did it all for you. ;)


i need harddisk version. well. i will try to follow the guide step by step.. later i will try with your whdload ready :)
i copy "all cars" intro 4D Sports Driving dir, but when i launch the exe it say: Success! 0 auto converted and stop. any keys it close the window and return to desktop.

Striker01 12 August 2023 17:42

It is a harddisk version. ;) :lol: For the lazy ones use the google drive link to portable all in one WinUAE from stunts.hu


All times are GMT +2. The time now is 02:10.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.08084 seconds with 11 queries