-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement cut stock game gibbing feature #294
base: master
Are you sure you want to change the base?
Conversation
game_patch/object/entity.cpp
Outdated
if (g_game_config.gibbing && !rf::is_multi && ep) { | ||
int damage_type = regs.ebp; | ||
ep->ai.explosive_last_damage = (damage_type == 3); | ||
if (ep->ai.explosive_last_damage && ep->info->body_temp >= 90.0f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it's not sensical to depend on some magic number that happens to work for stock game entities and has no other explanation. If what you want is to exclude entities with custom death animations or enormous one why not specify it directly? Body temp field was added with the intention to define color in IR scanners (e.g. railgun), not to determine how entity dies.
You also repeated that condition twice... Please follow DRY principle.
Revamped this to:
|
…ic, add new chunks and remove old, update licensing info
This PR reimplements the cut gibbing feature that at one point existed in Red Faction, and as seen in the Technochunk bonus video.
When enabled, this feature causes entities and corpses to explode into meat chunks when they are destroyed by explosive damage (and some specific conditions). Other damage types do not trigger gibbing. I have tried to replicate this feature as close to the spirit of the original code as possible, though a handful of changes have been made:
The functionality is controlled through the built-in gore level feature which I have tied to the new
gore_level
console command. It would be ideal at some point to have this as an option in the launcher, but I'm not worrying about that right now.Here's a video of (an older version of) this feature in action: https://youtu.be/tgunFnn-lx0
The gibbing function fires under the following conditions for entities:
custom_corpse
,dying
,in_water
, oreye_under_water
If those conditions are not met, the entity dies normally. If the entity has the flag
ambient
it disappears but doesn't explode into gibs. (Not totally sure if this is necessary - I don't know what theambient
flag does for certain, but this logic was in the original code. Perhaps it can be removed?)The gibbing function fires under the following conditions for corpses:
If that condition is not met, the corpse remains. If the corpse has flags for
drools_slime
orcustom_state_anim
it disappears but doesn't explode into gibsAdditional notes:
gore1.tga
)Gore
category - not strictly necessary but may as well let mappers use it if they want.g_rng
for mt19937 RNG, and uses it for revampedrand_quick
functions inside Vector3 and Matrix3.ImpactSoundSet
struct fromweapon.h
and properly defines it insound.h
players.cfg
, and is specific to each mod, as opposed to a registry key), which is far less of a concern. If a mod doesn't work quite right with gibs, the player should just not enable gore level 2 in that mod.