Amiga.org

Amiga computer related discussion => Amiga Gaming => Topic started by: BSzili on September 05, 2014, 08:50:59 PM

Title: Catagon
Post by: BSzili on September 05, 2014, 08:50:59 PM
Greetings lords and ladies!

I have decided to venture into the classic realm, and make my own Amiga game: Catagon. It's a clone of a LoadStar game called Paragon, originally created by Nick Peck for the C64. SoftDisk later released few different remakes (two for DOS, one for Windows 3.1). I started writing an Amiga version from scratch. This is hack job is the result of a week of work:

(http://i1064.photobucket.com/albums/u376/BSzili/001_.png)
Here's an early gameplay video: https://www.youtube.com/watch?v=rCaE9xhvqv8

Description:
- clone of the C64/DOS/Win 3.x game Paragon
- written in system friendly C
- runs well even on an unexpanded A500 with KS 1.2
- 640x256 PAL, 16 color graphics
Title: Re: Catagon
Post by: carvedeye on September 05, 2014, 09:42:56 PM
looks awesome keep it up the good work :)
Title: Re: Catagon
Post by: BSzili on September 11, 2014, 09:15:14 AM
Here's a new screenshot, featuring a vastly improved player sprite:
(http://i1064.photobucket.com/albums/u376/BSzili/005.png)

The items and other converted tiles are also gradually being redrawn. There have been a lot of changes under the hood, mostly speed improvements. This video shows off the level change, when all the items are picked up:
https://www.youtube.com/watch?v=-laIXIXnpsg
Title: Re: Catagon
Post by: Oldsmobile_Mike on September 11, 2014, 08:04:12 PM
Looking good! :D
Title: Re: Catagon
Post by: klx300r on September 11, 2014, 08:33:53 PM
@ BSzili

if you need some testing done on an Amiga 1000 let me know:)
Title: Re: Catagon
Post by: BSzili on September 11, 2014, 08:56:59 PM
I just tried it on my A500, and it was a bit slower than expected. I probably went a bit overboard with all the function calls. After I sorted this out, I'll I'm going to release a test version :)
Title: Re: Catagon
Post by: BSzili on September 14, 2014, 04:48:11 PM
The first demo is here! I added a lot of features in a rush (animated slime, status bar, joystick support, music playback, etc.), so there could be some performance problems. There's currently no way to save your progress or your score, and the collision detection is still not perfect. These problems will be solved in the future, I just wanted to put the game out there, so people can test it. Huge thanks to saimon69 for the music. Without further delay, here's the disk image:
http://bszili.morphos.me/stuff/catagon_demo.adf
Title: Re: Catagon
Post by: BSzili on September 20, 2014, 12:04:56 PM
It turns out that all the problems (jerkiness, attached sprites falling apart, etc) were caused by ptreplay.library. It pains me, but I had to disable the music for the time being. If anyone knows any other solution to play ProTracker music, I'm all ears.
In the meantime I noticed a news item about my game on www.amiga68k.de (http://www.amiga68k.de). It has been subsequently picked up by many Amiga sites :) Too bad they decided to use the oldest screenshot available, which does not represent the current state of the game. Oh well, it's nice to have some publicity anyway. Here's a new screenshot showing off the status bar, and more redrawn items:
(http://i1064.photobucket.com/albums/u376/BSzili/006.png)
Title: Re: Catagon
Post by: lionstorm on September 20, 2014, 08:59:48 PM
so whats the aim of the game ? I never owned a C64 (started with A500) so dont know this game at all !
Title: Re: Catagon
Post by: BSzili on September 20, 2014, 09:11:56 PM
Your goal is to collect all of the items on the level. Gameplay-wise it's pretty simple, it's all about jumping off the rails at the right place and time. Well, it's easier said than done :)
Title: Re: Catagon
Post by: lionstorm on September 21, 2014, 09:21:17 PM
ah ok thanks for the reply and good luck for chasing the bugs !
Title: Re: Catagon
Post by: Leffmann on September 23, 2014, 02:29:14 PM
Quote from: BSzili;773469
It turns out that all the problems (jerkiness, attached sprites falling apart, etc) were caused by ptreplay.library. It pains me, but I had to disable the music for the time being. If anyone knows any other solution to play ProTracker music, I'm all ears.


It's difficult to say what the cause is, but it sounds like the ptreplay.library is eating up too much CPU time. Have you tried The Player 6.1? It's very time-efficient, and it performs some compression on the module to save a bit of RAM as well.
Title: Re: Catagon
Post by: Thorham on September 23, 2014, 03:17:21 PM
Very cool :) But you've got to do something about that ugly mouse pointer :lol:
Title: Re: Catagon
Post by: BSzili on September 23, 2014, 05:51:16 PM
Quote from: Leffmann;773739
It's difficult to say what the cause is, but it sounds like the ptreplay.library is eating up too much CPU time. Have you tried The Player 6.1? It's very time-efficient, and it performs some compression on the module to save a bit of RAM as well.
The player interrupt definitely uses up too much CPU time. A better protracker replayer would solve the problem too, but they are all written in assembler, so it takes some effort to glue them to C code.

Quote from: Thorham;773742
Very cool :) But you've got to do something about that ugly mouse pointer :lol:
You don't like the psychedelic colors? :) I'll rearrange palette of the player sprite a bit, so the pointer will look normal. It doesn't use all the 15 colors anyway.
Title: Re: Catagon
Post by: Leffmann on September 23, 2014, 07:42:06 PM
Quote from: BSzili;773745
The player interrupt definitely uses up too much CPU time. A better protracker replayer would solve the problem too, but they are all written in assembler, so it takes some effort to glue them to C code.


If you're writing it in C then it's just a few lines of code to fix that actually. Let me write up an example.

EDIT:

https://dl.dropboxusercontent.com/u/8177628/p61.zip

Just link with p61.o and use it f.ex. like this:
Code: [Select]
#include <proto/dos.h>

extern char module[];
extern char samples[];
extern int P61_Init(void*, void*);
extern void P61_End();

int main()
{
  if (P61_Init(module, samples) == 0)
  {
    Delay(10*50);
    P61_End();
  }

  return 0;
}
Title: Re: Catagon
Post by: BSzili on September 25, 2014, 07:39:58 AM
Thanks, I'll check it out this weekend. BTW, these function prototypes look a bit odd to me. They don't have any registers specified for the arguments, and a lot of them are omitted, like A6, A4, D0 for P61_Init. Is this intentional? I also noticed there's an optimized version if The Player: http://aminet.net/package/mus/misc/P6111
Title: Re: Catagon
Post by: Leffmann on September 25, 2014, 03:26:20 PM
I added a stub to the player for standard C calls. IMO it's cleaner and more elegant than using compiler-specific keywords for register usage. It works and plays songs exactly like it's supposed to, it's not some random guesswork.

I'm not sure what the optimizations in the unofficial 6.1.11 are, as the official 6.1 is pretty fast and optimized as it is. I tried 6.1.8 some time ago, but the changes made it confusing to use, and it didn't work reliably. The problems might be fixed in 6.1.11, but I haven't tried it.
Title: Re: Catagon
Post by: BSzili on September 26, 2014, 01:39:25 PM
Sorry, I didn't mean to imply that you've randomly omitted the register keywords :) I was just interested in how did you do it, and what does the stub look like. I was originally going to use Frank Wille's ProTracker player, which can play sounds effects on the least used channel. I went to ptreplay.libray for the demo, because it could us it "out of the box" from C code.
Title: Re: Catagon
Post by: Leffmann on September 26, 2014, 06:35:09 PM
The arguments go on the stack in reverse order, D0/D1/A0/A1 can be used as scratch registers, all other registers must be preserved, and any return value should be passed in D0, so the stubs look like this:
Code: [Select]
_P61_Init  movem.l  (4, sp), a0-a1
           movem.l  d2-d7/a2-a6, -(sp)
           moveq    #0, d0
           bsr      P61_Init
           movem.l  (sp)+, d2-d7/a2-a6
           rts

P61_Init   ...


_P61_End   movem.l  a3/a6, -(sp)
           lea      $dff000, a6
           bsr      P61_End
           movem.l  (sp)+, a3/a6
           rts

P61_End    ...