Arcade Tool for people who want to mess with it

After a few optimizations it’s running a bit better, but some games are more demanding than others. Here’s the emulator running Super Mario Kart:

Star Fox:

and yes, it can run Doom (albeit very slowly)

32 Likes

That’s seriously awesome.

20 Likes

but can it run tower unite

4 Likes

wait actually
iirc unreal 4 has support for building to html5/javascript
so if a modification was made to expose webGL or OffscreenCanvas() to the javascript VM
yes, theoretically it could lol

11 Likes

Inb4 booting up Tower Unite to play your favourite game, Tower Unite, in-game

2 Likes

holy shit, if that doom could run on a reasonable pace, it would be hella stellar

Now that I have the emscripten DOM base from the SNES emulator, I’m planning to eventually port over DOSBox, which will allow all sorts of stuff, and hopefully realtime DOOM.
I’m gonna try to port a GBA emulator first though

12 Likes

GBA emulator was a success! Unfortunately I don’t think much can be done about the lag, but I’m on a roll with these emulators lol


the visual artifacts are increasingly common with the more advanced emulators; as the image quality/color variety increases, it gets harder and harder to optimize the pixels correctly while maintaining a steady framerate
23 Likes

Unfortunately, DOSBox was a bit too much for the tool to handle, and wouldn’t ever start.
However, I did manage to get Doom running, using a version recompiled through emscripten!


Once again, I had to drastically decrease the resolution and do some major optimizations/corner cutting to get it to render the full image. Hopefully, as the arcade tool is developed in the future, this won’t be as much of an issue
27 Likes

yes

all of my yes

at least the fps has drastically been improved

Alright, so after spending an exhausting two weeks figuring out C++ and tracking down the correct version of V8 (that was a big headache), I managed to modify metacade’s source code to make a build that supported dynamic textures, as a way to show off my emulators’ capabilities without having to deal with the draw limit. I present to you DOOM again, with a much improved render quality, and a massive performance improvement! It uses only one _r.rect call, rather than the several thousand that were required before, with 0 artifacts.


This won’t reflect the final experience in Tower, as my code is still a bit hacky right now, and is probably a bit too messy to be user friendly lol. I’ll try tidying it up anyway and see if I can get it to be worthy of a pull request though.
28 Likes

Woah, good work!

While you’re digging into the source code, have you thought about looking into sound generation at all? Would be awesome to hear some adlib tunes belting out of a screen in TU some day haha

7 Likes

I don’t know much about scripting audio, nor SDL, so I couldn’t figure out how to make dynamic audio work.

However, I did tidy up my code edits enough if anyone wants to play around with it - I’ve added a basic _r.image(x, y, w, h, buffer, texture) function that takes image data from a Uint8ClampedArray() buffer and draws it onto the screen.
To use it, you’re going to need a dummy texture asset loaded already, because of the way metacade assets work - the code needs an already loaded texture to replace the pixels of. Just reference it in the function call for right now.
It’s also for javascript only currently, as idk how to go about implementing it in Lua yet (and because probably all the emulators people port will be in JS).

Here’s the build:


And if anyone’s interested in undertaking the absolute struggle it is to compile v8 and then metacade without any errors, my github fork is here:

Note that these edits are probably not gonna end up in the final game, adding this was pretty much an experiment to see if it could be done, in an attempt to push metacade’s limits - so develop at your own risk haha.

14 Likes

That’s really cool! Awesome work!

13 Likes

Hi just a quick question, will this tool be used and implemented with workshop support in the arcade? I know this was planned originally but is it still planned?

It’s still planned.

6 Likes

So I got like, really bored, and I figured I might try to get a melonDS emscripten frontend I created a few months back ported to metacade.
Turns out melonDS has a really neat software renderer, and apparently metacade’s version of V8 actually does support WebAssembly if it’s been embedded into the javascript file. Performance is (relatively) fantastic as a result of this.
Unfortunately I did still have to use a custom updated build of metacade, as it seems like the version of V8 available in the public build of the tool doesn’t play nice with some of the newer WASM instructions (and the v8 message loop wasn’t being pumped). Hopefully this is resolved whenever the arcade tool actually makes it into the game.
Here’s Mario Kart DS running:

note that the vid is super crusty and the mouse pointer is fucked up - the mouse lines up correctly when you’re actually using the tool, Win+G recording is just stupid
I also wanted to add some custom audio output functionality to metacade for this, but unfortunately it seems like there’s a bug in metacade with the latest version of SDL2 where it messes up the audio sample format and breaks things - i’ll probably make an update post if I get around to fixing this

16 Likes

I decided to try and add a 3rd dimension to my minigolf game.

It’s a tad jank but it’s working. Polygons like to render in the wrong order cus I’m just drawing them from back to front, rather than doing any rasterization to properly handle depth. The physics is also questionable, but a lot of this should be tweakable.

My dream of playing Tower Unite in Tower Unite edges closer.

Edit: You can now play around with this in the browser here.

18 Likes

I’d like to mess around with this but the towerunite.com downloads appear to be broken at the moment.