You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
Frustration --- "Virtual Lab"
Posted on: 2013/3/12 22:58
Nintendoid!
Joined 2013/1/22
USA
198 Posts
Long Time User (6 Years)
So you're supposed to drop "tiles" (organs?) and create a closed system. Once you do, "Tetris-like" your whole closed system explodes and clears that much area.

The problem is when I have just the perfect piece, but it's one space to the left of where I want it. I give it a brief "right" click.

It moves two spaces.

Noooo, one space left.
It moves TWO spaces left.

No! One right!
It moves two spaces right.



NO, ONE SPACE, YOU STUPID PIECE OF....
It moves two spaces left.



By this time it's LANDED in the wrong place and is STUCK.

"ARRRRGGGGGHHHHHHH!!!!"



Is it supposed to do that? It seems YELLING at it doesn't help...
Top

#2
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/12 23:04
PVB Elite
Joined 2008/12/28
Slovenia
629 Posts
Highscore Top ScoreHighscore Top ScoreCoderContributor10+ Game RatingsLong Time User (10 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Yes, that's an annoying flaw in the game. I've thought about hacking the ROM to fix this, but the code is such a mess that I can't promise anything.

EDIT:
If it bothers you that much, play on the lowest speed. The scoring rules are the same anyway.
Edited by HorvatM on 2013/3/12 23:25
Top

#3
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/13 1:01
PVB Elite
Joined 2007/10/26
USA
757 Posts
ContributorTop10 PosterLong Time User (12 Years) Donator
hehe i think the speeds are mixed up..if i remember..medium was high ??

btw..i luv that game :) classic
Top

#4
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/13 4:18
Nintendoid!
Joined 2013/1/22
USA
198 Posts
Long Time User (6 Years)
Quote:

HorvatM wrote:
Yes, that's an annoying flaw in the game. I've thought about hacking the ROM to fix this, but the code is such a mess that I can't promise anything.
That would be kewl!!!

Hey --- if you do hack the Rom, maybe it's possible to replace the Japanese with English??? That'd be kewl-er!!!

Quote:
If it bothers you that much, play on the lowest speed. The scoring rules are the same anyway.
Oh, I think I'll live. But I was playing on the lowest speed; that is, it SAID "lowest". It doesn't happen all the time --- after 3-4 (or so) double-moves, then it would move ONE space.
Top

#5
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/13 4:36
Nintendoid!
Joined 2013/1/22
USA
198 Posts
Long Time User (6 Years)
Quote:

bigmak wrote:
hehe i think the speeds are mixed up..if i remember..medium was high ??
Really? Hadn't discovered that yet.

Quote:
btw..i luv that game :) classic
"Lab" and "Virtual Bowling" are two I've never acquired. Now I find I can't play Bowling very well either; lots of gutter balls. Haven't figured out the controls.

I never thought I'd get to play those two --- way too expensive (when they DO show up at all!)

"Viva FLASHBOY"!!!

Top

#6
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/13 14:50
PVB Elite
Joined 2008/12/28
Slovenia
629 Posts
Highscore Top ScoreHighscore Top ScoreCoderContributor10+ Game RatingsLong Time User (10 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Quote:

vb-fan wrote:
Hey --- if you do hack the Rom, maybe it's possible to replace the Japanese with English??? That'd be kewl-er!!!


According to Google Translate, the Japanese text in all cases says pretty much the same thing as the English text above it.
Top

#7
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/13 18:38
Nintendoid!
Joined 2013/1/19
USA
114 Posts
Long Time User (6 Years) Donator20+ Game Ratings
Seriously, Back in the day I Got Virtual Lab from a small shop in NYC for $120 (!!!!!!!!!) But It was so bad I only played it twice. That game was an unfinished mess. I always wondered if it had a two player option though (it was probably "supposed to".

At that point I had 20 of the 22 games (unless you count The Japanese version of Baseball as a different game, in which case its 23). Guess which two I did not have.



It was Sooooooo bad that I ended up selling it to pay for a school film project less then a year later ($500 on ebay, not bad for 2004). Now I need to get to the point where I buy Virtual Lab again to complete a collection.
Top

#8
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/13 19:31
PVB Elite
Joined 2011/4/27
USA
2293 Posts
Highscore Top10 1stHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreCollection Top10Contributor#2 PosterLong Time User (8 Years) 30+ Game Ratings
Quote:

HorvatM wrote:
I've thought about hacking the ROM to fix this, but the code is such a mess that I can't promise anything.



Hey HorvatM, have you found anything in the code of Virtual Lab that lets us know what the purpose of the numbers at the end of each level were supposed to be? Is there evidence in the code that these numbers truly were supposed to be used as a password to save the game?
Top

#9
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/14 18:48
PVB Elite
Joined 2008/12/28
Slovenia
629 Posts
Highscore Top ScoreHighscore Top ScoreCoderContributor10+ Game RatingsLong Time User (10 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
I was going to try to find that out some day, but, since you asked, I felt obliged to start doing that immediately.

I already knew from previous attempts at hacking the game that the password (note: I'll call it the password even though I haven't told you whether it's a password yet), unlike in eg. Insmouse, does not get stored anywhere into the WRAM, probably because there is nowhere to enter it. So I had to find the function that displays it. That was easy, and fortunately it was a separate function, while most of the gameplay code is in one huge function.

I assumed that the function only displayed the password and was not responsible for calculating it, so I thought I had to go somewhere else to find the calculating function. Common sense dictated that the call to the calculating function had to be close to the call to the displaying function. Well, there is only one place in the code where the displaying function is called and I noticed it was being passed two values. One of them was the current level, the other one was unknown to me. But it was a dead giveaway that the function was not only responsible for displaying the password, but for calculating it as well.

Virtual Lab code is very hard to follow and completely unlike the code in Insmouse: the functions are long, full of redundant instructions, and everything seems to be as complicated as possible; apparently the code was compiled without any optimizations. Since the password function contained both the code to calculate the password and to display it and was very long (much longer than you'd think, considering what it does), I really didn't want to figure out how it works.

Instead, I decided to play with the two values passed to it. They were both global variables (so I don't know why they decided to pass them as parameters, but at least it made reverse engineering much easier) and I knew one of them was the level. It shouldn't be too hard to figure out what the other is, right? It turned out to be the "MAX" value. Amusingly, the game has two MAX-related variables, both of them global: one is incremented each time the on-screen MAX display is incremented, and the other is calculated before the incrementing begins.

Now that I knew what both values were, it was time to try out different combinations of them to see how they influence the generated password. Here are some of them:

Level 1, MAX 0: 0000000
Level 1, MAX 1: 0000016
Level 2, MAX 0: 0032000
Level 2, MAX 1: 0032016

A pattern emerges. We can see that to get the password of a given level and MAX value, we simply use the formula

P = L * 32000 + M * 16

where L is the completed level, starting with 0 for level 1, and M is MAX, which may be no higher than 62, although that value is impossible to get during gameplay. Let me also point out that, according to this formula, some of the passwords listed on this site are invalid because they are odd, while the formula only produces even numbers. All others are valid. I will speak about this later.

This formula works only for values of L up to 7. If you use it for L = 8, you will get 0256xxx, "xxx" depending on MAX. The game, however, gives you 1256xxx for completing level 9. Well, if you look at the password list on this site, you will see that the passwords for L values of 0 to 7 begin with a 0, 8 to 15 with a 1, 16 to 23 with a 0, 24 to 31 with a 1, and so on. So, in programming terms, if the bitwise AND of the level and 8 is nonzero, the password starts with a 1, otherwise it starts with a 0. This extra step appears to exist only to make reverse engineering the passwords slightly harder, as you will see later.

But even that only works up to L = 15. Starting with 16, things get weird. If you use the formula with 16, you get 0512000, but the game says 0002xxx. Long story short, if you look at the password list, you will see that, if you ignore the first digit, the passwords don't just keep getting higher, but "roll over" to a smaller value periodically.

It was midnight (it was already 7:31 PM for me when you asked the question) and I was tired, so I went to sleep and continued the research in the morning before going to school (it starts at 8:40 AM on certain days). I discovered that the correct encoding algorithm (but not necessarily the one used in the game) is this (presented in an obscure programming language called NewtonScript, which is my favorite programming language and has a syntax similar to Pascal):

P := (L * 32000 + M * 16) mod 510000;
if BAnd(L, 8) <> 0 then P := P + 1000000;

Note: "mod" is the modulo operator, which here is effectively the remainder of division and is responsible for "rolling over" the number. "BAnd" is the bitwise AND function.

As you can see, L = 16 now gives us 0002000, which is a valid password. Now I only had to find a way to decode the level and MAX from any given password. My previous method was

P := P mod 1000000; // ignore the first digit
M := P mod 1000;
L := (P - M) div 32000; // get level
M := M div 16; // get MAX

but that only worked for values of L lower than 16. (Note: "div" represents division whose result is rounded towards zero.)

My classmate Sebastian Čolić (got to give credit where credit is due!) figured out the rest during history class.

For example, if you have the password 0034000, you will see my decoding algorithm fail. 34000 div 32000 is 1, but the correct level is 17. It turns out you have to pay attention to the remainder too. 34000 mod 32000 is 2000. Divide 2000 by 2000, multiply the result by 16, add 1, and you get 17. The correct algorithm, which I then tested against all the passwords listed on this site, except the odd ones, is this:

P := P mod 1000000; // ignore the first digit
M := P mod 1000;
P := P - M; // get rid of the last three digits
M := M div 16; // get MAX
Q := P div 32000;
R := P mod 32000;
L := R div 2000 * 16 + Q; // get level

Here are the rules for determining whether a given password is valid (there may be more):

* If the bitwise AND of the 0-based level and 8 is nonzero, the first digit of the password must be 1, otherwise it is 0.
* The last three digits, taken as a number, must be divisible by 16 and must not be higher than 832, because 52 is the highest possible MAX value (I think).
* The 0-based level must not be higher than 99.

Here is one more interesting fact about the game, which is not related to passwords: the game indeed ends and repeats on level 100, but since the level display is only two digits wide, the number 100 doesn't display correctly. The programmer[s] accidentally checked for level 99, forgetting that it will be displayed as 100, while they should have checked for 98 instead.

The 17-year old mystery has finally been solved.
Edited by HorvatM on 2013/3/14 18:58
Top

#10
Re: Frustration --- "Virtual Lab"
Posted on: 2013/3/14 19:29
PVB Elite
Joined 2011/4/27
USA
2293 Posts
Highscore Top10 1stHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreHighscore Top ScoreCollection Top10Contributor#2 PosterLong Time User (8 Years) 30+ Game Ratings
Dude... I seriously got chills as I read this. Thank you so much for this!

This truly deserves to go down on the webpages of Virtual Boy history as a momentous occasion!

A big question arises in my head, though:

Why in the world would the password save the max value and not the score? The developers must have had some purpose for the max value, which never made it into the version of the game that got commercially released, unless it was just so that a player could say to his friends, "Hey, check out this max value I got. Here's the password to prove that I got it," instead of "hey, check out this score I got, here's the password to prove that I got it."
Top

 Top   Previous Topic   Next Topic


Register To Post