News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Slide Panic - A BASIC slide puzzle game

Started by adamioan, 12:52, 20 December 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adamioan

This game runs in Amstrad CPC 6128 (or 464-664 with disc drive).
Programmed in Locomotive BASIC.
Graphics, design and programming by Adam Ioannides.
Sprite routines by Sean McManus (https://www.sean.co.uk/).
Music track "Pixelated Landscape" by Roald Strauss via IndieGameMusic (https://www.indiegamemusic.com/).



Disk contents
-------------
For adding, editing and change properties of files I used ManageDsk utility (https://www.cpcwiki.eu/index.php/ManageDsk).
There are two disks in the project. One is the release (only mandatory files included, all files are hidden except SLIDE.BAS, no break functionality) and the other is the development which contains:
7375.AKG - Music file exported by Arkos Tracker 2.
COND.MC - Assembled condensed font library.
CONGRATS.BAS - Congratulations screen.
CORE.DAT - Joined resources of font, music player and music.
LEVEL.BAS - Level screen.
LEVEL[1-8].SPR - Level sprite.
LOADER.SCR - Splash image.
MAKECORE.BAS - for creating the joined assembled binaries.
MENU.BAS - Menu screen.
MENULOGO.SPR - Menu logo sprite.
MUS.BAS - Music test.
SCORES.DAT - Saved hi-scores table.
SLIDE.BAS - Game startup splash screen.
SLIDEALL.BAS - Entire game in single BAS file (with memory issues).
UAKG6B19.BIN - Music player binary compiled in #6B129 memory address.
WC.SPR - Congratulations screen sprite.

Graphics
--------
Graphics are made using Photoshop as an editor and compiled to sprites using ConvImgCPC (https://demoniak-contrib.forumgaming.fr/).
Some of them are compiled using my single page sprite creation HTML page (https://bitbucket.org/adamioan/amstrad-programming/src/master/Plain%20Basic/Sprite%20creator/sprite_from_image.html).

Music
-----
Music was made by compiling track "Pixelated Landscape" by Roald Strauss in Arkos Tracker 2 (https://www.julien-nevo.com/arkostracker/).
Track was exported as AKG file in #7375 address.
For music player I used PlayerAkg. Player is compiled to binary using Rasm tool (https://www.cpcwiki.eu/index.php/RASM).
In order to have it fit in memory I had to compile it to address #6B19 using song configurations.
Below is the complete process to compile track and player.

Music file preparation
----------------------
Open music file in Arkos Tracker 2.
Export as generic AKG.
Check subsong 1 and psg 1
Uncheck "Export to several files"
Check "Generate configuration file"
Uncheck "Export used samples"
Check "Export as binary file z80"
Set encode to address the memory point to be stored in your program
Name the file with 8 letters max (without extension)
Click OK
Open ManageDsk utility and load your disk
Click "Add files" and select your file
Set BINARY file and set "Start address" the memory point you set earlier and "Entry point" the same
Click "Validate"
Click "Save DSK"

Player binary preparation
-------------------------
Copy utility RASM to your project directory. (https://github.com/EdouardBERGE/rasm/releases/tag/v2.1.4)
Copy BasicInterruptions_CPC.asm from Arkos Tracker 2 players (C:\Users\Adam\Downloads\Amstrad CPC\Tools\Arkos Tracker 2\players\playerAkg\sources\tester\BasicInterruptions_CPC.asm) and rename it to player.asm
Open player.asm file with notepad and search for 'org #' (line 41)
Set the memory point in hex to be stored in your program
After org command paste the songs configuration WITHOUT PLY_CFG_NoSoftNoHard.
Go to end of file and look for 'include "../PlayerAkg.asm"' (line 226). Change it to 'include "PlayerAkg.asm"'
Save file
Copy PlayerAkg.asm from Arkos Tracker 2 players to your project directory (C:\Users\Adam\Downloads\Amstrad CPC\Tools\Arkos Tracker 2\players\playerAkg\sources\PlayerAkg.asm)
Copy PlayerAkg_SoundEffects.asm from Arkos Tracker 2 players to your project directory (C:\Users\Adam\Downloads\Amstrad CPC\Tools\Arkos Tracker 2\players\playerAkg\sources\PlayerAkg_SoundEffects.asm)
Open command line in your project directory and type "rasm player.asm -o player -s -sl -sq"
This will export two files player.bin and player.sym
If there is any error, check includes in asm files
Open ManageDsk utility and load your disk
Click "Add files" and select player.bin
Set BINARY file and set "Start address" the memory point you set earlier and "Entry point" the same
Click "Validate"
Click "Save DSK"

Test music
----------
After creating music file (let's say music.akg) and player binary file (player.bin) and imported then in your disk using ManageDsk utility, close ManageDsk and open WinApe and load your disk
Type the following to test
10 MEMORY 29999
20 player=[MEMORY HEX VALUE OF PLAYER]: ' Example &6d61 - Warning: AKG player size is 3613 bytes. Max address &9500
30 music=[MEMORY HEX VALUE OF MUSIC]: ' Example &7b7e - Beware of overlaps with player
40 LOAD"player.bin",player
50 LOAD"music.akg",music: ' Set your music filename
60 CALL player,music,0: ' Start playing
70 ' To stop playing CALL player+3
More info: https://www.julien-nevo.com/arkostracker/index.php/using-interruption-player-with-cpc-basic/

Fonts
-----
Application is using MODE 0 to run (except the congratulations screen), so it was essentially to use a condensed font.
Because of the tight memory limits, I chose not to create my own font set (using SYMBOL command).
Therefore I embedded an assembled condensed font library of Heft Schneider Magazin (https://www.cpc-power.com/index.php?page=detail&num=16456).
This library can be used both in MODE 0 and 1, and supports printing in screen graphical location using TAG.

Memory
------
As we all know, CPC memory is really tight, so I have tested a lot of workarounds to prevent MEMORY FULL error.
Firstly I created a mini program MAKECORE.BAS to join core routines in memory. So this loaded font, sprite print, sprite grab, music player and music assembled data in one file name CORE.DAT.
Keeping memory addresses for each routine helped me to save some bytes later.
So memstart=24999, memfont=25000, memsprite=26088, memspritegrab=26142, memblackh=26201, memblackv=26401, memboxnumbers=26617, memmp=27417, memmusic=29557, memlogo=35332, memlevel=35332.
Lastly three memory addresses was used to store user current state. These were keys=24995, music=24996 and level=24997.
The final formula was to load in memory all the basic stuff that are being used in all over the game, such as font, music, player, and split game components in separated BAS files.
I don't know is this method is optimal, but doing that, I had no memory errors.
So I split the game in four components.
Splash screen (SLIDE.BAS)
Menu (MENU.BAS)
Level (LEVEL.BAS)
Congratulations screen (CONGRATS.BAS)
Each screen saves user choices of keys, level and music in the appropriate address, so the next component will be able to restore them.
Splash screen loads the splash in screen memory (#C000) and also loads the CORE.DAT in order to be available in any other component.
Menu screen loads game logo sprite in memlogo address and also the SCORES.DAT.
Level screen reads level value of 24997 memory address and loads the appropriate level sprite LEVELx.SPR.


SpDizzy

Congratulations, looks an outstanding basic game. Need to try it back home. Also very well docummented thread and develepoment info

Powered by SMFPacks Menu Editor Mod