Archive for August, 2014

Unity game – what to do next, part 2

August 31, 2014

In my last post, I outlined where my thinking on my Unity project was about six months ago.  In this post I will outline my current thinking as to where I’d like to take my game next.

Currently, the state of the project is that I have a multiplayer game, capable of supporting about 6 rooms of 15 players apiece on a small server sitting in a server farm somewhere, and open to the internet.  In the process of building the project, I have matured slightly as a software engineer and game designer, to the point where I have been able to build data driven games and deploy such on cloud architecture.

So that’s a good start, however now is the time to decide what sort of data driven multiplayer game I’m going to build, and I think I have a much better idea now than I did a few months ago as to what it should be.  In particular, I don’t want to build another MMORPG, as high quality games of that type have more or less saturated the market now.  Rather, I’d like to do something slightly different, and in order to explain my thinking on the subject, I will need to make a slight digression.

Over the last couple of years, I’ve been involved in a return to an old hobby of mine, role playing games.  And I don’t mean the world of warcraft style role playing game – rather I mean the old school variety, the TSR, wizards of the coast dungeons and dragon style game, where one person is the dungeon master, you sit around a table, drinking beer / energy drinks, and then pretending that you’re in a dungeon, or in a city, or travelling through the wilderness of the forgotten realms, or eberron – looking for treasure, adventure, and trouble.  Essentially, a collaborative storytelling experience.

Fairly recently, Hannu Rajaniemi gave a talk in which he discussed the future of the book.  In passing, amongst some other very interesting things, he mentioned role playing games as a form of storytelling.   Consequently, this led me to think – can the medium of computer games be focused more on fostering this sort of experience?

This is not ground that is completely untrodden, of course.  Roll20 is an ‘app’ or project / site that is geared around providing a tabletop gaming experience for gamers who are geographically separated.  Over the last year or so, as a matter of fact, I have been fortunate enough to have been involved in an occasion session or so of this application.  It makes for quite good fun.  Also, Neverwinter Foundry allows players to craft their own dungeons for other players to experience.

So I guess I was wondering whether I could build my own dungeon creation engine type of experience.  And I have to admit that the idea has me slightly hooked.  In particular, I would like a game where:

1. Players can log in and load a pre-exported map into a game room.

2. Players can take the role of a ‘player’ or a ‘dungeon master’.

3. Players can work on maps and export them while in game.

4. ‘Dungeon masters’ can continue working on / tweaking maps while ‘players’ are in them.  In particular, adding corridors, rooms, passages at will, adding monsters at will (drag and drop), adding chests, traps, furniture, trees, buildings at will.

And two other nonessential, but nice to have features:

5. ‘Dungeon masters’ can embody monsters, or groups of monsters, and move them around in first person, etc.  Eg NPCs.

6. ‘Dungeon masters’ have control over what ‘players’ can see and what they can do to a limited extent. eg, viewing monster hit points, moving other characters around (hopping into another characters first person perspective or drag selecting multiple characters to move).

So that’s the general idea.  Obviously there is a great deal of fine detail on top of that outline (eg, a ‘market’ of pregenerated player maps, a ‘favoured objects’ list for level design, menus and submenus for selecting objects to drag and drop in game, database / object persistence and handling, etc), but that’s what I’d like to build.

Evidently that is a mammoth task.  But I think the general approach to take would be:

  • Represent all objects and their locations as values in a database.  So when ‘exporting’ all that is truly exported in a database configuration file.  And when performing a modification to a map, all that is happening in terms of the metadata is that the map / data configuration / sql file is being updated.
  • For instance, each client could have some directory where objects are stored by a standard numbering system common across clients.  Then the database could contain a lookup table – eg ‘1’ would represent a goblin, and ‘2’ would represent a table.  Each of these items could have attributes assigned, for instance, position (x,y,z) and euler rotation coords(u,v,w).
  • For dungeon walls, or dungeon floors, the database problem becomes perhaps slightly more challenging, as one is interested in having multiple objects linked in a certain way.

To start off, what I’d like to do would be to allow for a game master, in game, to paint out a tiling starting from a world where there is nothing but a limbo-scape of featureless squares.  In this way, one has the basis for a game of the nature outlined in points 1 to 4 above.

One approach, and probably the one I will attempt to take, would be to allow the dungeon master to select a texture from a palette – eg ‘grass’, ‘stone’, etc, and then, using the mouse, select an area of the ground where they’d like to apply the texture inside – so essentially drawing a polygon which is painted inside.  I’d also like the option to ‘snap to grid’ for a more polished look if they want it.  The texture would be looked up relative to a folder using a ‘key’ for the texture in question, sitting in a table in the database, and assigned to the interior of all of the polygons associated to that texture, whose points (and order of same) would be stored in a separate table.

Then, to export, the game would export the tuples (polygonId, polypointId, textureId, pointX, pointY), and store this to a sql file, which could then be used by the player to reload the map.


Unity project – what to do next, part 1

August 31, 2014

A while ago, I had a bit of a think about what I should do next, subsequent to completion of my initial foray into using mysql and a smartfoxserver extension to handle persistence in a unity game world.  So in this post I will outline these ideas, however, this is not what I intend to focus on next in my project based on my current thinking.  That will instead be the focus of part 2.

Database considerations – inventory, equipment, etc.

Certainly it would be good to implement an inventory table in the database and an inventory manipulation interface in the game client.  Then, once this was done, I would like to create an “equipped” table, and allow a player to equip items, and for the state of what is equipped and what is not to persist.  Furthermore, I would like the appearance of various items to be displayed on the character, and for this to be transmitted to other players in the game via the smartfoxserver extension, so that the appearance of the player to themselves, and to others, was consistent with their current equipped / non equipped status.I think this would be a good next step to take this game project, albeit a rather conventional one.  Doubtless later on I will be able to do certain things that are a bit more surreal and slightly off the beaten track.

In terms of obtaining models, etc, to use as inventory, I learned from this video that there is a site, turbosquid, that specialises in 3D models, and many of the resources there are free.  So this is an additional resource of items in addition to the Unity asset store that I could use.

Character customisation / appearance of models

In terms of character customisation, there is already a certain amount of information and discussion on the web regarding how to modify the mesh of a character and swap in / out various items / armours etc, rather than clipping them all on the same model and merely hiding the ones not in use.  It is possible to do this, of course, but is not recommended – in an environment where one has say even a moderate amount of players running around, a game world will take a considerable performance hit.

In particular, there are these discussion threads, all on the Unity forum message boards:

In particular, the last thread points to an out of the box character customisation system for Unity, albeit for Unity Pro, which is by no means a cheap or ready to hand solution.  But nonetheless interesting that the solution exists – maybe in a year or two, Unity free might support something like this?

In terms of criticality of getting something like this working, though, although fascinating and definitely somewhere I’d like to get to eventually, this is not really what I’d like to target next.

Interface and gameplay

The third subfocus I had was to start working on the user interface, as well as gameplay, in particular:

  • health bars
  • skill bars / skill & spell books
  • equipment and character equipment slots
  • icons for skills and equipment, and empty character equipment slots
  • a skill system for skills, spells, etc
  • an action system for combat / player movement
  • better avatars / monsters
  • a minimap
  • gameplay
  • access to local events only on the client – though the server should keep track of all events (albeit, as representative data, of course)

For all of these, save the last two (the second last which is contingent on sensible synthesis of many of the rest), I identified assets on the Unity Asset store I could (and can) use / adapt to my purposes.  I’ve also found another site that sells quite interesting character and monster models (including a dragon!), which has also piqued my interest .  This will probably be a good next step.  Furthermore, I could in particular work to tie in of all these features to

  • a sensible database schema and messaging system, both in the local game client and on the server ( I already have solutions that exist for this and work quite well – C# messenger extended locally and smartfox for the client server messaging)
  • full multiplayer functionality

Abstract / surreal environments and game logic

The fourth idea that I thought would be interesting to focus on was incorporating a heavy surreal element into what I am trying to build.  This is something that I think is good to aim for in games, since it is in such that there is this tremendous opportunity to suspend the laws of reality and physics as we understand them, and flip them on their head.

Gameplay is also quite important, so I also had in mind looking into combat (magic & melee).

And then, consequent to this step, and prior to doing advanced project work on meshes / customisation of characters, I thought it would probably also be good to focus more on multiplayer functionality, eg, grouping, chat.  And maybe minigames, as well as some sort of quest system.  This is probably where I’d like to start diverging from the standard, and start exploring a somewhat more abstract and idiosyncratic game world and game logic – like Another World, or Abe’s Oddysee / Oddworld, or even, more prosaically, the Link games / Super Mario World universe.  Something a bit unusual.  I’d also like the gameplay to allow for a certain degree of freedom in terms of actions / animations, eg, dodge and roll, etc.

Artificial intelligence frameworks and embodiment

The final discarded item in the string of ideas I thought would be interesting to consider (and which I may eventually return to) is artificial intelligence.

In particular, I’d be very interested at some point starting to look into using OpenCog for embodiment of intelligent agents in a Unity game world, and somehow also incorporating that into the game.  This would be an extremely interesting thing to do – not least of which is that it seems that the community team behind that project seems to be starting to get some traction with their ideas.  Certainly at the very least I’m interested to see how things progress on that front over the next few years – as, if their current roadmap is even to be half believed, there could well be some fairly interesting behaviours one could instantiate in agents within a game world circa 2015+ or so, through use of the OpenCog framework.   Something that would be worth doing by someone on that project in particular might be to write tests; certainly, if I had unlimited amounts of time and energy I would do so myself, but I consider this extremely unlikely at the moment given my current priorities.