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

0 Members and 1 Guest are viewing this topic.

Online mr_lou

  • 6128 Plus
  • ******
  • Posts: 2.610
  • Country: dk
    • index.php?action=treasury
    • The Music Resource for the Indie Game Developer
  • Liked: 823
Re: The Dawn of Kernel (Development)
« Reply #25 on: 21:08, 13 January 18 »
Twitter videos work fine for me every time...

First time I tried clicking a Twitter video I think, and it didn't work.
Seems to work now though. So dunno.

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.361
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2580
Re: The Dawn of Kernel (Development)
« Reply #26 on: 21:12, 13 January 18 »
May random snafu, ok :)

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
Re: The Dawn of Kernel (Development)
« Reply #27 on: 11:10, 15 January 18 »
Update time!

Disclaimer: the video doesn't capture 50Hz properly, also lots of debug are enabled and it looks "weird"; but the game is updating at 25 FPS.

What does the debug mean:

  • Red boxes show mini-buffers in use, which is tiles affected by sprites being drawn. Take into account the red boxes are erased in moving sprites (remove the sprite and leave the background), so there are few things going on.
  • The thin border lines (not very visible on the video) signal when an update happens on time (25 FPS!), thick lines or a complete red frame means the update was late (slow-down!). There are no thick lines on the video, meaning: yay!


https://twitter.com/reidrac/status/952689606255939584

I've been optimising few bits that were OK for my previous games but a waste of time in this one; that includes better batched draw (e.g. the engine fire on the player's ship, now is not a composition of player + fire) and few places where I was was being silly using CPU (e.g. even for fixed path enemies, I tend to be lazy and make them "smart", looking for obstacles, although I know the complete path when the map is loaded).

I'm also updating the HUD when the game isn't busy, so it may delay updating the score a frame or two, but it will never slow down the action.

Next thing is improving how bullets are drawn. For performance I don't support blitting arbitrary sprite sizes but a limited fixed set (8x8, 8x16 and 8x24). Bullets can be consolidated into 4x4, and I may even not use a mask because the shape is square-ish.

With that change I think I'll be really close to the performance that is required for the game, and 25 FPS.

(to be honest, this game would play just fine at 16 FPS; but now that I'm used to play it at 25 FPS, it would be hard to play it at a lower frame rate)
« Last Edit: 11:19, 15 January 18 by reidrac »
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
Re: The Dawn of Kernel (Development)
« Reply #28 on: 10:56, 17 January 18 »
Faster, faster!

I made an optimisation for "small sprites" (still masked), and it improved a lot.

The following video isn't amazing, but it shows a bit what I'm talking about (if you look closely). See previous post for information about the debug bits on the video.


https://twitter.com/reidrac/status/953411077278195712

If the sprite is between tile boundaries, that means more pixels to push and it'll be slower, but it reduces "worst cases" reasonably.

This engine isn't ideal for a shooter anyway, but as I said in my first post, I plan it to be more tactical than just pew-pew.

I'm going to leave the engine alone for now and start making new enemies and probably prototype the terminals; although that part is still one of the "unplanned" bits of this game.

Anyway, progress!
« Last Edit: 10:58, 17 January 18 by reidrac »
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline GUNHED

  • 464 Plus
  • *****
  • Posts: 367
  • Country: de
  • Reincarnation of TFM
  • Liked: 167
Re: The Dawn of Kernel (Development)
« Reply #29 on: 14:42, 17 January 18 »
Any link to a video? Chrome doesn't pick up that tweet.  :)

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
Re: The Dawn of Kernel (Development)
« Reply #30 on: 14:46, 17 January 18 »
Any link to a video? Chrome doesn't pick up that tweet.  :)

You can watch it on Twitter, if you're interested. If you see the preview, click on the date and that opens the content on Twitter domain. If you don't see the preview, just open the link.

I guess is something related to cookies or anything like that.
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline GUNHED

  • 464 Plus
  • *****
  • Posts: 367
  • Country: de
  • Reincarnation of TFM
  • Liked: 167
Re: The Dawn of Kernel (Development)
« Reply #31 on: 14:48, 17 January 18 »
Well, I don't use Twitter, Facebook and all that stuff... Would be nice it you post us a message as soon as you got a video up somewhere.  :)

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
Re: The Dawn of Kernel (Development)
« Reply #32 on: 14:55, 17 January 18 »
Well, I don't use Twitter, Facebook and all that stuff... Would be nice it you post us a message as soon as you got a video up somewhere.  :)

You don't need Twitter account to watch the video, as far as I know.

I won't upload the videos to anywhere else, for now. I'm sorry you can't be bothered to watch it on Twitter, is your call.
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.931
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 775
Re: The Dawn of Kernel (Development)
« Reply #33 on: 15:39, 17 January 18 »
Works for me on Chrome, maybe you adblocker is causing you trouble?

Offline Skunkfish

  • Supporter
  • 464 Plus
  • *
  • Posts: 377
  • Country: gb
    • Colour Personal Computing - The CPC Fanzine
  • Liked: 268
Re: The Dawn of Kernel (Development)
« Reply #34 on: 12:45, 18 January 18 »
The videos are working for me now embedded on the forum which is nice, not sure what changed as they weren't before!

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.361
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2580
Re: The Dawn of Kernel (Development)
« Reply #35 on: 14:11, 18 January 18 »
They were always here :D Perhaps connection to Twitter was slow and so the page rendered without them or something, but it's been a while since they're available fully embedded ;)

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
Re: The Dawn of Kernel (Development)
« Reply #36 on: 00:32, 24 January 18 »
Update Time!

Fixed a bug that I believe it's been there since my first game; I probably imported it from a speccy game when I started working on the CPC, BUT it only shows at 25 FPS (well, probably shows at 50 FPS too). So I guess is not a bug in my previous games because all of them run at ~16.6 FPS.

I made few changes in the map renderer, simplifying the shadows. I really like the shadows I made in Golden Tail, but it requires too many tiles, so in this one I'm using a different approach that, as a side effect, improves compression of the maps (so WIN).

I'm working on the first tileset, and planing some map design and thinking on some ideas for the core gameplay.


* kernel-tileset.png
(552.19 kB, 1173x880 - viewed 112 times)

Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.136
  • Country: au
    • index.php?action=treasury
  • Liked: 765
Re: The Dawn of Kernel (Development)
« Reply #37 on: 05:13, 24 January 18 »
That  is looking fantastic.
I love those glowy red-bullet-things in the top right corner. Very very nice pixel work.

Just wondering - what was the bug that is only visible at 25+ fps?
« Last Edit: 05:27, 24 January 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: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
Re: The Dawn of Kernel (Development)
« Reply #38 on: 09:33, 24 January 18 »
That  is looking fantastic.
I love those glowy red-bullet-things in the top right corner. Very very nice pixel work.

Just wondering - what was the bug that is only visible at 25+ fps?

It is related to the code that tracks time to enforce the specific number of FPS. There's a divider ; with 16 FPS that divider is 3, and it was working fine, but it didn't work with 2 (50 / 2 = 25 FPS), making some updates longer and making the animations quite choppy.
Released The Return of Traxtor, Golden Tail and Magica for the CPC.

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.136
  • Country: au
    • index.php?action=treasury
  • Liked: 765
Re: The Dawn of Kernel (Development)
« Reply #39 on: 12:56, 24 January 18 »
It is related to the code that tracks time to enforce the specific number of FPS. There's a divider ; with 16 FPS that divider is 3, and it was working fine, but it didn't work with 2 (50 / 2 = 25 FPS), making some updates longer and making the animations quite choppy.


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

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: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
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.361
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2580
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: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
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.136
  • Country: au
    • index.php?action=treasury
  • Liked: 765
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: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
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: 661
  • Country: fr
  • Liked: 599
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: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
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: 565
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 925
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.361
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2580
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: 661
  • Country: fr
  • Liked: 599
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 »