Each log is sent with a number of fields required by simplelog. Simple log allows for a custom field called event_data_complex along with its category enumerator:
event_custom: category enumerator
event_data_complex: JSON.stringify(log_data)
Each log_data is a JSON object for that specific category as defined below.
Bugs
There would be 'grave' entries from farmbitdeaths that gives nulls. E.g. [0,0,null,null,null]. The bug doesn't come from normal in-game deaths, the last farmbit death or resetting the game.
(FIXED) Game resets don't always function as expected and there have been reset logs that are not followed by startgame events.
Version Log
Versions:
Alpha
Original Version
Change itemusechange: remove mark, add prev_mark (introduced bug fixed in v9). Also removed mark from selectitem because its already contained in the item data short. (8/13/2019)
Remove gzipping. (8/13/2019)
Restructure speed logs. Old version only logged manual speed changes. New version logs automatic and manual speed changes with a boolean "manual" as 1 if manually changed and 0 otherwise. (8/14/2019)
Add num milk/food/poop produced into the gamestate log. (8/15/2019)
Change num milk/food/poop produced from "since beginning of game" to "since last gamestate log". (8/21/2019)
Add fields for continue, language, audio, and fullscreen in the gamestart. Also now logs endgame when a player dies in addition to when a player exits the page. (8/22/2019)
Fix bug in itemusechange. Previously the itemusechange log did not include a label "item" for the "item" field. Now it does. (9/4/2019)
Simple log now sends player_id (if present) from the URL to log.php (9/24/2019)
Introduces log indices 24-29. Removes history logs. Changes emote history into separate emote logs. Produced logs now in separate logs. New logs for bloom and farmfail. (10/16/2019)
Introduces log index 30, debug. Also fixes an issue where gamestate's curr_selection_data key would not exist. (Detailed_data would not send a return value if the inspector is not open, and the key would not be assigned a value. Now it returns [] if the inpsector is not open). (10/22/2019)
Introduces log index 31, newfarmbit. Also now always sends a "gamestate" log immediately after any "startgame" log (10/23/2019)
Small typo fix. Previously the fullness desperate emote (I NEED FOOD!) did not match the logging category (I NEED FOOD). For v13 logs, please reassign any null (index=0) emotes to fullness desperate (index=2) emotes. (10/30/2019)
Add placement_valid to each buy hover (11/1/2019).
For these changes, use v18+. Introduces log indices 32-34: 32. availablefood, moneyrate, and sadfarmbits. This logs food available, money rate and sadness of the farmbits, respectively (8/12/2020).
For these changes, use v18+. Introduces log index 35: lakenutrition.
Introduces log indices 36-40: salestart, saleend, rainstarted, eatfood, and reset. 36-37: This logs the farmbit selling, the item sold, and the worth. The farmbit and item leave the field during salestart, and the money is added to total money when the farmbit returns without the item at saleend. This fully deprecates emote_sale in emotes. 38: This event signals when rain has started. 39: This event logs the farmbit eating and the food eaten. 40: This event signals when the game is about to reset, and is followed by a gamestate log (8/14/2020).
Changed the field on moneyrate of money to be the actual amount of money of the player instead of the rate. (gg.advisors.money_rate to gg.money). (9/8/2020)
Commented out reset (buggy on the layout/positioning). (10/30/2020)
Uncommented a line of code in the logging file that removes the reset enum. Also, shifted farmgrowth enum from 42 to 41.
A boolean array of whether the player has gotten the achievement at that index.
num_checkpoints_completed
get_num_checkpoints_completed()
Number of tutorials began + number of tutorial ended. Includes tutorials skipped.
raining
gg.b.raining
Boolean - currently raining or not.
curr_selection_type
gg.inspector.detailed_type
Current selection inspector content index. (Note that because the game currently (as of 7/25) logs gamestate only after buys, this will always be the type of tile.)
curr_selection_data
detailed_data()
SelectFarmbit/SelectItem/SelectTile data, depending on the curr_selection_type. (Warning: Prior to v12, this field will not exist if current_selection_type is 0, i.e. there is nothing selected.)
camera_center
prev_center_txty
Tile that the game is currently centered on.
gametime
time
Metric to count speed-adjusted time. Based on number of ticks.
timestamp
now
current client time
num_food_produced
num_food_produced_since_last_gamestate_log
total number of food produced (not bought) since the last gamestate log
num_poop_produced
num_poop_produced_since_last_gamestate_log
total number of poop produced (not bought) since the last gamestate log
num_milk_produced
num_milk_produced_since_last_gamestate_log
total number of milk produced (not bought) since the last gamestate log
Note selections may happen automatically by advisors in the tutorials. Mark is no longer necessary to send, as it is contained within item's data_short.
Key
Value
Description
item
item_data_short(it)
Item information reduced to an array. See Data Short.
Boolean. Whether the buy can be put on the tile. If not, buy fails.
buy_hovers
flush_buy_hovers(now)
List of tile Data Short appended with placement_valid (boolean denoting whether player can build in that tile, only sent in logging v15+) and client time before now for each hovered tile since either selectbuy log or the previous buy log.
Introduced in v11.
Occurs after rainfall for each lake tile that bloomed during the rain. Blooming is controlled by nutrition and defined as nutrition > water_fouled_threshhold, which is when the lake tile turns green.
Introduced in v13.
Occurs when a new farmbit enters the game.
Note: In continues, games will first generate farmbits (newfarmbit) before sending a startgame log.
Introduced in v18.
This logs the farmbit selling, the item sold, and the worth. The farmbit and item leave the field during salestart, and the money is added to total money when the farmbit returns without the item at saleend. This fully deprecates emote_sale in emotes (8/14/2020).
Key
Value
Description
farmbit
farmbit_data_short(f)
Farmbit information reduced to an array. See Data Short
item
item_data_short(it)
Item information reduced to an array. See Data Short
Introduced in v18.
This logs the farmbit selling, the item sold, and the worth. The farmbit and item leave the field during salestart, and the money is added to total money when the farmbit returns without the item at saleend. This fully deprecates emote_sale in emotes (8/14/2020).
Key
Value
Description
farmbit
farmbit_data_short(f)
Farmbit information reduced to an array. See Data Short
item
item_data_short(it)
Item information reduced to an array. See Data Short
Introduced in v18.
This logs when the player presses "Reset Game", followed by a "yes" confirmation when asked if they are sure. A gamestate log is logged immediately after (8/14/2020). (Currently being pulled out for the Fellowship meeting (10/30/2020))
Key
Value
Description
(none)
The log itself indicates that the game has recieved the signal to reset.
There are 26 begins and 26 ends. In the constants for the feature extractor, these tutorials are assigned indices alphabetically. Tutorials may happen in any order, but the tutorials with descriptions tutorial 1-11 must be completed in order, and are considered "tutorial mode". Players cannot achieve a sustainable farm without completing the first 6. Rain does not begin until all 11 are completed.
Index
Name
Description
Trigger
0
another_death
(maybe 2nd death)
1
another_member
(maybe 2nd farmbit)
2
bloom
(maybe first bloom)
3
build_a_farm
tutorial 3
tut2 end
4
build_a_house
tutorial 1
(None)
5
buy_fertilizer
tutorial 7
tut6 end, exists a farm which has nutrition < nutrition_motivated
6
buy_food
tutorial 2
tut1 end
7
buy_livestock
tutorial 8
tut7 end, 2+ farms on map
8
death
(maybe doesnt get used)
9
end_life
(??)
10
extra_life
(??)
11
final_death
(maybe game over)
12
flooded_fertilizer
(maybe after it rains while fertilizer present; i.e. runoff starts)
13
gross
(maybe first puke emote)
14
gross_again
(maybe second puke emote)
15
livestock
tutorial 9
tut8 end, 1+ livestock on map
16
long_travel
(??)
17
low_nutrients
(maybe farmfail?)
18
mass_sadness
(??)
19
poop
tutorial 10
tut9 end, 1+ poop on map (distinct from fertilizer)
Comma delimited string of uint8s.
Example: "15,3,6,9,12,0,0,2,9,...2,0,0,6"
Meant to be parsed to form 2d arrays like:
[[15,3,6,9],
[12,0,0,2,9],
...
[2,0,0,6]]
See Parsing Data Matrices for examples of how to parse these strings.
The gamestate log contains uint8 arrays of all tiles, farmbits, and items.
These arrays are concatenated data_short arrays, and can be thought of as matrices where the row (farmbit/tile/item instance)
is index//vars_per_entry and the column is index%vars_per_entry.
Note: The gamestate log of all tiles does not contain tile tx,ty. Row of the tile is derivable from 50*ty+tx.
Other helpful utilities include the following to convert the data matrix index to a tile (x,y) coordinate on the 50x50 map where (0,0) is at the top-left and (49,49) is bottom left: