Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - [Coding Competition 2022] Tetris4GG by armixer24

Reply to topic

Rate this entry!

1 (Terrible) 0% 0%
2 0% 0%
3 0% 0%
4 0% 0%
5 0% 0%
6 0% 0%
7 13% 13%
8 39% 39%
9 21% 21%
10 (Excellent) 26% 26%
This poll has expired.
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
[Coding Competition 2022] Tetris4GG by armixer24
Post Posted: Sun Mar 13, 2022 10:02 pm
https://www.smspower.org/Homebrew/Tetris4GG-GG

Quote
This is Tetris4GG, my first Sega 8-bit Homebrew project.

This is my tribute/homage to both the Game Boy Tetris and the Sega Game Gear, with a bit of Columns sprinkled on it!

In this version, you can only play the Type A mode. Try to score the highest amount of points!

All music present in the game was covered by me.

The only major adjustment I voluntarily made to the gameplay is allowing to move the shapes sideways faster than on the original game. This was always a source of Game Overs for me, so I essentially made things easier for myself!

This project taught me a lot about Sega SMS and GG homebrew development, including some mistakes that could require quite a big rework... Later, because I am doing this for fun :)
But I am genuinely quite happy with the result, I never thought I would be able to get this far with a homebrew project!

I hope you enjoy the game!

~ Armix (armixer24 on the SMSPower forums)


Special thanks:

- sverx for providing devKitSMS and PSGLib. Z80 ASM (or really any ASM) is really out of my comfort zone and I find it amazing that the barrier of entry into Sega was lowered thanks to this C development kit. Thanks a lot! :)
- Maxim for providing BMP2Tile and that VGM Player program who made me wonder about homebrew development on Master System and Game Gear!
- Calindro for PSGTool and Emulicious, the debugger of that emulator is amazing for 8-bit sega homebrew development. I don't think I would not have gone very far debugging things, if I didn't have these tools to help me understand the effects of what I was doing!
- The SMSPower forums and wiki, all useful source of info!
- All contributors to the above projects.
- My brother Vivien, for generally being an enabler in my Sega-filled nonsense, and for play testing a quick and dirty SMS version of the game on real hardware a few months ago. :)
- My fiancee Hannah, for doing the first major play test session and really helping out with her feedback. Love you! <3




[Youtube video is missing some audio due to a spurious copyright claim on Korobeiniki...]
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 436
Reply with quote
Post Posted: Sun Mar 27, 2022 10:08 pm
Nice Musics!!!! More tracks, please (SMS version, please!).
  View user's profile Send private message
  • Joined: 07 Mar 2021
  • Posts: 62
Reply with quote
Post Posted: Mon Mar 28, 2022 9:00 am
This homebrew will become a must have on game gear.

Congratulation armixer24 !

It looks as addictive as the original you will have to provide a bundle with the AC adapter or with a mountain of batteries :)
  View user's profile Send private message
  • Joined: 06 Mar 2022
  • Posts: 670
  • Location: London, UK
Reply with quote
Post Posted: Mon Mar 28, 2022 10:04 pm
Ah, this takes me back!

You've totally nailed the music - it's what really makes the game imo.

Also, love the detail of the pause screen jingle!!
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 436
Reply with quote
Post Posted: Tue Mar 29, 2022 9:03 am
Well, the level counter reaches to 9 and not advance. It stay in level 9 yet that i pass some times.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Tue Mar 29, 2022 3:57 pm
I'm enjoying it as a modern retro retro experience. The gameplay is a little bit off - I'm not sure what it is, maybe the lock time is too short - so it takes a bit of getting used to, but I'm enjoying the experience, especially the Korobeiniki arrangement which is spot on.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 877
Reply with quote
Post Posted: Wed Mar 30, 2022 12:11 pm
A good and very playable version. The music is brilliantly adapted.
  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Wed Mar 30, 2022 9:03 pm
Hi everyone, here is a minor patch version of the game.

Two changes:
- A new high score is now saved in SRAM upon entering the high score screen, so that it can be loaded upon startup of the game. Now you can compete against yourself from the past!
- Fixed a bug where a frame-perfect rotation just before a piece locked in on the surface could cause said piece to be suspended in mid-air. (Thanks Maxim for the bug report!)


While on the topic of versions, be aware that a Master System version is planned in the near future!
My first goal is to wrap up the game in its Game Gear incarnation first, so that I only have to do the changes for Master System once.

Otherwise, it has been really nice to see the reactions for that project :) thanks a lot for the feedback !

  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Wed Mar 30, 2022 9:10 pm
segarule wrote
Well, the level counter reaches to 9 and not advance. It stay in level 9 yet that i pass some times.

There is no higher level than level 9, however I did notice that the "level up" jingle keeps playing each 10 lines... I may remove that quirk later, not sure (I kinda like it that way haha).
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Wed Mar 30, 2022 10:39 pm
The original would keep going up to level 20, see the table at https://harddrop.com/wiki/Tetris_(Game_Boy) . For some of us, level 10 is not challenging enough (and we wait for bad RNG or mistakes to end the game).
  View user's profile Send private message Visit poster's website
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Wed Mar 30, 2022 11:18 pm
Maxim wrote
The original would keep going up to level 20, see the table at https://harddrop.com/wiki/Tetris_(Game_Boy) . For some of us, level 10 is not challenging enough (and we wait for bad RNG or mistakes to end the game).

Wait no way, I always thought level 10 and more were unlocked with a cheat code at start up! I suppose I never got gud enough to unlock it legitimately haha

Watch this space I suppose... :P
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Thu Mar 31, 2022 7:12 am
Last edited by Maxim on Fri Apr 01, 2022 6:35 am; edited 1 time in total
No, the “heart” levels were a way to start at the higher speeds but I think they did not give you that level’s score table so I always played at level 10 to maximise the score.
  View user's profile Send private message Visit poster's website
  • Joined: 12 Oct 2015
  • Posts: 194
  • Location: Ireland
Reply with quote
Well done
Post Posted: Thu Mar 31, 2022 8:47 pm
Nice rival to the [color?] GameBoy classic - very authentic port of Tetris... well done! Just quick Q: is it me or is it the pause button needed to be pressed to progress the intro screens? Not a major but fire1 / fire2 don't seem to respond there? Also, I'm not Tetris expert but I thought up / down could rotate the pieces[?] - I constantly keep pushing those buttons! Again nice work all the same...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Fri Apr 01, 2022 4:05 pm
I'm not a big Tetris or Columns player, but surely I can appreciate the work on this Game Gear port. I think it plays well and is very true to the original (I only know the Game Boy version). Nice work on the controls, the graphics, and of course the iconic soundtrack.
  View user's profile Send private message Visit poster's website
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Fri Apr 01, 2022 5:15 pm
SteveProXNA wrote
quick Q: is it me or is it the pause button needed to be pressed to progress the intro screens? Not a major but fire1 / fire2 don't seem to respond there?

The text screen has a long timer to allow the person to read it, but automatically skips after a while.
I did not use 1/2 to skip the intro, because on Game Gear, there is a "Start" button that is much easier to reach than the pause button on a Master System. A lot of Game Gear games use that button to start games, so I thought it made sense to use it here.

However, when I eventually do the Master System port, I will use the 1 button to achieve that instead, since there is a "start" label above that button on the Master System controller itself!

SteveProXNA wrote
Also, I'm not Tetris expert but I thought up / down could rotate the pieces[?] - I constantly keep pushing those buttons! Again nice work all the same...

On the original game boy game, Down speeds up the descent of the pieces, while Up goes unused. A rotates the pieces in one direction, and B in another, so I simply moved the buttons to the equivalent spaces on the Game Gear! Out of curiosity, what input device were you using to play the game?
  View user's profile Send private message
  • Joined: 05 Sep 2021
  • Posts: 57
Reply with quote
Post Posted: Fri Apr 01, 2022 9:11 pm
Hi

I love puzzle games and tetris. (I've done a special version on amiga some years ago)

This version is very well done and I have had fun to play with

gg

  View user's profile Send private message
  • Joined: 25 Jul 2007
  • Posts: 729
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sat Apr 02, 2022 1:00 pm
Ha.. you beat me to it, but I'm glad you did, it's such a good port.

You really nailed the music, which is arguably the most important aspect of the game.

Maybe I misremember but I thought the level up/difficulty increased quicker in the GB version.
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Sat Apr 02, 2022 1:40 pm
Being a Tetris fan, I finally found the time to try this... and it's great! I was about to record a video of it, but I see that a new revision with all the levels is upcoming, so I'll wait for that.

Maxim wrote
[Youtube video is missing some audio due to a spurious copyright claim on Korobeiniki...]
Yeah, there are many scammers on Youtube who try to pull bogus copyright claims on Tetris music, which is why I don't use the "Type A" music anymore in my videos. Who is the claimer, if I can ask? If it's "Dig Dis", they usually let go if you file a dispute, but if it's "The Orchard Music", you can forget about it. If it's someone else, you can try to file a dispute anyway, the first one on any given video is free and you don't risk a strike even if they reject it.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Mar 2015
  • Posts: 228
Reply with quote
Post Posted: Sat Apr 02, 2022 4:35 pm
I had a great time with this game, I found the bug where the pieces can't rotate as long as they are next one of the walls.
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sat Apr 02, 2022 4:41 pm
FeRcHuLeS wrote
this game never going to happen to SMS due to the chains of the N company.


... Maybe a gradius? :o
  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Sat Apr 02, 2022 6:31 pm
FeRcHuLeS wrote
I had a great time with this game, I found the bug where the pieces can't rotate as long as they are next one of the walls.

The rotation rules are almost the same as the original GB game. As a consequence in some case, rotation will not happen when the piece is against the wall.
  View user's profile Send private message
  • Joined: 12 Oct 2015
  • Posts: 194
  • Location: Ireland
Reply with quote
Post Posted: Sat Apr 02, 2022 6:34 pm
armixer24 wrote
On the original game boy game, Down speeds up the descent of the pieces, while Up goes unused. A rotates the pieces in one direction, and B in another, so I simply moved the buttons to the equivalent spaces on the Game Gear! Out of curiosity, what input device were you using to play the game?

Thanks armixer24 - of course as soon as I read that I remembered that Down speeds up the descent of the pieces... makes sense that buttons rotate the pieces which would feel natural on a real device... I was playing this on Emulicious BTW
  View user's profile Send private message Visit poster's website
  • Joined: 22 Mar 2015
  • Posts: 228
Reply with quote
Post Posted: Sat Apr 02, 2022 7:15 pm
eruiz00 wrote
FeRcHuLeS wrote
this game never going to happen to SMS due to the chains of the N company.


... Maybe a gradius? :o


Hahaha, this is from another thread anyways Green Beret and Tetris available for Sega systems Bravo!

armixer24 wrote
The rotation rules are almost the same as the original GB game. As a consequence in some case, rotation will not happen when the piece is against the wall.


Oh never tried the GB version of the game got me confused and how about a game mode in which pieces rotation next to walls is working, this mode can be called Game Gear does! ;-) ;-) thanks
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Great game!
Post Posted: Sat Apr 02, 2022 8:27 pm
Hey!

Very very very good tetris implementation. Most playable than most of the trash you can download on the play store. Maybe too slow the line removal procedure, but great playability.

The music sounds great, being a very good arrange of the original, and, even, it make me remember my old gamegear sounds (yep, i did not had a master, i had a gamegear). Nice thing to present an (almost forgotten) gamegear game!

Well done, congrats!
  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Tetris4GG 0.9
Post Posted: Sat Apr 02, 2022 10:56 pm
Hi everyone, here is another minor patch version of the game.

Changes included:
- The game now goes up to level 20 (although I've not been able to reach it myself, because I found out I actually sucked at Tetris... how in the world does anyone actually beat level 15 and up, though ???)
- As part of reworking the levels, I have also reworked the fall timings. Falling is mostly 1 frame slower than before, but the time between a piece locking in and a new one falling is shorter than before. It "mostly sinced" with the GB version, so this is good enough...
- Levels are now given according to the total number of lines, instead of every 10 lines.

If there is no bug reported, this version should last longer than 0.8, because I ended up giving myself quite a long to-do list for version 1.0...

More stuff is coming soon, but will most likely end up releasing after the competition :)

  View user's profile Send private message
  • Joined: 23 Jan 2010
  • Posts: 436
Reply with quote
Post Posted: Sat Apr 02, 2022 11:28 pm
armixer24 wrote
Hi everyone, here is another minor patch version of the game.

Changes included:
- The game now goes up to level 20 (although I've not been able to reach it myself, because I found out I actually sucked at Tetris... how in the world does anyone actually beat level 15 and up, though ???)
- As part of reworking the levels, I have also reworked the fall timings. Falling is mostly 1 frame slower than before, but the time between a piece locking in and a new one falling is shorter than before. It "mostly sinced" with the GB version, so this is good enough...
- Levels are now given according to the total number of lines, instead of every 10 lines.

If there is no bug reported, this version should last longer than 0.8, because I ended up giving myself quite a long to-do list for version 1.0...

More stuff is coming soon, but will most likely end up releasing after the competition :)

Wow! Super fast.
Dont judge me harsh but i loved a T piece. The T piece seems to me more bright and others pieces seems more "plain". Sprites in others pieces seems more draft and T piece seems more deep in color. This can be an imagination mine.
  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Sun Apr 03, 2022 12:21 am
Ah, I understand what you mean. The colour choice has been a bit of a difficulty for me.

I am trying to find a palette that looks good on both my Game Gear screen
(which makes everything clearer) and my computer screen (which makes everything deeper). It also needs to fit inside the Master System's more limited palette, rather than use the Game Gear colours.

Trying to rework the palette is in my to-do list anyway, so that might change in the future! Thank you for your feedback :)
  View user's profile Send private message
  • Joined: 23 Jan 2010
  • Posts: 436
Reply with quote
Post Posted: Sun Apr 03, 2022 8:51 pm
Quote
It also needs to fit inside the Master System's more limited palette, rather than use the Game Gear colours.

?? So, it work with SMS too?
  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Sun Apr 03, 2022 10:17 pm
Not yet, but I plan on doing a very quick port to the SMS when I am done with the Game gear version, so I have to keep the colour palette compatible with both.
  View user's profile Send private message
  • Joined: 23 Jan 2010
  • Posts: 436
Reply with quote
Post Posted: Sun Apr 03, 2022 10:31 pm
armixer24 wrote
Not yet, but I plan on doing a very quick port to the SMS when I am done with the Game gear version, so I have to keep the colour palette compatible with both.

Ah! Understood now. When the competition are over i will ask you one thing.
  View user's profile Send private message
  • Joined: 18 Mar 2019
  • Posts: 35
  • Location: Brighton, UK
Reply with quote
Post Posted: Mon Apr 04, 2022 8:07 am
This is awesome,

I actually made a label for a GG Tetris a few years ago when i thought of making a Super Tetris Cart from the terrible bootleg.

Please tell me you're going to implement game B as lvl 9 high 5 is my jam.

  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Mon Apr 04, 2022 11:20 am
armixer24 wrote
It also needs to fit inside the Master System's more limited palette, rather than use the Game Gear colours.
Let me politely disagree with this, nothing prevents you from using a better palette for the Game Gear version. I know, you mentioned that you want the Master System conversion to be a quick project, but changing a dozen or so of hex values sure isn't going to take that much time? The two versions don't need to look exactly the same (and they won't, because of the screen size to begin with), several official titles had palette (if not outright art) differences between the two systems. So my opinion (if I get to vote) is go for it.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Apr 04, 2022 1:16 pm
I agree it would be a pity to use the SMS colors on the GG. The SMS port can have (slightly) different colors and it will be fine.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Tue Apr 05, 2022 2:41 pm

So, Itried to play thisa bit more now that revision0.9 is out, andI have toask, what have youdoneto the RNG?



I played fora while, but Ieventuallygaveup.



Inany case, here isa video.



Don'tmisread me, I stillthink this isgreat, but... theRNG is wayoff from theGame Boy version.


Image1.png (120 B)
Image1.png

  View user's profile Send private message Visit poster's website
  • Joined: 12 Aug 2021
  • Posts: 73
Reply with quote
Post Posted: Tue Apr 05, 2022 3:10 pm
Oh my, that IS a terrible seed bwahahaha!

Well, to your defence, I'll admit the RNG code is very basic.
There is no piece rejection code in there, so you may get the same piece "quite a few times" in a row... :D

I want to try to rework the RNG code for the next version to at least mitigate that issue.
Also, when the game starts, I initially calculate a 256-piece-long list of "next pieces", and loop through them to reduce processing time while the game is playing. I may scrap that list or make it much longer, to avoid being stuck in a loop of terrible pieces like in your video.
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Tue Apr 05, 2022 3:32 pm
I thought that that might be the case, maybe you should just use the r register instead of a list, sometimes the simplest solutions are also the best.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Apr 05, 2022 3:34 pm
depending on if you want to ensure that a piece is not the same too many times in a row or if you just want to make it very hard to happen you might approach the problem in different ways

for instance a LUT of 256 values from 0 to 6 telling you which kind of piece pick next (based on offset from current piece type) if the 0 appears only once it will make it quite hard to repeat the same piece

if you want to make sure each piece gets picked a certain number of times at least over, say, 100 pieces, you could create a sequence of pieces beforehand and 'mix' them, but this might anyway cause some same pieces falling in a row of course...

so you see, it all depends on what you need to achieve (and Tetris experts will likely suggest how the 'official' game does its logic, but you might decide to go your route anyway surely!)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Tue Apr 05, 2022 3:54 pm
256 is way too short a sequence, especially if you’re not further randomising the way you use it. RNG should be fast enough to do as you need it.

Tetris.wiki covers a lot of options; the modern shuffled bag approach is however quite bad and I’d recommend not to use it.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Apr 05, 2022 4:53 pm
Maxim wrote
256 is way too short a sequence, especially if you’re not further randomising the way you use it. RNG should be fast enough to do as you need it.


sorry, I didn't explain it very well. The idea is that you would get a random entry from a 256 values LUT where only one entry had 0, thus forcing a different next piece 255 times over 256 on average... still you would get some same piece sequence quite rarely.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Tue Apr 05, 2022 6:14 pm
Hmm, that seems like much too high a ratio. Personally I think you want to see two the same in a row sometimes, but you don’t want to see as many in a row as true RNG could give. You might also not want to have SOSOSO… for example. The official random generator (sequences of shuffled “bags of pieces”) guarantees maximum “drought” lengths and lack of repetition of more than two in a row.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 64
  • Location: New Zealand
Reply with quote
Post Posted: Tue Apr 05, 2022 11:10 pm
Well done, this is a really well-done conversion to the Game Gear!

As far as random generators go, I've read a little about these before.

A lot of Tetris implementations use a 'bag' algorithm.

A bag of seven tetrominoes is generated (one of each type), this could be implemented as a simple array of 7 bytes. This bag is shuffled.

Once the shuffled bag has been generated, the seven pieces are given to the player one at a time. When the bag becomes empty, a new bag is generated.

This means that at most you'll only get two of the same piece in a row. It also means that there will be an even distribution of all seven types of pieces, you won't get too many of one type or too few of another.

Source:
https://tetris.fandom.com/wiki/Random_Generator
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Apr 06, 2022 12:09 pm
if you want to have a fixed amount of any piece in a run, you do like you would do when shuffling a deck.

note that this specific deck could have any number of cards, and some could be even more frequent than others

so for instance if you want to allow for up to 4 maximum of same pieces in a row you can have a 14 piece deck with each piece appearing twice - in the 'worst' case scenario the last two of one shuffle and the first two of the next will be the same piece, but you'll anyway have exactly 2 of each piece in each 14-pieces run, which might be quite close to look random enough but not being random at all...
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 877
Reply with quote
Post Posted: Thu Apr 07, 2022 5:32 am
You've probably seen this already, but here's a video that sheds some light on how the Gameboy version does it.

https://youtu.be/woK34TIdGzc
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!