Who wants to get his game in a web browser?

Use this forum to share and discuss Uzebox games and demos.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Who wants to get his game in a web browser?

Post by Jubatian »

Well, a bit of self-advertising, but if anyone is interested or wishes to have this, I can do it.

Castlevania in a web browser (alternative small screen variant, faster)

I think it works somewhat better than doing the same with Uzem. At least it works tolerably well even on my old box, feedback welcomed. And of course if you would like to have such a release of your game (and you can't figure out how to get Emscripten working), I could compile it for you (provided that my emulator can support it, for now most particularly there is no SD card support in it, although I am working on that!). Of course due to Emscripten, download sizes are a bit hefty (*), but if it runs, well, anyone can try the game out!

(*): Now that I backported the emulator to SDL1 for the Emscripten target, it is not that hefty.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Who wants to get his game in a web browser?

Post by D3thAdd3r »

If you get inspired some free afternoon(s), it would be an impressive accomplishment and nice to have some of the classic games available. Things like DK, Space Invaders, Megatris, the type of games that development is final on, could be a large attraction to the "outside world".

I don't know how to, or much effort it is to, make a game work in emscripten, but I think you are among the very few who do. You could put it up on the wiki and/or you can have an ftp account for uzebox.net to upload whatever files you wish. If someone gets curious on YouTube or something, it would be effective if they could immediately play the retro games without needing intrinsic knowledge about Uzem, etc. That probably holds a lot of casual retro gamers back from the player base.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Who wants to get his game in a web browser?

Post by Jubatian »

It is easy once you have Emscripten set up, or you can ask me (it is just the matter of a few minutes of compiling). Of course it leads a bit further as now it is just the generic Emscripten page, but at least it works. The emulator by the way got a bit of development since, so you wouldn't need to have two versions even (if you wanted to support older machines): you can now switch between large and small or showing the visual debug aids or not with the keys documented in the readme (F2 and F3). The pros of this emulators are better performance than Uzem (I now mean especially in Emscripten), and the total size is about 400 Kbytes compared to Uzem's 2 Mbytes. As I work on it, I might trim it even more.

I just dropped this that if anyone had some web site or whatnot, and wished to have a game there anyhow, I could do such a compile for him, and send him the result zipped up. So you can drop it in your site.

For now I am not overly interested in the cosmetic aspects of Emscripten's results (which keeps it looking like a bit cheap hack-job), rather in completing necessary features of the emulator. Particularly that SD support for a start. Including SD writes (so if interested in that, you could help with providing a game which actually attempts to write stuff on the SD, so there is something to test those functions with).

(And of course there is also my UCC entry to finish... Time management, dang it :p )
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Who wants to get his game in a web browser?

Post by Artcfox »

This is very amazing! Excellent work Jubatian!!! :D

Play Bugz using CUzeBox compiled with Emscripten.

(I modified the keyboard controls to match those of Uzem.)
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Who wants to get his game in a web browser?

Post by Artcfox »

D3thAdd3r wrote:I don't know how to, or much effort it is to, make a game work in emscripten, but I think you are among the very few who do. You could put it up on the wiki and/or you can have an ftp account for uzebox.net to upload whatever files you wish. If someone gets curious on YouTube or something, it would be effective if they could immediately play the retro games without needing intrinsic knowledge about Uzem, etc. That probably holds a lot of casual retro gamers back from the player base.
I already wrote a guide for installing/configuring Emscripten in order to compile Uzem and it lives on the wiki. Tonight I booted up a Debian Live DVD, and followed those instructions in order to compile CUzeBox.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Who wants to get his game in a web browser?

Post by D3thAdd3r »

Excellent guide thank you!

Edit-whatever the differences under the hood, the CUzebox/Emscripten version of Bugz runs about 28mhz(97% full speed) in Chrome on Windows 8 on a slow AMD 1.6ghz. Around 24.8mhz in Fire Fox, perhaps full speed with out memory visualization. Around 15-17mhz on a quadcore 2.5ghz cellphone, so it might be some time before we see that full speed.

It is the difference between something that is interesting to check a game out but not very playable, to something that feels/responds and sounds(significant static if emulation too slow) like you are playing on hardware on a low spec machine. I am very impressed with this combination and think every game on the wiki should have it available whenever someone goes crazy and does all that work.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Who wants to get his game in a web browser?

Post by Artcfox »

Glad you like the guide!

I just tried it on a friend's iPhone, and it is running it at 100% (26 fps) with the debug display turned on. It has no keyboard, so I can't turn the debug display off, but that's impressive. It might be nice to default the debug display to off when compiled with Emscripten, just to get that extra speed boost.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Who wants to get his game in a web browser?

Post by Jubatian »

I will tune that later, I mean how the display looks like (likely involving some GUI desing). For now if you want yourself a special build, tweak line 355 in main.c to your needs (the flags for it are described in guicore.h).

The ridicule there is that when you turn the debug display off, it doesn't turn anything off at all, just sends the smaller inner portion of the rendered content to the canvas. So it renders everything. Shoveling pixels onto a canvas is so atrociously slow (I checked the code and looked it up on the net: Emscripten does the most optimal thing there, yet still it is so crappy. Today's technology is just not built for software rendering - or you would have to render into a video file).
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Who wants to get his game in a web browser?

Post by CunningFellow »

Can T2K run OK in a web broswer? Artcfox set up a test for me with emscriptem and uzem, but the 400Meg datafile made it very slow to load. I wonder if cuzem is any better in this respect.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Who wants to get his game in a web browser?

Post by Jubatian »

Cuzebox won't get you to download a 400 meg file any faster :D (It should however work after setting up the data file for Emscripten proper which needs some hacks in the makefiles)
Post Reply