Game creation book for QL?

Anything QL Software or Programming Related.
User avatar
SinclairSociety
Over Heated PSU
Posts: 136
Joined: Fri Feb 22, 2019 6:17 pm

Game creation book for QL?

Postby SinclairSociety » Fri Oct 25, 2019 4:08 am

What QL book do you all recommend for creating video games on a QL... Ummm.... for the QL beginner. Want something that shows how to create creatures and move them via keyboard. Like UDG in speccylands but for QL.


Sinclair Computers are AWESOME!!
User avatar
Andrew
Gold Card
Posts: 350
Joined: Tue Jul 17, 2018 9:10 pm

Re: Game creation book for QL?

Postby Andrew » Fri Oct 25, 2019 7:48 pm

No good books on the subject - but there are some free games that include the code published in QL User magazine and on Rich's site https://rwapsoftware.co.uk/pdsoftware.h ... HMO1rbdmMQ
Also you should take a look at Super Sprite Generator 4 (still not free :( ) , Frank's Sprite Generator (free - http://www.dilwyn.me.uk/games/index.html ) and Adventure Creation Tool (not free)


Derek_Stewart
QL Wafer Drive
Posts: 1845
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Game creation book for QL?

Postby Derek_Stewart » Sat Oct 26, 2019 9:31 am

Hi,

I have some QL programming books, but they have had some coffee split onto them. I will maybe scan them and remove the stains.

I would read all the QL World Magazines and type all the programmes featured. Mike Lloyd did some programming tutorials on games programming. Maybe worth a look

There is a programme to use UDG on the QL, but I have never got it to work properly. On saying that the ZX Spectrum UDG just redefines existing characters in the defined ASCII character set.

If you read in QL Today V13 iss2-4, Dilwyn Jones did some articles on manipulation of the QL Font, it should be possible to implement QL UDGs by changing the QL Font to a user defined font with the UDG changed to a defined graphics shape.

I did look at this in a port of the ZX Spectrum Football Manager, which is written in Spectrum Basic, I have converted this to Superbasic and just had the Spectum UDGs to sort out.


Regards,

Derek
User avatar
Sparrowhawk
Gold Card
Posts: 293
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: Game creation book for QL?

Postby Sparrowhawk » Mon Apr 20, 2020 3:05 pm

To jump onto this thread - I downloaded Dilwyn's font2data program, and I can generate the DATA from one of the sample font files. How does one change a specific character though, say 174 (Theta) ? Is there some specific calculation that can be used to specify the offset for the start of the character?

Thanks.


a.k.a. Jean-Yves !
User avatar
Andrew
Gold Card
Posts: 350
Joined: Tue Jul 17, 2018 9:10 pm

Re: Game creation book for QL?

Postby Andrew » Mon Apr 20, 2020 3:27 pm

Sparrowhawk wrote:To jump onto this thread - I downloaded Dilwyn's font2data program, and I can generate the DATA from one of the sample font files. How does one change a specific character though, say 174 (Theta) ? Is there some specific calculation that can be used to specify the offset for the start of the character?

Thanks.

On a QL, a font is stored in the following format:

Code: Select all

Offset   Value
$0       Byte giving code of first character defined in the font
$1       Byte giving the number of characters defined minus 1
$2…$A    Nine bytes defining the first character
$B…      Nine bytes for each subsequent character…
........


Also see the Toolkit II commands CHAR_USE, CHAR_INC: https://superbasic-manual.readthedocs.i ... l#char-use


dilwyn
Mr QL
Posts: 1631
Joined: Wed Dec 01, 2010 10:39 pm

Re: Game creation book for QL?

Postby dilwyn » Mon Apr 20, 2020 5:31 pm

Worth adding here perhaps a couple of caveats about fonts.

Most fonts have characters in a set range, say space (CHR$ 32) up to copyright (CHR$ 127). But such fonts will have a default character too, whichis usually one character code lower than the first character.

The standard QL font, for example, covers character codes 32 to 127. But there is a CHR$(31) as well, which is usually a chequerboard character used for characters outside the range of the font.

Fonts generally start with two bytes:
First - lowest valid character code, for the standard QL font this would be 31.
Second - number of valid characters in this font less one (so that you can add it to the lowest character to get the highest in the font). So, if you have a font covering space to copyright plus the default character, the first two bytes in the font would be 31 and 96. 31+96=127, the last character int he font.

As characters are 9 bytes each, this makes it fairly easy to work out where each character is as an offset in the font. So we have to read the value of the first byte to get the first character code and do a simple calculation based on the code of the character you want to find after those first two bytes. I'll assume we want to find a character with code c:

OPEN_IN #3,flp1_my_font
BGET #3,lowest : rem code of lowest character in font
postn = 2+((c-lowest)*9)
CLOSE #3

So, to find the space character, this is code 32, at file position 2+((32-31)*9) or 2+(1*9) or 11.

For the upper character set with accented characters etc, the same applies just a different set of codes. This font will also have a default character, normally 127 if the font covers the usual CHR$ 128 to 191.

Hope all that makes sense.


User avatar
Sparrowhawk
Gold Card
Posts: 293
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: Game creation book for QL?

Postby Sparrowhawk » Tue Apr 21, 2020 10:47 am

Many thanks Andrew and Dilwyn, very helpful :)

I am currently trying to update a game I wrote in 1988. First pass through was breaking down code where I had 4 or 5 statements on one line into separate lines, adding indenting, adding comments and general cleaning up of what was frankly a horrid mess!

I clearly had no idea what a function was, or local scope back then. All global scope with procedures changing global vars any which way. Also, my variable naming conventions leave a lot to be desired.

I have been considering tidying up the code base for my Dreamlands adventure too , but frankly that is a monster and I am not sure that I would survive the ordeal :D


a.k.a. Jean-Yves !

Who is online

Users browsing this forum: RWAP and 6 guests