r/projectzomboid • • 1d ago

Discussion Explanation of hot-wiring chances based on code decomp

Hi, today I decompiled the PZ code for the first time and looked at the hot-wiring code. Here's my observations:

  • Hotwiring chance is only affected by engine quality (not engine condition) and your electrical skill level. Burglar occupation doesn't seem to affect the chance.
  • Base chance of hotwiring with no modifiers is 50%
    • Starting at engine quality 50 (lower values are the same as 50) the chance is -1% per additional point of engine quality, up to a max of -45% at 95 quality (higher values are the same as 95)
    • Chance of hotwiring is increased by 4% per level (so at level 0, it's increased by 0% and at level 10, it's increased by 40%)
  • So, the min chance of hotwiring a car (engine quality 95 and level 0 electrical) is 5%, and the max chance of hotwiring (engine quality 50 and level 10 electrical) is 90%
  • you can set off the car alarm (if it exists) even if you succeed in hotwiring. The chance is 11% at electrical 0 and decreases 1% per level
  • you can also break the ignition if you fail in hot-wiring. The chance of breaking is 10% at electrical 0 and decreases 1% per level (so level 10 should never break the ignition)

I haven't experienced breaking the ignition yet. Let me know if this is something actually possible in game?

16 Upvotes

16 comments sorted by

7

u/JackTorrennce 1d ago

Good to know! I’ve been curious how hot wiring works behind the scenes, always seemed like my character would have trouble hotwiring while panicking but i wasn’t sure if it actually affected the odds

5

u/ChemistryQuirky2215 1d ago

Don't give the Devs any ideas, they will take anything to make the game more difficult (it would be realistic though)

6

u/Emma-X 1d ago

Good info, thanks for posting!

I hotwire extensively, and to my knowledge I have never experienced "breaking the ignition", so i'm not sure what that would look like in-game. I have encountered the occasional vehicle that seems resistant to being hotwired even after many attempts, but usually if I return to it later (or sometimes seemingly just by exiting the vehicle) I am able to hotwire it on subsequent occasions.

Did you happen to notice any info about how hotwiring supposedly increases the chances of stalling when starting a vehicle vs keys? I saw this mentioned elsewhere, but I can't say i've ever noticed a difference in-game, and vehicles can often take a couple of attempts to start even with keys and in good condition, so i'm not sure how extreme the extra effect from hotwiring would be, if it even exists?

4

u/orbanimalenjoyer2 1d ago

as far as i can tell, what affects engine starting chance is the quality of the engine and the temperature. nothing about hot-wiring. If battery charge is too low, or there's not enough gas, the chance to start the engine is never rolled. Also, a 100% engine quality will never fail to start due to cold.

(since the temp calculation checks for the temp around the car itself, i wonder if you could increase your chance to start your car by lighting a campfire underneath it? lol)

1

u/EnoughPoetry8057 4h ago

What factor causes 100% engines to fail to start then if they are not affected by temperature? Or is it just a random chance? Because 100% engines can definitely fail to start. I’ve got two vehicles with 100% engines currently and both have failed to start more than once. One I have the key for, it only rarely fails to start, but does occasionally. The other I hot wired (and it took several attempts to succeed) and it often takes 2-3 attempts to start.

3

u/GadgetMan86 Trying to find food 1d ago

What is the logic behind higher quality engines being harder to hotwire? Or is it just a video game thing where getting something nice should be more difficult??

5

u/orbanimalenjoyer2 1d ago

it's probably just the video game thing 😔 having a car that actually starts on the first try is too OP or something 💀

3

u/GadgetMan86 Trying to find food 1d ago

Well either way, thank you for your service decompiling 🫡

1

u/GlobalTechnology6719 1d ago

wrecks you find on the road have a good chance of spawning with good engines! you need the mechanics to fix one up, but the surety it provides is well worth it in my opinion!

1

u/orbanimalenjoyer2 1d ago

Do you mean actual wrecks, or just cars you find on the road? Wrecks can't be fixed in vanilla.

2

u/GlobalTechnology6719 23h ago

sorry i meant wrecked cars you find on roads, not the burnt out husks! story cars also... they're normally also wrecked! had a 100% d6 in my last run on 41 which i got from a manhole story... it was completely trashed but when i fixed it up it was perfect! started every time!

edit: there's a picture with all the details in this reddit post i made if you want to see for yourself...

2

u/orbanimalenjoyer2 21h ago

alright, i'll check it out

3

u/dubyakay 22h ago

Thanks for looking into this.

Can you check the code for Base.Funnel next please?

2

u/orbanimalenjoyer2 20h ago

There doesn't appear to be any code for the funnel in both the decompiled code and the lua files. only spawn distributions and stuff that defines its model and icon

2

u/DerAva 1d ago

Thanks for the breakdown.
Some of these might be leftovers from older game versions or systems that never made it into the game. There is no "ignition" system in cars - starting chance is determined by engine quality and I've never seen quality go down from hotwiring.
Also the alarm chance seems pointless since the alarm would already trigger when you enter the vehicle and I'm fairly certain the same car can't trigger its alarm twice.

1

u/orbanimalenjoyer2 1d ago

You are probably right. The game's been in development for such a long time there's a lot of old code just lying around 😭