JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
2.03k stars 615 forks source link

Crash while playing - G2API_CopyGhoul2Instance #196

Closed exander77 closed 11 years ago

exander77 commented 11 years ago

screenshot - 5 5 2013 - 01 45 58 It happens while killing this guy by saber: code/ghoul2/G2_API.cpp:1854: void G2API_CopyGhoul2Instance(CGhoul2Info_v&, CGhoul2Info_v&, int): Assertion `modelIndex==-1' failed.

ensiform commented 11 years ago

Ignore it? Compile as release?

eezstreet commented 11 years ago

Is it a crash or just an assert?

Sent from Windows Mail

From: Ensiform Sent: ‎May‎ ‎4‎, ‎2013 ‎6‎:‎52‎ ‎PM To: Razish/OpenJK Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

Ignore it? Compile as release?

— Reply to this email directly or view it on GitHub.

cadika-orade commented 11 years ago

I had precisely the same problem. I fixed it by commenting out the failing assert. Seems to have fixed the issue with no ill effects.

It seems odd to have an assert that can be consistently ignored without issue.

eezstreet commented 11 years ago

The underlying cause of the assert needs to be investigated but I'm pretty sure it's due to the lack of an efx file.

Sent from my Windows Phone


From: cadika-orademailto:notifications@github.com Sent: ‎5/‎9/‎2013 5:09 PM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

I had precisely the same problem. I fixed it by commenting out the failing assert. Seems to have fixed the issue with no ill effects.


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/196#issuecomment-17689969

cadika-orade commented 11 years ago

I'm still a bit green on more advanced C++ and very new to such a large codebase, so pardon my ignorance.

If it is an error that can come and go completely ignored without causing any obvious problems, can it not just be ignored? What sort of risks might be involved in ignoring it?

On Thursday, May 9, 2013, eezstreet wrote:

The underlying cause of the assert needs to be investigated but I'm pretty sure it's due to the lack of an efx file.

Sent from my Windows Phone


From: cadika-orade<mailto:notifications@github.com <javascript:_e({}, 'cvml', 'notifications@github.com');>> Sent: 5/9/2013 5:09 PM To: Razish/OpenJK<mailto:OpenJK@noreply.github.com <javascript:_e({}, 'cvml', 'OpenJK@noreply.github.com');>> Cc: eezstreet<mailto:eezstreet@live.com <javascript:_e({}, 'cvml', 'eezstreet@live.com');>> Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

I had precisely the same problem. I fixed it by commenting out the failing assert. Seems to have fixed the issue with no ill effects.


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/196#issuecomment-17689969

— Reply to this email directly or view it on GitHubhttps://github.com/Razish/OpenJK/issues/196#issuecomment-17697517 .

mrwonko commented 11 years ago

If it is an error that can come and go completely ignored without causing any obvious problems, can it not just be ignored?

Because there may be non-obvious problems.

ensiform commented 11 years ago

There is no ill cause of the assert. The modelindex isn't even used anywhere other than the assert. And is set legitimately to -1 by gamecode.

cadika-orade commented 11 years ago

Which leads me to wonder what the purpuse of the code was in the first place.

On Friday, May 10, 2013, Ensiform wrote:

There is no ill cause of the assert. The modelindex isn't even used anywhere other than the assert. And is set legitimately to -1 by gamecode.

— Reply to this email directly or view it on GitHubhttps://github.com/Razish/OpenJK/issues/196#issuecomment-17724610 .

xycaleth commented 11 years ago

Judging by the comment next to the assertion in the code, G2API_CopyGhoul2Instance used to be able to copy specific models from the Ghoul2 instance -- I seem to remember the Solder of Fortune 2 SDK code doing this. They disabled this in JK2 and JKA, so the assertion is checking that coders aren't relying on the SoF2 functionality. As @ensiform said, the modelIndex isn't used, but previously giving modelIndex == -1 copied all models. Now, all models are copied regardless.

So it should be safe to remove the assertion :)

cadika-orade commented 11 years ago

Fascinating. Thank you!

On Friday, May 10, 2013, Alex Lo wrote:

Judging by the comment next to the assertion in the code, G2API_CopyGhoul2Instance used to be able to copy specific models from the Ghoul2 instance -- I seem to remember the Solder of Fortune 2 SDK code doing this. They disabled this in JK2 and JKA, so the assertion is checking that coders aren't relying on the SoF2 functionality. As @ensiformhttps://github.com/ensiformsaid, the modelIndex isn't used, but previously giving modelIndex == -1 copied all models. Now, all models are copied regardless.

— Reply to this email directly or view it on GitHubhttps://github.com/Razish/OpenJK/issues/196#issuecomment-17725126 .

eezstreet commented 11 years ago

The code calling it needs to be fixed then.

Sent from my Windows Phone


From: cadika-orademailto:notifications@github.com Sent: ‎5/‎10/‎2013 11:01 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

Fascinating. Thank you!

On Friday, May 10, 2013, Alex Lo wrote:

Judging by the comment next to the assertion in the code, G2API_CopyGhoul2Instance used to be able to copy specific models from the Ghoul2 instance -- I seem to remember the Solder of Fortune 2 SDK code doing this. They disabled this in JK2 and JKA, so the assertion is checking that coders aren't relying on the SoF2 functionality. As @ensiformhttps://github.com/ensiformsaid, the modelIndex isn't used, but previously giving modelIndex == -1 copied all models. Now, all models are copied regardless.

— Reply to this email directly or view it on GitHubhttps://github.com/Razish/OpenJK/issues/196#issuecomment-17725126 .


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/196#issuecomment-17725254

xycaleth commented 11 years ago

Probably this line in code/game/g_combat.cpp, line 2059:

gi.G2API_CopyGhoul2Instance( ent->ghoul2, limb->ghoul2, 0 );
eezstreet commented 11 years ago

Model index is 0 there though, not -1

Sent from my Windows Phone


From: Alex Lomailto:notifications@github.com Sent: ‎5/‎10/‎2013 11:47 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

Probably this line in code/game/g_combat.cpp, line 2059:

gi.G2API_CopyGhoul2Instance( ent->ghoul2, limb->ghoul2, 0 );

Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/196#issuecomment-17727966

xycaleth commented 11 years ago

Exactly, it should be -1, and not 0. (The assertion makes sure that the modelIndex is -1)

eezstreet commented 11 years ago

Oh right. Yeah, simple/easy fix. I do think that the SoF2 functionality should be restored at some point though.

Sent from my Windows Phone


From: Alex Lomailto:notifications@github.com Sent: ‎5/‎10/‎2013 11:59 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

Exactly, it should be -1, and not 0. (The assertion makes sure that the modelIndex is -1)


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/196#issuecomment-17728673

cadika-orade commented 11 years ago

I am not familiar with SoF2 or any Tech3-based games other than Jedi Academy.

Exactly what is that functionality, from the player's point of view?

xycaleth commented 11 years ago

It's more for coder's convenience (and probably would be a bit more efficient too). The player wouldn't notice any difference if it was restored or not.

eezstreet commented 11 years ago

There is potential for more features here with Ghoul 2.

Sent from my Windows Phone


From: Alex Lomailto:notifications@github.com Sent: ‎5/‎10/‎2013 3:10 PM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Crash while playing - G2API_CopyGhoul2Instance (#196)

It's more for coder's convenience (and probably would be a bit more efficient too). The player wouldn't notice any difference if it was restored or not.


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/196#issuecomment-17738970

eezstreet commented 11 years ago

If we're going to port back SoF2 functionality of Ghoul2, we best make a new issue for it, otherwise I'm closing this as the concern at hand has been dealt with.