Page 3 of 3

Re: The great MazezaM

Posted: Mon Mar 06, 2023 10:00 am
by @username@
OK - so I took a quick look at the code in various languages for MazezaM, and confess to complete confusion as to why levels are a concern.

MazezaM is a data driven puzzle game - where each level is defined with a very small set of data.

Here's the script for level 1 - Humble Origins, with the level data loader from the ZX BASIC program.

Code: Select all

#########
+ $  $  *
# $  $$ #
#########

@LOADMAZE: REM ** load mazes **
  RESTORE 2+@MAZEDATA +4*(mazeno-1)
  READ n$,c$,w,h,lx,rx
  FOR i = 1 TO h
    READ a$(i)
  NEXT i
  LET l=INT ((32-w)/2)
  LET t=INT ((24-h)/2)
  LET r=32-l-w
  RETURN
Let's break this down for non-developers. There are six variables and a single array which defines each level in data.

n$ is the level name, in this case "Humble Origins"
c$ is the author's name, which is just thrown away on ZX Spectrum, non-existent on other ports
w is the width of the play area, excluding bricks (# characters), in this case 7
h is the height of the play area, or number of active rows, in this case 2
lx is the row number on which the player enters from the left, in this case 1
rx is the row number on which the player exits to the right, in this case also 1
a$(1 ...n) is the array which holds the individual rows, here there are 2

The variables l,t and r just help with placement, for l is left side column count, r is right side column count, and t is rows above and below.

Here is the same data set as seen by C/CPP

Code: Select all

switch (mazenumber)
   {
   case 1:
		LevelName=(char *) "Humble Origins";w=7;h=2;
   		lx=1;rx=1;
		a[1]= (char *) " #  #  ";
		a[2]= (char *) " #  $& ";
		break;
	
    ...	
	
	case 42:
		LevelName= (char *) "The Beast";w=10;h=7;lx=1;rx=1;
		a[1]= (char *) " # $& #   ";
		a[2]= (char *) "# # $%& $&";
		a[3]= (char *) "  # # #   ";
		a[4]= (char *) " $& $& $%&";
		a[5]= (char *) "  # # # # ";
		a[6]= (char *) " $& # $%& ";
		a[7]= (char *) "  # $%& # ";
		break;
	}
This should demonstrate that levels are just a dataset - so whether you do 1 or 42 levels is dependent on how much you cut and paste!

From a programming standpoint, the source is a great introduction to data driven software. Once you have presentation and code logic functions in place, it's just throw more definitions at it to get more levels.

Please visit http://www.hirudov.com, which is Ventzislav Tzvetkov's collection of MazezaM ports with source code for each and make your own conclusion.

Re: The great MazezaM

Posted: Mon Mar 06, 2023 11:50 am
by Mobsie
Yes, this is exactly what i do. Is like all puzzle games, Puzznic, Color Buster are examples i like. Color Buster on Dos drive me crazy 30 years ago…

Re: The great MazezaM

Posted: Sun Jan 07, 2024 10:11 am
by @username@
While we wait for the improved graphics and levels of the upcoming MazezaM - here's the original in Super Spectrum vision :D

The challenge to me was how long to convert 125 lines of ZX BASIC to the creatiVision.

This is the original with 10 levels, although as it is data driven, it's as simple as convert another mzm level set and drop it in.

Enjoy!

Re: The great MazezaM

Posted: Sun Jan 07, 2024 2:44 pm
by Mobsie
I will not finish. I stopped all activities on Creativision

Re: The great MazezaM

Posted: Sat Jan 13, 2024 6:23 pm
by @username@
v2 - Has both original 10 level and updated 35 level mzms.

Re: The great MazezaM

Posted: Sun Jan 14, 2024 6:12 am
by MADrigal
Would you mind if I post the ROM on the CreatiVEmu website downloads page?

Re: The great MazezaM

Posted: Sun Jan 14, 2024 11:44 am
by @username@
Go ahead! - although remember it is pretty bare bones - just a Spectrum look and feel with beeps :)

The zip contains both ROMs (10 and 35 levels), dasm and original ZX Specturm BASIC source code.

Re: The great MazezaM

Posted: Sun Jan 14, 2024 12:36 pm
by MADrigal
Will do - thanks!