ZX Spectrum Game Development Noob Questions

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
Mozartkügel
Berk
Posts: 25
Joined: Fri Jun 07, 2019 7:19 am
Location: Finland

ZX Spectrum Game Development Noob Questions

Post by Mozartkügel » Fri Jun 07, 2019 7:51 am

Hi guys! I'm pretty much completely new to the ZX Spectrum, but I've recently gotten interested and fallen in love with many of the old home computers and consoles (in addition to the ones I was most in contact with back in the day), especially the 8-bit ones, and the Speccy is one of the computers on the top of my list! :)

I remember feeling intrigued about the funny colors of spectrum games in gaming magazines as a kid. Now when "everything's the same" when it comes to computers, the Speccy's restricted graphics come across as really unique and even legendary. That's one thing I love about the 8-bit generation of machines, you can usually almost immediately tell the difference from the graphics and music if it's for example a spectrum-, c64-, nes-, msx or amstrad cpc- game! Also a limited colour palette partly forces the graphics artist to better design choices than a large one (many times probably inadvertently on some of the old games).

Anyways, I was thinking of trying to set up some small start of a game on the spectrum with Z88DK, and as a complete noob I'd really appreciate if someone could point me in the correct direction about ZX Spectrum development. I'm not going to try to push the system to its limits and I've got very limited free time at the moment, so I'll have to leave assembly for the future.

1A. Is there a simple "standard" graphics tool that has emerged that "everyone" uses (comparable to spritepad and charpad on the c64), that can export the graphics in tables for assembler and preferably C too? I've seen multipaint before, but I haven't tried it yet: http://multipaint.kameli.net/

1B. If I understood correctly you can have two colors per 8x8 cell on the spectrum? (I've read about Nirvana+ but these questions would be from a standard speccy view).

1C. Are the Bright and normal variants of the colours usable on cell level or do you have to choose for the whole screen which ones to use?

1D. I suppose you can't use basic colour and bright colour of the same colour in the same cell?

2A. Is there some simple AY music tracker that can export music to be fairly easily used with Z88DK?

2B. Do homebrew spectrum games usually support both beeper sound of the early models and AY sound?

3. Does someone know if there's a Z88DK template / code skeleton / boilerplate code somewhere to be found that would incorporate basic stuff you'd need for a game, i.e. user defined characters for graphics + AY music/sfx + input of both kempston and zx interface 2? So far I mostly found snippets or finished games where the code is so big and mixed with assembly it becomes a bit overwhelming.

Actually in this moment I read that Nixy the Glade Sprite (which looks like a very fun and great looking game) has been made with AGD, I think that is something that I'd might wanna look into too.

Thanks in advance for any help! :)
1 x

dfzx
Microbot
Posts: 165
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: ZX Spectrum Game Development Noob Questions

Post by dfzx » Fri Jun 07, 2019 8:21 am

Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
Anyways, I was thinking of trying to set up some small start of a game on the spectrum with Z88DK,...
Shameless plug: my Z88DK getting started with Spectrum development guide is here.
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
3. Does someone know if there's a Z88DK template / code skeleton / boilerplate code somewhere to be found that would incorporate basic stuff...
No, that approach doesn't really work with the Spectrum, either with Z88DK, ASM or anything else. Every byte matters, and just hauling in a whole mass of pre-written stuff in the hope that it's useful will just fill the memory. You have to adapt your coding discipline back to the 1980s mindset - economical, with attention to detail. That's what still makes it fun, 35 years after we started. You don't have to start by obessing to the level some experts on here do, you can strike a happy medium which suits you.

Others will doubtless answer your other questions. I'm at work so don't have time right now. :)
1 x

User avatar
Alessandro
Manic Miner
Posts: 387
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: ZX Spectrum Game Development Noob Questions

Post by Alessandro » Fri Jun 07, 2019 8:34 am

Welcome on the forum Mozartkügel!

To ask your questions, I'll first presume that by "cell" you mean one of the low resolution attribute blocks of the Spectrum display. They are 768 starting from the one in the top left corner and are memorized between addresses 22527 and 23295 of the computer's RAM. Each one of them can hold at any given time 1 INK value (pixel color), 1 PAPER value (background color), 1 BRIGHT value and 1 FLASH value (alternates between INK and PAPER). Whereas pixels are memorized between 16384 and 22527 for a total of 6144.

INK and PAPER can assume values ranging from 0 (black) to 7 (white). 8 means "transparent", i.e. leave the old attribute unchanged. 9 means that the INK or PAPER value will be set to contrast with the color of PAPER and INK respectively.

FLASH and BRIGHT can be set to 0 (off), 1 (on) or 8 (unchanged).

The above answers to your questions 1B, 1C, and 1D, however I'd suggest you to consult Chapter 16 of the Spectrum programming manual.

As for the other questions:

1A) There are a number of programs for that purpose, there is no de facto standard. Personally I have been using ZX-Paintbrush for years.

2A) Same goes here, there is no de facto standard although Vortex Tracker, now at version 2.5, is my personal choice.

2B) They might support both or just the beeper or just AY sound. My games, for instance, usually have beeper sound effects and AY background music. Of course the AY-8912 chip is natively present on the 128K and later models only.

3) I never used Z88DK since I am ignorant about C but there are folks here who can help you with that.

Finally, if you wish to see more games authored with AGD, I can point you to my own ones (go to my website and select Retroinformatica/Mio software). Feel free to ask me any information about them.

Hope that helps :D
Last edited by Alessandro on Fri Jun 07, 2019 8:47 am, edited 1 time in total.
1 x

User avatar
djnzx48
Manic Miner
Posts: 463
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: ZX Spectrum Game Development Noob Questions

Post by djnzx48 » Fri Jun 07, 2019 8:35 am

Hi, welcome to the forum!
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
1A. Is there a simple "standard" graphics tool that has emerged that "everyone" uses (comparable to spritepad and charpad on the c64), that can export the graphics in tables for assembler and preferably C too? I've seen multipaint before, but I haven't tried it yet: http://multipaint.kameli.net/
ZX-Paintbrush is probably the most well-known one, but you can also use standard PC graphics tools and then use something like SevenuP, bmp2scr or img2spec to convert. I believe SevenuP has several options for exporting so you can also use it for sprites.
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
1B. If I understood correctly you can have two colors per 8x8 cell on the spectrum? (I've read about Nirvana+ but these questions would be from a standard speccy view).
Assuming a static screen, that is correct. Since the screen cells are displayed one line at a time, by changing the colours in sync with the raster you can get up to 16 colours in a single cell.
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
1C. Are the Bright and normal variants of the colours usable on cell level or do you have to choose for the whole screen which ones to use?
It's based on 8x8 cells. So it can be varied across the whole screen.
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
1D. I suppose you can't use basic colour and bright colour of the same colour in the same cell?
Not without using multicolour. There's only one bit per cell with brightness information, so both colours have to be the same bright level. However, the colour black is unaffected by the bright bit so both levels of black will look the same.
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
2A. Is there some simple AY music tracker that can export music to be fairly easily used with Z88DK?
Pretty much any interrupt-based tracker will work as far as I'm aware. For the PC, you have Vortex Tracker 2.5, Arkos Tracker 2, WYZ Tracker, and chipnsfx (command line). Vortex is the most popular option out of those. You can either use the export function in the editor (useful if you're dealing with a single song) or include the song files along with a standalone player.
Mozartkügel wrote:
Fri Jun 07, 2019 7:51 am
2B. Do homebrew spectrum games usually support both beeper sound of the early models and AY sound?
It depends, you can have ingame options depending on what you want to support. On the machines that do have AY, it's mixed a lot quieter than the beeper, so you may not want to have them playing at once (or the AY can be drowned out). You could use beeper for sound effects and AY for music, or just play everything on the AY.

Also, although the AY chip was only added starting with the 128K model, it was also available as a third-party hardware addon as well as being built-in to the Timex models. So you can still include AY music in a 48K game.
1 x

Ralf
Dynamite Dan
Posts: 1161
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: ZX Spectrum Game Development Noob Questions

Post by Ralf » Fri Jun 07, 2019 9:16 am

Hi!
Good luck with Speccy programming.

Here are Some answers for your questions. Sorry for being concise, I'm writing from work ;)

1A. Yes, it's called Sevenup
1B Yes, without advanced tricks you have only 2 colours per character
1C You set bright on char level so each 8x8 pixels area is either bright or not
1D Yes, you can't mix bright and non-bright in a cell
2A AY trackers are generally difficult stuff but I would suggest Vortex Tracker as it runs under Windows
2B It differs. You can do a game just with some beeper buzzes, you can do a game with beeper music, you
can do a game with AY music. Generally if a game has some music, you score extra fame from the gamers ;)
3. There are some full environments for games making like AGD or some libraries for C like Churerra. Do some search
1 x

User avatar
djnzx48
Manic Miner
Posts: 463
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: ZX Spectrum Game Development Noob Questions

Post by djnzx48 » Fri Jun 07, 2019 10:33 am

Alessandro wrote:
Fri Jun 07, 2019 8:34 am
INK and PAPER can assume values ranging from 0 (black) to 7 (white). 8 means "transparent", i.e. leave the old attribute unchanged. 9 means that the INK or PAPER value will be set to contrast with the color of PAPER and INK respectively.

FLASH and BRIGHT can be set to 0 (off), 1 (on) or 8 (unchanged)
If I may add to this: these attribute values of 8 or 9 are only abstractions used by the BASIC interpreter for printing coloured graphics. They don't actually exist in the hardware, nor in machine code programs that don't use ROM routines.
1 x

User avatar
Mozartkügel
Berk
Posts: 25
Joined: Fri Jun 07, 2019 7:19 am
Location: Finland

Re: ZX Spectrum Game Development Noob Questions

Post by Mozartkügel » Fri Jun 07, 2019 10:46 am

Thanks so much for your answers/info/links and the warm welcome guys! I got a lot to sink my teeth into now and I pretty much got all of my questions answered! I will reply properly in the evening because I am too at work now. :mrgreen:

One follow up question if I may, does anyone have experience what version of AGD would make sense to use? I noticed there are AGD, MPAGD and AGDX. As I mentioned before I wouldn't be looking to push the limits of the Speccy, rather I'm looking for simplicity but with the possibility for all the parts needed for a finished game and "product". I forgot to mention that the final goal somewhere in the future would still be to put it on C-cassette, so I guess that might imply level compressing (uugh) and loader/tape mastering (eek, help me!) :lol:

@Alessandro Beatuiful games, especially Sophia 1&2 and Doom pit caught my eye! I got to check these out properly asap.
1 x

User avatar
djnzx48
Manic Miner
Posts: 463
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: ZX Spectrum Game Development Noob Questions

Post by djnzx48 » Fri Jun 07, 2019 10:54 am

I don't know much about AGD versions, but if you're looking to use a compressor, there's a good article here: http://hype.retroscene.org/blog/dev/740.html
1 x

Ralf
Dynamite Dan
Posts: 1161
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: ZX Spectrum Game Development Noob Questions

Post by Ralf » Fri Jun 07, 2019 11:31 am

AGD is a good choice for someone who doesn't want to go pure assembler path. I don't use it myslef but believe it's quite easy to begin.

It has limitations, you won't be able to make any kind of game with it. You won't do a scrolling game, 3D game or something with really big sprites.

Also people using tools for game making sometimes make their games very similar to other existing ones. I guess it's the problem of starting from the same tutorial example ;)

But a lot is possible. Definitely check games from Alessandro, he certainly knows how to use AGD to make some good and original stuff.
2 x

User avatar
Alessandro
Manic Miner
Posts: 387
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: ZX Spectrum Game Development Noob Questions

Post by Alessandro » Fri Jun 07, 2019 2:12 pm

Mozartkügel wrote:
Fri Jun 07, 2019 10:46 am
One follow up question if I may, does anyone have experience what version of AGD would make sense to use? I noticed there are AGD, MPAGD and AGDX. As I mentioned before I wouldn't be looking to push the limits of the Speccy, rather I'm looking for simplicity but with the possibility for all the parts needed for a finished game and "product". I forgot to mention that the final goal somewhere in the future would still be to put it on C-cassette, so I guess that might imply level compressing (uugh) and loader/tape mastering (eek, help me!) :lol:

@Alessandro Beatuiful games, especially Sophia 1&2 and Doom pit caught my eye! I got to check these out properly asap.
Thanks! :D

About the distinction between the different AGD versions floating around:

Arcade Game Designer. This is the basic original version, created by Jonathan Cauldwell to run on a common 128K and later model. Needless to say it's much easier to develop your game on PC/Linux/Macintosh etc. under emulation and employ real hardware (when available!) just to test it before release. Note: Of course the same applies with every kind of development for such an old system; an advanced text editor like Notepad++ will be very useful in writing your own bits of BASIC/Assembly/C etc.
AGD comes with a detailed guide that contains every information you need to start off creating even a simple test game. The latest stable version is 4.7; there is also a v4.8 around but as Jonathan himself says it's "untested and with no guarantees".
Compared with MPAGD it might seem less user friendly because you must use the keyboard to do everything, and it does not have the same number of keyboard shortcuts and information provided by AGDx. In a nutshell, AGD is pretty much a relic of the past nowadays; even Jonathan has concentrated his efforts on the newer multi-platform version.

Multi-Platform AGD. The newer development environment created by Jonathan runs under Windows and is arguably more accessible to someone who prefers a more conventional point-and-click user interface. It is called Multi-Platform because it can allow you to develop titles for other platforms such as the Amstrad CPC 464 or the ZX Next. Other advantages include the possibility of managing the scripts as simple text files and to export the whole game as a Z80 Assembly source code. However - at least in my experience - it can be difficult to navigate through the various windows, and the saving system seems pretty confusing, with just too many temporary files around. Most recent version is 0.74.

AGDx. This is a reworking of the original AGD editor made by a group called AGD Labs. Basically it lets you do the same things of AGD, but with a much larger amount of information about sprites and graphic blocks, many shortcuts, a sort of undo system, bug fixes etc. That makes it is much easier not only to create your own game but also to add custom bits of code for special sound and/or visual effects. It also employs a sort of shorthand for scripts, for instance PUTBLOCK becomes PBLK. This is done in order to save memory.
Unfortunately, the program is hard to get because it is almost exclusively available through subscription to a closed Facebook group. Personally Facebook is anathema to me because I consider it to be one of the most blatant manifestation of evil :twisted: However AGDx has become my tool of choice since I was working at Sophia II. One of the group members, Mr Highrise (Allan Turvey) has a YouTube channel where he posts tutorials and the odd bit of additional code. The latest version in my possession is 4.7xLb.

Tony Thompson has created a Windows-based environment for AGDx, but after a period of continuous updates, it has not been touched in the last three months. I haven't tried it so I cannot tell you more.

Finally, there is the AGD official forum. Of course it is focused more on AGD and MPAGD, but the advice you find there can be also used in AGDx.

Data compression will be extremely useful if you plan to take advantage of the 128K and later models' extra RAM. Keep in mind that AGD and its derivates are meant to create stand-alone titles that can run on a 48K, but you can author a multi-level game by creating each level as a single distinct game. Most of the times I employed ZX7, a very good and versatile tool made by Einar Saukas. Sometimes I also used Exomizer, which yields slightly higher compression ratios but it's not as fast or flexible as ZX7.

As for tape management, you can, at least for the beginning, stay with the Spectrum ROM loading routines. Custom loaders add extra flair and are useful for people who like to load their games on physical hardware, even from their PCs, but they are not necessary nowadays. That said, I went as far as creating a turbo custom loader myself.
1 x

Post Reply