Alternatively, join us on Discord.

[4x3 contest][C++][PC]MiniDungeon

Started by Scipi, May 09, 2015, 05:00:31 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Snektron

You can render fast and update at a smaller pace. That's how most games are done actually, but i think AAA titles keep the update speed bound to like 60.
Also seperating the render and update loop ensures the game will allways run at a certain tick rate, while the render speed may vary, even if its on some low end computer where the render loop takes longer than the update loop.
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Scipi

Quote from: DJ Omnimaga on May 27, 2015, 09:19:02 pm
For such game, I think the frame rate should be set to 8 max. You can have animations that run faster, but trying to walk at 60 fps would be a nightmare. :P


The framerate actually has no effect on the gameplay whatsoever. I could play fine running the game at full speed at ~4500 fps :P

Though I have the framerate locked to the screen's refresh rate.




DJ Omnimaga

Ok but what about key repeat? That was my main concern. If you press down an arrow, won't your character move by 4500 pixels in a second at such speed, making accurate movement impossible? Or did you disable key repeat/holding down arrows?

Snektron

As i said dj, you'd render at 4500 fps and run the update logic (containing key detect code and such) only 20 times a second.
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

That's the reason update/render programming pattern exists. The rendering is independant from the updating and thus the programmer does have full control on the timing around them.

Scipi

Key repeat is disabled, so the input is registered only on the first frame a key is pressed.

As for the render/update pattern, generally you'd use that if you need to synchronize state across a network (ie, multiplayer) or if you have systems that become unstable at certain framerates, such as physics. Since this game features neither, there's no real need to use that pattern. If I were coding this at production level quality with key repeat enabled, I'd probably use a state machine to keep track of things and put a timer of maybe a fourth of a second on the AI's turn to ensure the player doesn't accidentally move too fast.




Unicorn

Was it done and submitted on time? Also, what platform is this for? nspire? PC?



??? ??? ??? ??? ???

Scipi

It's 99% done, I just need to finish up a few things with the map generator and get a basic health system implemented. Nothing too difficult, maybe an hour or two worth of coding. It'll definitely be submitted sometime today.

The platform is PC. I don't have any of the tools needed to target the Nspire installed.




Unicorn

Oh, cool! PC is worldwide. :)



??? ??? ??? ??? ???

Snektron

yay PC, now i can play it without emulators :P
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Scipi

Finished and submitted. Huzzah for waiting to the last minute to code everything! :3

Oh, also, I didn't actually use Love2D like I said I was in the OP. I used C++ instead, since I know it better.




DJ Omnimaga

Glad to see you managed to submit this in time. I tried it and liked what I saw so far. :)

Powered by EzPortal