Crush It - A crush data generator for Carmageddon

Forum dedicated to editing and modifying Carmageddon 1 & Carmageddon 2.

Moderator: coffeycup

Post Reply
User avatar
Errol
Toxic Ranger
Posts: 262
Joined: Wed Dec 05, 2001 6:47 pm
Location: Sunny Wales

Crush It - A crush data generator for Carmageddon

Post by Errol » Fri Apr 13, 2018 8:39 am

Image

How to use:
Put some .dat files in the same folder as crushit.exe
Run crushit.exe
Copy the resulting crush data into your car file, replacing the 2nd crush data block

Check out the project link below for more info.

Project: https://github.com/MaxxWyndham/CrushIt
Binary: https://github.com/MaxxWyndham/CrushIt/ ... v1.0.0.zip

User avatar
QTZ
hit n run
Posts: 176
Joined: Sun Jan 12, 2014 6:53 pm
Contact:

Re: Crush It - A crush data generator for Carmageddon

Post by QTZ » Fri Apr 13, 2018 4:14 pm

:supercrazy: :beer: :supercrazy: :beer: :supercrazy: :beer: :supercrazy: :beer: :supercrazy:

LinksofSphynx
pedestrian
Posts: 22
Joined: Thu Mar 22, 2018 12:16 pm

Re: Crush It - A crush data generator for Carmageddon

Post by LinksofSphynx » Fri Apr 13, 2018 4:23 pm

VERY impressive, Errol! Seems to work like a charm.

Image

Image

I can't tell if cars acquire mechanical damage more rapidly with this data chunk, though.

User avatar
Toshiba-3
アルカリ (単3形)
Posts: 3896
Joined: Thu Jul 24, 1986 12:13 pm
Location: Belgium/France
Contact:

Re: Crush It - A crush data generator for Carmageddon

Post by Toshiba-3 » Fri Apr 13, 2018 4:48 pm

Here we are! 20 years later, the last missing piece of C1 modding has been attained :crazy:
Again, extreme thanks to you Errol. It means a lot to us and for C1 modding as a whole.
Plus it's a nice and straightforward software, makes it all very easy.

Image
fig.1: "Beautiful and delicate crushing"

@Links: Mechanical damage is handled by the condition chunks for top, bottom, left, right, front, back impacts toward the start of car txt files. BUT it is also influenced by the first value (softness) of the second crush data (the one CrushIt generates). You have to change it manually: 0.0 is rock solid (and no mech damage, thus invulnerable), 0.7 is default softness for tier 1 cars.

BTW: I'm editing the link to the first picture of your posts as hosting them on newgrounds doesn't seem to work with the script that create the thumbnails in the forum header.
Image / carmageddon add-ons at road reaction

User avatar
WadeSullivan
driver
Posts: 67
Joined: Sat Nov 21, 2015 2:50 am

Re: Crush It - A crush data generator for Carmageddon

Post by WadeSullivan » Fri Apr 13, 2018 5:02 pm

Its happing! :shock:
Yeaaaaah awesome job!! I want to test that tool too XD

User avatar
Errol
Toxic Ranger
Posts: 262
Joined: Wed Dec 05, 2001 6:47 pm
Location: Sunny Wales

Re: Crush It - A crush data generator for Carmageddon

Post by Errol » Sat Apr 14, 2018 11:43 am

Glad things are working well. :ssmile:

I'm going to do a bit of a technical write-up on how I worked out the numbers, as well as some pseudo-code and illustrations to aid with getting this functionality into other tools.

Let me know if you have any issues, I'm available through PM here, Discord, Twitter and email. You can also raise issues on the GitHub.

User avatar
Harmalarm
motorised death
Posts: 1194
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland

Re: Crush It - A crush data generator for Carmageddon

Post by Harmalarm » Sun Apr 15, 2018 12:24 am

freaking awesome guys! Hats off to you sir Errol! Greets from NYC :D

User avatar
Mastro 666
speed freak
Posts: 630
Joined: Thu Jan 26, 2006 6:24 pm

Re: Crush It - A crush data generator for Carmageddon

Post by Mastro 666 » Sun Apr 15, 2018 4:16 am

Crashing this car…with no survivors!

Image

User avatar
WadeSullivan
driver
Posts: 67
Joined: Sat Nov 21, 2015 2:50 am

Re: Crush It - A crush data generator for Carmageddon

Post by WadeSullivan » Sun Apr 15, 2018 5:46 am

Image

Its awesomeeeee :shock:

User avatar
Jaw_Breaker
pedestrian
Posts: 22
Joined: Wed Sep 18, 2013 5:17 am
Location: Semarang, Central Java, Indonesia

Re: Crush It - A crush data generator for Carmageddon

Post by Jaw_Breaker » Sun Apr 15, 2018 11:20 am

Nothing more satisfying than crushing C1 addon cars into mangled tin cans! :cool:
Image

User avatar
QTZ
hit n run
Posts: 176
Joined: Sun Jan 12, 2014 6:53 pm
Contact:

Re: Crush It - A crush data generator for Carmageddon

Post by QTZ » Wed Apr 18, 2018 5:24 am

Tested (It working under XP!) with only two cars so far (I don't know why I can't upload images here anymore) - first with Toshiba-3 custom car - it working, but crush look different than in original cars. So tested with Mini (SUBFRAME) which originally crash the game at end of race when driven by player when broken and fixed. Crush data replaced by custom doesn't help, it crush different (IMO not as nice as originally, but not compared directly) and still give error at end of race. So my method - removing some part of crush data is still better... I think there must be something wrong with original model. Also this will be cool to generate crush data close to original. I think originally was possible to skip some parts from crushing preprocessing. Not tested yet, but RAMRAIDER have uncrushable "head", so I wonder if this tool will create crush data for it or not. Looking at the screenshot above I think this will be better with disabled crushing for such solid parts.

This is amazing you have done such tool and I hope for improvements ;). PS. It name is naughty as other tools in the C. universe - I like it too :)

User avatar
Toshiba-3
アルカリ (単3形)
Posts: 3896
Joined: Thu Jul 24, 1986 12:13 pm
Location: Belgium/France
Contact:

Re: Crush It - A crush data generator for Carmageddon

Post by Toshiba-3 » Wed Apr 18, 2018 10:30 am

CrushIt generates crush datas in a fashion extremely similar to the original cars. Some original cars have near 1:1 identical crush datas if you run them through CrushIt. Errol worked out CrushIt settings until it was able to replicate almost exactly those original crush datas.

It seems obvious to me that the crushing will look different if you apply it to an addon car with a higher polycount than the original cars...

MINI.DAT has degenerate faces. Have you attempted to repair it, apply CrushIt (tweaking the settings if the crushing isn't close enough to the original), and testing ingame?
Also you shouldn't compare CrushIt's crushing to your 'fixed' mini as the latter doesn't crush nicely anymore (only one side):
Image

Ramraider's ram is uncrushable because it isn't part of the main component. It wasn't possible to select uncrushable areas the way original crush datas were automatically generated (by the old MacOS PlayThing2), you simply had to detach them from the main component.


PS: Can't temporarily upload stuff to the CWA, just host it elsewhere like IMGUR.
Image / carmageddon add-ons at road reaction

User avatar
QTZ
hit n run
Posts: 176
Joined: Sun Jan 12, 2014 6:53 pm
Contact:

Re: Crush It - A crush data generator for Carmageddon

Post by QTZ » Thu Apr 19, 2018 4:01 am

It sound like CrushIt it's almost ideal from factory :)

Maybe including crush data require to make a car in specific way then (to look better after crash) :)

I don't know how to fix .DAT :( Maybe you can help? I think maybe it's even possible to keep original crush data (full of course) and just fix the model?

I didn't compared data, but just looked how the car crushing in game (of course full original data compared to custom - so I only guess the data is different - maybe not - I need to check).

As you know I made this fix completely blindly - with very limited knowledge about crush data - just trying each part of data one by one and eliminate every part that crashing game. Now we can look how it looks like - thanks for the screen-shoot :) It looks like this side is correct then?

I have made this fix *optional* just because I'm not satisfy as it is done. It's the only solution so far.
So I think fixed model should be the perfect way and definitive solution to replace current fix as non optional :)

I think CrushIt should warn about such situation in model.

Old MacOS PlayThing2? Is this available somewhere?

User avatar
Toshiba-3
アルカリ (単3形)
Posts: 3896
Joined: Thu Jul 24, 1986 12:13 pm
Location: Belgium/France
Contact:

Re: Crush It - A crush data generator for Carmageddon

Post by Toshiba-3 » Mon Apr 23, 2018 5:11 pm

Errol's trying to figure out how some crush datas make the game crash upon exiting the race (and how to circumvent the issue).
It only happens with CARMA95 because it features a memory protection that was only intended for debugging. I guess Errol could explain it better.

In the meantime, Errol pointed to an instruction to patch to avoid the issue:
http://rr2000.toshiba-3.com/R6/CARMA95- ... e-skip.zip

QTZ: MacOS PT2 might be lost.
Image / carmageddon add-ons at road reaction

User avatar
Errol
Toxic Ranger
Posts: 262
Joined: Wed Dec 05, 2001 6:47 pm
Location: Sunny Wales

Re: Crush It - A crush data generator for Carmageddon

Post by Errol » Tue Apr 24, 2018 8:40 am

In c you allocate a block of memory, use it and then free it. The "DAMAGE: after normal block" error occurs when memory is freed that has been written beyond the allocated amount.

Or, put more simply. The game says "I want 6 bytes", the game then writes 7 bytes and then calls free(). This will throw an error if the exe has been compiled in debug mode.

Stepping through with OllyDbg I was able to find the exact location the error occurred which has allowed Toshiba to skip the free() call and avoid the error. I'm now going to try and debug how the memory allocation is calculated in the first place and see why certain meshes cause issues.

The Joker
driver
Posts: 87
Joined: Fri Aug 19, 2016 7:04 pm

Re: Crush It - A crush data generator for Carmageddon

Post by The Joker » Mon May 28, 2018 4:51 pm

Image
Image

I must admit, its kind of weird to see Addon vehicles with the crush effect.

User avatar
Deep_Blue
motorised death
Posts: 4126
Joined: Fri Oct 18, 2002 4:00 pm

Re: Crush It - A crush data generator for Carmageddon

Post by Deep_Blue » Tue Jun 12, 2018 11:05 pm

YOU ROCK, BROTHAAAAAAAA!!
***When I die may I be surrounded by scattered chrome and burning gasoline***

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests