Mario

Hey guys!

Here it is! Finally I figured how to get a WebStart game deployed. This is a Mario remake I’ve been working on for quite a while. I didn’t want to release a beta until I got a nice working version, and here it is. It’s far from finished, but well on it’s way.

Here’s a screenshot of the big Mario. Yup, I got both big and little Mario done. There’s a couple things that needs to be worked out with big Mario, however.

http://www.myexh.com/~gonav341/Mario/Screenshot.png

And here’s WebStart: http://www.myexh.com/~gonav341/Mario/Mario.php

There is scrolling in the game, however, you won’t notice it because the level isn’t big enough yet to scroll. Enjoy!

And please, I appreciate any comments, suggestions, questions, etc. Thanks for trying it out guys!

–Jamison

Good work! Keep it up!

-Chris

Thank you. :slight_smile:

Is it supposed to paint the screen in the top left corner and run at 30 FPS?

Video card is a GeForce Go 7800 and screen is 1920x1200x32.

It’s fullscreen at 640x480x32 at 75mhz, but your monitor must not support that. I noticed that while I was testing it, even monitors that can go higher than that, it doesn’t support fullscreen (most likely because of the high refresh rate). Hopefully I can correct this soon. And yes, it’s supposed to run at 30 frames per second.

When fullscreen or display change is not supported, it runs in windowed mode. But since I can’t use setUndecorated(false) after my Frame is displayable, I don’t know what to do about getting the title bar and everything back.

Update
I made a quick modification to run it at 60mhz now instead of 75mhz. Maybe it will work in fullscreen for you now. I tried using setUndecorated(false) on my Frame if fullscreen or display mode change is not supported, but it doesn’t work because my Frame is already visible when it’s called. I spent about an hour and a half trying to fix it; I don’t know what to do to make it decorated after it’s already displayable.

Update
You should also notice I have moving platforms done.

I am using a laptop (most laptops use 60Hz), so perhaps instead of hardcoding the refresh rate, you should vsync it.

That’s a good idea. I’ll fix that later. I’ll also make another attempt at fixing windowed mode.

Also, what did you think of it so far?

everything seems to be ok :wink: , but I don’t like the way user input is being handled. Seems weird, if you hold one key and then press another and realease it, the first one also is canceled. About refresh rate, you could just leave it as it is, as in you don’t specify it, just change resolution.

I’ll lay off some super-specific stuff (about Mario mechanics) because I know they’ll be solved in time. I have users pelt me about things I know I’ll get done, so I’ll spare you that. :slight_smile:

However, I will comment on some other things that are not Mario-specific.

  1. Are you using milliTimer or nanoTimer (or GAGETimer)? Somehow, the game feels jerky to me, and I suspect it’s because of the timer. At the risk of making a pun, Mario will “jump” around a lot in the sense that some frames he progresses normally and others, he moves a lot farther than average.

  2. Collision detection is fine, but just a little note - when he walks up to the pipe, he misses it by 5 pixels or so. Shrink his bounding box. :slight_smile:

  3. Related to timing, the game moves “too fast” for me. I don’t know why, but it’s like I turned on turbo mode in an emulator, and everything progresses at twice its normal speed.

Everything else seems fine at this point. :slight_smile:

  • Eliwood
  1. Currently, I’m using the milliseconds timer (yes, I know, less precise).

  2. If you play the orignal game, you’ll notice it does the exact same thing.

3 I can’t say why it runs that way. I’ve tested it out on three differant PCs, my desktop beast, my dad’s PC (very slow), and my brother’s pc (extremely slow pc). All times I was able to get 30 frames per second (my beast could get a maximum of 500, dad’s pc got about 60, bro’s pc got about 40 maximum) and it never seemed jerky. I ran it on Java version 1.4.0, however. It’s compiled as 1.4.0. Ran the same with 1.5 and 1.6 on my desktop.

Thanks for the information!

If you use a more precise timer like the GAGE timer (very tiny addition in filesize and cross-platform), 1 and 3 will be solved, especially 3 since I had the same problem too.

As for #2, check in the real game. I know this because I’m programming Mario too. :wink:

http://www.stencyl.com/Backups/Public/TouchesPipe.png

(See that his mustache directly touches the pipe)

I have no idea what the GAGE timer is. So I’ll attempt to use the nanoTimer. However, I was trying to avoid using this as it requires Java 1.5 and I always get the following warning:

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

I recompiled with that, and it give me warnings that every time I add something to one of my many Vectors. For example, I get the following:

Sprite.java:46: warning: [unchecked] unchecked call to add(int,E) as a member of
 the raw type java.util.Vector
                frameImages.add(0, img);

As to number 2, you can see by the graphics in my Mario game, I am not creating the better-looking Mario game (the one on the GameBoy Advanced SP, I think). I am creating the orignal GameBoy Color game. Which on my emulator and the orignal game, he was always like 4 pixels away from the pipe.

UPDATE
Okay, I fixed my timer to use nanoTimer and it seems to run better now. It doesn’t seem like the framerate bounces around anymore (if I was limiting it to 60, it would bounce from 60, 61, and 63. Limiting to 30 would bounce between 30 and 33 sometimes). I also fixed my Vectors, wasn’t as big of a hassel as I thought it might be. I recompiled with Java 1.5. Please try it again, and maybe it won’t jerk around as much.

just noticed now, you have a bug, you can’t fall between those walls in the air. You can just cross to the other side if you move. For you to fall you have to try to put mario exactly in the middle.

GAGE timer’s actually compatible with 1.4 and below, which is why I suggested that over the nanoTimer.

http://java.dnsalias.com/downloads/gagetimer-1.1.zip

If you have 1.5 installed, it will continue to use nanoTimer, otherwise it will use the native timer on 1.4 and below.

Yes, this will hopefully be fixed soon.

Well, I’d rather stick to things that are built into Java. And especially now that I fixed the compiler warnings, it’s better to use 1.5 - better speed.

Eliwood, where did you get your sprites for that Mario game? I was trying to find them for my game, but couldn’t.

actually I remember it beeing that messed in the original, euh not sure about the gameboy one I haven’t played a color one on that, I’m refering to the NES, my NES’s adaper broke years ago and all I had was batteries to come up with the right voltage as all the adapters I could cut up where to low in voltage

not sure if you implented it that way but he seems to break randomly. most of the time it walks left to right without pause I remember a pause and it’s there but just randomly.

the whole speed thing and feeling like an emulator is probebly because he’s always running you normaly have to hold down b.

all in all looks nice, some graphics I don’t remember beeing in the original, the tree for example.

Yes, it was like that in the orignal, however, I want to fix it.

Not sure what you by, “he seems to break randomly.” Could you explain further?

The speed problem was because of my low resolution timer (milliseconds) - I was noticing it here and there, but not much. I’m now using a high resolution timer (nanoseconds) with Java version 1.5 (orignally written in Java 1.4).

The graphics were in the orignal game - I’m recreating from the GameBoy Color game Super Mario Bros. Deluxe.

By the way, I’m not making this game 100% like the orignal in all ways. Me and a friend will be implementing mini-games (he’s currently not on the project with me yet, just me at the moment), new enemys types, much bigger levels, and new tile types (maybe even more than what’s listed here). I want this project to be more of a unique remake.

Thanks for all the replies guys! ;D
–Jamison

Glad to here that. Not to squash anyone’s enthusiasm or anything, but I always enjoy clones much more if people add things, enhance features, and otherwise give the game their own personal touch. Of course, the “first games” people make could hardly be expected to have groundbreaking features, since they’re learning experiences (which should still be encouraged) but I get tired of seeing asteroids for the 5 millionth time when it’s exactly the same as it was before.

Anyway, good luck with your Mario and hope your development does not encounter too many migraine inducing error messages. It looks and feels really good so far.

Thank you! And I’m with you on the whole cloning games exactly like the orignal. But of course it’s a learning experience; however, my first game was actually a strategy puzzle game (tile based, but implemented very badly).

UPDATE February 7, 2007
The level is now big enough for you to see the scrolling effect (the added bit of level area is a bit plain, however). Also the refresh rate has now been updated to use your current display mode’s refresh rate.

It’s a lot smoother now, but when it scrolls, there’s a tearing effect that makes all of the graphics wobble around a bit. Any idea why that’s happening?