CPCWiki forum

General Category => Programming => Topic started by: reidrac on 07:12, 06 October 15

Title: Space Pest Control (Development)
Post by: reidrac on 07:12, 06 October 15
I got a little bit too late to the party, but this is my attempt to submit a game to CPC retro Dev 2015 (running out of time!!!!11one).

It is also my first Amstrad CPC game, so it is the perfect excuse to put together something and learn about the platform (meaning that if I can't make it to the compo, I'll still have a game!).

[attach=2]

[attach=3]

The game is still in development. I have a rough idea of where I'm going, but but there are still lots of unknowns. What I know so far is that it'll be a classic jump & shoot game, with an exploration component and priming strategy over the "shoot'em all" part.

I'm using mode 0, targeting the 464, with SDCC, some bits of cpcrslib and a custom tile/sprite engine. Still not sure how it will scale when I add the enemies, but I still have room to optimize so it may turn out just fine.

I have some videos of tests in Gamedev in progress - YouTube (https://www.youtube.com/playlist?list=PLvI1iQmfH6UN9ArY-XdkdiNuPK8FVu1Tr) and I tend to digress about the development in Juan (@reidrac) | Twitter (https://twitter.com/reidrac).

I'll keep you posted!
Title: Re: Space Pest Control (Development)
Post by: TotO on 08:17, 06 October 15
Watching the video, your game look promissing as the player moves are ok.
Now, take time to perfect the gameplay and the level desing as you no more have the contest dead line...  8)
Title: Re: Space Pest Control (Development)
Post by: ||C|-|E|| on 11:15, 06 October 15
It is actually looking very nice :). I think that if you polish it will be great, the foundation is already there :). I my humble opinion, it is much better if you take your time to finish it. There are so many productions that could have been potentially great but were rushed at the end just to be presented at this or that compo...


Title: Re: Space Pest Control (Development)
Post by: reidrac on 11:40, 06 October 15
Quote from: ||C|-|E|| on 11:15, 06 October 15
It is actually looking very nice :). I think that if you polish it will be great, the foundation is already there :). I my humble opinion, it is much better if you take your time to finish it. There are so many productions that could have been potentially great but were rushed at the end just to be presented at this or that compo...

We'll see! I tend to lose focus and interest (unfortunate, but true), so having a deadline is helpful.

If for some reason I don't get to the compo with a "good enough" game, I'll keep working on it. There are too many things I don't know how to do or if it's even possible (I'm new to the CPC, remember?), so there's always a chance I get to a dead end or the game is not as good as it could be. No problem, it is likely next one will be better!

Thanks for the support!
Title: Re: Space Pest Control (Development)
Post by: Optimus on 11:44, 06 October 15
Wow, the character reminds me of an old PC game called Electrobody.
I'd really like to play this when it's out.
Title: Re: Space Pest Control (Development)
Post by: TotO on 11:53, 06 October 15
Quote from: reidrac on 11:40, 06 October 15We'll see! I tend to lose focus and interest (unfortunate, but true), so having a deadline is helpful.
Nice Chrismas game that should be the game of the year on the PushNPop chart so!  8)
Title: Re: Space Pest Control (Development)
Post by: TFM on 15:51, 06 October 15
Very nice. Keep the good work up!  :)
Title: Re: Space Pest Control (Development)
Post by: McKlain on 16:18, 06 October 15
Looks promising  ;D
Title: Re: Space Pest Control (Development)
Post by: VincentGR on 17:03, 06 October 15
Oh, very nice!
Title: Re: Space Pest Control (Development)
Post by: reidrac on 20:08, 08 October 15
Testing some sound effects!



I'm using WYZ Player for now. The tracker kind of works in Linux (using Mono, somewhat unstable crashes frequently; I don't know why!). The tracker doesn't have support to edit effects, so I'm using Shiru's  AYFX Editor for that and is quite nice (available here: Shiru's Stuff (https://shiru.untergrund.net/software.shtml)). The preview is good enough, although it sounds different (perhaps because it emulates the AY in the spectrum); and the version of WYZ I'm using doesn't seem to support noise for the effects (don't quote me on that, still trying to grok the code).

WYZ is great: the code is very clean and easy to read. I've made some modifications already to use my own interrupt handler and so far I'm very pleased.

I've been told Arkos is better, but the tracker doesn't work in Linux. Vortex tracker works fine with WINE, but the only player I've found is a little bit rough and I don't think I can use it in the game "as-is".

So I've spent a couple of days with this and looks like WYZ just works. The video was recorded with JavaCPC, that runs so-so in my system, but in WinAPE looks like the player doesn't add overhead and I think I'll be able to increase the FPS a little bit.

I'm not sure if I'll keep working on the game engine or tackle the music for the menu and (perhaps) in game (and adjust the volume, still not sure if I got the right levels). We'll see!
Title: Re: Space Pest Control (Development)
Post by: invent on 00:29, 09 October 15
Nice work Reidrac, enjoyed watching the video progress :)
The character looks great too.
Title: Re: Space Pest Control (Development)
Post by: ervin on 01:29, 09 October 15
This is looking really great.

It's wonderful to see so much activity in the cpc community right now!
Title: Re: Space Pest Control (Development)
Post by: TotO on 08:15, 09 October 15
Quote from: reidrac on 20:08, 08 October 15I've been told Arkos is better, but the tracker doesn't work in Linux. Vortex tracker works fine with WINE, but the only player I've found is a little bit rough and I don't think I can use it in the game "as-is".
For the best, you can use Starkos on CPC too...  ;)
R-Type's sound and sfx was done with it.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 08:22, 09 October 15
Quote from: TotO on 08:15, 09 October 15
For the best, you can use Starkos on CPC too...  ;)
R-Type's sound and sfx was done with it.

Oh, I forgot to mention that: I also tried Starkos!

My main problem with that one is that emulators in Linux aren't great at the moment and both JavaCPC and WinAPE (this one used with WINE) have their issues specially with sound.

Starkos looks really nice and I think it could work just fine, but I'm going to stick to cross-development for now :)
Title: Re: Space Pest Control (Development)
Post by: mahlemiut on 22:15, 09 October 15
There's about a bajillion arcade games in MAME that use an AY, so that should have reasonably accurate sound... ;D
Title: Re: Space Pest Control (Development)
Post by: Gryzor on 15:17, 10 October 15
I really like how it looks and am looking forward to see your further progress! What I love most is that it really looks like an old classic from the golden days :)
Title: Re: Space Pest Control (Development)
Post by: reidrac on 22:05, 10 October 15
Got the music working!



It wasn't that difficult, but I got stuck with an issue with one of the instruments (the tracker played it just fine but the player on the CPC was crashing because I was going one octave too high!).

Finally I found that the tracker improves its stability when used with Mono 4.0 (I was using 3.2 that comes packaged by Debian). There are still some issues, but after some time I'm used to them so is not too bad.

EDIT: oh, I forgot! The tune in the video is my last attempt to understand the tracker, but I'm starting to like how it sounds (and it is really small), so I may keep it.
Title: Re: Space Pest Control (Development)
Post by: ||C|-|E|| on 23:04, 10 October 15
It sounds really cool!
Title: Re: Space Pest Control (Development)
Post by: AMSDOS on 04:06, 11 October 15
Quote from: reidrac on 08:22, 09 October 15
My main problem with that one is that emulators in Linux aren't great at the moment and both JavaCPC and WinAPE (this one used with WINE) have their issues specially with sound.


That's odd, I thought the Sound Technicians swear by JavaCPC. The other emulator mentioned isn't highly regarded for the sound it produces (even in Windows), even though I haven't had any trouble with it, but I'm not known for my great hearing.
Title: Re: Space Pest Control (Development)
Post by: mr_lou on 05:02, 11 October 15
People are so active on the CPC these days! It's gonna be a great Christmas this year! I can tell!  :)

I'm always using Starkos on my real CPC when doing music. I don't trust emulators.
I would trust Arkos Tracker too because I know how much of a perfectionist Targhan is, but since it doesn't run on Linux I'm sticking with Starkos. That way I'm 110% sure I'm getting the sound I want.

Everything else in my game development is done with Linux - except the graphics because my artist (i.e. my girlfriend) insists on using Windows for some silly reason.  :)

I'm also struggling with emulators.
I remember getting decent results regarding sound with CPCE once, and Caprice was also ok as far as I remember.
I'm hoping things will be perfect in Arnold Emulator soon though. I know @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) is working on it.
I'd have loved to use JavaCPC, because I like Java. Well, I'm into anything multiplatform'ish, and anything Java ought to run anywhere with a JVM. But I've always had problems with JavaCPC running too slow on my machines, and since it also seems to depend on a lot of Windows specific tools to run, I sometimes think it should be renamed to WindowsCPC-coded-with-java. (Sorry Markus).

Look out for Arnold Emulator.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 10:30, 11 October 15
Quote from: mr_lou on 05:02, 11 October 15
I'm also struggling with emulators.

At the moment I'm using WinAPE with WINE for testing, and seems to be OK. Is just that in the previous video the screen capturer didn't record WinAPE audio (but I fixed that fiddling with WinAPE settings).

JavaCPC is very nice, I really like it just to play games; but for development it uses too much CPU just being idle and I can't find an easy way to load the disk and boot the game quickly (this may happen a lot during development).

I would prefer a native emulator, but what I tried so far doesn't provide good enough emulation. After developing some games for the Speccy in Linux, I appreciate FUSE more than ever! :)
Title: Re: Space Pest Control (Development)
Post by: arnoldemu on 11:34, 11 October 15
I will share the link to the source code with you.

But the emulation needs much improvement still but I am actively developing it.

The GUI is much improved over the previous one so in terms of launching and debugging you should find it much nicer.


EDIT: The past couple of weeks I have been busy at work and at the weekend's I've spent a lot of time finishing off a wall I've been building in the garden before the weather gets too wet or too cold.
Title: Re: Space Pest Control (Development)
Post by: Devilmarkus on 13:18, 11 October 15
Quote from: reidrac on 10:30, 11 October 15
JavaCPC is very nice, I really like it just to play games; but for development it uses too much CPU just being idle and I can't find an easy way to load the disk and boot the game quickly (this may happen a lot during development).

Just drag'n`drop the DSK into CPC screen ;) Left side goes to DF0, right side of screen to DF1...

To boot: Try ALT + END, when is in DF0
Title: Re: Space Pest Control (Development)
Post by: Gryzor on 14:24, 11 October 15
Love the tune... The whole thing has a really old-school to it!
Title: Re: Space Pest Control (Development)
Post by: reidrac on 07:59, 13 October 15
Getting there with the entity system



It works fine with 8 enemies, but it slows down a bit when the player is firing full throttle (up to ~16 entities, being an entity anything moving on screen or drawing non tile-aligned).

I did my first round of optimizations writing some assembler and there's still room for more, so I don't think I'll have problems to keep it smooth (still not playing bg music though, that may change everything).

Anyway, progress!
Title: Re: Space Pest Control (Development)
Post by: McKlain on 08:04, 13 October 15
Are you going to have ingame music+sfx?
Title: Re: Space Pest Control (Development)
Post by: reidrac on 08:06, 13 October 15
Quote from: McKlain on 08:04, 13 October 15
Are you going to have ingame music+sfx?

That's the plan at least. I should run some tests to be completely sure that's possible; at the moment I'm doing SFX only.
Title: Re: Space Pest Control (Development)
Post by: TFM on 15:56, 13 October 15
Good work! Already looks better than a lot of commercial stuff from back the day.  :)
Title: Re: Space Pest Control (Development)
Post by: VincentGR on 16:27, 13 October 15
looks awesome
Title: Re: Space Pest Control (Development)
Post by: Ast on 22:08, 13 October 15
It seems really great, but why don't you use fullscreen size ?
Title: Re: Space Pest Control (Development)
Post by: reidrac on 23:51, 13 October 15
Quote from: Ast on 22:08, 13 October 15
It seems really great, but why don't you use fullscreen size ?

I guess I could use more screen as long as I don't have to redraw a larger area too often, but that would use more RAM and this game is targetting the 464; meaning that memory is scarce!

Actually, running out of memory is going to be my main issue pretty soon I'm afraid.
Title: Re: Space Pest Control (Development)
Post by: TFM on 19:43, 14 October 15
The curse of the 64 KB  :o
Title: Re: Space Pest Control (Development)
Post by: reidrac on 21:29, 14 October 15
Player hit box is working: you can be killed!



Also a rough "game over" screen that needs to be improved (to start with the text should be red, that's a bug right there!).

If you are hit, one life bar is removed and you're invulnerable for short amount of time. I may change things, but the basic mechanics are already there.

Today I spent some time refactoring and I got some bytes back (already used, obviously!). Also all the collision detection code is slowing things a bit, but still "good enough". The good news are that I tried some bg music and it doesn't affect the action, so WIN!
Title: Re: Space Pest Control (Development)
Post by: Bryce on 21:44, 14 October 15
How about showing him dead (ie: lying) and blend the "Game Over" over that frozen gameplay frame?

Bryce.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 22:00, 14 October 15
Quote from: Bryce on 21:44, 14 October 15
How about showing him dead (ie: lying) and blend the "Game Over" over that frozen gameplay frame?

Bryce.

That's not a bad idea!

Currently there are a lot of things to do and the memory is shrinking by the day :D. I'm happy with this as "place holder" and I'll review it later when I know how much resources are left.

To be honest, I did the game over part because it was related to the player hit box, but that's something I tend to make way later in the development process.
Title: Re: Space Pest Control (Development)
Post by: Ast on 10:36, 15 October 15
Fine. Great work.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 22:49, 17 October 15
Fun with teleporters!



The game is progressing nicely, but I'm almost completely sure it won't be finished for the CPC Retro Dev deadline. Basically my time is limited and the game is too big :(

I'll keep working on it just in case... but it is likely I'll finish the game in the following weeks.

Also I tried the game today in my CPC and it plays smoother than in the emulator :)
Title: Re: Space Pest Control (Development)
Post by: ervin on 00:15, 18 October 15
This is looking BRILLIANT.
Really looking forward to playing this one.

I hope you can submit something to the comp - you'd probably do quite well.
(Even a smaller version, that you can expand and fully complete after the comp).
:)

My game RUNCPC also appears to be a bit smoother and more responsive on my real CPC.
Probably due to the fact that emulating 50Hz on a 60Hz PC monitor will never be as smooth as running it on the CPC's 50Hz display.
Title: Re: Space Pest Control (Development)
Post by: Devilmarkus on 00:23, 18 October 15
Your game looks really cool...
But if I would be you, I wouldn't spoiler it too much with too many preview videos ;)
Some things should be a surprise for the players.....
Title: Re: Space Pest Control (Development)
Post by: reidrac on 06:55, 18 October 15
Quote from: Devilmarkus on 00:23, 18 October 15
Your game looks really cool...
But if I would be you, I wouldn't spoiler it too much with too many preview videos ;)
Some things should be a surprise for the players.....

I agree. These videos are showing basic functionality, but not the actual game.
Title: Re: Space Pest Control (Development)
Post by: TotO on 08:45, 18 October 15
Quote from: reidrac on 22:49, 17 October 15The game is progressing nicely, but I'm almost completely sure it won't be finished for the CPC Retro Dev deadline. Basically my time is limited and the game is too big :(
Just release a demo. It is already over the games released last year...  :-\
Title: Re: Space Pest Control (Development)
Post by: TFM on 23:39, 18 October 15
Right, gave em what you have for the compo and then you can overwork it. Or take another year!  :) :) :)
Title: Re: Space Pest Control (Development)
Post by: AMSDOS on 07:35, 19 October 15
Quote from: reidrac on 22:49, 17 October 15
Also I tried the game today in my CPC and it plays smoother than in the emulator :)


Yeah my computer seems to go ape when it's running Winape!  :o 
Title: Re: Space Pest Control (Development)
Post by: reidrac on 08:20, 19 October 15
Quote from: AMSDOS on 07:35, 19 October 15

Yeah my computer seems to go ape when it's running Winape!  :o

Also there was some flickering in the last row of sprites. uh?

I'm coming from the ZX Spectrum and for some reason I was expecting the Z80 IM 1 interrupt to happen at 50Hz (that's vsync in the speccy); but in the Amstrad it happens at 300Hz, and I was using that with a counter to get a fixed rate of 15 FPS.

My code was quite naive because I was assuming that after the 15 FPS was reached, last interrupt was the vsync (imagine! updating the monitor at 300Hz!). You need to wait for the CRTC to start with the vsync. Now it makes sense, but that's an example that I don't know what I'm doing (most of the time at least).

Programming for the CPC is a lot of fun :)
Title: Re: Space Pest Control (Development)
Post by: Fessor on 08:47, 19 October 15
If you only need the 50hz-Interrupt then you should take look at
KL NEW FRAME FLY &bcd7
KL ADD FRAME FLY &bcda
KL DEL FRAME FLY &bcdd

Title: Re: Space Pest Control (Development)
Post by: reidrac on 08:54, 19 October 15
Quote from: Fessor on 08:47, 19 October 15
If you only need the 50hz-Interrupt then you should take look at
KL NEW FRAME FLY &bcd7
KL ADD FRAME FLY &bcda
KL DEL FRAME FLY &bcdd

If the interrupt MUST be every 300Hz because of the way the CRTC works, not sure there's anything to do. My current code works and I keep the ISR short and simple, but I guess there's always some overhead.

I'll take a look anyway, although I disable the firmware and setup my own interrupt handler (measure time & audio basically).
Title: Re: Space Pest Control (Development)
Post by: arnoldemu on 09:02, 19 October 15
Quote from: reidrac on 08:54, 19 October 15
If the interrupt MUST be every 300Hz because of the way the CRTC works, not sure there's anything to do. My current code works and I keep the ISR short and simple, but I guess there's always some overhead.

I'll take a look anyway, although I disable the firmware and setup my own interrupt handler (measure time & audio basically).

For your own:


int_handler:
push bc
push af
ld b,&f5
in a,(c)
rra
jr nc,int_handler2
;; do once per frame interrupt handling here

int_handler2:
pop af
pop bc
ei
ret

Title: Re: Space Pest Control (Development)
Post by: arnoldemu on 09:03, 19 October 15
Quote from: reidrac on 08:20, 19 October 15
...imagine! updating the monitor at 300Hz!...
It allows us to do tricks with the crtc more easily :)


Quote from: reidrac on 08:20, 19 October 15
Programming for the CPC is a lot of fun :)
:)
Title: Re: Space Pest Control (Development)
Post by: reidrac on 09:06, 19 October 15
Quote from: arnoldemu on 09:02, 19 October 15
For your own:


int_handler:
push bc
push af
ld b,&f5
in a,(c)
rra
jr nc,int_handler2
;; do once per frame interrupt handling here

pop af
pop bc
ei
ret


Thanks! That's a good idea, I'll count t-states in my ISR to see which one is faster.
Title: Re: Space Pest Control (Development)
Post by: Ast on 11:16, 19 October 15
Don't be shy, it's faster than yours. :-D

Good job for your game. I put some words in Amstrad Plus Forum.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 11:22, 19 October 15
Quote from: Ast on 11:16, 19 October 15
Don't be shy, it's faster than yours. :-D

Good job for your game. I put some words in Amstrad Plus Forum.

How do you know how my ISR looks like?  :P Yes, it is a waste of time to increase my counter every 300Hz when 50Hz is enough resolution to calculate the FPS.

So at 300Hz, do you get only one interrupt per vsync?
Title: Re: Space Pest Control (Development)
Post by: reidrac on 11:30, 19 October 15
Quote from: Ast on 11:16, 19 October 15
Don't be shy, it's faster than yours. :-D

Good job for your game. I put some words in Amstrad Plus Forum.

Actually, I think is about 3 t-states faster than mine. oooh!
Title: Re: Space Pest Control (Development)
Post by: Ast on 11:34, 19 October 15
Now i know ;-)
Title: Re: Space Pest Control (Development)
Post by: ronaldo on 12:33, 19 October 15
Quote from: reidrac on 11:30, 19 October 15
Actually, I think is about 3 t-states faster than mine. oooh!
Beware! Amstrad CPC timing is not general Z80 timing (like in the ZX, for instance). All instructions execute in multiples of 1 microsecond (4 t-states) because the way Z80 CPU is controlled by the CRTC. This model was done to prevent concurrent access to memory between CRTC and Z80.

You have the "CPC Timings" here: Timings (http://cpctech.cpc-live.com/docs/instrtim.html)

And a nice table made with them here: http://wiki.octoate.de/lib/exe/fetch.php/amstradcpc:z80_cpc_timings_cheat_sheet.20131019.pdf (http://wiki.octoate.de/lib/exe/fetch.php/amstradcpc:z80_cpc_timings_cheat_sheet.20131019.pdf)

PS: I was making the same mistake time ago until @Prodatron (http://www.cpcwiki.eu/forum/index.php?action=profile;u=13) told me :) .
Title: Re: Space Pest Control (Development)
Post by: arnoldemu on 13:10, 19 October 15
Quote from: reidrac on 11:22, 19 October 15
So at 300Hz, do you get only one interrupt per vsync?
yes.

If your interrupt service routine takes too long (more than 32 scanlines or 64*32 cycles) that can cause the position of the next interrupt following it to move.

If it happens at the interrupt before the one where vsync is active, then the one that occurs at vsync will move and you will not see the vsync happen.

Generally though, not that much is done in the interrupts so this will not be a problem for you.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 13:39, 19 October 15
Quote from: ronaldo on 12:33, 19 October 15
Beware! Amstrad CPC timing is not general Z80 timing (like in the ZX, for instance). All instructions execute in multiples of 1 microsecond (4 t-states) because the way Z80 CPU is controlled by the CRTC. This model was done to prevent concurrent access to memory between CRTC and Z80.

You have the "CPC Timings" here: Timings (http://cpctech.cpc-live.com/docs/instrtim.html)

And a nice table made with them here: http://wiki.octoate.de/lib/exe/fetch.php/amstradcpc:z80_cpc_timings_cheat_sheet.20131019.pdf (http://wiki.octoate.de/lib/exe/fetch.php/amstradcpc:z80_cpc_timings_cheat_sheet.20131019.pdf)

PS: I was making the same mistake time ago until @Prodatron (http://www.cpcwiki.eu/forum/index.php?action=profile;u=13) told me :) .

Very interesting!

I'll check it better this evening, but looks like my code could be faster after all. @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) code uses extra push/pop plus in (4 usecs!). Besides I may need to change WYZ code if I change how often its ISR is changed called.

Thanks!
Title: Re: Space Pest Control (Development)
Post by: Ast on 16:53, 19 October 15
Some words about Push'n Pop.
Noticed that  :

Pop af, de, bc and hl take only 3 us
Pop ix and iy take 4 us
---
Push af, de, bc and hl take 4 us
and last
Push ix and iy take 5 us.

It's more readable like that, don't you think ?
Title: Re: Space Pest Control (Development)
Post by: ronaldo on 20:03, 19 October 15
Yes, @Ast (http://www.cpcwiki.eu/forum/index.php?action=profile;u=573), you are right. POP IX/IY take only 4 us, but they appear as 5 us on both documents.

@Octoate (http://www.cpcwiki.eu/forum/index.php?action=profile;u=12), @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122), could you please update documentation with correct us value for POP IX/IY?

Thanks to all of you  :D
Title: Re: Space Pest Control (Development)
Post by: reidrac on 07:05, 21 October 15
Following general advice, I'm putting together a version of the game that I'll submit to the compo; and continue working on it after that to make a final release.

Interestingly enough looks like I may run out of memory before I run out of time... and that probably means I have to rethink some part of my rough plan because otherwise the final release would be a short game ;)

So I'm not sure I'll post more updates until I submit the game. Bear with me!
Title: Re: Space Pest Control (Development)
Post by: ervin on 10:31, 21 October 15
Quote from: reidrac on 07:05, 21 October 15
Following general advice, I'm putting together a version of the game that I'll submit to the compo; and continue working on it after that to make a final release.

Interestingly enough looks like I may run out of memory before I run out of time... and that probably means I have to rethink some part of my rough plan because otherwise the final release would be a short game ;)

So I'm not sure I'll post more updates until I submit the game. Bear with me!

Really glad to hear it!
I wish you all the best with your entry - I think you'll do well.
:)

Just wondering - what are you writing the game in?
Is it a cpctelera project?
Title: Re: Space Pest Control (Development)
Post by: reidrac on 10:46, 21 October 15
Quote from: ervin on 10:31, 21 October 15
Really glad to hear it!
I wish you all the best with your entry - I think you'll do well.
:)

Just wondering - what are you writing the game in?
Is it a cpctelera project?

The game is written in C and some assembler (when needed, for speed), and a good amount of Python for auxiliary tools (converting maps from tiled into C structures, generating the font, png to sprite, etc).

I'm using SDCC (C & ASM) and cpcrslib for music (includes WYZ support), text and some utilities; the tile/sprite engine is being developed for this game.

I may write the missing bits and use my tile/sprite engine + WYZ for future games; but for now cpcrslib is very useful and a real time-saver!
Title: Re: Space Pest Control (Development)
Post by: Xifos on 11:23, 21 October 15
Hello, your game looks good.
:)

What version of sdcc have you ?

Do you use double buffering for sprites ?
Title: Re: Space Pest Control (Development)
Post by: reidrac on 11:34, 21 October 15
Quote from: Xifos on 11:23, 21 October 15
Hello, your game looks good.
:)

What version of sdcc have you ?

Do you use double buffering for sprites ?

I use latest stable release (not using the new Z88DK fastcall thing).

I implemented a back buffer for the tile engine, and that's one of the reasons I'm getting out of memory at this point. I could try to reduce the amount of memory used for that and be a little bit slower, but the saving would be less than 1 KB so I think is not worth it.

I could also reduce the game area, from 160 x 160 to let's say 144 x 140 (that would give me 2720 juicy bytes back), or just convert some C to ASM.

Anyway, still have around 6 KB left to wrap up the submission. I think is possible!
Title: Re: Space Pest Control (Development)
Post by: Xifos on 12:28, 21 October 15
How does this back buffer work ?
Could you explain please ?
i am interested in the various ways to avoid flickering sprites, with a tile engine.

Thanks !
:)
Title: Re: Space Pest Control (Development)
Post by: reidrac on 12:43, 21 October 15
Quote from: Xifos on 12:28, 21 October 15
How does this back buffer work ?
Could you explain please ?
i am interested in the various ways to avoid flickering sprites, with a tile engine.

Thanks !
:)

You can find lots of information if you search for it, probably better explained than anything I can write here!

Basically I keep a buffer using a continuous memory layout (easier to deal with than the CPC video memory layout) that is used to compose the scene, and then copied to video memory as fast as possible following the vsync (to avoid tearing, flickering, etc).

Copying the whole buffer every time is too slow. How do you update video memory fast enough then? I don't do it! I just track which parts of the buffer are in sync with video memory and which ones are "dirty", so every frame I copy only differences.

The buffer is split in "cells" of the size of a tile, and that's the "background image" information. So for each frame I collect information (erase the player, draw next frame in a new position) that is translated to back buffer operations (restore the tile in each cell than needs erasing, copy any sprite, etc).

When the work is done, just wait for vsync and copy any dirty cell to video memory.

I could do it faster, but I'm happy keeping it simple (compared with other engines I know, for example SP1 for the speccy).

I hope this helps!
Title: Re: Space Pest Control (Development)
Post by: Xifos on 15:03, 21 October 15
Ok !
I understand.
But it takes 25600 bytes, 12800 for the linear back buffer, 12800 for the screen.
So 144*140 should save 2720*2 ?

(maybe i did not understand  ;) )
Title: Re: Space Pest Control (Development)
Post by: reidrac on 15:08, 21 October 15
Quote from: Xifos on 15:03, 21 October 15
Ok !
I understand.
But it takes 25600 bytes, 12800 for the linear back buffer, 12800 for the screen.
So 144*140 should save 2720*2 ?

(maybe i did not understand  ;) )

Video memory is video memory, I don't think you can change that. I can reduce the back buffer size, that's all.
Title: Re: Space Pest Control (Development)
Post by: ronaldo on 17:03, 21 October 15
Quote from: reidrac on 15:08, 21 October 15
Video memory is video memory, I don't think you can change that. I can reduce the back buffer size, that's all.
In the Amstrad CPC you can. Video memory is controlled by the Gate Array and the CRTC. You can change resolution, colours, location... Following some rules, you can create your own resolution, as many games do. I think that @Xifos (http://www.cpcwiki.eu/forum/index.php?action=profile;u=186) is referring to that.

In fact, I'd only use a software backbuffer if it was a small backbuffer. If my backbuffer was same size as video memory, I'd definitely use hardware double buffering (which is as easy as changing registers R12/R13 when you want to move your video memory to the backbuffer area and back again). Well, at least in the majority of the cases: there may exist some special cases for not doing that, but I can't think of one right now.
Title: Re: Space Pest Control (Development)
Post by: Xifos on 17:09, 21 October 15
It's true that the unused video ram is not linear.
Because of the screen memory layout.
But it can be useful for storing some variables...

EDIT : i forgot to count the score panel, so video ram is used in fact...
As ronaldo said, you could use another screen size, with 64 bytes lines, but you get a greater border...
Title: Re: Space Pest Control (Development)
Post by: reidrac on 19:52, 23 October 15
OK, just to let you know: I submitted Space Pest Control to CPC Retro Dev 2015.

That means you'll have a playable game after October 31st when the contest results are out.

I plan to have a break and continue working on the game, hopefully after getting some feedback after you guys play the compo version ;)
Title: Re: Space Pest Control (Development)
Post by: TFM on 19:53, 23 October 15
Glad you made it! Looking forward to play it!  :)
Title: Space Pest Control (CPC Retro Dev version release)
Post by: reidrac on 20:57, 31 October 15
Well, the compo is over and... Space Pest Control was nominated in the PRO category! That's pretty good for my first Amstrad CPC game, specially taking into account how I rushed to be able to submit something.

Obviously winning one of the prizes would have been even better ;); but after I saw some of the games during the streaming of the ceremony... oh, dear; I didn't have a chance! Amazing games that definitely have tons of hours of work put into them! Congrats to the winners!

Anyway, I'm releasing Space Pest Control "CPC Retro Dev" edition (plus some minor bug fixes, but the game is the same that was submitted to the compo; also you'll be able to download the game from the compo site and eventually buy the cassette with the game on it).

You can grab the game (both CDT and DSK) from here: Amstrad CPC: Space Pest Control - usebox.net (http://www.usebox.net/jjm/space-pest-control/)

Just one stage, with three different areas (one of them is "disconnected", if you go there too soon you may not be able to get the pest level to 0% and finish the game). Only three different types of enemy and 25 screens. There's still room left for more, but that's the best I could do before the deadline!

Feedback is welcome, but please take into account how this was put together (meaning: be gentle  :-*).
Title: Re: Space Pest Control (Development)
Post by: Fessor on 02:44, 01 November 15
Pffff... there is no reason being gentle because you have no reasond to hide. Yes, it may be a dev-version and it may be your first game. But even at this stage it is much better than most of the crap the companies have thrown on the market back in the past. No flickering Sprites, no noticable slowdowns, nice Effects. It was right that it was nominated at the pro category, and this for itself is a victory. Its a raw diamond and i hope you spend more dev time on it.
Title: Re: Space Pest Control (Development)
Post by: Singaja on 08:12, 01 November 15
Yay. This is super smooth and I luv the style. I really like the concept of enemies at different heights in game shooting mechanics. I find the jumps most challenging, you could give the main character a little more time in the air. With such level design a jetpack or some other floating device could be really fun too. I'm a noob cpc coder so technically I'm super impressed what you got so far :o
Title: Re: Space Pest Control (Development)
Post by: arnoldemu on 09:54, 01 November 15
my comments:

- nice loading screen

- nice main menu. colourful, easy to use. reminds me of many Spanish made games

- i like i can press fire on joystick to start game. but press space on game over screen and not fire?

- in-game graphics are colourful and smooth.

- difficulty is good.

- a nice exploration game.
Title: Re: Space Pest Control (Development)
Post by: VincentGR on 10:00, 01 November 15
ZX coder huh?

HHmmm whe should have you back in the day porting to cpc.

The game is awesome.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 10:27, 01 November 15
Thanks for your feedback!

Quote from: arnoldemu on 09:54, 01 November 15
- i like i can press fire on joystick to start game. but press space on game over screen and not fire?

Actually it really doesn't matter, it is time based (music + some delay). Whatever you press won't change that :) I guess you pressed space at the right time and it felt like it reacted to your input.

(in fact I double checked the code to be sure!)
Title: Re: Space Pest Control (Development)
Post by: arnoldemu on 10:42, 01 November 15
Quote from: reidrac on 10:27, 01 November 15
Actually it really doesn't matter, it is time based (music + some delay). Whatever you press won't change that :) I guess you pressed space at the right time and it felt like it reacted to your input.
:-[ Yes.
Title: Re: Space Pest Control (Development)
Post by: ervin on 12:50, 01 November 15
Great little game! It's tremendously fun to play, although I can't figure out how to get to some of the teleporters.  :-[
I noticed a really nice touch in one of the rooms - the background tiles in the shape of a space invader!
Title: Re: Space Pest Control (Development)
Post by: reidrac on 12:54, 01 November 15
Quote from: ervin on 12:50, 01 November 15
Great little game! It's tremendously fun to play, although I can't figure out how to get to some of the teleporters.  :-[
I noticed a really nice touch in one of the rooms - the background tiles in the shape of a space invader!

Thanks! Glad you like it!

Spoiler: ShowHide
There's at least one teleporter that you must get in "jumping" so you'll get out on the other side "going up" and reach the platform on the left.
Title: Re: Space Pest Control (Development)
Post by: Optimus on 19:01, 01 November 15
Very nice game even if it's short. But I like that the controls are quite nice. It also shows that you don't necessary have to scroll to make a nice CPC game, good think the character movement felt more smooth than few others who went for scrolling (for example invasion of the zombie monsters). I don't mind flipping to the next screen and then no scrolling if it animates and plays so nicely in static backgrounds. I only had a little bit of puzzlement at some teleport that teleported you in the air, you kinda have to jump while teleport there to reach the platforms, not always worked at first.
Title: Re: Space Pest Control (Development)
Post by: AMSDOS on 08:47, 02 November 15
Thank God, another game not using WSAD to play it!  :D
Title: Re: Space Pest Control (Development)
Post by: reidrac on 10:56, 02 November 15
Quote from: AMSDOS on 08:47, 02 November 15
Thank God, another game not using WSAD to play it!  :D

I'm a big fan of "redefine keys" :)
Title: Re: Space Pest Control (Development)
Post by: dodogildo on 12:16, 02 November 15
Quote from: reidrac on 10:56, 02 November 15
I'm a big fan of "redefine keys" :)
Haha indeed. And what about those games who never let you redefine as arrow keys?!

Sent from my LG-H815 using Tapatalk

Title: Re: Space Pest Control (Development)
Post by: TFM on 22:12, 02 November 15
I can't redefine cursor left key, why?


what's the aim of it, kill all aliens?


Great game, was fun playing, even without cursor keys.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 22:19, 02 November 15
Quote from: TFM on 22:12, 02 November 15
I can't redefine cursor left key, why?


No idea, could be a bug. Default keys are cursors + space, you can redefine them to anything you want.

I didn't try to redefine the keys to use the default keys.

Quote from: TFM on 22:12, 02 November 15
what's the aim of it, kill all aliens?

Yes, the "pest level" should get to 0% (orange percentage in the hud).

Quote from: TFM on 22:12, 02 November 15
Great game, was fun playing, even without cursor keys.

Thanks! I'll take a look to that.
Title: Re: Space Pest Control (Development)
Post by: VincentGR on 22:19, 02 November 15
Quote from: TFM on 22:12, 02 November 15
I can't redefine cursor left key, why?


what's the aim of it, kill all aliens?


Great game, was fun playing, even without cursor keys.

LOL same here.
Title: Re: Space Pest Control (Development)
Post by: reidrac on 22:21, 02 November 15
Quote from: VincentGR on 22:19, 02 November 15
LOL same here.

Uh, I'm honestly lost here :)

I only tried it on a 464 and I didn't have any problems to redefine the keys to OPQA + space, or play with the default cursors.

May be I can reproduce the issue in an emulator...
Title: Re: Space Pest Control (Development)
Post by: TFM on 22:21, 02 November 15
Thanks! If they are default, then anything is fine! Great work, especially in such a short time!  :) :) :)
Title: Re: Space Pest Control (Development)
Post by: VincentGR on 22:22, 02 November 15
Quote from: TFM on 22:21, 02 November 15
Thanks! If they are default, then anything is fine! Great work, especially in such a short time!  :) :) :)

Indeed, the game rocks.
Title: Re: Space Pest Control (Development)
Post by: Xifos on 22:47, 02 November 15
Well done !
A very good game !
Title: Re: Space Pest Control (Development)
Post by: reidrac on 08:00, 05 November 15
Quote from: TFM on 22:21, 02 November 15
Thanks! If they are default, then anything is fine! Great work, especially in such a short time!  :) :) :)

It was a bug indeed! I found the problem and it's been fixed.

I don't think I'll make another release of the CPC Retro Dev version, but it'll be fixed in the "final" version (that will be called "Super Space Pest Control" or similar to make clear that is a "different" game).

Thanks for the report!
Title: Re: Space Pest Control (Development)
Post by: Optimus on 20:22, 07 November 15
Is it true that there is an area that doesn't lead with any teleports back or is am I missing something.
I finished the game on emulator in the past, now I tried to play it on my CPC, there is an area you drop that you can clean everything there, but no teleported can lead you back.
Second play, I try to not drop into that area, clean everything else, then drop. Aparently I missed one enemy, because down in the area I clean everything and I am at 1% :(
Title: Re: Space Pest Control (Development)
Post by: reidrac on 20:35, 07 November 15
Quote from: Optimus on 20:22, 07 November 15
Is it true that there is an area that doesn't lead with any teleports back or is am I missing something.
I finished the game on emulator in the past, now I tried to play it on my CPC, there is an area you drop that you can clean everything there, but no teleported can lead you back.
Second play, I try to not drop into that area, clean everything else, then drop. Aparently I missed one enemy, because down in the area I clean everything and I am at 1% :(

Sorry about that. I can argue that the platforming (including funny jumps into teleporters) is a good idea, but getting that part "disconnected" from the rest is definitely bad (to be honest, it was an accident consequence of putting the 25 screens together in no time).

I'll spend more time in the level design of the final game so this kind of thing doesn't happen, promise! :)
Title: Re: Space Pest Control (Development)
Post by: Gryzor on 15:06, 10 November 15
I really, really, really love the authentic, old-school looks and feel of this game! Highly enjoyable. Thanks!!!
Title: Re: Space Pest Control (Development)
Post by: seanb on 17:25, 10 November 15
Quote from: reidrac on 20:35, 07 November 15
Sorry about that. I can argue that the platforming (including funny jumps into teleporters) is a good idea, but getting that part "disconnected" from the rest is definitely bad (to be honest, it was an accident consequence of putting the 25 screens together in no time).

I'll spend more time in the level design of the final game so this kind of thing doesn't happen, promise! :)

Or release a patch for when we're all able to take our cpc's online.
Title: Re: Space Pest Control (Development)
Post by: TFM on 20:45, 10 December 15
Couldn't find the other thread... Have a question... I can kill all aliens then the alien counter is down at 51%, but I find no way to move on. What to do now? Any hint?

Title: Re: Space Pest Control (Development)
Post by: reidrac on 21:05, 10 December 15
Quote from: TFM on 20:45, 10 December 15
Couldn't find the other thread... Have a question... I can kill all aliens then the alien counter is down at 51%, but I find no way to move on. What to do now? Any hint?

There are two areas that are disconnected, if you get in one of them too soon, you won't be able to go back.

CPC-Power has a map of the game, it should be helpful to give you some hints on what you missed.

(there's not other thread for this game; yet)
Powered by SMFPacks Menu Editor Mod