# Dr. Mario virus placement

Thread in 'Research & Development' started by IoannesPaulus, 3 Aug 2012.

1. ### nightmareci

I've added information about capsule generation, virus generation and just now how the gravity works to the Dr. Mario wiki article. Check there for a description of how the game works.

2. ### Kitaru

Cool stuff. Thanks for doing this, nightmareci.

3. ### IoannesPaulus

Awsome work, man! Respect!

4. ### RoboPirate

Cool cool cool!

It's not every day you get to learn new stuff about how Dr. Mario works. =)

Say you start at HI speed and then you drop 100 pills, if I understand things correctly you get an index of 31+10 = 41, and the corresponding number in the gravity table is 6...
So what does this 6 mean? Does the speed increase by 6 units? Or is it like 1/6 = 0.1666...G?

Also, perhaps I'm a bit nit-picky, and if so I apologise, but in the wiki it says:
Indexes 0-25: (35 - index) * 2 - 1
and the gravity table goes to 79...

Shouldn't the lowest possible index be at the start of LOW, 15+0 = 15,
and the highest index be when the speed counter tops out on HI, 31+49 = 80?

Anyways, really awesome work! Very interesting to read.

5. ### nightmareci

The entries in the gravity table are in frames per row, so 6 means the capsule will remain in the same row for 6 frames before dropping one line. I've edited the wiki page to include this little detail.

I'll have to analyze Dr. Mario a bit more to figure out the maximum index, and see if 80 is the real maximum. I know the index minimum must be 15, but the game stores indexes 0-14 in ROM, so I included those values in the gravity table. And if 80 is the real maximum, then some random byte in ROM after the gravity table is the number of frames per row for index 80.

6. ### RoboPirate

Okay, cool. So if it's frames per row and 79 is the highest index then 70 would in practice be the point were speed didn't increase furthert, since both index 70 and 79 corresponds to 1 frame per row.

However, I got inspired by this and so I played 20 HI just now without clearing all the viruses, and waited till 490 pills, and I must say I definitely felt an increment in speed around that value(counted in my head while playing so I don't know about the exact value).

It went from playable speed before 490 to crazy speed after 490.
It felt like the game wouldn't let me move the pills fast enough to be able to continue on playing. So I got maybe 30 more pills before I died.

7. ### dandelany

Hi all,

Just wanted to resurrect this old thread to say "thanks" to nightmareci for the excellent work decompiling/transcribing the Dr. Mario virus generation algorithm (along with the other useful info in the wiki)! I am working on writing a Dr. Mario clone in javascript that can be played in the web browser, and this info was an indispensable part of my quest to make it loyal to the old NES original.

I now have all of the basic gameplay working for one-player mode. I'm working on a network multiplayer mode as well, so you can play against others over the internet. I also need to design it, right now it's just basic colors and blocks... But once I get those parts working, I'll post a link to it in here! I can think of no better beta testers than all of you... Thanks again,

-dan

8. ### IoannesPaulus

I just checked back here after a long while. Please do post the link when ready! I'd love to beta test it.

Wow! This thread is a goldmine of information. I'm learning a new language so I thought dr.mario would be perfect to reimplement because of so few properly finished ones. Couple of questions though: For the virus generation,

What is the purpose of this? Why not just generate a random number in range [1, Virus_Level.Maximum_Row]?

Also, running test.sh gives me this...
Code:
./test.sh
5,17c5,17
< B--R--BY
< RYBRRBYR
< RBYYBRYB
< YRRBYYBB
< YRB-YBRR
< -BYRRBYR
< BYYBRRYY
< R-BBYYBB
< YBRR-YBR
< BBY--R-Y
< RRBBYRRY
< R-BRYBR-
< --Y-----
---
> --------
> --------
> --------
> --------
> --------
> --------
> ----B---
> --------
> --------
> --R----Y
> --------
> ---R----
> --------

Is it because I'm on an x86-64 machine and this was intended for 32 bit machines? I guess it doesn't really matter since the pseudo code is available on the wiki.

How does the 2p revenge system work?
What I've noticed is if 2 or more lines are cleared, the opponent will receive the number of lines cleared up to 4

Most of the time, the colors cleared are going to be the same colors that appear on the opponent's side. However, this happened so that throws that theory out the window

Unless it's because more than 4 consecutive cells being cleared, it takes higher precedence?

The last thing(I think) is the placement of the punishment blocks... It doesn't seem to follow any pattern!? Is it really just random and I'm overthinking it?

I've also noticed that if blue is cleared first, followed by a red, then blue will always be left of the red on the opponent's screen.

10. ### nightmareci

Sorry, I just checked out the test script, and it turns out I had defined VIRUS_LEVEL as 0, instead of 20, which was what was used when the test.txt file was generated. I've also just compiled and tested on my x86-64 system, and the test script outputs nothing (which is what should happen, if the bottle program's output is identical to test.txt). After looking over bottle.c, nothing in it looks CPU-dependent, so it should work on any platform. I've attached the same drmario.zip package as before, but VIRUS_LEVEL defined as 20.

I didn't think of investigating the versus behavior, but I'll work on that.

File size:
6.7 KB
Views:
1