User blog comment:RobinCarr/How Does Crystal Production Shutoff/@comment-5116140-20130122025145

Two Models for Game Recipe Events

Is the Cookbook file Large or Small 

Well villagers - we are really close to knowing the answer to the question posed on this blog, and I want to thank all the villagers who have submitted data over the last few days. We need to remain attentive for probably just one more day - but we will get the answer thanks to you!

Our #1 Question: When the shutoff file is pushed, will the last recipe give cyrstals or not.

This all depends on how game recipe events are stored. Every time you start a recipe in any store, a new recipe object is added to your game file - and sent to the server quite regularly. These recipe objects art collected in a file* I will call your Cookbook.


 * It does not matter if they are in a separate file or are just stored as a data structure such as an array or stack.

Each r ecipe object has numerous fields such as the start time and cooking time. As the game runs, a field I will call timeRemaining, is calculated and displayed. It is a calculated field and is not stored with the object. Your cookbook looks something like this.

{ [Recipe1: field1, field2, ...],

[Recipe2: field1, field2, ...],

[Recipe3: field1, field2, ...] }

Now there are two models for this cookbook, and which one is used will determine the answer to our #1 question.

Model 1: The Small Cookbook

The Small Cookbook model postulates that all info, such as the reward you get, is stored on your gadget. This info is imported into your game at start up, but the Cookbook on the server remains tiny, holding such critical data as the start Time, building and recipe ID only. If this model is correct, your recipes will change from crystals to lousy coins at startup after the cutoff files are sent.

Model 2: The Large Cookbook

The Large Cookbook model postulates that your Cookbook file (on the server) holds many more fields, in fact all the data needed to process and complete your recipe as intended. When you start a new recipe,  all the data for that recipe is collected from the in-game files at that moment, and sent to the Cookbook on the server where it is stored until the recipe is completed. When that recipe is completed, the Cookbook (not your gadget) determines your reward, and the completed recipe is deleted from the Cookbook.

We really don't know yet if the server-side Cookbook file is large or small.

But thanks to your data, we will know very, very soon.

Many thanks for all your contributions.

ID: DreamingDino