BLOG of the LOST GOD

Changelog, week commencing 2018-11-19

After much wailing and gnashing of teeth, account creation is now finished! (Or a first pass at it, anyway). Oh, how tedious this kind of basic web app stuff is, but it's done now (for now). New players can create an account, and then select their first character from a pre-generated list of unsavoury types.

"The people of BONES of the LOST GOD aren't particularly heroic; not to begin with, anyway. But by picking one from this rag-tag bunch of characters, you can start your adventure. Perhaps they will become a great fighter, either in the great Arena of Rooksfoot, or in the dark dungeons of the world. Maybe they will be a great artisan, a gilded merchant, or study the ancient and arcane arts. They will be lucky; most will die in poverty and obscurity. Such is life."

As always, you can see the live changelog here, but here's this week's entry:

[!] Simple account creation screen which forwards to a character select screen
[!] Created roster selection page to allow players to recruit characters
[!] Created Item class, database table, and a basic collection of items
[+] Rewrote database methods so I can call BOTLG::db()
[+] Added Save and Load methods to character object
[+] Added class templates to character object
[+] Characters now have portrait images and associated colours
[+] Characters now have class features
[+] Player object pre-loads characters and won't needlessly rebuild them
[+] Moved bootstrap functions from Page object into their own collection
[+] Router can force a certain page view for logged-in players
[-] Router can now load arbitrary javascript files into page footer
[-] Portrait image for mobile splash screen
[-] Fixed some cookie-related bugs
[-] Moved some PDO database stuff out into its own class for safekeeping
[-] Moved routing data into a separate file to maintain my own sanity
[-] Implemented DKIM signing for outgoing email
[-] Routine server maintenance

I'm actually quite pleased with how the character selection screen turned out (referred to internally as a "roster"). It's got a pretty hover highlight, the explanation text does it's job in a reasonably succinct manner, and the color-coded portrait images turned out quite nicely. But really, best of all, it's done. Perfect is the enemy of good, or done in this case, and I'm mainly just glad I don't have to work on this little corner of the system any more. Instead, I can start on the good stuff -- getting those player characters out into the work and completing tasks.

One last thing before I sign off for the day. This character was generated while I was working on the roster screen. The layout isn't the same as it is now, but he caught my eye for having a perfect combination of portrait image, name, and descriptors:

undefined

Sometimes the random number generator gets it just right. I'm hoping for a lot more of these moments as BONES starts to take shape.

Changelog, week commencing 2018-11-12

Inspired by this FAQ Friday thread on /r/roguelikedev, which lead me to keep a changelog, I've started keeping a log of everything I've done on BotLG. I'll be keeping it all in one file, divided up by weekly chunks rather than version numbers. You can always read the plain text, latest version at https://bonesofthelostgod.com/changelog, but I'll also be doing occasional blog posts like this one, where I'll expand on what I've been doing.

So, without further ado, this week's changelog:

KEY to VARIOUS SYMBOLOGIES and MYSTERIOUS MARKS
[!] New and important features or content
[+] Changes to existing features or content
[-] Minor tweaks, bug fixes, miscellany
[?] Arcane and unsolved puzzles, disturbed thoughts

Week commencing 2018-11-12
[!] Signed unholy covenant with the LOST GOD to resurrect this accursed project
[!] Added splash screen with mysterious countdown timer
[!] Implemented the Router and Page objects to handle URL routing
[!] Pages now consist of Models and Templates to provide a nice MVC-esque divide
[!] Created working log-in form action and template
[!] Created log-out action
[!] Created simple navbar menu
[!] Created Character object with functions for generating names and personalities
[+] Added support for public, private pages with optional redirects
[+] Added support for custom CSS, headers and footers on a per-page basis
[+] Added FontAwesome icons to navbar elements
[+] Page model can output JSON instead of HTML
[+] Converted existing session code to use the Router object
[+] Logging function, database table, page view
[+] Simple admin flag for Player accounts, routing options
[+] Nice little function for returning random elements from array
[+] Wow, that regex for URL rewriting is really something, huh?
[-] Created favicon
[-] Fixed up some minor CSS issues
[-] Slight adjustments to blog stylesheet, header image
[-] Ongoing tweaks to mobile view

First of all, the symbols. The idea is to make the file a little easier to skim through looking for the important stuff -- players will want to focus on the [!] that marks out new content primarily, and may want to dig into [+] lines, which denote changes to existing content. Only the super-fans will care about [-] lines, the most basic bugfixes and mundane dross that nonetheless needs doing.

There's a lot of [!] important and new lines this week, because this is essentially the first week of development work -- almost everything is new! I've mainly been working on the basic objects that make up the game's structure; there's a lot of behind-the-scenes scaffolding work here. I've settled on three main objects so far:

  • BOTLG.class is actually one of the slimmest classes so far, but it deals with low-level authentication, talking to the mySQL database, and provides some helper functions that lots of other objects will lean on.
  • Router.class does HTTP routing, surprisingly. All requests are directed through one script, and the Router object handles them (very nicely, if I do say so myself). It's main goal is to transform an HTTP request into a bunch of configuration options for this next object...
  • Page.class does the heavy lifting. It takes a successful request from the Router, and generates the content to send back. It has Models, which do something, and Templates, which format results from the models and generates the actual pages you end up looking at.

It's a really nice, flexible system, with a clean delineation between processing and content display, and it's easy to add new pages and output types (like a route that results in JSON, for consuming via an AJAX request). I'm really pleased with how this has turned out, which is important, because this is the stuff making up the most fundamental, building-blocks that everything else will rely on.

I've also got two objects that are leaning toward more actual gameplay purposes, which is of course what we really care about. I have a Player object, representing the real, actual person playing the game -- email addresses, passwords, account-wide settings -- important but dull things like that; and a Character object, for holding the various heroes and NPCs the players will both control and interact with.

The next step is to create some behind-the-scenes functions for creating fully fleshed-out characters, and then to create some UI to allow players to recruit their first hero and get into the main gameplay loop of adventuring, exploring, crafting and carousing with them. This sounds easy, but that first step into UI creation is going mean a lot of Javascript / AJAX / JSON scaffolding will need creating first. I think I can make a few tweaks to the Router and Page classes to speed that along, but I'm going to need a corresponding "application" object up and running in Javascript in the web browser to handle everything. That's going to be fun. 

Home