40% port of Cave Story in HTML5

Oct 17, 2011 at 7:30 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Oct 17, 2011
Location:
Posts: 3
Hi there,

I've created a 40% complete port of Cave Story in HTML5. You can play it in the latest version of Chrome or Firefox, or in Safari if you enable WebGL. Opera may also work, but I have not tested it.



Play it in your browser
http://cavestory.rickyromero.com/itsasecrettoeverybody/


I emailed Pixel about this, and he does not want me to proceed with the port, so I will not work on it further. I would, however, at least like to share it and to have some feedback on what I've done, because I worked on it for a month and a half and it just feels like a bit of a waste otherwise.

Please:
  • do not consider this to be a release.
  • do not share the link beyond this tribute site's forum.
  • do not download the source code and mirror it.
  • do not pester Pixel on my behalf.

I will need to take it offline if it is shared outside of this group of enthusiasts.

With that said, let's get on to the details!

WHAT ISN'T WORKING?:
Sounds and music were not implemented. I could have used the new raw audio APIs in Firefox and Chrome, but I put that off. Pressing Escape or opening the Map System will throw a JS exception and you'll need to reload the page. You'll also find that some of the AI does not behave exactly as it does in the original Cave Story, due to differences in NXEngine itself.

You may also get a small initial hiccup in Firefox when you first load it. That's just how Firefox deals with loading in images. Be patient, you'll get the full framerate after it's all done loading everything in.

CONTROLS:
Same as with normal Cave Story.

WHAT CAN I DO?:
Pretty much everything is implemented until you get to Sand Zone, where things start to get a little wonky and unstable. Other than that, the game is by-and-large bug free and you can do almost everything you can in the normal game up until that point.

Additionally, the game makes use of the localStorage API, which means you can save your game (and you have the ability to do so in one of five game save slots).

WHY DID YOU CREATE THIS?:
Most of what you see done in HTML5 are just simple toys. My ambition was to create a showcase for HTML5 technologies and demonstrate that you can build some seriously advanced things with them. Also, I love Cave Story's enthralling gameplay. Unfortunately, since I don't have Pixel's permission to continue, I can't show this to nearly as large an audience as I had hoped.

I had also wanted to open-source it so that anybody could improve it.

TECH:
This port was created using NXEngine as a base, but I converted all of the source code to JavaScript. The rendering engine is crudely done in WebGL. It could be optimized quite a lot (I'm not even batching quad draws), but I never got around to it.

From there, I had to fiddle around with a lot of the source code to get it working, as there are a lot of touchy little differences between C++ and JavaScript.

The game files themselves (maps and so on) are read in using XMLHTTPRequest and then parsed by jDataView. As for the sprites, they've all been converted to PNGs.

:debug:
 
Oct 17, 2011 at 7:59 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 30
Cool concept, but it doesn't work for me (I use Chrome). It told me I needed to enable "WebGL", but I looked in Chrome's options and found nothing that said WebGL.

edit: doesn't seem to work on Firefox either :debug:
 
Oct 17, 2011 at 8:05 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Oct 17, 2011
Location:
Posts: 3
Hm... Chrome might not have been able to enable WebGL because it's running on an older computer, maybe? That's my guess, anyway. WebGL might not be able to initialize if it's running on a computer that does not have a capable graphics card.
 
Oct 17, 2011 at 8:38 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
It seems to work alright for me. This is pretty cool, and a shame it can't be finished but I pretty much expect that since Nicalis got hold of him. I'm going to assume that the quirks in the engine are from NX (I never bothered to try it) but overall it's pretty smooth and fairly accurate.

I don't know anything about HTML5 but I'll assume this is pretty impressive. Good work :debug:
 
Oct 17, 2011 at 8:46 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 32
This is an incredible, incredible partial port. I thought I already understood how to work with HTML5, javascript, XML & XML-RPC, and so on, but this web application is a work of art!

It's really unfortunate that Pixel doesn't want you to go further with this. Have you considered making your own web application game from scratch? You clearly have the skills to do it -- now just put your ideas into an original game. You could get pretty far as long as you have some creative juices.

EDIT: I have Chrome and it works for me.
 
Oct 17, 2011 at 11:12 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
You are one sexy chikorita, monsieur.
I am in the same boat as Carrotlord. Make an awesome game. If your goal was to show how HTML5 can be used for nontrivial things, you have succeeded -- you just need to give it a new story so that it can be displayed to the public..
 
Oct 18, 2011 at 12:29 AM
Demon taming, headphone wearing, casanova
"All your forum are belong to us!"
Join Date: Dec 31, 2010
Location:
Posts: 560
This is amazing. I made a quick test using chrome, it worked. I admit that i spent no more than 3 minutes on it (im using a notebook and as you can guess the game went at a really slow pace). But still mind blowing.
 
Oct 18, 2011 at 12:37 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Oct 19, 2008
Location:
Posts: 74
Age: 30
Using my main system, this game runs much faster than Cave Story normally runs on it, so I had trouble not running into spikes and enemies from the start, lol. Like those who spoke before me, I too believe your skills with html5 have great potential for an original game. Amazing job!
 
Oct 18, 2011 at 12:43 AM
Banned
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Aug 19, 2010
Location: South of Nowhere
Posts: 305
... Dude. YOU MUST MAKE NEW GAME! Seriously, this is amazing. I don't know shit about stuff like this, and I still find it amazing that you were able to recreate this. I mean. It's just incredible. If you get a team together, you could make a truly amazing game.
EDIT: two things. A. I assume the breakable blocks arent in yet? I just see SN where they should be. B. So with this is it possible to create online mods? I imagine we wouldn't be able to actually distribute them with what pixel said about your recreation, but IN THEORY... This could be used to create online mods?
 
Oct 18, 2011 at 1:34 AM
Tommy Thunder
Discord Group Admin
Org Discord Moderator
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 24, 2011
Location: New Westminster, BC
Posts: 1368
Age: 26
Uhh, I couldn't run it on Firefox :debug:
I'll try on Chrome on another computer when I get the chance, but from the looks of it, this is one amazing port :o
Edit: In the process of enabling webgl on Firefox.
Editedit: No luck.
 
Oct 18, 2011 at 3:38 AM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
Tpcool said:
Uhh, I couldn't run it on Firefox :(
I'll try on Chrome on another computer when I get the chance, but from the looks of it, this is one amazing port :o
Edit: In the process of enabling webgl on Firefox.
Editedit: No luck.

youre missing out.
 
Oct 18, 2011 at 3:40 AM
Tommy Thunder
Discord Group Admin
Org Discord Moderator
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 24, 2011
Location: New Westminster, BC
Posts: 1368
Age: 26
Voyce said:
youre missing out.

...On the original Cave Story??
40% of the original Cave Story??
Which I have already beaten??
 
Oct 18, 2011 at 4:06 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Oct 17, 2011
Location:
Posts: 3
Thanks, I'm glad people seem to enjoy what I've done.

Regarding mods: The core is a port of NXEngine, which is basically just a clone of Cave Story. It reads in TSC files and map files and so forth from my server. In theory, the only thing stopping you from making mods for it is that the TSC parser isn't complete. So maybe I could open-source the core engine, without any script files in it.

Regarding making my own game: Maybe. I've never made a game before, and I'm not exactly sure what makes a game "fun." I know there needs to be rules and payoff, but I don't yet know what makes a game fun to play. Maybe I just need to experiment and figure that out on my own.

Regarding WebGL problems: You're probably on a computer which has a graphics card that's either really old, or doesn't support OpenGL. I'm sorry, but I don't have a solution for you!

Thanks for the support, everyone. :(
 
Oct 18, 2011 at 2:08 PM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
Tpcool said:
...On the original Cave Story??
40% of the original Cave Story??
Which I have already beaten??

its like.. when you have an apple, and you have a purple apple, that tastes the same.
its not like youve never tasted an apple... "nothings special" about that specific apple... its just a sight you have to see which will probably amaze you.
you are totally under-estimating this.
 
Oct 18, 2011 at 9:27 PM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 15, 2009
Location:
Posts: 19
Wow, this really is cool. It's a shame Pixel won't let you continue and I do hope you or someone you deem better makes a game on this platform. I'm not going to play through when it's a game I already have downloaded and beaten several times, but how is it a 40% port? Does it end four tenths of the way into the game?
 
Oct 18, 2011 at 10:45 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
It doesn't go past the sand zone. I think that is approximately 292.8 732ths through the game.
 
Oct 19, 2011 at 2:59 AM
Offensive User
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 7, 2011
Location: IT'S TIME FOR A SHAQDOWN
Posts: 539
I just got to play this, and I have to tell you this; I am amazed!
It runs a lot faster and smoother than the original.
If you were to make a game out of HTML5, Flash games could bite the dust with the snap of a finger.
 
Oct 19, 2011 at 3:06 AM
Um... Chosen One? Yeah that'll work. : P
"Keep on rollin'!"
Join Date: Jun 25, 2009
Location:
Posts: 451
Could tyrone do something about the whole "no porting" thing?
 
Oct 19, 2011 at 5:02 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6206
Age: 37
ShinyElectricBlueTiger said:
If you were to make a game out of HTML5, Flash games could bite the dust with the snap of a finger.
Not quite. HTML5+Javascript+CSS3 lack the self-containment of Flash, which means that 40% of your code will be compatibility checks and also that HTML5 games could contain malicious code if submitted to a site. It also lacks the ease of use of Flash. Plus HTML5 is still experimental and is only in use now because the death of flash forced it's early adoption.

You know that animation on the home page of cs.org? After switching from flash to javascript I tweaked it on and off for over 5 months until I was satisfied that it wouldn't randomly lag or cause memory leaks in firefox 3. -_-

Silly firefox 3 and your slow repaints and memory leaks. :(
 
Top