Join us on Discord!
You can help CodeWalrus stay online by donating here.

[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.
  • Calculators owned: TI-84+
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.
  • Calculators owned: TI-83+, Nspire, Nspire CX, Casio Prizm




Dream of 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?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

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.
  • Calculators owned: TI-84+
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.
  • Calculators owned: A lot.

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.
  • Calculators owned: TI-83+, Nspire, Nspire CX, Casio Prizm




Unicorn

Was it done and submitted on time? Also, what platform is this for? nspire? PC?
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



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

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.
  • Calculators owned: TI-83+, Nspire, Nspire CX, Casio Prizm




Unicorn

Oh, cool! PC is worldwide. :)
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



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

Snektron

yay PC, now i can play it without emulators :P
  • Calculators owned: TI-84+
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.
  • Calculators owned: TI-83+, Nspire, Nspire CX, Casio Prizm




Dream of Omnimaga

Glad to see you managed to submit this in time. I tried it and liked what I saw so far. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal