The great MazezaM

Talk about programming of homebrew games only.
User avatar
@username@
Posts: 335
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: The great MazezaM

Post by @username@ » Mon Mar 06, 2023 10:00 am

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.
User avatar
Mobsie
Posts: 717
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: The great MazezaM

Post by Mobsie » Mon Mar 06, 2023 11:50 am

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…
User avatar
@username@
Posts: 335
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: The great MazezaM

Post by @username@ » Sun Jan 07, 2024 10:11 am

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!
Last edited by @username@ on Sat Jan 13, 2024 6:23 pm, edited 1 time in total.
User avatar
Mobsie
Posts: 717
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: The great MazezaM

Post by Mobsie » Sun Jan 07, 2024 2:44 pm

I will not finish. I stopped all activities on Creativision
User avatar
@username@
Posts: 335
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: The great MazezaM

Post by @username@ » Sat Jan 13, 2024 6:23 pm

v2 - Has both original 10 level and updated 35 level mzms.
You do not have the required permissions to view the files attached to this post.
User avatar
MADrigal
Site Admin
Posts: 1270
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: The great MazezaM

Post by MADrigal » Sun Jan 14, 2024 6:12 am

Would you mind if I post the ROM on the CreatiVEmu website downloads page?
User avatar
@username@
Posts: 335
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: The great MazezaM

Post by @username@ » Sun Jan 14, 2024 11:44 am

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.
User avatar
MADrigal
Site Admin
Posts: 1270
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: The great MazezaM

Post by MADrigal » Sun Jan 14, 2024 12:36 pm

Will do - thanks!
Post Reply