Rewriting history for fun and bugfixes

Please complete the required fields.




Welcome back to WebUrbEx my Godot project where you explore the retro internet.

Following my tired breakdown in the last devlog I took a little break to try to learn perl (I swear it makes sense in context) and program a game called CAT for a game jam with my homies, the results of which are currently raising money for charity. I also signed up for limit break and took several attempts at fixing my dreamcast’s GDROM drive before just replacing it. What can I say? I’m a man of many talents.

When we last left off I mentioned that the code behind the UI of WEX needed some reworking to make it aware of tabs existing, and cut down on the sprawl of the top level browser class to make it a little easier to implement features. Naturally, coming back to the project I now want to rewrite everything. When I was working on CAT I ended up doing a lot more interop between godot’s native data structures and c#, owing to the broken version of a plugin I accidentally downloaded, and I want to apply some of that to WEX to make more code in it adhere to the “single point of failure” paradigm I’m trying to make stick.

I’m starting to understand why gamedev youtubers have enough material to make videos about reworking the same code over and over again.

So, I’m a data oriented guy, I like iterating through collection, that’s what a lot of WEX’s backend is and it’s also been quite good for creating those Single Point of Failure functions because if everything is processed in the same place, that’s where the problem is. however as data gets bigger and more complex, and collections get modified more and more often, I always get a little bit concerned about losing sync between different data that’s supposed to be associated with the same object. In the past for site database building I’ve used dictionaries keyed to the url of a site, but those are kind of a pain to iterate over, but reworking TLB I want something a little bit more clean. again, this class is a bit labarynthian at the moment.

Problematic History

Where this really comes to a head is how History is implemented. At the moment History is saved merely as a list of every tab opened or changed, providing the functionality of the History dropdown menu. That’s all well and good but that’s not the only kind of history a web browser has.

Web browsers allow each tab to scroll back (and sometimes forwards) through their own history, and when you duplicate a tab that history/future is copied over. That and a tab’s future is erased whenever you go back and change the page of one of the tabs from its history… you know, standard time travel stuff. I don’t think I’m explaining this very well but mess around with the <-, -> and right click + duplicate tab functions on your browser to see what I mean. There is very much a expected way for this all to function and my system isn’t up to parity with any of that. Hell in some regards it isn’t up the parity with what I’ve coded it for. I believe I’ve put in the code for creating new tabs next to the currently active tab rather than at the end of the tab list, but for reasons I haven’t delved into it hasn’t really started working. Like I’ve said this class is a sprawl of “the first code I wrote for the project” with even more dodgy hacks shoved on top of it.

An argument of Terminology

Another key thing that needs changing is the use of the term “arg”, which has been largely inconsistent across the project to refer to either the arguments of a url or the path portion of a url. Add on top of that the fact that it uses the term “url hint” in some of the other classes… yeah, that needs a clean up too.

Hello, this is the part where I rewrite the backend!

Basically there’s no easy way to slowly switch over here, fixing bugs as I go. If I want to replace how tabs are treated I need sites to know what tab they’re a part of, and tabs to know what site they’re associated with, and I need to make sure the information about a site is unified with that in a tab, which means I need to pass tab information to sites, and that means the information I need to generate to open a site needs to be compatible with the new tab system… also everything that stores lists of site names, urls, etc need to be so, basically yeah I just went through every function that passes strings between the browser and sites, wrote a version of it above it to use two new resources TabKeys (storing the url) and BrowserTab (storing the reference to the site and any history of the tab), and then deleted the original function so I could hunt down anything else that needed rewriting.

And once I’d finished ripping out references to the old system it all just… kinda worked.

Like all good programmers I’m superstitious and I’m sure the universe is going to punish me for that later.

Random Crashes (unexplained)

Here we go! So websites started crashing whenever they change tab. That was a lot faster retribution than expected. And yet also weirdly not a result of changing the system but changing something else… anyway I kinda took about a week away from writing this post and it deleted what I was gonna say but IIRC the fix was to add in some things that rescanned what tabs exist at any point, and while at the time I called it a “hacky fix that I wasn’t sure exactly what the problem was so I’m gonna have to look into it further, I think it really was just a things being called in the wrong order issue so, checking it to see if it has been done beforehand is probably as good a fix as any.

Do I take advantage of the new clean codebase?

No, so anyway I got distracted working on assets for the game instead. A really nice part of working solo as someone with ADHD is if you end up too deep in the weeds in one thing and need a bit of time away to recover, there’s always more different things to do. For example:

Distraction number 1:

One of the sites I’ve really been wanting to have in the initial release is called Tabletop Story. Inspired by the d&d campaign story that launched the site Twenty Sided (the blog of the late great Shamus Young) as well as various other AARs/tabletop game stories I’ve read, listened to or watched over the years. I thought of this as a good kinda way to bring a character (Anton, the “eternal student”) I wanted to use much later down the line in to the 2000 storyline to help sorta tie the ideas I’m coming up with now with the initial plans I had for a story set in 2006, but the new characters I introduced for it are also pretty good inspiration points for sites inbetween now and whenever I get to then. Some of the characters I came up with to fill in the cast were quite interesting so… well, you’ll have to check out the game to delve into that.

To avoid copyright (while I’m not sure if/where that applies here, with all the OGL drama a couple years back it seems like steering clear of hasbro is just legally wise in general) I based the game they play around an old untested horribly named game I designed as a teenager called Household Object RNG RPG Framework (or HORRF), a system which does not use household objects and does not provide a complete framework for making an RPG. Foisting the fault of this on a character named Dan and the role of chronicling the resultant clusterfrick on his brother Shawn I set apart writing some “weekly” session notes and (for the sake of making things interesting) largely rolling and drawing cards for them. And at the end of the game throwing up the “revised to actually work” HORRF system on another website.

Anyway it turns out that takes a lot of time and character writing and is gonna be going on in the background for a bit so… when my brain’s not got the energy for that what else can I distract myself with?

Distraction number 2:

I actually need to replace this art to not use mspaint tools that wouldn’t exist in the year 2000.

Ah yes that adventure game. I decided because of the atrocious mspaint art I was putting together for prototyping to cast it as the work of one Mr. Andrews, a character who’d already made some dreadful mspaint art for another site. Again I’m kinda trying to write things in a way that really starts to tie the world together, so at the moment I’m looking into ways to reuse some of the characters I’ve already come up with (and to drop others entirely) to help flesh out the idea that this is a community starting to form. I do hate it when everything in a setting is done by a small handful of people so I’ve started making a list of characters and sites and when they enter the story and when they exit so I know when to start culling characters and bringing in new ones, and where to slot in one-off characters.

Anyway Horde of the Abyssal Lord is on my side an attempt to see how complex a game I can make without using scripting. Just hyperlinks. And… it turns out yeah I can make a fairly fleshed out adventure but also it’s entirely hell whenever you start including inventory items and things that can be done in multiple orders. I considered writing a program to take in a game with a set number of variables and then convert it down to web pages but then the character of Mr. Andrews is supposed to be an english teacher so I kinda just decided to do it manually because up until the last puzzle everything is largely simple. So that’s my mindless distraction in the face of my mind-heavy distraction of tabletopstory. Also, doing things manually means that because the art is so bad i decided that it’d probably be nice to write very very detailed descriptions of everything to both make it not suck and imply that that’s the character’s strong point as a teacher. So that allows me to be very custom with that. There’s a lot of very fancypants descriptions at play, and also some quite brutal descriptions of classic cartoonishly violent adventure game deaths that… may come off as a little less comedic in text form.

Speaking of, I worry I’m reaching the end point of my range in terms of setting the characters who make art apart stylistically in terms of my own artistic abilities so I’m starting to plan out where and when I can affort to get other people involved to fill in those gaps. Finances are, as always, a concern, so I’m being very picky at the moment.

Distraction number 0 :

One good example is for the guestbooks. I’ve wanted to have a handful of custom backgrounds for Lis’s guestbooks for a while so I reached out to some folks from the Autistic Creative Hub discord to see if they’d be happy to do some art for it and one of the folks that got back to me was Finn who helped put together a couple of different backgrounds.

a 9 sliced background showing someone's desktop with text boxes and pictures of a cat
background tiles by @finncaronart

This kinda pushed me to add 9-slice backgrounds as an option for EWA-G. Something I’ve been wanting to have in the game for a while so it’s nice to have the push to get that done. So combining that with the improvements to the tab system allowing me to add credits to each individual pages allows me to display Finn’s backgrounds like this, and add information about them like this.

Uh… fun fact the top right corner there is falling back to use the right side tile. which is apparently because I named that tile backwards so it wasn’t loading. Well, as you can see the system is robust enough to populate the 9 tile renderer with less than 9 tiles if there aren’t 9 tiles to load so consider that a demonstration of my power.

Any Other AOB?

So between last blog post and now I joined Limit Break, a mentoring program for marginalised devs in the UK, as a mentee. I’ve also been put on the restart scheme. So all in all I’ve been looking into learning more about the business side of running an Indie and also into what I should do to launch WEX, but like… good. So hopefully that goes well.

Spinning off of that I still need to learn perl to write some blog stuff for Dervishi’s Palace and while I’ve been putting that off, either someone in the limit break discord or something in the resources they provide for mentees linked me to Learn X in Y minutes so I’m gonna go through that at some point.

I’ve also, as you can tell in the screenshots above added back and next buttons to the browser bar. They feel like they’re in the wrong position but aloso they fit better there than anywhere else. I’ll probably have to change it all up to take place on 2-3 rows but for now I kinda don’t mind them being on the wrong side of the searchbar actually. Maybe that’s better than the normal place to have them.

So as always, happy something or other, and don’t eat things where you don’t know where they’re from.

-Matt

Leave Comment

Your email address will not be published. Required fields are marked *