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.01k stars 612 forks source link

Changing Video Settings Causes Repeating Initialization... #433

Closed aFoxNamedMorris closed 9 years ago

aFoxNamedMorris commented 10 years ago

Heya. I compiled the 64-Bit version of OpenJK. I installed all the needed assets, started it up, and everything seemed fine, at least until I tried to change the video settings. Whether I edit the cfg file or use the in-game UI, the game begins to Initialize over and over again as if just starting the game. No errors in the output, no suspicious messages. I am using a stock Lenovo Ideapad, running 64-bit Ubuntu Linux.

ensiform commented 10 years ago

Make sure you have newest sdl2.

Likely *nix specific issue.

ensiform commented 10 years ago

We also need to know what settings you are changing.

aFoxNamedMorris commented 10 years ago

It happens also in the i386 version. I have the newest sdl2. And the issue happens when I change the screen resolution at all, and if I try and enable effects.

aFoxNamedMorris commented 10 years ago

Okay, now I can enable effects, but any screen resolution change, or enabling fullscreen breaks the game. I can delete the cfg and play in windowed, but it sucks.

xycaleth commented 10 years ago

That's odd. I thought I fixed this problem a few months ago. The problem has to do with with this line in sdl_input.cpp: https://github.com/JACoders/OpenJK/blob/master/codemp/sdl/sdl_input.cpp#L641

When the window restarts, it triggers another resize event, which causes it to go into an infinite loop of restarting. I can't remember how i fixed it though.

@aFoxNamedMorris As a temporary fix, you can set r_restartOnResize to 0.

ensiform commented 10 years ago

The cvar causes it or the cvar was a fix?

xycaleth commented 10 years ago

Setting r_restartOnResize to 1 enables the code to restart the window every time the window is resized.

aFoxNamedMorris commented 10 years ago

@xycaleth Thanks a ton! This fixed it. Now I can happily play MovieBattles II on Linux! Back when I was in online High School, I played this a ton during down time. This is the fastest I have ever seen the game play, and the massive number of bugs has been greatly diminished. Keep up the good work, devs!

ensiform commented 10 years ago

I didn't realize movie battles 2 had a linux version of cgame/ui let alone an x86_64 version :D

aFoxNamedMorris commented 10 years ago

They apparently do, as the game has Linux compatibility mentioned in the downloads. <n.n>/

ensiform commented 10 years ago

Well there will only be a linux version of the server IIRC. There was never a linux client of jedi academy before. And they don't exactly play nice with openjk people, so...

aFoxNamedMorris commented 10 years ago

Damn... you were correct... Oh well. Dark forces works, as well as a bunch of my other favorite mods. :3 What's odd is that Movie Duels II works, and it uses a lot of MBII features. O.o Their excuse is that MBII uses calls sent to jamp.exe's various glitched code holes. Seeing as OpenJK has closed a bunch of those, the features would have to be hard-coded to a Linux+OpenJK specific make of the mod. ~sighs~

xycaleth commented 9 years ago

I'm in the process of removing this for unified SDL. I don't see it being all that important and we can try to add it back in at some later date if we really want it...

HEXcube commented 9 years ago

The latest 2015-02-10 build from Official OpenJK builds seems to have solved this bug. The new build works fine on Ubuntu 14.04LTS "Trusty Tahr" without needing seta r_restartOnResize "0" option. Older builds when run on Ubuntu 14.04LTS had this restart loop problem on startup, though they ran fine on Ubuntu 12.04LTS.

xycaleth commented 9 years ago

The cvar was removed which is why it works now! :p but thank you for noticing

HEXcube commented 9 years ago

@xycaleth But, do you know why it ran fine in Ubuntu 12.04LTS before the cvar was removed? When I tested the same build on Ubuntu 14.04LTS, it got a restart loop!

xycaleth commented 9 years ago

Unfortunately not. I didn't have any intention of fixing it properly so I didn't look into it. If I were to guess, I would say that something in the window manager between 12.04 and 14.04 changed, perhaps due to a window sizing event being sent at start up by the WM in 14.04, and not in 12.04, which would cause the 'resize' code to be triggered again, and thus the window to repeatedly restart.