Hmm, okay. I've experimented a lot now and I've been able to write a program that reproduces the black screen consistently here. I may just be abusing the API to do something Windows normally wouldn't do, but it may help you debug it.
Anyway, the program sends a SHIFT+F4 keydown/keyup pair to the LFS window, but the crucial bit here is that I call SetForegroundWindow on the window in between the keydown/keyup pairs. If I remove that, or move it to after the key messages, LFS behaves normally. The interesting bit though is that it only happens the second time you go full screen after the program has been run. First time everything is fine, but the second time it goes black... every time.
So, to reproduce:
- Start LFS in windowed mode.
- Run the program and LFS will go full screen.
- Press SHIFT+F4 manually twice to return to windowed and back to fullscreen.
- Black screen hopefully.
My guess is that Scawen is mainly trying to fix the server going bonkers while lots of people try to get in at once bug. It's rather serious issue because it locks up the whole server and the server needs to be restarted to fix it. When it is sorted X can be released.
The black screen thing everyone is talking now isn't as serious because it's only a nuisance for the individual player so if that can't be fixed easily it will probably be left for later patches.
Disclaimer: That above is only a speculation.
Yes, it works perfectly, and you only need to run it once. The first run already starts the bug, you just need to change screen mode twice after that yourself. Exactly like I described, if you think about it
Thanks! Now we have a way to reproduce it every time.
You program didn't run on my windows for some reason, so I've compiled again with your source code and attached it here.
I'll do some remote debugging and try to catch this later. Remote debugging, for anyone who doesn't know, means : running the program on a different computer from the debugger, and that is needed when you are debugging things going full screen, because when it goes full screen you can't see the debugger.
Yes, when too many people join and leave all at once, it can go wrong. I've already improved some things and will probably test this evening. Though I'm keen to make in-game votes and the game setup screen "ready" flags persistent because it's so hard to get in for a race or restart. So... patch X is already delayed and it's better to fix these known serious issues or it really isn't that good for 32 players.
I tried it several times and did not succeed in getting a black screen on my system. When switching from full screen to windowed mode the window is black for about 1 second but then everything is fine again.
My question is: when will we see, over the next X amount of time, such a large amount of people joining all at once? I can only see this happening if S2 final comes out, or if you release the long anticipated RBR and Westhill Club circuit. And then the fervor will die down in a matter of days, if not shorter.
Obviously, it is good to plan for the future, but are you sacrificing time and energy on a bug that for the most part will be a rare occurance? Or am I missing the point? I guess I am speaking for the common man who does not understand the reason for such extensive coding.
Just throwing my opinion out. Still...for me, the wait is worth it.
Yeah, I then clicked on the screen so LFS regained focus and then tried shift + f4 and nothing.. still came back to the game with normal picture..... try as i may I just cannot reproduce it
Guess it's not working on all configurations then... and maybe it's not even an LFS bug. I mean, in how many other games do you repeatedly switch between fullscreen and windowed mode? Normally that's not even possible, or ridiculously slow.
The only hope is that Scawen can reproduce it, so he can maybe rewrite the code a bit to, if not fix it, at least minimize the chance of it happening even further. Then again, it's not like the black screen thingy is a real problem anyway, especially now that I know how to reproduce it, I also know how to actively avoid it - the network issues are far more important
Very true, but imagine a scenario where we have a nearly full server or two attempting to restart. It's quite hard to get enough votes as it is, but when a 99% completed vote gets cancelled because of a new joiner it can be quite annoying. And it does happen even with 'only' 20 people.
Yeah, the issues are quite serious. There are just so many people joining and leaving all the time on a 48 connection / 32 players host, that these bugs come up too frequently - and when they do, 30 to 40 people are affected all at once. So... gotta fix them.
Anyway, I've tried to fix the server killer bug, updated to W40 now. Franky will soon be updating the bug test server and we can try another stress test on it. That involves basically everyone joining and racing, but we probably need to try all leaving and rejoining a few times.
Under the queueing system, if you reach #1 and then enter, it's possible for you to receive a "player is disconnecting" and your connection attempt becomes void. Technically not a bug I realise
I also received a JOOS on connection, in w40, yet managed to stay in server about 20 seconds before I was disconnected, perhaps not relevant, but I'd rather report it. It ws franky's bug testing server also, about 19:30-ish
the only change I can notice with 39 and 40 is that it twitches and laggs the game much more then it used to when people connect, leave pits and DL/loading skins.
Not sure if this is simply an issue on my side but it is much worse then it used to be (now I regularly lag off of the track during the above mentioned occurrences)
It's only meant to handle a lot of people connecting at the same time while there's still room in the server I think. If it's full, you get the normal message.
Hmm. LFS just crashed on me while waiting in the connection queue. I think it was at the first position and was getting ready to connect. Unfortunately I didn't have LFS in focus when it happened so I couldn't see exactly what it was doing.