Please advise a wannabe coder

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
ImissSirClive
Drutt
Posts: 7
Joined: Sat Feb 11, 2023 12:19 pm

Please advise a wannabe coder

Post by ImissSirClive »

Hello everyone.
I'm an old guy who has some time on his hands and wants to create a ZX Spectrum game but I'm not sure about the best way to go about it.
I do have the 30hour Spectrum Basic book but i'm aware that basic is too slow for most games.

I'm just wondering if we have any modern tools to help create games on the beloved Spectrum?
or is it still just basic for the most of us and machine code for coding gods?

are stuff like Hurg and quicksilva's game designer still the only options?

my thanks
User avatar
Luzie
Manic Miner
Posts: 917
Joined: Fri May 01, 2020 2:07 pm

Re: Please advise a wannabe coder

Post by Luzie »

Hello @ImissSirClive,

what kind of game you are thinking of? There are many options to write games nowadays, like this one: AGD by Jonathan Cauldwell: https://jonathan-cauldwell.itch.io/arcade-game-designer
User avatar
R-Tape
Site Admin
Posts: 6603
Joined: Thu Nov 09, 2017 11:46 am

Re: Please advise a wannabe coder

Post by R-Tape »

are stuff like Hurg and quicksilva's game designer still the only options?
Good lord don't used those! If it's game designers you want, nowadays we're gifted with Jonathan Cauldwell's Arcade Game Designer (AGD). It started as a utility that runs on the Spectrum version 4.7 is the one I use, but now it's become a PC tool called Multiple Platform AGD that has a lot more functionality.
ImissSirClive wrote: Sat Feb 11, 2023 12:28 pm and machine code for coding gods?
Machine code isn't for coding gods! Here's one of my posts from another thread about how I learnt it:

I'd start by playing about with BASIC for a bit. Even if you move on to asm, you'll still need it, and it gives you a starting understanding of the Speccy's memory and ROM. If you then want to move to assembly, I started with Big Jon's 30 minute machine code, and then Jonathan Cauldwell's How to write Spectrum Games, and I used ZX-Spin 0.666 which has a built in assembler (PDFs available in both those links).
andydansby
Microbot
Posts: 148
Joined: Fri Nov 24, 2017 5:09 pm
Location: Syracuse, NY, USA
Contact:

Re: Please advise a wannabe coder

Post by andydansby »

It all depends on how deep you want to go down the rabbit hole.

There are in reality 4 options.

Using a game engine like HURG, ACG etc. They can produce some decent games, but many times games will feel the same with custom graphics unless you get very creative.

Using an interpreted language such as ZX BASIC. There's a bit more involved with programming and yes they do run slowly. You can also mix BASIC with ASM to speed up some slower items (such as graphics).

Using a compiled language (my favorite technique) such as Z88dk (C compiler) https://z88dk.org/site/. Borel Basic https://www.boriel.com/forum/. There are compilers written for the ZX Spectrum back in they heyday such as Highsoft BASIC http://hayne.net/Spectrum/HiSoftBASIC/ as well.

Finally, there's Assembler, perhaps the most involved of all the options. You will have to have a deeper understanding of the ZX Spectrum and low level operations. This is perhaps the fastest of all the options but time-consuming as compared to the other options.
ImissSirClive
Drutt
Posts: 7
Joined: Sat Feb 11, 2023 12:19 pm

Re: Please advise a wannabe coder

Post by ImissSirClive »

Thanks for the help!
I'll take some time looking into the compiled basic and agd options
ImissSirClive
Drutt
Posts: 7
Joined: Sat Feb 11, 2023 12:19 pm

Re: Please advise a wannabe coder

Post by ImissSirClive »

Luzie wrote: Sat Feb 11, 2023 12:46 pm Hello @ImissSirClive,

what kind of game you are thinking of? There are many options to write games nowadays, like this one: AGD by Jonathan Cauldwell: https://jonathan-cauldwell.itch.io/arcade-game-designer
I was thinking maybe something like a vertical shooter (Arcadia?) or moving around a maze (Hungry Horace?)
Ralf
Rick Dangerous
Posts: 2331
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Please advise a wannabe coder

Post by Ralf »

I was thinking maybe something like a vertical shooter (Arcadia?) or moving around a maze (Hungry Horace?)
Scrollers are hard to make because they require... scrolling :) On other machines like C64 you have hardware scrolling, here
one Spectrum you have to do everything yourself in your code. And you have to deal with several sprites on the screen, bullets,
enemy waves etc. It's not easy.

You won't do it with AGD too. Actually there is a tool called S.E.U.D. for making scrolling shooters, again from Jonathan Cauldwell:
https://spectrumcomputing.co.uk/entry/1 ... ctrum/SEUD

It would be great if it allowed some colour and if enemies could shoot bullets. But currently it can't be done I believe so it's
somehow limited

Something like Hungry Horace (action going on one screen) would be easier so I suggest you going this way.
Dr beep
Manic Miner
Posts: 388
Joined: Mon Oct 01, 2018 8:53 pm

Re: Please advise a wannabe coder

Post by Dr beep »

ImissSirClive wrote: Sat Feb 11, 2023 1:07 pm I was thinking maybe something like a vertical shooter (Arcadia?) or moving around a maze (Hungry Horace?)
Start with moving over a screen like pacman with bytesized steps. You can use RST 16 to do the display
PRINT AT is easily done in MC
LD A,22
RST 16
LD A,10
RST 16
LD A,10
RST 16

will set the next character to print at 10,10
User avatar
Morkin
Bugaboo
Posts: 3336
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Please advise a wannabe coder

Post by Morkin »

Just do it... 8-) Jump right in and try to learn machine code (z80 assembly) I reckon... Fortune favours the brave and all that..! :D

What seemed to be forbidden magic 35-40 years ago really isn't impossible to learn. Especially with modern dev tools. The best parts for me:

- no more re-loading everything from scratch after a crash (which happens a lot :lol: )
- you can write horrible, clunky code and it mostly won't matter, the game will still run as fast as heck

Knowing where to point to may depend on the expertise and experience of the person. For example:

- are you already comfortable with the development process of typing code in an editor, assembling it, compiling it and running it in an emulator?
- do you already know any modern coding languages (e.g. C, C++)?

Depending on the answers it might promote different tools, methods etc.
My Speccy site: thirdharmoniser.com
User avatar
PeterJ
Site Admin
Posts: 6966
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Please advise a wannabe coder

Post by PeterJ »

@ImissSirClive,

Welcome. Please look through the programming section of the forums. There are many useful threads started by people with similar questions to you. Enjoy.
User avatar
Lee Bee
Dynamite Dan
Posts: 1498
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: Please advise a wannabe coder

Post by Lee Bee »

ImissSirClive wrote: Sat Feb 11, 2023 12:28 pm I'm an old guy who has some time on his hands and wants to create a ZX Spectrum game
An old guy with great taste! A warm welcome to the forum! :-) Looking forward to seeing what creation you might come up with. But above all, hope you have fun along the way. That's the important bit!
ImissSirClive
Drutt
Posts: 7
Joined: Sat Feb 11, 2023 12:19 pm

Re: Please advise a wannabe coder

Post by ImissSirClive »

PeterJ wrote: Sat Feb 11, 2023 4:03 pm @ImissSirClive,

Welcome. Please look through the programming section of the forums. There are many useful threads started by people with similar questions to you. Enjoy.
Thank you. I guess I should have done that before posting, sorry.
User avatar
WhatHoSnorkers
Manic Miner
Posts: 264
Joined: Tue Dec 10, 2019 3:22 pm

Re: Please advise a wannabe coder

Post by WhatHoSnorkers »

It's always lovely seeing new people getting the "I want to create something" bug! :)
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
User avatar
Guesser
Manic Miner
Posts: 649
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: Please advise a wannabe coder

Post by Guesser »

I advise not using Sinclair BASIC at all because the lack of hexadecimal support means you'll get used to peeking and poking memory addresses in decimal and suffer irreparable cognitive damage :lol: ;)
firelord
Manic Miner
Posts: 611
Joined: Wed Nov 03, 2021 10:57 am
Location: Greece - Thessaloniki

Re: Please advise a wannabe coder

Post by firelord »

You plan to make an arcade/platform game?
You want to code using zx spectrum directly or use an external tool that will export a zx spectrum game.
You could make an adventure/interactive story.
Eg with lantern you can avoid writting any code on the spectrum. You use a windows gui to create the game elements and then if you want complex stuff you use C like syntax. You can start with a program like trizbort to create a map of the game and then import in lantern (or another adventure creator tool). You can add graphics but it has bugs.
User avatar
Einar Saukas
Bugaboo
Posts: 3222
Joined: Wed Nov 15, 2017 2:48 pm

Re: Please advise a wannabe coder

Post by Einar Saukas »

ImissSirClive wrote: Sat Feb 11, 2023 12:28 pm I do have the 30hour Spectrum Basic book but i'm aware that basic is too slow for most games.
If you are already comfortable with BASIC but you are concerned it's too slow, try Boriel ZX BASIC. It's fast enough for most kinds of games.

However if developing in BASIC turns out to be too hard for you and you need something simpler, try AGD (for action games) or adventure creators like PAW (for adventures).

Frankly I don't recommend trying to develop your first game in Assembly if you have no experience in programming. Unless you are really REALLY motivated about learning Assembly...

And most of all, don't think you need to learn tons of stuff before you start developing games. Many simple games require very little knowledge, and attempting to create them will give you a lot more motivation to keep learning.
User avatar
WhatHoSnorkers
Manic Miner
Posts: 264
Joined: Tue Dec 10, 2019 3:22 pm

Re: Please advise a wannabe coder

Post by WhatHoSnorkers »

I quite liked the ZIP Compiler, which was written originally as a type-in. It turns Sinclair BASIC into machine code which is a lot faster (but not as fast as pure machine code). Astonishing achievement. But more modern stuff exists, like ZXBasic that you write in just about BASIC and compiles straight into machine code.

My path has been (so far) Sinclair BASIC, then Sinclair BASIC with machine code bits. There are some things you can do in BASIC but are just too slow. Other things just aren't possible. But a few bytes here and there can really elevate a game.

I've got a book which purports to take you from BASIC to machine code but apparently it is riddled with errors. Which is a shame, as it starts off with "Here is code that sets the INK and PAPER colour. Here's how to do that in BASIC and now in machine code"...
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
User avatar
uglifruit
Manic Miner
Posts: 707
Joined: Thu Jan 17, 2019 12:41 pm
Location: Leicester
Contact:

Re: Please advise a wannabe coder

Post by uglifruit »

Einar Saukas wrote: Sun Feb 12, 2023 1:01 am Frankly I don't recommend trying to develop your first game in Assembly if you have no experience in programming. Unless you are really REALLY motivated about learning Assembly...

And most of all, don't think you need to learn tons of stuff before you start developing games. Many simple games require very little knowledge, and attempting to create them will give you a lot more motivation to keep learning.
I very much agree with this.

I actually think BASIC is a great way to learn the concepts; variables, IF THEN constructs, input and output and some boolean logic. Fortunately things like these forums (or the Crap Games Contest) provide a place to help improve and move on to compiled/C based or assembly language should you wish.
CLEAR 23855
ImissSirClive
Drutt
Posts: 7
Joined: Sat Feb 11, 2023 12:19 pm

Re: Please advise a wannabe coder

Post by ImissSirClive »

Thanks for all the help, you're all very kind and helpful.

I have settled on using Boriel basic, struggling a little to set it up right now but I'm sure I'll have it working eventually.
Thanks!
Post Reply