gta-reversed / gta-reversed-modern

Reimplementation of GTA:SA 1.0 US
559 stars 96 forks source link

Assert failed `CGeneral::RandomBool` #708

Open Vladik01-11 opened 4 months ago

Vladik01-11 commented 4 months ago

Expected and current behavior

The game without this warning.

Additional information

Log log.log This warning occurs here: https://github.com/gta-reversed/gta-reversed-modern/blob/master/source/game_sa/General.cpp#L169

Steps to reproduce

  1. Start Game 1.1. New game 1.2. Loading a save I don't know about others, but that's how it comes into play. Perhaps it is because of such a launch?
  2. Pick up a sawn-off shotgun and start shooting randomly

Screenshots/Videos

https://github.com/gta-reversed/gta-reversed-modern/assets/70571714/a6c570c9-15af-4ce7-be7b-69565d3ff485

yukani commented 4 months ago

Thanks for the fancy bug report. I need a stack trace though.

Vladik01-11 commented 4 months ago

gta_reversed.asi!CAEAudioUtility::ResolveProbability(float p) Строка 45 C++
gta_sa.exe!004db8d8()   Нет данных
gta_reversed.asi!CAECollisionAudioEntity::ReportBulletHit(CEntity * entity, eSurfaceType surface, const CVector & posn, float angleWithColPointNorm) Строка 279 C++
gta_reversed.asi!CAudioEngine::ReportBulletHit(CEntity * entity, eSurfaceType surface, const CVector & posn, float angleWithColPointNorm) Строка 356    C++
gta_reversed.asi!CWeapon::DoBulletImpact::__l8::<lambda_1>::operator()() Строка 513 C++
gta_reversed.asi!CWeapon::DoBulletImpact(CEntity * firedBy, CEntity * victim, const CVector & startPoint, const CVector & endPoint, const CColPoint & hitCP, int incrementalHit) Строка 685 C++
gta_sa.exe!0074119e()   Нет данных
gta_reversed.asi!CWeapon::Fire::__l2::<lambda_1>::operator()() Строка 1678  C++
gta_reversed.asi!CWeapon::Fire(CEntity * firedBy, CVector * startPosn, CVector * barrelPosn, CEntity * targetEnt, CVector * targetPosn, CVector * altPosn) Строка 1608  C++
gta_reversed.asi!CTaskSimpleUseGun::FireGun::__l2::<lambda_1>::operator()(CVector origin, CVector barrelPos) Строка 91  C++
gta_reversed.asi!CTaskSimpleUseGun::FireGun(CPed * ped, bool isLeftHand) Строка 103 C++
gta_reversed.asi!CTaskSimpleUseGun::SetPedPosition(CPed * ped) Строка 555   C++
gta_reversed.asi!CPedIntelligence::ProcessAfterPreRender() Строка 598   C++
gta_reversed.asi!CWorld::ProcessPedsAfterPreRender() Строка 273 C++
gta_reversed.asi!Idle(void * param) Строка 335  C++
gta_reversed.asi!AppEventHandler(RsEvent event, void * param) Строка 107    C++
gta_reversed.asi!RsEventHandler(RsEvent event, void * param) Строка 292 C++
gta_reversed.asi!ProcessGameLogic(int nCmdShow, tagMSG & Msg) Строка 245    C++
gta_reversed.asi!MainLoop(int nCmdShow, tagMSG & Msg) Строка 271    C++```
Pirulax commented 4 months ago

This seems familiar for some reason. I guess p of ResolveProbability is negative (or 0?) and that's what causes the issue.

Pirulax commented 4 months ago

image image @yukani just reminded me of this... Yeah, this needs more than a stack trace... But I don't remember being able to trace back what exactly caused the nans.

yukani commented 2 months ago

Tested it last night and coulsn't reproduce. Can you retest with master?

Pirulax commented 2 months ago

It's really random and hard to reproduce. I haven't had it in a while myself either.

Pirulax commented 2 months ago

Actually I just remembered: It was an issue with how we used the AudioLog10 in ReportBulletHit, it wasnt OG. I've fixed it (Not sure if the commit is in master yet)