juzzlin / DustRacing2D

Dust Racing 2D is a traditional top-down car racing game including a level editor.
http://juzzlin.github.io/DustRacing2D/index.html
GNU General Public License v3.0
301 stars 67 forks source link

Occassional 'stutter' when finishing a lap #94

Closed Korodny closed 4 years ago

Korodny commented 4 years ago

I'm playing dustrac 2.0.5 on an older PC (Intel i3@3.1Ghz, 8 GB, Intel onboard graphics) under Debian Testing.

The game runs perfectly fine, but occasionally when I'm finishing a lap, it hangs for half a second or so. I have not yet identified the exact circumstances (too busy racing ;)), but it happens regularly. It's not related to setting a new lap record (just checked), that was my initial suspicion.

Wuzzy2 commented 4 years ago

I can confirm this.

juzzlin commented 4 years ago

On my rather powerful machine I'm seeing some weird general stuttering when playing in the windowed mode, but not in the full screen mode.

Wuzzy2 commented 4 years ago

Strangely, I also have a stutter when I get a new lap record. But it's shorter. Maybe the long stutter happens at the end of a race when multiple achievements are gotten at once: Race record, new best rank, new track unlock, etc.

Random guess: Maybe it's the writing of files that takes so long?

juzzlin commented 4 years ago

It's possible that it's doing something stupid with QSettings. Of course using QSettings to store lap records is stupid in the first place. IIRC there's an issue to move these to an SQLite database.

Wuzzy2 commented 4 years ago

Interesting: When the Game.conf file is rather large (many records/completed races are recorded), the stutter is longer than when I have a completely empty one. In a fresh install, the stutter is non-existant.

Maybe do you try to open and close the same file over and over again? :)

Korodny commented 4 years ago

I didn't look at it too closely the last few days, but so far I can't see a clear pattern. Sometimes it does hang when reporting a new lap record, sometimes it doesn't (I'm running in Fullscreen, btw.).

Maybe it's a cache related issue? I.e. opening the relevant file for the first time or writing it causes a problem? Read the data into a buffer before the race, don't write the buffer back until after the race?

juzzlin commented 4 years ago

Could you test if this helps: d28c2f1ea99c3d7c112878e6a252e3467b226ada

Korodny commented 4 years ago

Compiled and ran this new version - I take it it's intended that this new build ignores all of my achievements from the previous one?

I raced a handful of courses with heavy difficulty 1-5 times each. Didn't notice any stuttering when finishing a lap during the race, but every time I finished the race there was a short delay when crossing the finishing line. It was very short, sometimes barely noticable - but it was there every time.

Also: I don't think I got any "new lap record!" notifications during the race - I'm pretty sure a new lap record used to be announced below the lap time when finishing the lap?

Wuzzy2 commented 4 years ago

FYI: The whole game is rather slow on most menu transitions (when I select PLAY, number of laps, difficulty level). I have a rather large Game.conf, too. Maybe you want to try testing with my file. When I remove the Game.conf, everything is fast again, but then I lose all my progress!

[BestPositionsV2]
Crossroads_10_2=1
Crossroads_1_0=1
Crossroads_1_1=1
Crossroads_1_2=1
Crossroads_20_2=1
Crossroads_3_0=1
Crossroads_3_1=1
Crossroads_3_2=1
Crossroads_5_2=1
Curvastone_10_2=1
Curvastone_1_0=1
Curvastone_1_1=1
Curvastone_1_2=1
Curvastone_20_2=1
Curvastone_3_0=1
Curvastone_3_1=3
Curvastone_3_2=1
Curvastone_50_2=1
Curvastone_5_1=1
Curvastone_5_2=1
Desert%20Storm_10_2=1
Desert%20Storm_1_0=1
Desert%20Storm_1_1=1
Desert%20Storm_1_2=1
Desert%20Storm_20_2=1
Desert%20Storm_3_0=1
Desert%20Storm_3_1=1
Desert%20Storm_3_2=1
Desert%20Storm_5_1=1
Desert%20Storm_5_2=1
Diamond_10_2=1
Diamond_15_2=1
Diamond_1_0=1
Diamond_1_1=1
Diamond_1_2=1
Diamond_20_2=1
Diamond_3_0=1
Diamond_3_1=1
Diamond_3_2=1
Diamond_5_0=1
Diamond_5_1=1
Diamond_5_2=1
Far%20Lands_10_2=1
Far%20Lands_1_0=1
Far%20Lands_1_1=1
Far%20Lands_1_2=1
Far%20Lands_20_2=1
Far%20Lands_3_0=1
Far%20Lands_3_1=1
Far%20Lands_3_2=1
Far%20Lands_5_1=1
Far%20Lands_5_2=1
Figure%208_10_2=1
Figure%208_15_2=1
Figure%208_1_0=1
Figure%208_1_1=1
Figure%208_1_2=1
Figure%208_20_2=1
Figure%208_25_2=1
Figure%208_3_0=1
Figure%208_3_1=1
Figure%208_3_2=1
Figure%208_50_2=1
Figure%208_5_0=2
Figure%208_5_1=1
Figure%208_5_2=1
Infinity_10_2=1
Infinity_1_0=1
Infinity_1_1=1
Infinity_1_2=1
Infinity_20_2=1
Infinity_3_0=1
Infinity_3_1=1
Infinity_3_2=1
Infinity_50_2=1
Infinity_5_0=1
Infinity_5_1=1
Infinity_5_2=1
Monza_10_2=1
Monza_1_0=1
Monza_1_1=1
Monza_1_2=1
Monza_20_2=1
Monza_3_0=1
Monza_3_1=1
Monza_3_2=1
Monza_50_2=1
Monza_5_0=1
Monza_5_1=1
Monza_5_2=1
Radiator_10_2=1
Radiator_1_0=1
Radiator_1_1=1
Radiator_1_2=1
Radiator_20_2=1
Radiator_3_0=1
Radiator_3_2=1
Radiator_5_2=1
Ring_100_2=1
Ring_10_2=1
Ring_1_0=1
Ring_1_1=1
Ring_1_2=1
Ring_20_2=1
Ring_3_0=1
Ring_3_1=1
Ring_3_2=1
Ring_50_2=1
Ring_5_0=1
Ring_5_1=1
Ring_5_2=1
Straight_10_2=1
Straight_1_0=1
Straight_1_1=1
Straight_1_2=1
Straight_20_2=4
Straight_3_0=1
Straight_3_1=4
Straight_3_2=1
Straight_50_2=3
Straight_5_1=1
Straight_5_2=1
Suzuka_10_2=1
Suzuka_1_0=1
Suzuka_1_1=1
Suzuka_1_2=1
Suzuka_20_2=1
Suzuka_3_0=1
Suzuka_3_1=1
Suzuka_3_2=1
Suzuka_50_2=1
Suzuka_5_1=1
Suzuka_5_2=1
Triangle_10_2=1
Triangle_1_0=1
Triangle_1_1=1
Triangle_1_2=1
Triangle_20_2=1
Triangle_3_0=1
Triangle_3_1=1
Triangle_3_2=1
Triangle_50_2=1
Triangle_5_0=1
Triangle_5_1=1
Triangle_5_2=1
Twineburg_10_2=1
Twineburg_1_0=1
Twineburg_1_1=1
Twineburg_1_2=1
Twineburg_20_2=1
Twineburg_3_0=1
Twineburg_3_2=1
Twineburg_5_2=1
Twister_10_2=1
Twister_1_0=1
Twister_1_1=1
Twister_1_2=1
Twister_20_2=1
Twister_3_0=1
Twister_3_1=1
Twister_3_2=1
Twister_50_2=1
Twister_5_0=8
Twister_5_1=1
Twister_5_2=1
Western%20Valley_10_2=1
Western%20Valley_1_0=1
Western%20Valley_1_1=1
Western%20Valley_1_2=1
Western%20Valley_20_2=1
Western%20Valley_3_0=1
Western%20Valley_3_1=2
Western%20Valley_3_2=1
Western%20Valley_5_2=1

[Config]
IA_DOWN_0=39
IA_DOWN_1=116
IA_LEFT_0=38
IA_LEFT_1=113
IA_RIGHT_0=40
IA_RIGHT_1=114
IA_UP_0=25
IA_UP_1=111
difficulty=0
fps=60
fullScreen=true
hRes=1920
lapCount=1
sounds=1
vRes=1080
vsync=1

[LapRecordsV2]
Crossroads=29216
Curvastone=33200
Desert%20Storm=40112
Diamond=15456
Far%20Lands=54320
Figure%208=14720
Infinity=13136
Monza=22672
Radiator=31664
Ring=11120
Straight=20672
Suzuka=20816
Triangle=12048
Twineburg=24320
Twister=13632
Western%20Valley=21184

[RaceRecordsV2]
Ring_1_0=15280
Crossroads_10_2=335680
Crossroads_1_0=34992
Crossroads_1_1=39712
Crossroads_1_2=32336
Crossroads_20_2=706640
Crossroads_3_0=116096
Crossroads_3_1=101632
Crossroads_3_2=103040
Crossroads_5_2=178496
Curvastone_10_2=379424
Curvastone_1_0=41120
Curvastone_1_1=40064
Curvastone_1_2=37792
Curvastone_20_2=781232
Curvastone_3_0=143904
Curvastone_3_1=125376
Curvastone_3_2=108688
Curvastone_50_2=1905008
Curvastone_5_1=199824
Curvastone_5_2=190480
Desert%20Storm_10_2=432512
Desert%20Storm_1_0=48992
Desert%20Storm_1_1=47088
Desert%20Storm_1_2=42672
Desert%20Storm_20_2=963312
Desert%20Storm_3_0=153632
Desert%20Storm_3_1=141600
Desert%20Storm_3_2=128512
Desert%20Storm_5_1=225840
Desert%20Storm_5_2=220800
Diamond_10_2=186448
Diamond_15_2=264560
Diamond_1_0=21488
Diamond_1_1=20384
Diamond_1_2=17520
Diamond_20_2=360064
Diamond_3_0=59136
Diamond_3_1=54656
Diamond_3_2=51360
Diamond_5_0=104688
Diamond_5_1=88864
Diamond_5_2=90368
Far%20Lands_10_2=627840
Far%20Lands_1_0=71232
Far%20Lands_1_1=66272
Far%20Lands_1_2=54320
Far%20Lands_20_2=1212496
Far%20Lands_3_0=209952
Far%20Lands_3_1=193440
Far%20Lands_3_2=179024
Far%20Lands_5_1=304768
Far%20Lands_5_2=303856
Figure%208_10_2=163056
Figure%208_15_2=249840
Figure%208_1_0=20032
Figure%208_1_1=19456
Figure%208_1_2=15776
Figure%208_20_2=330064
Figure%208_25_2=439136
Figure%208_3_0=56720
Figure%208_3_1=52352
Figure%208_3_2=50576
Figure%208_50_2=870000
Figure%208_5_0=95376
Figure%208_5_1=82192
Figure%208_5_2=84128
Infinity_10_2=161696
Infinity_1_0=21232
Infinity_1_1=20000
Infinity_1_2=16800
Infinity_20_2=319120
Infinity_3_0=50784
Infinity_3_1=51264
Infinity_3_2=43904
Infinity_50_2=808800
Infinity_5_0=96176
Infinity_5_1=91248
Infinity_5_2=85872
Monza_10_2=266672
Monza_1_0=33440
Monza_1_1=29952
Monza_1_2=27184
Monza_20_2=553456
Monza_3_0=95888
Monza_3_1=83520
Monza_3_2=74000
Monza_50_2=1286944
Monza_5_0=149136
Monza_5_1=139984
Monza_5_2=138512
Radiator_10_2=352160
Radiator_1_0=40560
Radiator_1_1=37408
Radiator_1_2=35200
Radiator_20_2=715808
Radiator_3_0=123200
Radiator_3_2=100384
Radiator_5_2=169744
Ring_100_2=1234192
Ring_10_2=118704
Ring_1_1=14320
Ring_1_2=13232
Ring_20_2=248864
Ring_3_0=42576
Ring_3_1=39632
Ring_3_2=36496
Ring_50_2=592352
Ring_5_0=70320
Ring_5_1=64368
Ring_5_2=58480
Straight_10_2=221744
Straight_1_0=28864
Straight_1_1=25744
Straight_1_2=23536
Straight_20_2=466800
Straight_3_0=96016
Straight_3_1=80032
Straight_3_2=69344
Straight_50_2=1207712
Straight_5_1=122032
Straight_5_2=110368
Suzuka_10_2=240096
Suzuka_1_0=26480
Suzuka_1_1=27632
Suzuka_1_2=24208
Suzuka_20_2=496800
Suzuka_3_0=80656
Suzuka_3_1=76976
Suzuka_3_2=69616
Suzuka_50_2=1240064
Suzuka_5_1=126128
Suzuka_5_2=109488
Triangle_10_2=131616
Triangle_1_0=16912
Triangle_1_1=15392
Triangle_1_2=13936
Triangle_20_2=275344
Triangle_3_0=46528
Triangle_3_1=43728
Triangle_3_2=39632
Triangle_50_2=697504
Triangle_5_0=80032
Triangle_5_1=71296
Triangle_5_2=64448
Twineburg_10_2=274032
Twineburg_1_0=32496
Twineburg_1_1=30432
Twineburg_1_2=28720
Twineburg_20_2=572576
Twineburg_3_0=96672
Twineburg_3_2=82736
Twineburg_5_2=148176
Twister_10_2=139664
Twister_1_0=16224
Twister_1_1=15584
Twister_1_2=13920
Twister_20_2=277840
Twister_3_0=49600
Twister_3_1=46464
Twister_3_2=42736
Twister_50_2=745152
Twister_5_0=95328
Twister_5_1=75568
Twister_5_2=69136
Western%20Valley_10_2=255840
Western%20Valley_1_0=27792
Western%20Valley_1_1=25824
Western%20Valley_1_2=24784
Western%20Valley_20_2=499072
Western%20Valley_3_0=80352
Western%20Valley_3_1=83440
Western%20Valley_3_2=68320
Western%20Valley_5_2=128048

[UnlockedTracksV2]
Q3Jvc3Nyb2Fkc181XzI%3D=true
Q3Jvc3Nyb2Fkc18xMDBfMg%3D%3D=true
Q3Jvc3Nyb2Fkc18xMF8y=true
Q3Jvc3Nyb2Fkc18xXzA%3D=true
Q3Jvc3Nyb2Fkc18xXzE%3D=true
Q3Jvc3Nyb2Fkc18xXzI%3D=true
Q3Jvc3Nyb2Fkc18yMF8y=true
Q3Jvc3Nyb2Fkc18zXzA%3D=true
Q3Jvc3Nyb2Fkc18zXzI%3D=true
Q3VydmFzdG9uZV81MF8y=true
Q3VydmFzdG9uZV81XzE%3D=true
Q3VydmFzdG9uZV81XzI%3D=true
Q3VydmFzdG9uZV8xMF8y=true
Q3VydmFzdG9uZV8xXzA%3D=true
Q3VydmFzdG9uZV8xXzE%3D=true
Q3VydmFzdG9uZV8xXzI%3D=true
Q3VydmFzdG9uZV8yMF8y=true
Q3VydmFzdG9uZV8zXzA%3D=true
Q3VydmFzdG9uZV8zXzE%3D=true
Q3VydmFzdG9uZV8zXzI%3D=true
QnJpZGdlIFRlc3RfNV8y=true
R3Jhc3MgVGVtcGxhdGVfNV8y=true
RGVzZXJ0IFN0b3JtXzE1XzI%3D=true
RGVzZXJ0IFN0b3JtXzEwXzI%3D=true
RGVzZXJ0IFN0b3JtXzFfMA%3D%3D=true
RGVzZXJ0IFN0b3JtXzFfMQ%3D%3D=true
RGVzZXJ0IFN0b3JtXzFfMg%3D%3D=true
RGVzZXJ0IFN0b3JtXzIwXzI%3D=true
RGVzZXJ0IFN0b3JtXzNfMA%3D%3D=true
RGVzZXJ0IFN0b3JtXzNfMQ%3D%3D=true
RGVzZXJ0IFN0b3JtXzNfMg%3D%3D=true
RGVzZXJ0IFN0b3JtXzUwXzI%3D=true
RGVzZXJ0IFN0b3JtXzVfMQ%3D%3D=true
RGVzZXJ0IFN0b3JtXzVfMg%3D%3D=true
RGlhbW9uZF81MF8y=true
RGlhbW9uZF81XzA%3D=true
RGlhbW9uZF81XzE%3D=true
RGlhbW9uZF81XzI%3D=true
RGlhbW9uZF8xMF8y=true
RGlhbW9uZF8xXzA%3D=true
RGlhbW9uZF8xXzE%3D=true
RGlhbW9uZF8xXzI%3D=true
RGlhbW9uZF8yMF8y=true
RGlhbW9uZF8zXzA%3D=true
RGlhbW9uZF8zXzE%3D=true
RGlhbW9uZF8zXzI%3D=true
RmFyIExhbmRzXzE1XzI%3D=true
RmFyIExhbmRzXzEwXzI%3D=true
RmFyIExhbmRzXzFfMA%3D%3D=true
RmFyIExhbmRzXzFfMQ%3D%3D=true
RmFyIExhbmRzXzFfMg%3D%3D=true
RmFyIExhbmRzXzI1XzI%3D=true
RmFyIExhbmRzXzIwXzI%3D=true
RmFyIExhbmRzXzNfMA%3D%3D=true
RmFyIExhbmRzXzNfMQ%3D%3D=true
RmFyIExhbmRzXzNfMg%3D%3D=true
RmFyIExhbmRzXzVfMQ%3D%3D=true
RmFyIExhbmRzXzVfMg%3D%3D=true
RmlndXJlIDhfM18w=true
RmlndXJlIDhfM18x=true
RmlndXJlIDhfM18y=true
RmlndXJlIDhfMTBfMg%3D%3D=true
RmlndXJlIDhfMV8w=true
RmlndXJlIDhfMV8x=true
RmlndXJlIDhfMV8y=true
RmlndXJlIDhfMjBfMg%3D%3D=true
RmlndXJlIDhfNTBfMg%3D%3D=true
RmlndXJlIDhfNV8w=true
RmlndXJlIDhfNV8x=true
RmlndXJlIDhfNV8y=true
SW5maW5pdHlfM18w=true
SW5maW5pdHlfM18x=true
SW5maW5pdHlfM18y=true
SW5maW5pdHlfMTAwXzI%3D=true
SW5maW5pdHlfMTBfMg%3D%3D=true
SW5maW5pdHlfMV8w=true
SW5maW5pdHlfMV8x=true
SW5maW5pdHlfMV8y=true
SW5maW5pdHlfMjBfMg%3D%3D=true
SW5maW5pdHlfNTBfMg%3D%3D=true
SW5maW5pdHlfNV8w=true
SW5maW5pdHlfNV8x=true
SW5maW5pdHlfNV8y=true
TW9uemFfM18w=true
TW9uemFfM18x=true
TW9uemFfM18y=true
TW9uemFfMTBfMg%3D%3D=true
TW9uemFfMV8w=true
TW9uemFfMV8x=true
TW9uemFfMV8y=true
TW9uemFfMjBfMg%3D%3D=true
TW9uemFfNTBfMg%3D%3D=true
TW9uemFfNV8w=true
TW9uemFfNV8x=true
TW9uemFfNV8y=true
TWluaV81XzI%3D=true
TWluaV8xXzI%3D=true
TWluaV8yMF8y=true
TXkgQ3Jvc3Nyb2Fkc18xMF8y=true
U3RyYWlnaHRfM18w=true
U3RyYWlnaHRfM18x=true
U3RyYWlnaHRfM18y=true
U3RyYWlnaHRfMTBfMg%3D%3D=true
U3RyYWlnaHRfMV8w=true
U3RyYWlnaHRfMV8x=true
U3RyYWlnaHRfMV8y=true
U3RyYWlnaHRfMjBfMg%3D%3D=true
U3RyYWlnaHRfNTBfMg%3D%3D=true
U3RyYWlnaHRfNV8w=true
U3RyYWlnaHRfNV8x=true
U3RyYWlnaHRfNV8y=true
U3V6dWthXzEwXzI%3D=true
U3V6dWthXzFfMA%3D%3D=true
U3V6dWthXzFfMQ%3D%3D=true
U3V6dWthXzFfMg%3D%3D=true
U3V6dWthXzIwXzI%3D=true
U3V6dWthXzNfMA%3D%3D=true
U3V6dWthXzNfMQ%3D%3D=true
U3V6dWthXzNfMg%3D%3D=true
U3V6dWthXzUwXzI%3D=true
U3V6dWthXzVfMQ%3D%3D=true
U3V6dWthXzVfMg%3D%3D=true
UmFkaWF0b3JfM18w=true
UmFkaWF0b3JfM18x=true
UmFkaWF0b3JfM18y=true
UmFkaWF0b3JfMTBfMg%3D%3D=true
UmFkaWF0b3JfMV8w=true
UmFkaWF0b3JfMV8x=true
UmFkaWF0b3JfMV8y=true
UmFkaWF0b3JfMjBfMg%3D%3D=true
UmFkaWF0b3JfNV8x=true
UmFkaWF0b3JfNV8y=true
UmluZ181MF8y=true
UmluZ181XzE%3D=true
UmluZ181XzI%3D=true
UmluZ18xMF8y=true
UmluZ18xXzA%3D=true
UmluZ18xXzE%3D=true
UmluZ18xXzI%3D=true
UmluZ18yMF8y=true
UmluZ18zXzA%3D=true
UmluZ18zXzE%3D=true
UmluZ18zXzI%3D=true
V2VzdGVybiBWYWxsZXlfM18w=true
V2VzdGVybiBWYWxsZXlfM18x=true
V2VzdGVybiBWYWxsZXlfM18y=true
V2VzdGVybiBWYWxsZXlfMTBfMg%3D%3D=true
V2VzdGVybiBWYWxsZXlfMV8w=true
V2VzdGVybiBWYWxsZXlfMV8x=true
V2VzdGVybiBWYWxsZXlfMV8y=true
V2VzdGVybiBWYWxsZXlfMjBfMg%3D%3D=true
V2VzdGVybiBWYWxsZXlfNTBfMg%3D%3D=true
V2VzdGVybiBWYWxsZXlfNV8x=true
V2VzdGVybiBWYWxsZXlfNV8y=true
VHJpYW5nbGVfM18w=true
VHJpYW5nbGVfM18x=true
VHJpYW5nbGVfM18y=true
VHJpYW5nbGVfMTBfMg%3D%3D=true
VHJpYW5nbGVfMV8w=true
VHJpYW5nbGVfMV8x=true
VHJpYW5nbGVfMV8y=true
VHJpYW5nbGVfMjBfMg%3D%3D=true
VHJpYW5nbGVfNTBfMg%3D%3D=true
VHJpYW5nbGVfNV8w=true
VHJpYW5nbGVfNV8x=true
VHJpYW5nbGVfNV8y=true
VHdpbmVidXJnXzEwXzI%3D=true
VHdpbmVidXJnXzFfMA%3D%3D=true
VHdpbmVidXJnXzFfMQ%3D%3D=true
VHdpbmVidXJnXzFfMg%3D%3D=true
VHdpbmVidXJnXzIwXzI%3D=true
VHdpbmVidXJnXzNfMA%3D%3D=true
VHdpbmVidXJnXzNfMQ%3D%3D=true
VHdpbmVidXJnXzNfMg%3D%3D=true
VHdpbmVidXJnXzUwXzI%3D=true
VHdpbmVidXJnXzVfMQ%3D%3D=true
VHdpbmVidXJnXzVfMg%3D%3D=true
VHdpc3Rlcl81MF8y=true
VHdpc3Rlcl81XzA%3D=true
VHdpc3Rlcl81XzE%3D=true
VHdpc3Rlcl81XzI%3D=true
VHdpc3Rlcl8xMF8y=true
VHdpc3Rlcl8xXzA%3D=true
VHdpc3Rlcl8xXzE%3D=true
VHdpc3Rlcl8xXzI%3D=true
VHdpc3Rlcl8yMF8y=true
VHdpc3Rlcl8zXzA%3D=true
VHdpc3Rlcl8zXzE%3D=true
VHdpc3Rlcl8zXzI%3D=true
eGRfM18y=true

(Note: I have manually converted the stuff to v2).

juzzlin commented 4 years ago

@Korodny Are you sure the times were lap records? It's showing the lap time anyway even if it was not a record. Now that I tested the message is working for me.

juzzlin commented 4 years ago

@Wuzzy2 Confirmed.

juzzlin commented 4 years ago

I replaced the slow QSettings with SQLite in f7edcad36e746de79ab6409a76e9f11c8c5aabc0. The only drawback is that all previous data will be erased. I still think this is a much better solution to store record times.

I'm closing this for now, but please reopen if the problem persists.