News

DevBlog 33 - Building Explained

Hello and welcome to the 33rd CardLife DevBlog,

As I mentioned in last week’s Devblog we are going to be slowing down on updates while everyone is working on large major features, so there is no patch this week, but we do have a nice big DevBlog :)

Ongoing Work: Building

Building is progressing really well which is very exciting. Cian now has the majority of pieces in-game and you can build some really cool structures with the pieces we have added. If you have been following CardLife for a while you will probably know that we deliberated a lot over the balance between creative freedom and ease-of-use - and I think we have struck a nice balance, although the true test will be when we push it live. 

I touched on last week that the building was being developed in a data driven manner and this week I wanted to give you a more in-depth description of what that actually means. Firstly each building piece is modelled in Maya (a 3D modelling program). Then Mike adds locators at specific points on the model which represents the connection points at which a piece of card would snap to another piece of card. This means in-game you can place a floor piece on the ground and then craft a wall and point your crosshair at the visual connection points on the floor and the wall will just snap to them.

This snapping though is not just a simple matter of aligning the locators and attaching the pieces together though. Each locator has a specific naming convention that contains all of the design logic for the building system which works like a lock and key system. This means that when you’re holding a building piece and looking at an already constructed piece - the code will check which locators on the held piece (i.e. keys) fit into the locators on the targeted piece (i.e. locks) and hide any others.

This means that we can prevent pieces of card being snapped together in a such a way that would totally break the system. For example you can place an angled ceiling onto an angled wall using the central top locator - but you wouldn’t want that same central top locator being used to snap an angled ceiling to a normal straight wall as half of it would intersecting as the below image shows:

Now as I mentioned at the beginning, each piece is modelled in 3D but when we export the object to card - our exporter turns it into a series of 2D images and creates a .json file (think of this like a text file) which contains all of the data. This .json file contains the position (x,y,z coordinates) and the name of the locators - which as you now know dictates the design logic for the building system. This means it is incredibly simple for you to be able to change this name and/or position to be whatever you want to allow for a much freer building system on your own server. You can also easily load up the 2D images in paint and tweak those, or make your own to create brand new pieces without ever touching a 3D modelling package. That is the true power of the data driven method.

Ongoing Work: Crafting & CTD

Brian has continued to work on the crafting system and is mainly focussed on allowing you to draw your own tools with the Connect the Dots system. This is working really well but as we are making an online multiplayer game it means every feature we do has to take that into account - so he is making sure that the tools you make can be seen by other players. This means that once you have crafted your tool, that data is sent to the server and then sent to other players who connect to that server - so that they can see your custom tool.

We have also made some usability tweaks to the normal crafting system to help improve the user experience. The first of these being that an item is now always selected by default in the item crafting list, so you can clearly see what other materials you need to craft that item. Previously nothing was selected until you clicked on one of the icons and so it could be confusing as to why the tools showed up but they had red x’s next to them.

Secondly we have merged all of the stone recipes into one which means you won’t get 4 different icons in the item crafting list for the same tool i.e. Stone Pickaxe. So now you can drag any type of stone into the craft slots and it will show the same items to craft and you can also mix different stones types together. When mixing stone types (i.e. Stone and Compact Stone) the final tool will inherit the texture of the stone you used the most. In the cases where you used the same amount of each stone - we will pick the first stone you added. This mixing will also apply to wooden tools when we add more types of wood.

Thirdly we now remember which item you have selected in the crafting list so if you drag in other materials into the craft slots that item will remain selected - where previously it was being deselected. We have also made it so items that can be crafted with the current materials are moved to the top of the list for better visibility and finally we have added simple tooltips that show the name of the ores and tools you can craft.

Ongoing Work: Terrain Generation

As many of you who read this DevBlog will know we have spent many months (in actual fact more than year now - how time flies!) working on our core technology, with the largest effort devoted to ‘cardifying’ the huge voxel world we have created. Now at the moment Neil, our resident tech expert is working on massively improving this so that the game runs really well on low end pcs. This is a long term task though and in the meantime we want to continue working on the game and providing updates.

With this in mind we are going to implement a temporary solution for the terrain generation. In simple terms this means that if you manage to outpace the world generation a loading screen will pop up until your PC catches up. During this period you will be invulnerable and it should only last a few seconds - but this is a way of us in the short term guaranteeing that you don’t get to a part of the world that you cannot interact with. If you want more info on the terrain generation and why we need this type of system have a read of DevBlog 19.

Ongoing Work: Combat & AI

In terms of combat and AI we are still laying the foundations of what these systems will become. In combat we now have animations up and running and we are starting to work on the application of damage. While Aldo is working heavily on the server side of the AI architecture. There’s not really a huge amount to report on these systems but I just want to let you know that we’re progressing steadily.

 -----------------------------------------------------------------

As always if you have any feedback, questions or comments please feel free to contact us at any of our social portals: Facebook, Twitter and our very own Forums.

Cheers,

Rich - Lead Designer