Page 1 of 1

Crush It - A crush data generator for Carmageddon

Posted: Fri Apr 13, 2018 8:39 am
by Errol
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

Re: Crush It - A crush data generator for Carmageddon

Posted: Fri Apr 13, 2018 4:14 pm
by QTZ
:supercrazy: :beer: :supercrazy: :beer: :supercrazy: :beer: :supercrazy: :beer: :supercrazy:

Re: Crush It - A crush data generator for Carmageddon

Posted: Fri Apr 13, 2018 4:23 pm
by LinksofSphynx
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.

Re: Crush It - A crush data generator for Carmageddon

Posted: Fri Apr 13, 2018 4:48 pm
by Toshiba-3
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.

Re: Crush It - A crush data generator for Carmageddon

Posted: Fri Apr 13, 2018 5:02 pm
by WadeSullivan
Its happing! :shock:
Yeaaaaah awesome job!! I want to test that tool too XD

Re: Crush It - A crush data generator for Carmageddon

Posted: Sat Apr 14, 2018 11:43 am
by Errol
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.

Re: Crush It - A crush data generator for Carmageddon

Posted: Sun Apr 15, 2018 12:24 am
by Harmalarm
freaking awesome guys! Hats off to you sir Errol! Greets from NYC :D

Re: Crush It - A crush data generator for Carmageddon

Posted: Sun Apr 15, 2018 4:16 am
by Mastro 666
Crashing this car…with no survivors!

Image

Re: Crush It - A crush data generator for Carmageddon

Posted: Sun Apr 15, 2018 5:46 am
by WadeSullivan
Image

Its awesomeeeee :shock:

Re: Crush It - A crush data generator for Carmageddon

Posted: Sun Apr 15, 2018 11:20 am
by Jaw_Breaker
Nothing more satisfying than crushing C1 addon cars into mangled tin cans! :cool:
Image

Re: Crush It - A crush data generator for Carmageddon

Posted: Wed Apr 18, 2018 5:24 am
by QTZ
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 :)

Re: Crush It - A crush data generator for Carmageddon

Posted: Wed Apr 18, 2018 10:30 am
by Toshiba-3
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.

Re: Crush It - A crush data generator for Carmageddon

Posted: Thu Apr 19, 2018 4:01 am
by QTZ
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?

Re: Crush It - A crush data generator for Carmageddon

Posted: Mon Apr 23, 2018 5:11 pm
by Toshiba-3
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:
https://rr2000.cwaboard.co.uk/R6/CARMA95- ... e-skip.zip

QTZ: MacOS PT2 might be lost.

Re: Crush It - A crush data generator for Carmageddon

Posted: Tue Apr 24, 2018 8:40 am
by Errol
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.

Re: Crush It - A crush data generator for Carmageddon

Posted: Mon May 28, 2018 4:51 pm
by 70's Viking
Image
Image

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

Re: Crush It - A crush data generator for Carmageddon

Posted: Tue Jun 12, 2018 11:05 pm
by Deep_Blue
YOU ROCK, BROTHAAAAAAAA!!

Re: Crush It - A crush data generator for Carmageddon

Posted: Thu Oct 03, 2019 10:59 pm
by Toshiba-3
Errol has updated Crushit to let the user set the minimum amount of vertices for a model to be processed.

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