Jul 17, 2017, 07:23 AM | |
Vanilla physics in Plus (Speedrun mode? Open-source part of Plus?)
Hi,
Vanilla JJ2 crashes in Wine between levels often. Plus fixes that crash and works as it should, very good work. Problem: Plus changes the physics in singleplayer, making speedruns incomparable between Plus and Vanilla. Plus removes some boss quick-kills, removes the bitchslap damage boost in Victorian Secret, etc. What to do?
Shtrudel has been learning the Jazz run and that sparked my interest again. Even before, I've had the itch several times to run Jazz 2, but didn't do it because I'd have to choose between crashes and physics differences. Shtrudel considers learning the run on Plus, not on Vanilla like everybody else, merely to compare with me. -- Simon Last edited by Stijn; Jan 12, 2018 at 04:38 PM. |
Jul 17, 2017, 10:37 AM | ||
Quote:
If dual-booting Windows is not an option for you, maybe you could run Windows in a virtual machine and then run JJ2 on it? That would probably be the easiest way out of this. |
Jul 18, 2017, 08:21 AM | |
His suggestion could be added to an expanded version of quirks mode?
VMs rarely work for this. I tried running Jazz 2 via VM in Linux a little while ago when I was thinking of primarily switching to Ubuntu. Performance was awful, maybe not even 15fps. |
Jul 18, 2017, 08:33 AM | ||
Quote:
The thing is that this would require JJ2+ to offer two versions for a variety of physics subroutines, the buggy vanilla version and the better plus version. That's obviously more work to maintain, and it feels silly re-implementing buggy behaviour that has already been patched out, usually for good reason. In some cases the old behaviour may be relatively easy to get back, if it's still in the code somewhere and relatively isolated, but that won't be the case for all physics patches. It's not necessarily difficult, it's just a fair bit of work. Maybe it will happen! There's an issue for it in the JJ2+ issue tracker already, in fact. But the cost/benefit analysis for this one, for this particular reason, isn't very favourable. |
Jul 19, 2017, 01:38 AM | ||||
Quote:
I've discussed this issue with Violet 6 months ago. Since this issue wasn't mentioned in the Plus 5.5 release notes, I'd like insight on the recent planning, thus this thread. Quote:
Quote:
I know that nobody else needs this. It would be egregious to demand so much work and maintenance from others. Plus caters to multiplayer and their own physics, this issue doesn't fit. I can't patch Vanilla without at least the basic bugfixes open-sourced. I'm a programmer, but I've never hijacked execution and injected methods into binaries. I know where Vanilla crashes in the disassembly. My binary-patching is feeble -- overwriting the instruction with nops makes Vanilla unbootable, and I didn't have other ideas. The gist: I want exactly one bug in Vanilla patched, the crash between levels. I'd be open to learn how exactly Plus does that. Would the Plus devs share knowledge? -- Simon |
Jul 19, 2017, 02:07 AM | |
There are several crashes between levels that I recall but I believe the most prominent cause on Linux to be related to music playback. JJ2 uses parallel threads incorrectly and, as far as I could tell, assumes that one will finish its work in time for the other to have it available. Multiple Linux users reported that disabling music in the game options reduces or completely eliminates crashes; although this was said about JJ2+ before this fix rather than about vanilla JJ2.
Because the error is related to how multithreading was designed in that part of code, a proper fix would be fairly complicated. The fix I wrote for it is essentially an equivalent of duct tape; it doesn't look great, or work great, but at least the hole is gone until a better solution is in place. I can try to help you adapt it to vanilla JJ2 but first please provide the address your crash occurs at to confirm that's it.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Jul 19, 2017, 02:28 AM | |
Hah, thanks for the offer. I run in vanilla 1.23.
Between levels, there is a chance to crash at 0x004a2a72 by reading from 0x0. During levels, exiting the entire program by Alt+F4 can again crash at 0x004a2a72 by reading from 0x0. -- Simon |
Jul 19, 2017, 04:17 AM | |
Yeah, that's the address. The line of Assembly that crashes your game is <code>mov ecx, [eax]</code>. It accesses whatever <code>eax</code> is pointing at, and <code>eax</code> is previously loaded from a variable that, presumably, another thread is supposed to write to. JJ2 doesn't correctly test whether this already happened or not, so sometimes it's null, hence the attempt to read from <code>0x0</code>. Thus the proper solution would probably be to create a lock to prevent JJ2 from entering that part until the other thread is finished.
We're not going to be doing that. It's complex and, in code we don't entirely understand, has a lot of room for error. What JJ2+ does is simply test whether the pointer is null and not perform any of the following actions if so. This is a moderately good solution but it also means injecting more code than there's room for. It works for us because we have a setup where we can perform jumps from JJ2 code to our own and back, but it's not easy to do otherwise. You can't insert additional bytes in the middle of the executable without breaking everything, so it may not be a viable solution for you. You could easily always terminate execution of the function early but this would probably be exactly equivalent to just disabling your music output altogether. Alternatively you could delay the execution of this function more but it wouldn't be guaranteed to eliminate crashes, only make them more sparse. I'll get back to you if I find a solution that's more worthwhile.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Jul 19, 2017, 08:03 AM | |
Curious coincidence, I have been working on similar stuff lately. I've been working on a project that needed injecting a considerable amount of code inside some functions in the JJ2 executable. I COULD have used the spare space at the end of the code section, but that space would have exhausted anyway in the end, jumping all over the place isn't healthy cache-wise, and the compiler used for JJ2 is apparently pretty crummy given the results; so I figured I could optimize the code myself by hand, compressing the existing functions and inserting my own stuff in it.
I'd say that over time I became rather proficient at it; like, with the keyboard state processing routine I managed to save about 47% of the space, while preserving original functionality (hopefully) and without hammering down performance too much. Just saying that, if you need a hand with this kind of stuff in JJ2+, I'd be happy to contribute. P.S.: Hi guys, long time no see.
__________________
Mercatura musicae delenda est. There is a flame untamed Deep in my heart Unyielding, pure Ain Soph 'tis measureless Our right divine: Aspire to all horizons To seek nature ov things Retreat within yourself To find the primal breath Behemoth - Transmigrating Beyond Realms ov Amenti |
Jan 9, 2018, 12:21 AM | |
How is the status of this? It's not urgent at all, I haven't run Jazz 2 in about 4 months.
Isolating the music bugfix still sounds like the best approach. Disabling music altogether dampens the experience. Forcing maintenance of vanilla phyics in Plus is not worth the permanent work. Consider moving this thread to the JJ2+ issue board. -- Simon |
Apr 1, 2021, 11:12 AM | |
I don't know anything about the music problem, but I'm getting much closer to being able to implement a proper speedrun mode, and would welcome help brainstorming the list of changes/fixes that should be disabled for that. Things that I've thought might be relevant:
I've also considered removing the possibility (only during speedruns) of enemies randomly dropping carrots, since that affects your health management at random and doesn't seem fair--thoughts? Last edited by Violet CLM; Dec 16, 2022 at 11:53 AM. |
Apr 23, 2021, 09:27 PM | |
Update: I've unfixed everything listed in the above post. Still looking for suggestions for what else "vanilla physics in Plus" might include, if I've forgotten anything.
|
Dec 18, 2021, 06:25 AM | |
Hi, I've promised Love and Thunder to reply here.
You already have a good comprehensive list of differences between vanilla and Plus. Leftover ideas:
I still haven't played Jazz 2 since fall of 2017. I follow the community, but AFAIK still nobody but me uses Linux or has such excessive crashing. Don't push this work merely for me. But maybe this mode will entice new runners to try! -- Simon |
Dec 18, 2021, 09:56 AM | ||||
Thanks for the reply!
Quote:
Quote:
Quote:
For each of those except the Beach 2 start, what would be really useful is a .j2m file that reliably demonstrates the behavior in vanilla and reliably fails in JJ2+ v5.9. Otherwise these are super specific key inputs that I doubt I could reproduce on my own. (To create a .j2m, run a level from the command line using the -record option, e.g. jazz2 ./castle1 -record.) |
May 13, 2023, 06:36 PM | ||||
Quote:
Quote:
It's possible that you're right, and it's merely precise. I don't have Jazz 2 installation around to test here, and (unlike with the water skip) I don't remember if I discussed possible differences (between vanilla and J2+ about this boost) with BinaryBlob or Dominator_101. Quote:
(Sorry for the absurd delay -- I've read your answer in December 2021 already, and put off an immediate reply.) -- Simon |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 03:12 PM.
Jazz2Online © 1999-INFINITY (Site Credits). Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats. Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Original site design by Ovi Demetrian. DrJones is the puppet master. Eat your lima beans, Johnny.