Author Topic: The Dawn of Kernel (Development)  (Read 4266 times)

0 Members and 1 Guest are viewing this topic.

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 554
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 915
Re: The Dawn of Kernel (Development)
« Reply #40 on: 13:23, 24 January 18 »

Ah, ok... very interesting.
Do you do that to stop the game going too fast when there is less stuff moving on-screen?

Yes, something like that. The game updates state and redraws every other vsync, instead of 50Hz.

Without tracking time I wouldn't know how to make it constantly smooth. No all the updates require the same CPU time.
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.327
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2567
Re: The Dawn of Kernel (Development)
« Reply #41 on: 18:37, 27 January 18 »
How I love your pixel style... :)

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 554
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 915
Re: The Dawn of Kernel (Development)
« Reply #42 on: 00:24, 09 February 18 »
Quick update

I finished integrating Arkos 2 in my code and... well, I'm stupid. All my efforts to get things playing smoothly at 25Hz are just not enough, because I didn't take into account the CPU cycles required by the music and effects.

This is not all bad news, Arkos 2 is amazing, and I hope I'll show in the game with better music than usual; but I need to think how I can make it play smooth now.

I'm using the lightweight player and I still need to spend more time reading the code. I did the conversion to SDCC assembler (that is a bit "special"), but perhaps I can find ways of reducing the CPU use.

Anyway, this means that the game will have sound soon. Not sure if I'll be able to keep it running at 25Hz, though.
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.130
  • Country: au
    • index.php?action=treasury
  • Liked: 763
Re: The Dawn of Kernel (Development)
« Reply #43 on: 01:18, 09 February 18 »
Quick update

I finished integrating Arkos 2 in my code and... well, I'm stupid. All my efforts to get things playing smoothly at 25Hz are just not enough, because I didn't take into account the CPU cycles required by the music and effects.

This is not all bad news, Arkos 2 is amazing, and I hope I'll show in the game with better music than usual; but I need to think how I can make it play smooth now.

I'm using the lightweight player and I still need to spend more time reading the code. I did the conversion to SDCC assembler (that is a bit "special"), but perhaps I can find ways of reducing the CPU use.

Anyway, this means that the game will have sound soon. Not sure if I'll be able to keep it running at 25Hz, though.

How are the sprites being drawn?
Are you using an optimised asm routine, or a function provided by a framework you're using?

Also, the code that you've written that determines which parts of the screen need to be redrawn - is that code in C or asm?
I've been working on a little prototype of large sprites, and the code that determines how much to redraw makes a noticeable difference to performance, once optimised.
« Last Edit: 02:29, 09 February 18 by ervin »
My entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.pouet.net/prod.php?which=66566

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 554
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 915
Re: The Dawn of Kernel (Development)
« Reply #44 on: 22:59, 12 February 18 »
How are the sprites being drawn?
Are you using an optimised asm routine, or a function provided by a framework you're using?

Also, the code that you've written that determines which parts of the screen need to be redrawn - is that code in C or asm?
I've been working on a little prototype of large sprites, and the code that determines how much to redraw makes a noticeable difference to performance, once optimised.

It's all ASM; all my game engines are like that, I only write high level logic in C (and very often I end converting that to ASM too, once I proved the idea works).

I'm working on small optimisations and I'm getting some cycles back, so I may get there. I still have few options left (like make the bullets more "blocky" and don't use masked sprites for them).

Is not as bad as I though, but the audio player is definitely using a good chunk of CPU. At the moment I'm using 25Hz for the audio, meaning that I can update the sound every other int (and not the same one I use for drawing). That definitely helps!
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 619
  • Country: fr
  • Liked: 543
Re: The Dawn of Kernel (Development)
« Reply #45 on: 00:50, 13 February 18 »

Quote
Is not as bad as I though, but the audio player is definitely using a good chunk of CPU. At the moment I'm using 25Hz for the audio, meaning that I can update the sound every other int (and not the same one I use for drawing). That definitely helps!

You can also cut the player in two: the code that sends the data to the PSGs can be called one frame out of two. This will "smooth" the consumed CPU.

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 554
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 915
Re: The Dawn of Kernel (Development)
« Reply #46 on: 09:19, 13 February 18 »
You can also cut the player in two: the code that sends the data to the PSGs can be called one frame out of two. This will "smooth" the consumed CPU.

I think I know how to do that, it is a brilliant idea. Playing at 25Hz is perfect. Thanks!
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 554
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 915
Re: The Dawn of Kernel (Development)
« Reply #47 on: 01:28, 19 February 18 »
Update time!

I've implemented few improvements on the engine itself:

  • Small optimization by adding support to erase "small" (4x5) sprites; this is for the bullets.
  • Split the Arkos player "play" in two: prepare frame and write to the PSG; so I can run them in different interrupts (I play the music at 25Hz).

Both seem to help, but is still not good enough. It all depends; with Arkos player on, trigger happy and few enemies; there will be some slow down when the bullets aren't tile aligned and there are explosions, etc.

I'll think about this further on; perhaps I may go back to the big-buffer memory-hungry engine. I still have one last idea to try that is basically stop using masked sprites for the bullets, and I'd like to experiment with some ideas to allow the engine to catch up minimizing the slowdown.

For now, I'm continuing with the game. I'm implementing the secondary weapons now. You can see the missile in the following video.

Usual disclaimer: the video was captured from an emulator and encoded to be shown on Twitter, it is not an accurate representation of the game updating at 25Hz on the real hardware.


https://twitter.com/reidrac/status/965245408829063168
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.327
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2567
Re: The Dawn of Kernel (Development)
« Reply #48 on: 10:21, 19 February 18 »
Still looking great... can't wait to play it - thanks for the updates!

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 619
  • Country: fr
  • Liked: 543
Re: The Dawn of Kernel (Development)
« Reply #49 on: 10:44, 19 February 18 »
Did you try using the AKY player? It is waaayy faster, but the music will take more memory, but maybe this will suit your needs. There is no sound effect for this player, but the next version will provide a stand-alone sound effect player, so mixing both shouldn't be too hard.
« Last Edit: 13:22, 19 February 18 by Targhan »