Rocks'n'diamonds in a browser!

Discussion around programming R'n'D, its source code and its tools.

Moderators: Flumminator, Zomis

filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Rocks'n'diamonds in a browser!

Post by filbo »

Some differences I noticed:

https://www.artsoft.org/rocksndiamonds/play

- seems to have no music
- display is larger
- some browser keyboard commands are ignored (e.g.: ctrl+1 to switch to tab #1, on Opera)
- has R'n'D favicon :)

https://armagetron.kevinh.us/rnd-opt

- has music
- display is smaller
- ctrl+1 works
- no favicon
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Rocks'n'diamonds in a browser!

Post by Holger »

Some differences I noticed:
Just opened both URLs side by side (in Chrome on Mac) to check your findings.

Regarding music: Yes, that's right. armanelgtron has converted the MODs to OGG music files, while I did not change anything (so you can see three warnings in the browser console about not being able to load those MOD files).

Maybe I'll use his converted music files when "officially" announcing the R'n'D browser port. (As I intend to only use it as a preview for the "real" game, I think it is not that important. But then, it really plays quite well in the browser, so also having music would be nice, of course.)

Regarding display size, I can see no difference at all -- it's exactly the same size for me (pixel-exact original size, unless you change the scaling in the setup menu).

Regarding browser keyboard commands, I was also unable to notice any difference. (Tested with some standard keyboard shortcuts, like opening a new browser tab etc., as there is no Ctrl-1 in my Chrome.)

The favicon could be explicitly added in the "index.html" file of the browser port (to use a different one), but here it simply uses that of the main web site.

----------

More interesting, in my opinion, would be the following three potential enhancements:

1. Store local changes locally in the browsers internal database (using Emscripten's IDBFS). This would make ist possible to store setup changes, newly created levels, tapes and scores between browser sessions, which would be really cool.

I think it is not too difficult to add this, and I will at least have a look at this sooner or later.

2. Load remote files from the web server. This would make it possible to dynamically access files like levels (also from new levels sets added later) and configuration defaults for the browser port (which currently either have to be hardcoded into the game, like the different rendering mode used for the Emscripten port, or would require packaging the game with an adjusted default configuration file, just like the "Mirror Magic" or "R'n'D jue II" packages do it).

I am currently not sure if this would be easy to add or not.

3. Store files to the server. This would be nice for centrally storing high scores and solution tapes, and would also need adjustments in handling these assets in the game.

This would probably require more work than the two above tasks.
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Rocks'n'diamonds in a browser!

Post by filbo »

Regarding the size difference, I'm on a very large low-res screen at the moment (38.5" 1080p TV while waiting for my 4K replacement to arrive). I've set some sort of magnification factor somewhere in system settings. (Sorry to be vague, but last time I looked for it I didn't find it!) I know it leaves some things sort of dorked up in the browser; e.g. when I use ctrl+shift+5 (Opera native shortcut) to do a screenshot, then mouse-select an area, I receive an image of the specified size in pixels, but which contains only the upper left 70% x 70% of the screenshot! The right & bottom 30% are blank. And when I open Google Maps it complains 'For the best experience, please reset your browser to the default zoom level.', although its 'zoom' is 100%. So, that is to say, somewhere in the plumbing of my system + browser combination, there is some confusion about scaling; this was probably a manifestation of that.

Regarding kbd commands, it isn't important, just a thing I observed :)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Rocks'n'diamonds in a browser!

Post by Holger »

R'n'D running in a web browser is now officially "announced" as a preview option for the latest R'n'D version just released! :)

Thanks again, armanelgtron, for this great contribution! :)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Rocks'n'diamonds in a browser!

Post by Holger »

Since 4.2.3.0, the R'n'D Emscripten port (at https://www.artsoft.org/rocksndiamonds/play ) now also supports storing local data in the browser, so things like tapes, scores, edited levels, game progress and general settings are persisted between invocations of the game. :-)
Flumminator
Posts: 184
Joined: Fri Jun 18, 2004 8:08 pm
Location: Germany

Re: Rocks'n'diamonds in a browser!

Post by Flumminator »

I just noticed this last week. This is absolutely fabulous :D

Great work!
Flumminator->PostCounter += 1;
Post Reply