Thursday 2 February 2017

Game Update : the Accomplishments of 2016

I did it!  After 3 years of hard work (during my spare time, of course), I managed to build within the Unity engine a game system that supports:
- Procedurally generated environments featuring custom made occlusion culling and LOD.
- Day/Night cycle that can trigger specific lighting schemes based on event/location.
- Pseudo-physic projectiles (such as arrows, thrown rocks) that can be picked up.
- Loot table logic.
- A (crude) dialogue interface.

The biggest achievement yet is to get all of that working with four players in LAN (haven't tried over the internet yet); squashing all of the bugs that were found.

Whew!

1) The part where we procedurally generate the environment took a lot of time to develop; mainly because pre-packaged game engines don't really support that kind of thing.  There was a logic issue, there was a memory issue and there was a graphic issue.  All of which are pretty much resolved so my friends know how to build the art and we can implement new stuff without adding too much code.

There's still a lot of work to do, particularly when the game builds cities.  The game doesn't really know how to build houses yet, so a small portion of my time throughout 2017 will be spent on fleshing that out.
My only real concern with cities is hitting a limit on collision objects.  So it'll be a balance between [how many objects can I use to decorate the cities], [how many of those objects can I get away without having collision on] and [how large can I make each city with those decorations].

It shouldn't be that bad, but better safe than sorry.


2) There's still a few tweaks I need to do to make sure the clock remains in-sync between game clients but, overall, the system is practically complete.  I can start looking into creating new environment types to add more variety in the mood; gotta make good use of those old colour-theory classes.

This is the kind of thing you do when you only have a short amount of time available in a given day but you still want to spend that time to work on the project.  You know, mess around with colours after a hard day at the office.


3) Projectiles were fun to work on.  It's not like I'm putting combat mechanics earlier than planned, but I had to figure the server-to-client stuff out... which is why I only mention projectiles as opposed to sword play and what-not.  So I came up with 3 types of possible projectiles that a given player would be firing (arrows, thrown objects and fireballs) and made them work.  Latency issues with projectiles is inevitable but I'm keeping an eye out for any issues.  I haven't any problems yet but, then again, we're testing in a LAN.

Fireballs don't really have any physics to them but they do generate light so I wanted to make sure that casting spells wouldn't break the game's performance.  A neat little thing I added (one of the beauties of the iterative process) is that charging up a fireball (like one would to draw an arrow, by holding down the button) currently increases the size of the fireball... Dragon Ball Z style :P

... and it gives us something to do while we play-test.  I’m not sure we’ll end up keeping the fireball-gets-bigger-as-you-charge thing but we might as well play with it and see if it sticks.

I also took the time to work on stationary objects such as doors, chests and anything other item that one could pick up.

4) Chest objects introduced the concept of loot tables, which allows the game to generate new items to reward the player.  It was an interesting challenge considering, typically in roleplaying games, the results of loot tables are based on the player’s level.  You know, “if player is at level 5, then spawn more magical items”; that kind of thing.  But the game I’m working on has no “level” to speak of so I had to come up with an way to reward players with loot without relying on a linear table.

It functions and what I came up with seems interesting enough on paper; only time will tell if it’ll actually be fun to loot things.

This is what happens when you forget to put a limit
on how many items may spawn on a single chest.

5) The dialogue system was one of the most challenging things I had to come up with; primarily the UI.  How do you build a system that's intuitive, doesn't pause the game during a conversation and allows the player to say pretty much anything he might want to say?  … and possibly allow multiple players to participate in the conversation?

I practically had to delay work on it for a full year (I was supposed to dedicate 2016 to the system) because I wasn't sure how the player would interact with the NPCs.  It's one thing to generate dialogue for the NPCs (not an easy task on its own, but I think I got it figured out) but I wanted to figure out how the player would communicate to the NPCs first.

Not that I'm complaining too much because it did allow me to fix a lot of other stuff in the meantime, but it does sadden me a bit that I've taken yet another delay.  On the bright side, everything's ready to go for 2017 and work on that dialogue.

It's like I can finally build the game, now.