Page 1 of 8

P.I. Cole - noir detective game RELEASED

Posted: Sun Nov 03, 2019 4:08 pm
by Andrew
January 31st 2020 - Game was released. You can download it here: viewtopic.php?p=31854#p31854

P.I. Cole - noir detective game - in development
Graphics are ready. It was a pain in the back to create some (passable) artwork on PC that still looks good on he QL because the difference in pixel sizes.
Well it's ready now - some screens are ok, some might have been better
Now working on the texts and dialogues :)

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 4:09 pm
by Andrew
Some more screens

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 4:29 pm
by robheaton
Excellent work!!

Really looking forward to playing this!!
How much of the game is complete?

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 4:47 pm
by Andrew
robheaton wrote:Excellent work!!

Really looking forward to playing this!!
How much of the game is complete?
Thank you Rob!
The graphic screens are ready and this was the hard part for me.
The scenario is ready - now I am working on the dialogues
The data structures are ready and the coding will not take long.
The only issue is my extremely limited time to dedicate to this project.

Are there any fast functions that I could use to compress/decompress the screens ?
I tried several ways to compress/decompress, but all are too slow for a QL without at least a Gold Card, and I would want the game to run on QL+Trump Card or a QL+vdriveQL (compiled Superbasic)

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 5:00 pm
by Sparrowhawk
Looks amazing Andrew - loving the artwork.

This and the Q68 Magnetic Scrolls remakes. Good times!

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 5:44 pm
by tofro
Andrew wrote: I tried several ways to compress/decompress, but all are too slow for a QL without at least a Gold Card, and I would want the game to run on QL+Trump Card or a QL+vdriveQL (compiled Superbasic)
Impressive! And, apparently, a juicy plot.

Those b&w pictures should benefit greatly from RLE compression. Simple and small. Something along the lines of

Code: Select all

void encode(void) {
  char c, n, new_c;
  if (get(&c) == 0) return;
  put(c);
  n = 1;
  new_c;
  while (get(&new_c) != 0) {
    if (new_c == c) {
      if (n == UINT8_MAX) { put(n); n = 1; put(c); }
      else { n++; }
    } else {
      put(n); put(new_c);
      c = new_c; n = 1;
    }
  }
  put(n);
}

void decode(void) {
  char c, n, i;
  while (get(&c) != 0) {
    get(&n);
    for (i = 0; i < n; i++) put(c);
  }
}

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 6:06 pm
by vanpeebles
Awesome work! :)

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 6:08 pm
by Andrew
tofro wrote:
Andrew wrote: I tried several ways to compress/decompress, but all are too slow for a QL without at least a Gold Card, and I would want the game to run on QL+Trump Card or a QL+vdriveQL (compiled Superbasic)
Impressive! And, apparently, a juicy plot.

Those b&w pictures should benefit greatly from RLE compression. Simple and small. Something along the lines of

Code: Select all

...
Thank you tofro!
I tried the RLE encoding/decoding but it is still too slow in compiled SBasic
On an unexpanded QL I got the following results:
Lbytes data to memory buffer <1 sec
Decode buffer and write decoded data into another memory buffer = 17-20 seconds, depending on the screen
Move_Mem from buffer to screen < 1 sec

It is far to slow for my practical purposes. I need to decode in less than 3 seconds, and do it in Sbasic (I have not used C language since 1997)
Images are 360 x 151 pixels

Code: Select all

100 WINDOW#1,512,256,0,0: PAPER#1,0: CLS#1
110 ConfigDrv$='Dos2_Picole_'
120 FileName$='street'&'_SCC': REMark the compressed file in format - BytesCount, Color 
130 mem1=FLEN(\ConfigDrv$&FileName$)
140 mem=ALCHP(mem1): REMark Reserve memory for compressed image
150 all=ALCHP(13590) : REMark Reserve memory for uncompressed image 360 x 151 pixels
155 crt=all
160 LBYTES ConfigDrv$&FileName$, mem :  REMark Load compressed image to buffer
170 FOR i=0 TO mem1-1 STEP 2 :  REMark Decompress image and write it to uncompressed buffer
180   cnt=PEEK (mem+i)
190   cod=PEEK (mem+i+1)
200   FILLMEM_B crt, cnt, cod
210   crt=crt+cnt
220 END FOR i
230 Loadscr:  :  REMark Move decompressed image to screen
240 RECHP mem
250 RECHP all
360  DEFine PROCedure Loadscr
390  FOR i=0 TO 150
400    MOVE_MEM all+i*90, 131072+(13+i)*128+32, 90
410    NEXT i
420  END FOR i
440  END DEFine LoadScr

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 6:40 pm
by RWAP
Looking great - I love more adventures :)

QREST (part of ACT was probably the fastest display method I have seen for compression) - but there are two ways around this -

a) Why do you need to compress the screens? Is it to fit it on a floppy disk - or is the game going to run from HD disk or SD / CF card?
b) Can you decompress the screens in the background - ie show the text input and allow text input, and show the menu on the left immediately and then just load the graphics in the appropriate frame?

Re: P.I. Cole - noir detective game

Posted: Sun Nov 03, 2019 7:11 pm
by tofro
You can't get any faster than RLE - It is by far the fastest (and simplest) compression method. If compiled S*Basic is too slow, you'll need to revert to a faster language.

However,
If your picture is really only black and white, you can easily squeeze them into half the space by only storing the green (that is, every other) bytes - the red ones are exact copies of them - and then copying to the red byte positions to give white. You'd need machine code for this, however. Maybe the DIY toolkit's "W" edition can help here, it has machine code functions to do that.

Tobias