Home

Monthly Archives: March


Back-End: Function Chains in AS3  

We are lately pepping up our code-base by making it more modular. Things get cluttered very easy if you have to deal with a lot of asynchronous interdepending data.
Imagine you’d like to implement two distinct, independent methods to first load some 3D-models and then load their according textures. In AS3 you would basically create two loader-objects, one for the 3d-model and one for the texture. The first loader would then receive a COMPLETE- or INIT-event-listener pointing to the next loader, which would then load the textures and finally (on receiving another complete-event) do something with all those data. Pretty bound at the hip, if you don’t want to end up with anonymous listeners, which is not recommended. And it’s pretty much the same if you use a multi-loader (like Arthur Debert’s great BulkLoader) and listen to either the completion of the whole bulk or its parts. What if you want to keep all methods self-contained?

Enter Yoshinori Munehara’s Chain-class. This class allows for function-chains which can consist of any combination of methods, listeners, tweens and wait-commands, which can either be executed as a top-down list or parallel. Yoshinori’s work seems to be virtually unknown in the west since everything is unfortunately explained in Japanese only. Still, we highly recommend Chain.as—if you take a few minutes to look at the source-code and the examples, it’s pretty easy to figure out how it works.

In our case, we used this to decouple a lot of our loader-methods, which are now neatly self-contained and can be called and combined freely by a front-controller with a chain. Bulkloader and Yoshinori’s chain work together like a charm. 


Upgrade: Forest  

Coobico: Forest

A forest is the work-place of a wood-cutter. Forests are upgrades for farmsteads, used to produce Wood & Crop in exchange for higher levels of pollution. 


Game-Mechanics: Supply Chains  

It’s about time for another posting about Coobico’s supply chains and how they affect the management of a settlement. Based on our general mantra of keeping Coobico’s gameplay as simple as possible, we started out with only a hand-full of resources and goods – while tweaking the game it felt necessary to introduce additional types of goods.

To be precise, “simple” settlers produce and need basic goods, while “advanced” settlers require and manufacture additional, different types of resources. This is a straightforward fundamental underlying principle of several city-building games we decided to implement too. For example, a farm and its upgrades can provide basic necessities like food-supplies and wood & crop, important for almost all settlers. But with an advanced upgrade like a papermill, you can also produce paper & dye, which is required to keep scholars and healers happy.

While introducing new types of goods like paper & dye, tool & weapons and horses, we have yet avoided using complex supply-chains, for the sake of intuitive usability. You will not need to build different types of buildings depending on each other as production chains (as in the Anno series, for example). Whenever a settlement requires a certain resource, you can either manually harvest it somewhere or uncover it in a dungeon; you can also trade it from another settlement or build an according production spot in your settlement (which might require certain tech achievements and will probably raise the settlement’s pollution level). This works consistently for each of the resources of the game.


Upgrade: Papermill  

Coobico: Papermill

In a papermill, paper & dye is manufactured by a papermaker. Paper & dye is an important good for advanced settlement, since it is necessary to keep settlers like Healers and Scholars happy. A papermill is another upgrade for farmsteads.