Programming Mah Jongg
Moderator: Moderators
Programming Mah Jongg
Last night I was wondering, if there was a Mah Jongg game like Atari's "Shanghai" for the VIC and if not, how to write one... I thought a little bit about it during the day and I guess, the main problem is the low resolution of the VIC:
The game consists of 42 different tiles, AFAIK. The classic game play has 8 rows, of which the longest one is 15 tiles at the start of the game, so one tile can have a max. of 11 pixels (max. X resolution of the VIC is 22*8=176px / 15 tiles = 11 px per tile) -- I know, there is the one or other trick to expand the X res. a little bit, but I don't know, how useful they are, so let's calculate with the "normal" limitations...
As the graphics on the tiles are pretty complex, it's not possible to put a tile in an 8*8 matrix, even 11*11 is very hard, not calculated the additional px I'd need for the 3D view of the tiles or using multi color, which would halve the X resolution
Assuming I write (or use an existing?) "hi"-res graphics solution (which means basically a routine, that allows to set and clear single dots in a matrix), I would need (without multicolor) 15 tiles * 11 px / 8 px per char = 21 chars in X and 11 chars in Y, which means 231 re-defined chars - is this possible? (Sorry, I can't remember the limitations). Okay, I could save the one or other char by cutting the hi-res matrix where no tiles are, but I definitely would need more than 128 chars... possible or not?
A scrolling playfield is not practicable, the player needs the overview of the whole figure. I think, *if* it is realisable at all, I'd have to simplify the tiles a lot... or do I think completely wrong and there is another solution for the "Mah Jongg problem"?
The game consists of 42 different tiles, AFAIK. The classic game play has 8 rows, of which the longest one is 15 tiles at the start of the game, so one tile can have a max. of 11 pixels (max. X resolution of the VIC is 22*8=176px / 15 tiles = 11 px per tile) -- I know, there is the one or other trick to expand the X res. a little bit, but I don't know, how useful they are, so let's calculate with the "normal" limitations...
As the graphics on the tiles are pretty complex, it's not possible to put a tile in an 8*8 matrix, even 11*11 is very hard, not calculated the additional px I'd need for the 3D view of the tiles or using multi color, which would halve the X resolution
Assuming I write (or use an existing?) "hi"-res graphics solution (which means basically a routine, that allows to set and clear single dots in a matrix), I would need (without multicolor) 15 tiles * 11 px / 8 px per char = 21 chars in X and 11 chars in Y, which means 231 re-defined chars - is this possible? (Sorry, I can't remember the limitations). Okay, I could save the one or other char by cutting the hi-res matrix where no tiles are, but I definitely would need more than 128 chars... possible or not?
A scrolling playfield is not practicable, the player needs the overview of the whole figure. I think, *if* it is realisable at all, I'd have to simplify the tiles a lot... or do I think completely wrong and there is another solution for the "Mah Jongg problem"?
Re: Programming Mah Jongg
I'm fond of atari 2600 solutions to complex games: simplify. Card games on that console didn't seem to suffer from a limited ability to depict actual playing cards or even suits.
Older generation games presume the player's imagination will pick up where technology leaves off. If this were my project, I would trust the 8x8 standard character size to be sufficient. Is the visual of actual Asian tiles important to you? I bet you could hint at it and have enough variation for each tile to be distinct in hires mode. Maybe music and colorful borders could help with atmosphere.
Sent from my iPhone using Tapatalk
Older generation games presume the player's imagination will pick up where technology leaves off. If this were my project, I would trust the 8x8 standard character size to be sufficient. Is the visual of actual Asian tiles important to you? I bet you could hint at it and have enough variation for each tile to be distinct in hires mode. Maybe music and colorful borders could help with atmosphere.
Sent from my iPhone using Tapatalk
Re: Programming Mah Jongg
I would suggest a 192 x 160 pixel layout with double height chars. This would be 24 chars in x-resolution and would still be visible on NTSC. You can set up the screen on PAL/NTSC with these commands, courtesy of Mike:
192 x 160 also fits nicely into RAM - use chars 16 to 255 (= 240 chars in double height = 30720 pixels = 192 x 160) to start screen-ram and char-ram both at $1000
With this setup you can have 15 tiles of 12 pixels wide each and you can make the tiles 20 pixels high which leads to nice square tiles because of the 5:3 PAL-pixel aspect ratio. Or go with 16 pixels high which might be easier to address and would look fine on PAL and NTSC - this would also leave 32 lines for status/score display.
Code: Select all
poke 36866,(peek(36866)and128)+24 ; display 24 columns
poke 36864,peek(60900)-2 ; 2x4 pixels to the left
poke 36867,21 ; 20 double-height chars
poke 36865,peek(60901)+6 ; 6x2 pixel down
With this setup you can have 15 tiles of 12 pixels wide each and you can make the tiles 20 pixels high which leads to nice square tiles because of the 5:3 PAL-pixel aspect ratio. Or go with 16 pixels high which might be easier to address and would look fine on PAL and NTSC - this would also leave 32 lines for status/score display.
- Mike
- Herr VC
- Posts: 4849
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Programming Mah Jongg
A tile size of 11 pixels width (including border) would also fit into a 160x192 bitmap (with 15x10+1 = 151 pixels width of the longest row, when you let adjacent borders overlap). That resolution also would have the big advantage, that there are already a plenty of tools around.Dusty wrote:The classic game play has 8 rows, of which the longest one is 15 tiles at the start of the game, so one tile can have a max. of 11 pixels (max. X resolution of the VIC is 22*8=176px / 15 tiles = 11 px per tile)
In any case, you'd need some way to select a tile - that method could include a zoomed view of the selected tile in one of the screen's corners, with more detail.As the graphics on the tiles are pretty complex, it's not possible to put a tile in an 8*8 matrix, even 11*11 is very hard, not calculated the additional px I'd need for the 3D view of the tiles or using multi color, which would halve the X resolution.
Sorry, but no. The VIC-20 can do better than that. Like thus:Jeff-20 wrote:If this were my project, I would trust the 8x8 standard character size to be sufficient. Is the visual of actual Asian tiles important to you? [...]
Re: Programming Mah Jongg
Wow, really impressive tiles - not my favourite game but great to see it starting on the Vic-20
Vic20-Ian
The best things in life are Vic-20
Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
The best things in life are Vic-20
Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
Re: Programming Mah Jongg
It's funny, I have just last week been playing Mahjong on a Sord M5. It's a very rare cartridge for Sord which I bought from Japan. I think the game is identical as this one for MSX though: http://www.generation-msx.nl/software/h ... lease/174/
It doesn't use the flowers and seasons tiles.
It doesn't use the flowers and seasons tiles.
- Mike
- Herr VC
- Posts: 4849
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Programming Mah Jongg
Just to reassure our Denial fellows (and especially Dusty) that there is active development on this project, a pre-alpha version of Mah Jongg could be spotted on a Retro-Meeting in Cologne yesterday:
It's already fully playable.
The full game will be released on Revision 2015.
It's already fully playable.
The full game will be released on Revision 2015.
- Mayhem
- High Bidder
- Posts: 3027
- Joined: Mon May 24, 2004 7:03 am
- Website: http://www.mayhem64.co.uk
- Location: London
Re: Programming Mah Jongg
Oooo, funky! What memory expansion does it use?
Lie with passion and be forever damned...
- Mike
- Herr VC
- Posts: 4849
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Programming Mah Jongg
The main game engine runs in +16K, but the full game most probably will require +24K or +32K.Mayhem wrote:Oooo, funky! What memory expansion does it use?
Re: Programming Mah Jongg
Looks really impressive.
This is exactly the type of thing I love to see for the VIC. Stuff that was beyond belief back in the 80s.
This is exactly the type of thing I love to see for the VIC. Stuff that was beyond belief back in the 80s.
- orion70
- VICtalian
- Posts: 4341
- Joined: Thu Feb 02, 2006 4:45 am
- Location: Piacenza, Italy
- Occupation: Biologist
Re: Programming Mah Jongg
Mike has been a precious guest here in Italy a while ago, and I had the opportunity to give this game a first look... well, I'm lucky enough to have my own copy on the FE3, and play it on a regular basis - it's not a good work Mike, it's a GREAT one.
He also explained me in person some programming tricks and the general path leading to the present version, and it was one of the most interesting times I've had with a VIC (and with a friend ) lately!
He also explained me in person some programming tricks and the general path leading to the present version, and it was one of the most interesting times I've had with a VIC (and with a friend ) lately!
Re: Programming Mah Jongg
I'm excited to see this one. It looks great.
Sent from my iPhone 6 Beta using Tapatalk
Sent from my iPhone 6 Beta using Tapatalk
Re: Programming Mah Jongg
Yes looks great! And if I had known that it takes the time it is about to take now, I surely had joined the development - but Revision 2014 was much too short for me. Better I keep my ideas next time?!