(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)
Death Kart!
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Death Kart!
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).
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).
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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....
Last edited by pauljessup on Wed Jul 15, 2020 8:05 pm, edited 2 times in total.
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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).
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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.
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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...)
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...)
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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.
Fixing it now and it should work fine for everyone. Figured it out while porting it to the raspberry pi.
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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!
i want try to play that game, but i cannot download
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Death Kart!
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
Who is online
Users browsing this forum: Bing [Bot] and 4 guests