MEGATRIS JAMMA

Use this forum to share and discuss Uzebox games and demos.
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

MEGATRIS JAMMA

Post by mapes »

I re-ported MEGATRIS for the Uzebox JAMMA. For best play it should be tried out in a cabinet. Otherwise you can try it on a standard Uzebox, but you need to use both controllers and be familiar with the Uzebox Jamma button mapping.

(coin 1 = P2_SL), (coin 2 = P2_SL)

Also, a 2 player game is P1_SELECT

If this was not revision of the current Megatris, I'd enter it into the 2014 competion because I'm rather pleased with how it turned out. :mrgreen:

Features include:

Still 1 or 2 player
saveable hi Score to EEPROM
coin detection. 1 coin/1 credit
some optimization to the flow of the game (in my opinion) to make it more arcade friendly and more difficult as an arcade game.
You can soft reset the system pressing the 'test' button.
If you hold the 'service' button when it turns on, the hi scores will be reset.

Please post any bugs you find, particularly on the JAMMA version.

-Mapes
Attachments
arc_mega.uze
(58.53 KiB) Downloaded 478 times
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: MEGATRIS JAMMA

Post by D3thAdd3r »

Nice additions and streamlining for the arcade port. I like to see stuff is getting ported to JAMMA version and this seems right at home now. Now I just have to get a bigger place so I have room for an arcade cabinet(and the 100 other classic computers I want) and get the authentic experience.

Has anyone taken a look at how big a project adding tetris AI would be? I recall seeing some algorithms that supposedly played well, and were shockingly simple for the claims made.
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: MEGATRIS JAMMA

Post by mapes »

I have finished the MegaTris JAMMA version (as far as I can tell, all the bugs are gone).

If you find some bugs, let me know. I'll be using this arcade machine and game for a charitable fund raising activity at my work.

After extensive testing with some friends for a best all around arcade feel for duration of play and difficulty, I recommend the following settings which can be set when you enter configuration mode (should be the SET button, the other is a reset button).

2 credits for P1,
0 credits for P2 (which means 2 credits for a 1 or 2 P game) P2 credits and the number of credits ABOVE a 1P game required to play a 2P game.

Ghost block on
P.level 24-25 (Starting speed/level) (Start at Level 5)
Lines/Level = 5 (Number of lines to eliminate to move to the next level)
lines=level no (Lines start at 0)

Since Lines=level is no, 30 lines must be scored before the level goes to 6. If lines=level is yes, the starting line would be 25, and after 5 lines, the level would be 6.

My highest score is 12200.

-Mapes
Attachments
arc_mega.uze
(60.37 KiB) Downloaded 466 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MEGATRIS JAMMA

Post by uze6666 »

Great new Mapes! I'll give it a spin if it works on a regular Uzebox. Can you post the sources when you are done? Is the code a lot different than the regular Megatris?
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: MEGATRIS JAMMA

Post by mapes »

I optimized the code a lot and removed certain functions that I found were not needed.

I commented sections of the code to compare with the standard megatris code, but there is a lot of new code I had to write.

There is some level of optimization that could still be accomplished. Occasionally I'll hear an audio glitch, but it goes away when a new block is landed.

Use the player one SL and SR buttons to reset and to go into the menu options for your standard Uzebox.

Also, I seem to never accomplish a T-Spin, whats the trick to pull this off?

-Mapes
Attachments
Arcade MegaTris.zip
(493.04 KiB) Downloaded 444 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MEGATRIS JAMMA

Post by uze6666 »

Thanks for posting the sources, I'll probably add them with the other demos in SVN unless you already have them on GoogleCode, Github, etc.

I played with it last night, very well done. :)
Also, I seem to never accomplish a T-Spin, whats the trick to pull this off?
It implements the "SRS" system. Check out this wiki page for how to do it: http://harddrop.com/wiki/T-Spin_Guide

High score: 24200!
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: MEGATRIS JAMMA

Post by mapes »

uze6666 wrote:Thanks for posting the sources, I'll probably add them with the other demos in SVN unless you already have them on GoogleCode, Github, etc.
You can add them to the SVN. I have not posted them anywhere else.
uze6666 wrote:High score: 24200!
If you got this high score with the settings I recommended, I bow to your megatris excellence since that is 7 or 8 back to back tetrises before it gets WAY to fast for me. 8-)

The nice thing about the arcade version is the option to set the initial speed and lines per level before the difficulty increases, it gives the arcade owner a flexibility for the length of game play.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MEGATRIS JAMMA

Post by uze6666 »

mapes wrote:
uze6666 wrote:Thanks for posting the sources, I'll probably add them with the other demos in SVN unless you already have them on GoogleCode, Github, etc.
You can add them to the SVN. I have not posted them anywhere else.
uze6666 wrote:High score: 24200!
If you got this high score with the settings I recommended, I bow to your megatris excellence since that is 7 or 8 back to back tetrises before it gets WAY to fast for me. 8-)

The nice thing about the arcade version is the option to set the initial speed and lines per level before the difficulty increases, it gives the arcade owner a flexibility for the length of game play.
I used the default settings with the ghost block on, and yep I got 8-9 back to back tetrises to get there :D . Thinking about it, if not already done, why not put a 15% penalty on point for using ghost block?

There's those noise glitches I'm wondering why they are there, I'll look at the patches perhaps something to do with that. Another thing I noticed is that it starts accelerating perhaps a bit too fats near the end. I do a tetris and then speed almost doubles! I'd go for a more linear increment to play a bit longer. Also is it possible you disabled the possibility to move the block for a short while when it hits the bottom?

New High score: 27000! 8-)
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: MEGATRIS JAMMA

Post by mapes »

uze6666 wrote: I used the default settings with the ghost block on, and yep I got 8-9 back to back tetrises to get there :D . Thinking about it, if not already done, why not put a 15% penalty on point for using ghost block?
Mainly because the ghost block is an option the arcade cabinet owner can turn on and off, not something the player is allowed to do.
uze6666 wrote: There's those noise glitches I'm wondering why they are there, I'll look at the patches perhaps something to do with that.
I'm suspecting that the RAM is maxed out. When you play the standard Megatris the game can crash when you get a game over. I did some sleuthing and found that when the final play song is executed so deep into a function, the RAM gets trashed and the system resets. This is why I moved the game over routine out of the standard loop. I just set a gameover flag to break from the game.
uze6666 wrote: Another thing I noticed is that it starts accelerating perhaps a bit too fats near the end. I do a tetris and then speed almost doubles! I'd go for a more linear increment to play a bit longer. Also is it possible you disabled the possibility to move the block for a short while when it hits the bottom?
I'm not sure I can fix the accelerating pieces. I thought this was part of the limitations of the game i.e, the speed increases the number of frames between dropping the piece. This happens when the level reaches 28 or 29.

The code that increases the speed is:

Code: Select all

if(fields[f].lines > fields[f].nextLevel){
     //increase speed
     if(fields[f].gravity>0){
          fields[f].gravity--;
     }
     fields[f].level+=1;
     fields[f].nextLevel+=linesPerLevel;
}
The code that brings the pieces down is:

Code: Select all

bool processGravity(void){


	//check lock delay
	if(fields[f].locking){
//		fields[f].currLockDelay++;
//		if(fields[f].currLockDelay>LOCK_DELAY){ These changes set block when it lands
			fields[f].locking=false;
			fields[f].currLockDelay=0;
			fields[f].currGravity=0;

			//lockBlock();
			//processGarbage();
			//issueNewBlock(NEW_BLOCK);
			return true;
//		}
	}else{

		fields[f].currGravity++;
		if(fields[f].currGravity>=fields[f].gravity){
			fields[f].currGravity=0;
			//attemp to move block down
			if(moveBlock(fields[f].currBlockX,fields[f].currBlockY+1)){

			}else{
				fields[f].locking=true;
			}
		}
	}
	return false;
}
You can see I commented out sections of the code. Primarily because the QUICKLY dropping pieces can be rotated non-stop without the block locking into place. This might be why I could never pull off a T-spin.

So you can get an idea of what I am trying to prevent, play regular megatris with a high starting level, if you keep pressing A or B and rotating the block, you can keep the block from locking for a LONG time... Something I thought was very undesirable for an Arcade game.

-Mapes
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: MEGATRIS JAMMA

Post by D3thAdd3r »

mapes wrote:I'm not sure I can fix the accelerating pieces. I thought this was part of the limitations of the game i.e, the speed increases the number of frames between dropping the piece.
I wonder if there is time to run 2 game ticks per video frame? If you update the gamepad twice per frame and run logic twice as well you not only gain quicker response feel, but you could easily have sub frame movement ticks. Otherwise if I am remembering the code right, I would say use bigger numbers and subtract an odd number or & 0b10, that way a piece could fall 1 frame, not fall the next, then fall the next 2 frames(on average that would be falling faster than every other but slower then every frame)...so there would be speeds in between basically. Don't know if that made sense I'm pretty tired but I think the old megabomber code shows that and it works well and easy to implement.
Post Reply