You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

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

b/Contests Started by Scipi, May 09, 2015, 05:00:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

u/Snektron May 27, 2015, 09:31:43 PM
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.
u/Scipi May 27, 2015, 11:18:32 PM
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.
u/Dream of Omnimaga May 28, 2015, 05:49:45 AM
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?
u/Snektron May 28, 2015, 07:20:06 AM
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.
u/Duke "Tape" Eiyeron May 28, 2015, 04:20:03 PM
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.
u/Scipi May 29, 2015, 08:25:19 AM
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.
u/Unicorn May 31, 2015, 07:23:41 AM
Was it done and submitted on time? Also, what platform is this for? nspire? PC?
u/Scipi May 31, 2015, 07:59:24 AM
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.
u/Unicorn May 31, 2015, 08:03:52 AM
Oh, cool! PC is worldwide. :)
u/Snektron May 31, 2015, 09:26:38 AM
yay PC, now i can play it without emulators :P
u/Scipi May 31, 2015, 09:45:58 AM
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.
u/Dream of Omnimaga June 02, 2015, 05:41:12 PM
Glad to see you managed to submit this in time. I tried it and liked what I saw so far. :)
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal