123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|686|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Rebuilding the Browsercade

Mon, 16 Jun 2025, 08:45
Jayenkai

Rebuilding the Browsercade


Today, I took a great big sledgehammer and walloped the Browsercade firmly and with intent.
*SMASH*

It's been AGES since I made a Browsercade game. Rollin' Rubber was back in May 2023, and in the world of AGameAWeek, that's a whole lifetime ago.
At some point, JSE got fast enough that I started building my arcadey style games in there, instead of bothering with Browsercade at all, and it all got left behind as a result.

So, today, I opened up the code and did the first thing that anyone else would do.
I replaced 90% of Browsercade's Engine.js code with JSE's Engine.js code.

Keep in mind that JSE is originally built from Browsercade, and that the JSE Engine.js code is originally a copy and paste from there, but everything from that point went in one direction, and one direction alone.
Everything, all the past few years of optimising and tweaking and fixing up..
It all went into JSE, and not back into Browsercade.

So, when I copied it back..
Well.. Here's a quick alignment test with a circle and some text centred on the screen.



Oh no.

... I have a lot to rebuild.
And, this is just a quick test. This isn't even "All the games".. Each of which is bound to have a myriad of stupid little alignment quirks and breaks, and all sorts.
This might take some time.

-=-=-
''Load, Next List!''
Mon, 16 Jun 2025, 09:19
Pixel_Outlaw
I would think you'd want functions though to help keep things modular with JSE.
Mon, 16 Jun 2025, 09:29
Jayenkai


Yeah, a whole big lump of drawing functions have now been copy+pasted (with SO many fixes!) back into Browsercade from JSE.
It's much more aligned now.
...
But that's just the alignment test.

I know in my heart that every single game in the Browsercade was coded with these old alignment quirks in mind, so I'm pretty much going to have to backtrack and fix every single one of them.
.. 60+ games.
Should be simple!

(And why is the background now flat black instead of the colour it was, earlier.. Uhoh!!)

-=-=-
''Load, Next List!''
Mon, 16 Jun 2025, 18:38
Kuron
@Jay. Awesome and speaks to the power and universality of JSE.

I wasn't joking when I said Spider Basic license is up for renewal and I may skip it and just delve into properly learning JSE. Can easily code in JSE on my Orange Pi 800 or any device.

JSE is so much like what us old farts were using back in the day before it was called retro coding.
Tue, 17 Jun 2025, 01:51
realtime
Is the browsercode engine still exists and maintened.

-=-=-
me blog: fork-garden
Tue, 17 Jun 2025, 03:45
Jayenkai
It exists, of course, but I pretty much abandoned it once JSE started to take shape properly, and because JSE needed to be .. um.. let's say "usable!".. I had to fix up all these little quirks.

In my game code for Browsercade, I would adjust for the misalignments pixel by pixel. It worked, but only because all the code was mine and I didn't really have to care about other people ever trying to code with it!
But JSE couldn't have issues like that, so I took the time to make everything better, faster, neater, and then the past couple of years of optimising, too. None of that went back into the Browsercade engine.
It's actually quite slow, at this point.
If I wrote an identical game in the raw-Javascript that browsercade runs, vs the same game in JSE, right now, then the JSE one would actually run smoother.
.. Which isn't good!!!

Most of that is down to the old drawing code that Browsercade uses, and that's where all the misalignments and other things crop up.

So, yeah, it's still here, but it's not been maintained for a good couple of years.
And a couple of years in the world of Browser Enhancements might as well be a lifetime.

-=-=-
''Load, Next List!''
Tue, 17 Jun 2025, 15:06
Jayenkai
OK, step one, replacing the menu system.
As much as "A bit fleet of arcade cabinets!" made sense when there were 10 or 20 games to play, there's currently 60-odd, and I'm planning to add more, so ..
Time to replace it with something a little less scrolly.



That'll do for now. It's nothing super-fancy, but it does the job enough that I can scroll through and test all the games, one by one, enough to see what needs fixing up.



That's the current list. Seemingly working games are indented. The rest .. Oh my god, so many broken games!

And that's only quick-tests of each game, not a fully fledged end-to-end playtest.

So many breaks. So many ODD breaks. Very strange that things like sprites being entirely missing seems to be happening so much, and weird crashes, too.
But, who knows why some of this is happening.
It's a good idea to run through it all, anyway. Patch up the whole Browsercade, not bits of it!

-=-=-
''Load, Next List!''
Tue, 17 Jun 2025, 16:15
Jayenkai
: Download | Suno Link

Lyrics : By me
Sound Imported : Conspicuous Identity

-=-=-
''Load, Next List!''
Tue, 17 Jun 2025, 20:29
Kuron
Somehow I missed Retro Raider! Can't wait for the tweaked versions.
Tue, 24 Jun 2025, 10:19
Jayenkai


Added a bit of colour to things, today. Yes, it's taken a week to get here, but I've been busy with other things.

I also appear to have broken more games, so that's good to know. :/
But, you know what, it's not too bad, and the new menu seems nice and workable..
.. Until you're in Portrait mode.



Where it becomes entirely useless, and goes back to being a single-item-scrolling thing again.
Hmm..

Plenty more work to do.
I've opted to take this week off from doing AGameAWeek Proper, so that I can spend some much needed time fixing all of this up.
.. It really does need it!

Incidentally, whilst doing this, this morning, I realised the top of the left-bar looks a bit like a B, and that if you flip one around, it becomes an S.
Hmmm.. Where could that be useful?

-=-=-
''Load, Next List!''
Thu, 26 Jun 2025, 07:01
Jayenkai
As I delve deeper into the games, so many odd little "It'll do" flaws present themselves..
Like, in Flappadiddle, because I'm having to deal with multiple screen ratios, I cheated by having the spikes spread apart to fill the screen.



Here, you can see that there's gaps between spikes.. Most noticeable across the top of the screen.
When you change screen ratio/resolution, it's the same spikes in the same places, but they spread out differently to fit the changes.



... Which leaves a huge bloomin' great gap between Flappy and the platform he's stood on.

FFS, Jay, do better..

...
The rebuild continues.

-=-=-
''Load, Next List!''
Fri, 27 Jun 2025, 06:10
Jayenkai


I'm thinking, everything might be easier if I just chop the screen in half when in Portrait mode, and use the bottom half for onscreen controls..
... hmmm...

-=-=-
''Load, Next List!''
Fri, 27 Jun 2025, 14:00
Jayenkai

Play Video


LOL.. Yeah, everything's knackered!
This was working a few days ago.
LOL!!!
*sigh*

-=-=-
''Load, Next List!''
Fri, 27 Jun 2025, 15:02
Pixel_Outlaw
What have been the bulk of the problems?
Changes to the way the JavaScript canvas works?

Also I'm a fan of rendering everything in the same aspect ratio and using best fit.
I think it's better than breaking the screen up or cutting the sides off.


What if you render everything to a buffer and then scale that buffer appropriately for best fit? Spike Dislike was much less fun when the sides got removed in the harder version. It's best not to completely remove information by cropping the screen.
Fri, 27 Jun 2025, 17:36
Jayenkai
I've not figured out exactly why the above video is as broken as it is. It's something global, somewhere I think. I've probably reused a variable. Naughty me. 'tis the way I do it


On the subject of scaling, ratios, etc..

There's nothing wrong with trying these kinds of things. And altering the different methods you can use to achieve them. Like how Blockman will try to keep Blockman to an exact size, Clusters of Hex tweaks things so the scrolling feels the smoothest, Flappadiddle pads things out with little gaps, and ...
So many other little changes, all the way through the various games.

That's one of the fun things with AGameAWeek, is trying out experiments, seeing what does and doesn't work, and not simply saying "no" because you presume it won't work. I have the luxury of getting to throw things away when they're garbage, without thinking "Man, I worked for months on that, what a waste.."

Like, in Flappadiddle, though the level is the same, it changes the gaps depending on screen ratio, and that actually changes the very feel of the game. On a widescreen, you're having to guide yourself gently, with precise flaps, whilst in portrait, you flap more frantically to gain the vertical height.
It's quite an interesting difference between the two extremes.
There's no "better" or "worse", they're just ... different.

What I've decided on, though, is to crop out the bottom of the screen, so that everything is at least in landscape. It'll still change from 1.3:1 to 2.3:1 ratio, but all the games will happily cope with that. Taking away <1:1 ratios just makes everything that little bit easier to cope with.

-=-=-

"Spike Dislike was much less fun when the sides got removed in the harder version." .. I don't know what you mean by this. Sides got removed?!

-=-=-
''Load, Next List!''
Fri, 27 Jun 2025, 17:47
Pixel_Outlaw
What I mean is information is lost when you crop the screen.
It's much easier to plan when you see 4 spikes instead of two.

So you can see that visual information is removed in one version making it harder when it's technically the same game.




Vs


Fri, 27 Jun 2025, 18:03
Jayenkai
Eeeeuw, what a nasty ratio that is!!!
Get a squarer phone

On mine it's 2.5 vs 3, so it's not as noticeable.

In Spike's defence, it really is hard to manage...
A, having floor and topmost spike in view
And
B, having enough lookahead
But also
C, leaving enough space for your thumb
As well as
D, keeping everything visible.

In an ideal world, I'd force users to play in landscape, but ... then you get into a whole other battle.

-=-=-
''Load, Next List!''
Sat, 28 Jun 2025, 13:43
Jayenkai


I'm now up to the bit where I'm fighting to make decent onscreen controls, and wondering just how well it'd work if I copy+paste swathes of JSE controller code directly across.

...hmmm..

-=-=-
''Load, Next List!''