Page 3 of 3
Re: Death Kart!
Posted: Wed Jul 15, 2020 5:54 pm
by pauljessup
(and yes, you need to hold down the "gas" so to speak...pretty much like Mario Kart, etc to speed up and go more than one or two pixel per frame)
I'll look into using scancodes rather than key constants, but really, it works best with a gamepad...even the menu input quirks are gone with the gamepad)
Re: Death Kart!
Posted: Wed Jul 15, 2020 7:10 pm
by zorg
My example that i posted already caps the FPS in terms of it'll only update your FSM when the update function accumulates at least 1/60 deltatime; no need to sleep it. (and love.run already sleeps the main thread for 0.001 seconds so it doesn't hog a cpu core)
Also, you don't have a conf.lua from what i've seen, so iirc löve's default behaviour unless you set it yourself via setMode or updateMode or something, is to have vsync be on; that might already force dt to be 1/screen refresh rate (if it works correctly, that is).
Re: Death Kart!
Posted: Wed Jul 15, 2020 7:54 pm
by pauljessup
Yeah man, your example doesn't work on my mac. it just cuts out all input and doesn't do anything. And when I have it out output FPS, it says it's 565 frames per second. So, no input, frame rate through the roof....
Re: Death Kart!
Posted: Wed Jul 15, 2020 7:55 pm
by pauljessup
Yes, if you looked in the fsm folder at intro.lua (which is the finite state that starts the game), you would see that vsync is turned off, since it doesn't work quite right on all monitors (like my mac, for example, the refresh rate is way higher than 60fps, and causes input lag and all sorts of not fun stuff).
Re: Death Kart!
Posted: Wed Jul 15, 2020 10:37 pm
by pauljessup
Messed with the menu timer speed (sped it up by a bit, though might move too fast between menu items now, not sure), and then I took out the FPS cap code and just have it use vsync for now for limiting the framerate. It's wonky on my mac, but maybe this can fix the keyboard input issues on windows machines, who knows.
Re: Death Kart!
Posted: Thu Jul 16, 2020 1:54 pm
by pauljessup
I think I see it now- funnily enough, I ported it to the Retropie, and the main menu took *forever* to move between menu options. Slowwwwww. Which is weird, because I sped it up on my osx so it runs almost too fast. It doesn't do that for any other menu now, just the main menu.
It makes me think something else is slowing it down on other systems that has nothing to do with the timers...not sure what though, since this menu is only slightly different (at the load it checks to see how many gamepads are connected, and then it highlights Player 1, 2, 3 according to how many are connected...though that shouldn't slow down the menu, since it's calculated on menu load, not during update or draw...)
Re: Death Kart!
Posted: Thu Jul 16, 2020 2:03 pm
by pauljessup
AHAHAHA I figured it out. It had nothing to do with input timers or how I was doing FPS caps. Nothing at all.
Fixing it now and it should work fine for everyone. Figured it out while porting it to the raspberry pi.
Re: Death Kart!
Posted: Thu Jul 16, 2020 2:23 pm
by pauljessup
Yup. I think that did the trick. Was just some old debug code I hadn't removed from the menus, it was slowing things down to a crawl, since it was calculating a bunch of stuff right inside the draw function.
Re: Death Kart!
Posted: Thu Aug 06, 2020 2:17 am
by daduv
i want try to play that game, but i cannot download
Re: Death Kart!
Posted: Fri Aug 21, 2020 11:06 pm
by pauljessup
looks like we'll be returning to this game in a few months, updating the graphics, tweaking the code, adding in stuff we originally wanted to leave in but didn't have time, and also adding in online multiplayer. Nothing complex, doing it pretty much the way Stardew Valley and others do it, with one person being the host they connect to via IP