Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOOM RPG gets very slow with sounds #90

Open
coldner opened this issue Aug 20, 2020 · 7 comments
Open

DOOM RPG gets very slow with sounds #90

coldner opened this issue Aug 20, 2020 · 7 comments

Comments

@coldner
Copy link

coldner commented Aug 20, 2020

It looks like sounds in DOOM RPG need to load from file everytime when game wants to play this sound.
The longer you play, game requires more and more time to load a sound and finally it's impossible to smooth playing.
Looks like a kind of memory overflow.

Game with sound disabled works very fine.

DOOM RPG version: 1.8.94
OS: Windows 10

@vadosnaprimer
Copy link
Contributor

Try other phone device options (don't remember how they are called).

@recompileorg
Copy link
Collaborator

This is probably my favorite mobile game. I started this project with the primary goal of being able to play this game on my television. In that process, I've torn this game apart, dissecting and analyzing more details about it that is reasonable. I have an article about some it here: http://www.neocomputer.org/projects/doomrpg

Sound is very strange in DoomRPG. IIRC, the sound effects are complicated MIDI files instead of the more obvious wav files. I can't image that they're saving any space that way! Java is notoriously bad at playing MIDI files, and I believe that is responsible for most of the pain here.

A few things to try:

Try version 1.0.92. It's still awful, but I haven't really noticed things getting worse as you play.

Try changing your default MIDI synth. VirtualMIDISynth seems popular. https://www.youtube.com/watch?v=4MZnZQO7rJk

If you're able, take a look at the code in src/org/recompile/mobile/PlatformPlayer.java starting at line 205. It's about as simple as I could manage, and I don't see anything obvious that would cause the issue, but there's no harm in looking at it.

@Nokia64
Copy link
Contributor

Nokia64 commented Aug 23, 2020

I have also experienced "lag spikes" when a MIDI sound begins to play under Windows, both under FreeJ2ME and KEmulator.

With KEmulator, when using the old JRE 1.4, that uses its own internal MIDI synth rather than passing MIDI to Windows one, there's no issues. When running the same KEmulator executable and game with the newer JRE 8, that passes MIDI to Windows synth, the game lags for half a second before playing a MIDI sound. Similar issues happen with FreeJ2ME, that performs a little better, though. Could not try with the older JRE 1.4 since FreeJ2ME requires JRE 8 or higher.

@naviabbot
Copy link

naviabbot commented Jun 12, 2022

A lot of lag spikes happen with this game and supposedly many other ID Mobile games. John Carmack posted a workaround on his twitter account. Full thread here: https://twitter.com/id_aa_carmack/status/1395089205986988043

His workaround is using the switch -XX:+DisableExplicitGC on the command line or as a part of a batch file. It works.

@vadosnaprimer
Copy link
Contributor

:(
изображение

@recompileorg
Copy link
Collaborator

I read that as well. It might be worth following up with him.

@recompileorg
Copy link
Collaborator

I asked him on Twitter and he told me that they not only submitted a patch, but it was accepted. This must have been it:

c831246

So that's pretty neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants