return

Shogun! Postmortem

Posted January 27th, 2021

## Introduction I like revisiting old projects. I get to see how much I've learned and have a perfect excuse to work on them again. In some cases I simply fix up the original project, but occasionally I opt for a total redo. In this case, after almost a year to the day, I decided to reboot my nation roleplaying game "Deus Vult!". The most interesting areas of development on that site were the nation customizer and the interactive SVG map. I knew from the first time I finished the site that it was still pretty half-baked and poorly optimized, but I had confidence that I'd be able to do it proud sometime in the future. Enter "Shogun!". ## Inspirations The original reason I even started running nation roleplaying games is because of my experiences playing strategy video games like Sid Meier's Civilization, Rise of Nations, Nobunaga's Ambition, Europa Universalis, and Total War. These series had a marked impact on my interests and helped fuel my transformation into an unabashed history geek. Wanting to emulate these games, I would host nation roleplays on forums where each player would control a country. Diplomacy, war, the whole nine yards were in effect when these games were happening. It was great fun and helped cultivate a solid understanding of geography and historical context for me. Now that I'm capable of programming, it seemed only natural to elevate my experience to the next level. ## Decisions, Decisions When I looked at Deus Vult! after such a hiatus, I saw just how fragile and amateurish its code was. A bloated SVG that bogged down load times, shoddy JavaScript that threatened to snap at a moment's notice, and no event delegation to be seen! I've left the site mostly untouched since its initial completion as a reminder of how I used to code. It was because of the immense labor it would take to undo such terrible spaghetti code that I decided to just start from the ground up. I focused especially on learning SVG manipulation, better JavaScript practices, and applying a fresh coat of historical paint, so to speak. That's how I landed on feudal Japan. The original site's setting was the First Crusade which meant all of Europe and parts of Africa were in play. This was pretty ambitious for a first-time interactive SVG map project, so I decided to cut it way back for Shogun! and did the Japanese archipelago instead. ## Vector Cartography The map is always the lifeblood of these historical roleplays, so I knew it had to be really killer. I also knew that I needed to do it better than I did last time, because the load times and functionalities of the Deus Vult! map were very poor. For these reasons I decided to hand draw the Japanese map myself based on some historical diagrams. Through simplifying pathwork and tidying metadata, I got the entire map's SVG file to be under 100 KB (roughly 20x or so smaller than the map of Europe I had originally). I had to get very comfortable with Inkscape very quickly for this change to take place. Although it's very cumbersome to navigate, I got the basics of it down and concocted the perfect map I needed. The clan icons are also vectors I had to handclean, as well. ## Map Information A map's responsibility is to convey information. Different maps are needed to express different contexts, like alliances, holdings, and religions, which can introduce additional complexity when keeping the game up to date. In the old forum-based ones I ran years ago, I would have to juggle updating three or four maps at once. It was a real pain in the neck! This is where my push for the interactive SVG map comes in: if there's an interactive map like this, I can have all of these necessary contextual maps represented at once. Using the lense buttons I have on my map page, the user can toggle between the different map modes, and by hovering over provinces, this information will be visible anyway, regardless of the active lense. It is for this reason that taking the nation roleplaying games online is the next evolution. ## Design Considerations When preparing the first Deus Vult! I was not in a position to host it on a webserver, just as a simple static site. For that reason I could not leverage a database to keep track of information. And although I am now capable of that, I decided to stay close to the original implementation and did not give a database to Shogun!. Perhaps in another year when I revisit this I'll include one. Something that did not carry over between Deus Vult! and Shogun! though is the nation customizer. As I was making the reboot I just simply didn't see a reason to include it, despite wanting to remake it. Maybe in another project or remake I'll make it again. ## Conclusion All in all a great experience. I had a ton of fun working on the SVG map and will likely do more with them in the future. Maybe a map game? Who knows! And as for Shogun!, maybe I'll reinstate that customizer that I left on the cutting room floor from the transition from Deus Vult!.