Project Theta #6

I went to watch Lang Lang play piano with the SF orchestra. It was an exhilarating program, befitting his character. Thanks to a certain fervent fangirl, I had a chance to briefly converse with Lang Lang at the tail end of the signing session. He was quite a nice guy!

Music

I originally thought about writing a brief critique of the concert, but I thought talking about music in games is probably a better idea. Music is such a key component in games and films, yet most of the time people don’t really seem to notice. I once played a game where a specific music file was missing, only then I noticed how awkward the dialog was with the silent backdrop.

While mediocre game music gets ignored, outstanding music elevates a good game to new heights. Hollow Knight, for example, contains a wide array of beautiful scores. I find myself associating each track with specific emotions, which in turn heightens my immersive experience. Mad respect to Christopher Larkin, who composed the suite.

Now, where would I get my hands on some awesome game music? I do wonder about this from time to time. Eventually, I suppose the game will be presentable for a kickstarter. I can then use the funds to obtain some high quality music! One can at least dream…

Honorary mentions to sound tracks in Undertale and Final Fantasy series, which are just as amazing!

Coding

I’ve been working on more tilemaps. In fact, I’ve been working on nothing but tilemaps for the past three months! It is such a fundamental piece of groundwork that almost all other meaningful modules depend on it. NPC movement requires it. Environment design uses it. Battle system needs it. The list goes on…

I’ve finished two more needed features in the past two weeks: individual tile editor and rotation support.

Tile Editor

Unity’s 2D tilemap does not support tile attributes out of the box. For example, it is impossible annotate specific tiles such that the player cannot walk over them. The workarounds are rather ugly as I suspect it just isn’t a feature considered in the original design. With a custom system written from scratch, however, this is no longer a problem.

While this isn’t exactly news, I coded an interface to select and edit existing tiles. Previously, although tiles had attributes, there was no way to edit them.

Rotation Support for Tile Sets

Rotation is a feature in Unity’s 2D tilemap system, where the RuleTile automatically rotates the tile based on the surrounding tiles. It essentially saves some setup time, as you only need to specify what one corner looks like, instead of all four corners.

I originally thought I don’t need to implement the rotation feature found in Unity’s 2D tilemap system. Theoretically this feature only provides a moderate amount of convenience on setting up. I then realized that I’m dealing with 3D models. Without rotation support, I need to set up four copies of corner, edges, and ramps models!

I decided to shove in rotation support, and had some fun with it too.

Roadmap

I did not anticipate the 3D tilemap system to take so long to code. But then, I tend to be optimistic on a lot of coding tasks. Originally, I planned to finish a small playable demo of the game by the end of 2019. At this point, that does not seem realistic. Nevertheless, I want to plan beyond the current task. Once tilemap is finished, I would like to work on NPC and dialog. From there, perhaps a basic stats/inventory screen(s) would be a good idea.

Below I list a bunch of things I’d like to work on, in order:

  • Tilemap system
  • Decoration system (trees, doors, windows, etc)
  • Simple NPC system
  • Dialog system
  • Stats and inventory system

Art

After many back-and-forth sessions, we are almost finished with the design for our protagonist, Edge. I expect a finalized portrait in two weeks!

Meanwhile, Y drew another comic short! She’s giving it the finishing touch, and she should post it to Instagram soon!

I also imported some of the tilemap textures she has been working on.

Narrative

Time to reveal something else about the continent!

The Antima Empire is a relatively new player in the game of politics on the continent. Founded in 1043, it barely has 200 years of history. It was born as the result of a tumultuous event – the Gemian anti-magic revolution. Civil disobedience leading up to the event was largely ignored by the Council of Five, as they believed the non-magic users were powerless in their struggle. Little did they know that they would be betrayed by influential individuals among their ranks…

Excerpt from A Brief History of Antima

Project Theta #5

I went to watch Joker. As a big fan of the Dark Knight trilogy, I was pleasantly surprised how the backstory of Joker snugly weaves into the entire franchise, as if it has been thought out from the very beginning. As for all material I find interesting nowadays, I try to see if I can incorporate the points I find particularly appealing. A memorable story doesn’t just depict an appealing main character, but also an irresistible villain worth defeating.

In fact, for the past two weeks I’ve been working on character backstories and the settings of the world, and almost didn’t touch any code at all.

Art

Y has been working on town mocks again. Here’s a mock for how she wants the town to look like. We had a discussion whether it’s worth it to spend time developing the tilemap tool to be able to draw this, as opposed to just to draw every building separately in Illustrator. Well, I hope I’m able to make a powerful enough tilemap tool that justifies the time I’ve spent making it.

On the other hand, Y has ideas for the second comic short, based on the backstory I just wrote this week! I shall wait with bated breath. Check out our Facebook page and Instagram, where she will be posting it.

Narrative

I started watching two new shows in the last two weeks, and somehow that gave me inspirations to write character backstories of my own!

A Certain Scientific Railgun captivated me with its characterization and above average number of “hmm, this make sense” moments out of a wild esper anime setting. Usually in this type of stories it’s very easy for the author to make up something that doesn’t even make sense within the rules of the world, and yet I couldn’t find big plot holes.

I find the protagonist Mikoto Misaka – an overpowered high school girl – quite intriguing. Her powers are balanced with various mechanisms that I haven’t considered before, such by rules of society, her sister, her feelings for her friends, and etc. It really reverberated with me on an emotional level, and I wanted to create something similar.

To commemorate this, I shall make our female protagonist Abigail a thunder magic-user, and I will find a place in the plot where she will be cooler than Mikoto Misaka.

Magic

While I can’t really divulge the backstories I wrote for Abigail and her father (whose plight is worthy of a game of its own), I do want to write about how magic should work in the game.

I have some objections with how magic usually works. You know, the type where users just declare the magic they want to use, and they unleash magic. Pure and simple.

But where did the energy come from? It can’t be possibly from the human brain, or their diet won’t be 8,700 kilojoules, more like 8,700 megajoules!

Also, what do wands/staves do? In Harry Potter, wands are necessity for magic casting. For many other worlds, they look like prop. If magic users are able to cast magic without them, why carry them in the first place?

I had this idea of moving the notion of “mana”, energy used to cast magic, to the magic weapons instead of an intrinsic trait of humans (more broadly, creatures). Magic weapons act both as vessels to store magic energy, and as conduits for casters to channel the energy stored within.

This solves both problems above. Magic users can no longer pull out crazy amount of energy themselves, and their weapons serve important functions. On top of enabling them to cast spells (making them powerless without), the weapons store the energy required by the spells. This means it makes sense for casters to carry multiple magic weapons with them on adventures.

I was slightly disappointed, very soon after, when I found out that the concept has already been implemented by Noita, a 2D exploration game where you play as a spell-caster. Oh well, I still think it’s a great idea to make a world out of. Noita is an amazing game, though. It takes the idea of “pixel game” quite literally by physically simulating every pixel on the screen.

Potentially Hurtful Truth

The other anime I watched, only because there are too many memes about it, was Demon Slayer: Kimetsu no Yaiba. Why did I not mention it earlier? Because I regret every minute I had spent watching this full-of-cringe show. It is the epitome of cliches and awkward fight scenes. No. Just…No.

Project Theta #4

If you haven’t heard, KFC’s dating simulator is out now, free on Steam. I had a go at it, and I must admit two things:

  • it packed lots of laughs, and
  • it made me crave and eat KFC that night.

To prove my point, here’s a screenshot:

Maybe I should learn from this intentionally cringe-worthy writing style, and put some steamy love story in the game. Inspirations!

Coding

I have to admit, the coding section today is a bit technical. Feel free to skip to the art section if you aren’t into game making with Unity!

Default tile set tiles

The past two weeks have been about extending the 3D tilemap system I’ve built, beyond the existing Unity’s 2D tilemap features which I modeled it on. In particular, I wanted a natural way to define default values for each tile within a tile set. For example, a tile set contains two tiles, a walk-able ground tile and a blocking wall tile. In default Unity 2D tilemap, there is no natural way for its RuleTile to define default custom values for each tile, so that the ground tile can be walked on, while the wall tile will block the player. Heck, there is not even a good way to define custom fields for each tile!

I took some time to think about this, and in the end defined a generic factory class that is a property of every tile set, that is responsible in returning new tiles. There is also a method that is called by the TileSetEditor to draw an editor to edit default tile values for that particular tile variation in that tile set. This way for future projects (or when eventually I decided to tidy the asset for sale, for customers), I just need to extend the factory for a custom tile editor. Kind of like how custom brush work in current 2D tilemap.

The end result looks like this:

Rule tile set neighbor detection

Another feature I made extended how neighbor detection work. Originally, a tile’s variation is based on a specific set of requirements of its surroundings. For instance, if you have a lake tile set that has different textures on its edge (to draw the bank of the lake), then for any tile in the tile set, if it is surrounded by other lake tiles from the same tile set, then display the texture without border. The rules were simple, we require a specific variation to be shown only if, in each possible direction, that direction either contains the same tile set, doesn’t, or it doesn’t matter whether it did or not.

This turned out to be very limited, as you can’t define rules like, display this variation if it is next to a tile from another tile set. This turned out to be a crucial element in making ramps work (the problem I was trying to solve these two weeks), as ramps had to be put on a different tile set than flat tiles, and they were not playing nicely with each other. After some thought, I decided to add name based regex matching for neighbor detection. That is, instead of displaying a variation based on whether the neighbor tiles are the same or not, we are now displaying a variation based on whether the neighbor tiles’ tile sets’ names satisfy some regular expressions. This turns out to be immensely powerful if we careful choose a name scheme for the tile sets!

The end result for the tile set editor looks like this:

Here’s a demo thrown together with ramps and proper collision on cliff tiles:

Art

Y actually started drawing comic shorts on the characters! The first one is done, but since we haven’t really introduced the main characters yet, we are planning to post it after we introduce them in another short.

There will be multiple series following the stories of separate sets of characters in the game. I can’t wait to see them myself!

Apart from comic shorts, Y also drew some tilemap textures. I’ll be adding them to the game and finally showcase an example that doesn’t look like Minecraft, yay!

Narrative

I have been investigating how to create my own language this week in order to truly create an immersive fantasy setting. I came across an excellent article, Generating naming languages by Martin O’Leary. The article goes quite in-depth about picking consonants and vowels with different flavors and how to combine them. Quite an interesting read!

However the article proved to be too complicated than my needs, and there were many, many variables to tune in order to generate the ideal language. I don’t want the names of the characters to be too difficult to remember, so I think I’ll still invent my own names by myself, but have a systemic approach to it. For example, generate a pool of atoms, or partial words, and look to combine them in some order that makes sense.

Hopefully this means I can finally get along with writing the story. I’ve been putting it off because I wanted to get the geography and the names right.

That leaves the geography…I still need to draw up a continental map of some sort…

Project Theta #3

I found it! I found the source of the image which motivated me to build the current 3D tilemap! The above image floated in my search results whenever I typed in “Unity 3D tilemap” and I just couldn’t find its source!

It is from the Isometric Pack 3d asset made by Manufactura K4. I’ve included another asset preview from the asset store. Aren’t they just beautiful.

In fact, I can probably use my 3D tilemap system with this asset to layout a mock level pretty easily! Maybe. After I fix another bazillion bugs.

Coding

I converted the player controller from 2D to 3D! Most of the logic still made sense, and I got to delete a lot of disgusting code I originally wrote to make 2D work like 3D (yep, the code sounded as ridiculous as that statement). This actually didn’t take very long.

…what took very long was all the bugs *ahem* unexpected behaviors *ahem* interesting features in my code. Mostly to do with the quirks of serialization in Unity. Finding why it was doing what it did took a long time. Figuring out what to do with the code took a long time. Moving code around to correct its behavior took a long time. Fixing more interesting features as a result of moving code around took a long time…

The end result: once again I got a character moving in the game, but this time in a 3D tilemap!

For the next two weeks, I’ll be implementing ramps and finer control over tile collisions in a tile set. I see more code moving coming my way…

Art

I think I’ve convinced Y to start drawing some comic shorts on the back stories of the characters of the game. I anticipate incoming awesomeness.

Narrative

I recently watched the Saga of Tanya the Evil Movie, and I couldn’t help myself analyzing the plot. It’s summarizable in a few sentences. Literally only a few things happen in the film, sandwiched between a lot of fancy fight scenes.

Perhaps I don’t really need to make the plot of the game super complicated either?

I wrote up a bunch of significant events in the plot of the game, and that took a whole page. Will the game take 100 hours to play?

Well that’d be exciting.

Project Theta #2

I had just a week to work on the game before TI9 began and consumed all my spare time. To make up for this, I decided to write a section on the lore of the game in every update!

Coding

Spent most of my time bug-fixing.

I managed to push seven commits and closed out a bunch of issues. The 3D tilemap is now functionally a superset to Unity’s own 2D tilemap, with extra features such as saving tiles to disk and loading them seamlessly, so not everything is saved to the scene. Reaching this milestone makes me quite happy, so I’ll show it off in a few more GIFs below.

Not really focused on the tiles in the tile set, so they look a bit like water-downed version of Minecraft. Y is working on some textures for the prototype tiles, though!

The next step is to get a working character controller ready so we can move around in the tilemap. This also means implementing a tile-based collision and ramp system. Fun!

Narrative

Since I’m also writing the story, I guess I’ll put out bits and pieces of lore of the game.

Humans have populated the Continent for well over twelve hundred years now. Hamlets became villages, villages formed towns. Countries rose and fell, buried in the sands of time. The Antima Empire, with a mere two centuries of history, is a new player on the stage of continental politics. Its founding father, Lepton Antima the Wayward, sacrificed his own life to establish a powerful barrier to deter all forms of magic in the Empire. This double-edged sword repelled countless invasions from the neighboring states, at the cost of the country’s own magical advances.

It is in this country that our protagonists, Edge and Abigail Seed, begin their journey as a duo with one who aspires to become the Demon King, and one who wants to stop him.

Excerpt from The Chronicles of Edge and Abigail Seed – Volume I