Backpack Monsters – js13k 2019

Js13kGames is a JavaScript coding competition for HTML5 Game Developers. The fun part of the compo is the file size limit set to 13 kilobytes. The competition started on 13th August and ended on 13th September 2019. The theme for 2019 was back.

I managed to participate in the competition for the third time in a row, this year I created a monster-catching game. You can play online here or here. Source code is here.

image (3)

The game itself is pretty simple, you walk around the map using the cardinal directions, and when you land on a spot you may find a monster and catch it. Both moving and attempting to catch a monster will consume your action points, which replenish automatically every 20 seconds to a maximum of 40. It works in both mobile and desktop browsers.

The organizers were encouraging the participants to integrate with coil.com and XRP tip bot to monetize their entries, I implemented a simple bonus for coil subscribers (they get a 25% bonus on the speed for action points to recover). So far I have received 1.08 XBR (That’s Ripple cryptocurrency,  converting to about 0.3 USD today)

The Story

What was my motivation this year? I was really hesitant to participate since I’ve been busy with other projects and just participating for the sake of it was not enough of a reason. Certainly, after last year’s results, I didn’t care much about “winning” the contest.

So, in the end my motivation ended up being merely to create an interesting procedural generator, to hone my procgen skills. I had just tried to participate in “Advanced Topics in Procedural Content Generation” online summer school provided by the IT University of Copenhagen and New York University, where I was able to watch some talks and gain some insights, but failed to participate in the course project.

The weeks before the challenge started I had an idea for a procedurally generated sports event (that thing has been in my head for some time now), but it was not very compatible with the theme they announced (“Back”). For most of the month, I couldn’t come up with something fun and interesting, that only managed to happen in the last week. So I started late and only managed to invest about 5 days on it, but the last days were super intense.

Being a pokemon fan (and a somewhat proud genwunner), I always wanted to create a monster-catching game (well, I kind of already did). Some years ago I was even working on a Pokemon Go-like game, but it never lifted off due to missing some original designs for them monsters.

So, I thought I could take another stab at a similar project, using procgen to fill the gap. I started by analyzing some pokemon anatomies and coming up with their structure and even used tracery.io to have an idea of how this “taxonomy” was looking (I had wanted to use it for something, for years :P). Sadly I didn’t include these descriptions in my final entry. (then again, I dunno how big the JS lib for tracery is)

js13k0

js13k1

Then, I started setting up the project, reusing the structure from my previous entries. In keeping my idea of NOT using pixel art on new projects, I thought of reusing the vector rendering routines I had used in these previous entries, however, the shapes I was planning to use were going to be more complex (I was initially thinking on trying to replicate the look of the original pokemon, like this one), so instead of just coding them by hand I used some online SVG editors and then manually translated the SVG instructions into my rendering routine.

However, as I needed to produce more complex shapes (mainly supporting bezier curves), I found out it would be more straightforward to generate SVG objects rather than extending the “vector script” I had in place, which by coincidence was pretty similar already to the SVG path definitions. This became more important as I looked for ways to get an artist to help me with content for the game since I would have had to translate SVG into my own script language, either manually or automatically.

So I ditched rendering paths and shapes into the canvas and instead started experimenting with generating SVG components from code and overlaying them using CSS.

js13k5

As the deadline drew closer, it became obvious that I would not be able to replicate the appearance of the reference I had for the monsters in a convincing way. I looked around a lot and finally found something in Etsy that I could use as a reference for my generator. (sadly, the store and the item itself seem to be gone now. Good timing for me tho!)

unnamed

These designs had several advantages:

  • They were portrayed as a symmetrical front view
  • They were more “symbolic”, without relying on individual poses for personality.
  • They were “inspired” by the original Pokemon designs, so not a direct knock-off.
  • They were already provided in SVG format.

I bought it, thinking I could at least cut and paste the different body parts and use them as individual SVGs, but my skills with both Illustrator and Inkscape proved not to be enough for it. Luckily, js13k colleague Rybar came to the rescue and helped me with the task, probably having to redo a lot of SVG work following the references.

Now with the individual SVG assets provided by Ryan, I could finally advance in the actual generator, having, at last, some progress to show.

The generator works by picking a random “anatomy” which determines the body parts slots the monster will have, and their location. then it proceeds to select a random type of body part for each slot and positions them together using some anchor points.

It also picks a random “pastel” color for the monster, I did some research and found out an easy way to generate them was using the HSL model, and having both Saturation and Lighting at 70%, and picking a random Hue. Luckily, CSS supports defining colors with the HSLA notation so this was pretty easy to include.

I also build a simple, syllable-swapping based name generator for the monsters. It generates names using two to three syllables, picking from a random list of consonants, vowels and a possible third consonant, for each syllable.

It’s also worth noting that this generator is seeded, which means the “races” of monsters that are generated are always the same, and all players will get the same set! For this, I reused the simple (on implementation!) but effective Park-Miller LCG

Now that I was finally generating some content, I focused on creating an actual game around the generator. I knew from the onset the game would not be deep, but there had to be a game!

I created a world represented by a 10×10 grid of locations and added a simple name generator for them (reusing the monster name generator but also adding some flavor with location types and colors). Also added the energy system to move around and catch the monsters, to serve as a barrier for content consumption.

In the world model, I placed lists of monsters for each location, considering their “rarity” so that very rare monsters can only be found in a single location, and so on. The idea being that players could share their findings, creating something of a social aspect to the game (Hey, what monster are you missing? I found Lesense in the Temple of Serkekol!).

I added a simple model to keep track of the monsters you had captured, and a view where you could see them.

I had managed to have a playable game one day before the deadline, so I could focus on enhancing the UX and testing. Needless to say, this ended up consuming a lot of energies but the end result was very good.

I managed to include a music track (thanks again to Rybar for creating it!) and even modified it in the tracker to make it longer (first time I make something useful using a tracker). We used SoundBox again (here‘s the final version of the track)

sb

I also made the game public and asked around for suggestions to improve it, one of them was adding more variations to make the monsters feel more unique. I fired Inkscape and drew a lot of horns, antenna, mouths and some tails, and also defined an additional anatomy with no “body” (just a head with things attached to it). The structure that was in place made it very easy to add new content.

Also, in order to add some “depth” into their appearance, I was suggested to do some shading into the bodies, which I managed to do with the help of Prinfexita, a fellow indie dev from Colombia. She drew the shadow shapes and I added support for them into the generator (including producing a darker version of the body color)

I also did a LOT of tweaks on the user interface, to make navigation easier for the players and provide a cleaner experience, especially in mobile.

What went right

  • I was able to create a finished, stable and polished experience
  • I learned a bit more about SVG
  • I created something technically different than last year entries.
  • The monsters look cute.
  • I was able to collaborate again with Ryan Malm, for the first time with graphics and for the second time with music.

Inadvertently, I think I managed to do just what I set to do from last year’s postmortem:

  • An easy game, rewarding players without requiring lots of skill.
  • Gorgeous visuals. (Maybe??? :))

What went wrong

Nothing really went wrong, however, there are some core things I wish I had managed to include to make my entry more fun:

  • A scrolling map view of the world, since right now it relies a lot on the player imagination
  • Deeper gameplay mechanics for catching the monsters, maybe collecting some items in the world that would help you lure them.
  • Allow trading monsters with other players.
  • More body parts, especially Wings and tails
  • Scaling variations for the monster’s appearances.

But all in all, I’m very happy with what I was able to create in the short time frame.

However, I got pretty sick and weak for two days after the deadline, I believe I pushed too hard. Would be better to avoid crunch by starting earlier.

The Future

I never intended the game to be more than just a collecting game, so things like a plotline or a combat system were willingly ignored.

Some other things that would have been nice to have, as possible points of expansion:

  • A more in-deep generation of the monster anatomies beyond randomly selecting and swapping parts.
  • Generate monster descriptions and stories.

 

 

 

OpenArthurian v0.6 released

Mirrored from https://openarthurian.com/2019/09/01/v0-6-released/

This is mostly a bugfix / refactor version, based on the feedback received over v0.5

You can play online here: http://slashware.games/oax6/0.6/

Changelog

  • Separate Talk command
  • Step on party members
  • Prevent FOV glitch by forcing an updateTransform after affecting the mask
  • Prevent concurrent mob activation after dialog when coming from idle AI
  • Upgrade to phaser-ce 2.13.2
  • Simple mouse or tap movement
  • Allow configuring game width and height, basic viewport responsiveness
  • Don’t load save games from old serialization models
  • Add missing cowCorpse item
  • Prevent moving off the map
  • Remove camera bounds, allowing it to keep centered on the player when walking near the borders of the map
  • Add option to go toggle fullscreen
  • Decay messages after 5 seconds, gray them out
  • Refactor to handle mobs and items as object layers
  • Change appearance of stairways

mobLayer

Expedition – August 20, 2019 update

It’s been 44 days since the last update so let’s go!

CREA Digital winners

ganadores

We were selected as winners for “Crea Digital”, a program from the Ministries of Culture and Information Technologies of Colombia, with “Expedición: Los Hijos de Bachué”. This will be a scenario based on the Muisca legend of Pacanchique, and the last years of the Muisca Confederation in the central Andes highlands.  We expect to make good use of these funds to enhance production, art and UX aspects of the game while producing quality content to be distributed across the country, inspiring children to become game developers in the future and teaching people about their history.

Changes in Exploration

After a lot of experimentation with the forests, including tests with 3d meshes, I decided to tackle the forest issue with a change of perspective. Of course, this isn’t a magical solution but I believe it’s closer to the sense of scale I want to portray.

screen1

For the “New Expedition” mode, the player now starts on land in the southeastern-most part of the map, using an adequate sea vessel based on the selected culture.

Regarding field of view, our first approach was to use zoom levels for this so that if for some reason your field of view was restricted, the game would zoom in so that what you could see would fit all screen. I found out this to be a bit confusing and troublesome from the art part, so we are now using a “vignette” effect instead.

screen2

We are also now detecting if the expedition is transversing a forest, in which case it moves slower and the field of view is also limited.

Procedural terrain

Worked further in procedural generation, adding controls to ensure a percentage of the map is above the sea, and smoothing out the mountain peaks to make them look more natural.

proc1b

Hometown and Transfer Items

For the “New Expedition” mode, the player adventure will start at his “hometown”, where he must stock his Expedition to the unknown. He may come back to town to trade and restock.

The UI is still very early but finally settled on a design for this multipurpose interaction, which will also be used to trade with native towns, and to transfer things between the expedition and locations such as ships and outposts.

screen4

Voyage mode

The current approach for the long voyages in the open sea. It will be a separate mode in which events will be simulated and things will be handled at a higher level. Will probably add some navigation and weather aspects, as well as events with the crew.

screen3

Combat – Pathfinding

We implemented pathfinding in combat using the A* Pathfinding Project, it’s looking much better now.

Expedition0727d

UI Tweaks

Added a permanent minimap on the lower-right corner of the HUD, and compressed lots of UI info into the status panel in the lower-left corner. Also increased the size of the Town and Conversation dialogs and relocated them.

Expedition0727b

Also, after lots of research and experimentation, we were able to add “markers” for the command destinations, painting them over the terrain using “projectors”.

Rivers

After evaluating different alternatives we settled on handling rivers as meshes generated from polylines (sequences of points), in order to provide more flexibility for their procedural generation. We also added animation to their flow. Their appearance is still work in progress.

Expedition0727c

Sound effects tests

We introduced speech effects for “commands” as well as random “expressions” from the expedition members during exploring, as well as new sounds playing when the units are injured or die. This is all still in test.

 

OpenArthurian – Milestone 3 completed!

Mirrored

I’m developing full speed. Milestone 3 is completed now as of version 0.5. Check the demo online here. Onwards to Milestone 4

  • Support for multiple height levels per map
  • Support multiple layers of tiles per level per map
  • Smooth transition between levels using stairs
  • Using levers to open and close doors
  • Finding hidden objects
  • Solo mode, so you can move around with an individual party member.
  • Examine items on inventory
  • Update pathfinding data when opening and closing doors.

oaxM3-2

oaxM3

OpenArthurianX6 Milestone 2 completed!

Mirrored

I’m developing full speed. Milestone 2 is completed now as of version 0.4. Check the demo online here. Onwards to Milestone 3

oax6dragable

  • Restore door state correctly
  • Fix Drop item flow
  • Use inventory item with the keyboard
  • Integrate using a key with the mouse with the main logic
  • Add armor
  • Display equipped weapon and armor on inventory
  • Click on party member to show inventory
  • Fix issues with the door opening and unlocking, and click interaction
  • Draggable inventory panel
  • Fix floating item state transitions
  • Change appearance of Asteroth
  • Ensure combat turns triggers are done before the mob action. Separate endCombat action.
  • Destroy old level when loading a new one, fix an issue with combat end before loading level causing issues with party member positioning.
  • Fix issue when trying to talk to non-NPC mobs
  • Make half of the door objects “fixed”, so you cannot walk thru them even if they change their appearance to open
  • Fix conflicts with look box being active during WORLD state
  • Add area to Iolo’s hut
  • Allow canceling floating item selection

OpenArthurianX6, Line of Sight

Crossposted from OpenArthurian devlog.

Was considering what would be the best way to do this. LOS in Ultima 6 is weird since it seems to be location-based (once you open a door you can see the room inside), but you can see through walls (some times?).

I thought just replicating it for the sake of it didn’t make sense and would bring more complexity for map handling and editing. So instead I went for a full system with opaque tiles, so you just have to define the tile as opaque and the engine takes care of the rest.

The current implementation is a pretty simple raycasting, and a mask drawn over the map. It works almost great except the tweening of the mask moving is not in sync with the camera tweening, which causes some small artifacts in the mask border.

fov1fov2fov3