FAForever / fa

Lua code for FAF
226 stars 233 forks source link

Remove mass from dead trees and tree groups #6087

Closed BlackYps closed 5 months ago

BlackYps commented 5 months ago

This is an experimental change to allow studying the engineer behaviour when trees have no mass. I only included the dead trees so far, these are an issue on Badlands, where they are interspersed with important rocks. I can trivially add this change for other trees if wanted, because I had chatGPT write me a nice script to automate it.

This approach is way easier for testing than having to edit the armature as done in #6063 This is intended to be used for testing on fafdevelop, it's not ready to be included in game patch at the moment.

Checklist

Garanas commented 5 months ago

Could you share the script? 😃

And do you want me to merge this in for testing?

BlackYps commented 5 months ago

The script is a bash command, so it assumes you are using linux. It traverses all subdirectories from the working directory.

find "$(pwd)" -type f -name '*.bp' -path '*/Trees/*' | while IFS= read -r file; do
    sed -i '/^\s*ReclaimMassMax =/s/^\(\s*\)ReclaimMassMax =.*/\1ReclaimMassMax = 0,/' "$file"
done

Yes, please merge this in for testing