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.
- 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.
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.
- gamestate
- startgame
- checkpoint
- selecttile
- selectfarmbit
- selectitem
- selectbuy
- buy
- cancelbuy
- roadbuilds
- tileuseselect
- itemuseselect
- togglenutrition
- toggleshop
- toggleachievements
- skiptutorial
- speed
- achievement
- farmbitdeath
- blurb
- click
- rainstopped
- history
- endgame
- emote
- farmfail
- bloom
- farmharvested
- milkproduced
- poopproduced
- debug
- newfarmbit
- availablefood
- moneyrate
- sadfarmbits
- lakenutrition
- salestart
- saleend]
- rainstarted
- eatfood
- reset
- farmgrowth
- Event Categories
- Emotes
- Buys
- Names
- Speed
- Achievements
- Tutorials
- Thing Type
- Inspector Content
- Text Type
- Advisor Type
- Tile Type
- Tile Type
- Job Type
- Item Type
- Job State
- Farmbit State
- Farmbit Need
- Direction
- Mark
See parsing data matrices for an example of how to parse the tiles, farmbits, and items in python.
Key | Value | Description |
---|---|---|
tiles | uint8_tile_array().join() | Tile data matrix. Note: Does not include tx,ty of each tile because all the tiles are sorted by position. |
farmbits | uint8_farmbit_array().join() | Farmbit data matrix. |
items | uint8_item_array().join() | Item data matrix. |
money | gg.money | current money |
speed | gg.speed | current game speed (see Speed) |
achievements | achievements | 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: In continues, games will first generate farmbits (newfarmbit) before sending a startgame log.
Key | Value | Description |
---|---|---|
tile_states | tile_states | 2500 element array of tile state indices. |
tile_nutritions | tile_nutritions | 2500 element array of tile nutritions on a scale 0-255. |
continue | gg.continue_ls ? 1: 0 | 1/0 boolean to indicate whether the player continued or not |
language | english, espanol, or deutsche | language of the game |
audio | AUDIO ? 1: 0 | 1/0 boolean to indicate whether audio was toggled on or not |
fullscreen | g.scenes[1].fullscreen_toggle.on ? 1: | 1/0 boolean to indicate whether the game was toggled into fullscreen whether or not |
Checkpoints are the google analytics events. As of 8/14/19 these are always tutorial begins and ends. See tutorials.
Key | Value | Description |
---|---|---|
event_category | arguments[2] | Always (as of 8/14/19) begin or end |
event_label | arguments[2] | Tutorial name. For example, the name of the tutorial that teaches the player how to build a house is called "build_a_house" |
event_type | arguments[1] | Always (as of 8/14/19) tutorial |
blurb_history | flush_blurb_history(now) | List of client time relative to now for each blurb popup. (Blurbs are now logged here instead of the blurb event.) |
client_time | now | current client time |
Note: Selections may happen automatically by advisors in the tutorials.
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Tile information reduced to an array. See Data Short. |
marks | t.marks | Tile mark indices. |
Note selections may happen automatically by advisors in the tutorials.
Key | Value | Description |
---|---|---|
farmbit | farmbit_data_short(f) | Farmbit information reduced to an array. See Data Short. |
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. |
deprecated as of v3 mark | it.mark | Item mark index. |
Key | Value | Description |
---|---|---|
buy | buy | Buy index. |
cost | gg.shop.buy_cost(buy) | Cost of buy |
curr_money | gg.money | Current money |
success | gg.money>=gg.shop.buy_cost(buy) | Boolean. Whether the buy can be selected or not. (Cannot select a buy that cannot be paid for.) |
Note: Buys are logged whether the buy was a success or not.
Key | Value | Description |
---|---|---|
buy | gg.shop.selected_buy | Buy index. |
tile | tile_data_short(gg.b.hover_t) | Data Short for the tile the buy will be placed on. |
success | gg.b.placement_valid(gg.b.hover_tgg.shop.selected_buy) | 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. |
client_time | now | current client time |
Key | Value | Description |
---|---|---|
selected_buy | buy | Buy index. |
cost | gg.shop.buy_cost(buy) | Cost of buy. |
curr_money | gg.money | Current money. |
buy_hovers | flush_buy_hovers(now) | List of tile Data Short appended with client time before now for each hovered tile since either selectbuy log or the previous buy log. |
client_time | now | current client time |
Key | Value | Description |
---|---|---|
road_builds | flush_road_hovers(now) | List of tile Data Short appended with client time before now for each tile a road was built on. |
client_time | now | current client time |
Note that this log occurs even when the player selects the current use/mark, i.e. produced corn 1 sell->sell.
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Tile information reduced to an array. See Data Short. |
marks | t.marks | Tile mark indices. |
Note that this log occurs even when the player selects the current use/mark, i.e.corn sell->sell.
Key | Value | Description |
---|---|---|
item | item_data_short(it) | Item information reduced to an array. See Data Short. |
prev_mark | self.prev_item_use | Item's previous mark index. |
Key | Value | Description |
---|---|---|
to_state | gg.b.nutrition_view | 1 if nutrition view is being turned on, 0 if turned off. |
tile_nutritions | nutrition_array() | 2500 element array of tile nutritions on a scale 0-255. |
Key | Value | Description |
---|---|---|
shop_open | gg.shop.open | 1 if the shop view is being opened, 0 if closed. |
Key | Value | Description |
---|---|---|
achievements_open | gg.achievements.open | 1 if the achievement view is being opened, 0 if closed. |
Note: Tutorial checkpoints will be logged regardless of if the tutorial is skipped or not.
Key | Value | Description |
---|---|---|
(none) | Event itself indicates that the player skipped a tutorial (the tutorial skipped is the last tutorial event logged). |
Key | Value | Description |
---|---|---|
cur_speed | gg.speed | To speed index. |
prev_speed | speed | From speed index. |
manual | manual_speed_bool | bool: 1 if speed was manually changed, 0 if not |
Key | Value | Description |
---|---|---|
achievement | i | Achievement index. |
Key | Value | Description |
---|---|---|
farmbit | farmbit_data_short(f) | Dead farmbit's information reduced to an array. See Data Short. |
grave | tile_data_short(f.home) | Tile data short of dead farmbit's home. Note that this tile has now changed from type home to type grave (See tile type.) |
(not currently implemented. See blurb_history under checkpoint.) Note: a blurb is an utterance from an advisor.
Key | Value | Description |
---|---|---|
(none) | Event itself indicates that the player clicked to the next blurb in a tutorial etc. (the tutorial itself is the last tutorial event logged). |
Key | Value | Description |
---|---|---|
(not currently implemented) |
Key | Value | Description |
---|---|---|
(none) | Log itself indicates that it was raining and the raining has now stopped. |
Not included in versions 11+
Key | Value | Description |
---|---|---|
client_time | now | current client time |
camera_history | flush_camera_history(now) | List of camera moves since last history log. |
emote_history | flush_emote_history(now) | List of 11 element sublists: [farmbit, emote index, time before client_time (negative number)] emotes since last history log. |
Key | Value | Description |
---|---|---|
(none) | Log itself indicates the player has left the game page. Seperate history and gamestate logs are sent. |
Introduced in v11.
Key | Value | Description |
---|---|---|
farmbit | farmbit_data_short(t) | Data of the farmbit that made the emote. See Data Short. |
emote_enum | emote_id | See emotes. |
Introduced in v11. Occurs when a growing farm's nutrition turns from pink to black (nutrition < nutrition_desperate).
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Farm that failed. See Data Short. |
marks | t.marks | Farm mark indices. |
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.
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Data of the tile that bloomed. See Data Short. |
marks | t.marks | Not relevant to lake tiles. Included for uniformity. |
Introduced in v11. Occurs when a farmbit harvests a farm (and thus produces 2 corn).
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Farm that produced corn. See Data Short. |
marks | t.marks | Tile mark indices. |
Introduced in v11. Occurs when a dairy produces milk.
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Dairy that produced milk. See Data Short. |
marks | t.marks | Tile mark indices. |
Introduced in v11. Occurs when a dairy produces poop.
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Dairy that produced poop. See Data Short. |
marks | t.marks | Tile mark indices. |
Introduced in v12. Occurs when someone enters "spyparty" on the keyboard.
Key | Value | Description |
---|---|---|
(none) | Event itself means that someone has used "spyparty" to enter debug mode. |
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.
Key | Value | Description |
---|---|---|
farmbit | farmbit_data_short(t) | New farmbit. See Data Short. |
Introduced in v16. Occurs every 5 seconds once the player buys food.
Key | Value | Description |
---|---|---|
food | gg.food | Current amount of food available on board |
farmbit | gg.farmbits.length | Current number of farmbits on board |
food_perfarmbit | food/gg.farmbits.length | 0 | number of food per farmbits on the board |
Introduced in v16. Occurs every 5 seconds once the player buys a house.
Key | Value | Description |
---|---|---|
money | gg.money | Money currently accumulated |
rate | money/permin | Rate of money accumulation |
Introduced in v16. Occurs every 5 seconds once a farmbit enters the board.
Key | Value | Description |
---|---|---|
sad | sad | Number of farmbits with joy status of DESPERATE |
farmbit | gg.farmbits.length | Current number of farmbits on board |
sad_perfarmbit | sad/gg.farmbits.length | Amount of sadness per farmbit |
Introduced in v17. Occurs every 5 seconds once rain falls to compute lake nutrition.
Key | Value | Description |
---|---|---|
lake_pos_tile | gg.lake_nutes.length | Number of lake tiles on the board |
total_nutrition | gg.lake_nutes.reduce((a,b) => a + b, 0) | Total nutrition of the lake |
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 |
worth | worth | monetary value of the item to be sold |
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 |
worth | worth | monetary value of the item sold |
Introduced in v18. This logs when rain has started (8/14/2020).
Key | Value | Description |
---|---|---|
(none) | The log itself indicates that rain has started. |
Introduced in v18. This logs the farmbit that ate an item. The item then leaves the screen (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. |
Introduced in v20. Occurs when a growing farm's nutrition turns from black to pink after in a farmfail state. (nutrition > nutrition_desperate).
Key | Value | Description |
---|---|---|
tile | tile_data_short(t) | Farm that regained from a farmfail state. See Data Short. |
marks | t.marks | Farm mark indices. |
Index | Name | Description |
---|---|---|
0 | gamestate | |
1 | startgame | |
2 | checkpoint | |
3 | selecttile | |
4 | selectfarmbit | |
5 | selectitem | |
6 | selectbuy | |
7 | buy | |
8 | cancelbuy | |
9 | roadbuilds | |
10 | tileuseselect | |
11 | itemuseselect | |
12 | togglenutrition | |
13 | toggleshop | |
14 | toggleachievements | |
15 | skiptutorial | |
16 | speed | |
17 | achievement | |
18 | farmbitdeath | |
19 | blurb | |
20 | click | |
21 | rainstopped | |
22 | history | |
23 | endgame | |
24 | emote | |
25 | farmfail | |
26 | bloom | |
27 | farmharvested | |
28 | milkproduced | |
29 | poopproduced | |
30 | debug | |
31 | newfarmbit | |
32 | availablefood | |
33 | moneyrate | |
34 | sadfarmbits | |
35 | lakenutrition | |
36 | salestart | |
37 | saleend | |
38 | rainstarted | |
39 | eatfood | |
40 | reset | |
41 | farmgrowth |
Index | Name | Description |
---|---|---|
0 | null | |
1 | fullness_motivated_txt | "i'm hungry" |
2 | fullness_desperate_txt | "i need food" |
3 | energy_desperate_txt | "i need a nap!" |
4 | joy_motivated_txt | "i want to play in the water" |
5 | joy_desperate_txt | "i'm so sad" |
6 | puke_txt | "🤮" |
7 | yum_txt | "😋" |
8 | tired_txt | "😴" |
9 | happy_txt | "🙂" |
10 | swim_txt | "swim" |
11 | sale_txt | "sale", deprecated. See salestart and saleend. |
Index | Name | Description |
---|---|---|
0 | null | |
1 | home | |
2 | food | |
3 | farm | |
4 | fertilizer | |
5 | livestock | |
6 | skimmer | |
7 | sign | |
8 | road |
Index | Name | Description |
---|---|---|
0 | Peter | |
1 | Paul | |
2 | Mary | |
3 | John | |
4 | George | |
5 | Ringo | |
6 | Yoko | |
7 | Stevie | |
8 | Saanvi | |
9 | Nethra | |
10 | Meha | |
11 | Sidney | |
12 | Lucy | |
13 | Belden | |
14 | Henry | |
15 | Alejandro | |
16 | Victor | |
17 | Richard |
Index | Name | Description |
---|---|---|
0 | null | |
1 | pause | x0 speed |
2 | play | x1 speed |
3 | fast | x4 speed |
4 | vfast | x16 speed |
Achievements is stored as a 16 element boolean array, true if the achievement has been gotten.
Index | Name | Description |
---|---|---|
0 | exist | get a visitor. |
1 | group | 3 workers |
2 | town | a small community |
3 | city | 10 townmembers |
4 | farmer | own a farm! |
5 | farmers | get three farms |
6 | farmtown | 5 farms! |
7 | megafarm | 10 farm industry |
8 | paycheck | $500 |
9 | thousandair | $1000 |
10 | stability | $5000 |
11 | riches | $10000 |
12 | bloom | algae destroys one tile |
13 | bigbloom | algae spreads to 3 tiles |
14 | hugebloom | you have an algae problem |
15 | massivebloom | a whole lake destroyed" |
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) |
20 | rain | tutorial 11 | tut10 end, 1000 (game?) time units passed |
21 | sell_food | tutorial 6 | tut5 end |
22 | successful_harvest | tutorial 5 | tut4 end, 1+ food on map, 1+ farm on map |
23 | timewarp | tutorial 4 | tut3 end |
24 | unattended_farm | (??) | |
25 | unused_fertilizer | (??) |
Index | Name | Description |
---|---|---|
0 | null | Default |
1 | tile | Gameboard tiles. Has state, type, and an array of 4 marks. Abbreviated as "t". |
2 | item | Of type water, food, fertilizer, poop, milk. Has mark attribute. Abbreviated as "it". |
3 | farmbit | Has name, state, job type, job state. Abbreviated as "f". |
Index | Name | Description |
---|---|---|
0 | null | |
1 | farmbit | |
2 | item | |
3 | tile |
Index | Name | Description |
---|---|---|
0 | null | |
1 | observe | |
2 | dismiss | |
3 | direct |
Index | Name | Description |
---|---|---|
0 | null | |
1 | mayor | |
2 | business | |
3 | farmer |
Index | Name | Description |
---|---|---|
0 | null | |
1 | home_vacant | |
2 | home_occupied | |
3 | land_d0 | |
4 | land_d1 | |
5 | land_d2 | |
6 | farm_unplanted | |
7 | farm_planted | |
8 | farm_grown | |
9 | livestock_eating | |
10 | livestock_digesting | |
11 | livestock_milkable |
Index | Name | Description |
---|---|---|
0 | null | |
1 | land | |
2 | rock | |
3 | grave | |
4 | sign | |
5 | lake | |
6 | shore | |
7 | forest | |
8 | home | |
9 | farm | |
10 | livestock | |
11 | road |
Index | Name | Description |
---|---|---|
0 | null | |
1 | idle | |
2 | wait | |
3 | eat | |
4 | sleep | |
5 | play | |
6 | plant | |
7 | harvest | |
8 | feed | |
9 | fertilize | |
10 | milk | |
11 | export |
Index | Name | Description |
---|---|---|
0 | null | |
1 | water | |
2 | food | |
3 | poop | |
4 | fertilizer | |
5 | milk |
Index | Name | Description |
---|---|---|
0 | null | |
1 | get | |
2 | seek | |
3 | act |
Index | Name | Description |
---|---|---|
0 | null | |
1 | dire | |
2 | desperate | |
3 | motivated |
Index | Name | Description |
---|---|---|
0 | null | |
1 | fullness | |
2 | energy | |
3 | joy | |
4 | fulfillment |
Index | Name | Description |
---|---|---|
0 | null | |
1 | r | |
2 | dr | |
3 | d | |
4 | dl | |
5 | l | |
6 | ul | |
7 | u | |
8 | ur |
Each tile contains an array of 4 marks and each item contains one mark.
Index | Name | Description |
---|---|---|
0 | null | |
1 | use | Default mark. |
2 | sell | |
3 | feed |
Index | Name | Description |
---|---|---|
0 | t.tx | center tile tx |
1 | t.ty | center tile ty |
2 | auto | boolean for whether the move happened automatically (1) or not (0) |
3 | time-now | time before client_time that the move happened (negative number) |
These are each uint8 vectors. They are as follows:
- Tile
Index | Name | Description |
---|---|---|
0 | val/nutrition_max*255 | 0-255 representing a tile type dependent value if exists, 0 otherwise. For example, this refers to growth for farms and remains 0 for homes. |
1 | nutrition/nutrition_max*255 | 0-255 representing nutrition of each tile. |
2 | og_type | Original tile type index. |
3 | type | Current tile type index. |
4 | tx | Tile grid x coordinate. (Not included in data matrix) |
5 | ty | Tile grid y coordinate. (Not included in data matrix) |
- Farmbit
Index | Name | Description |
---|---|---|
0 | tile.tx | Tile grid x coordinate of associated tile. |
1 | tile.ty | Tile grid y coordinate of associated tile. |
2 | name | Farmbit name index. |
3 | job_state | Current job state index, (null, get, seek, act). |
4 | job_type | Current job type index. |
5 | fullness/max_fullness*255 | Measure of hunger from 0-255 |
6 | energy/max_energy*255 | Measure of energy from 0-255 |
7 | joy/max_joy*255 | Measure of joy from 0-255 |
8 | fulfillment/max_fulfillment*255 | Measure of fulfillment from 0-255 |
- Item
Index | Name | Description |
---|---|---|
0 | tile.tx | Tile grid x coordinate of associated tile. |
1 | tile.ty | Tile grid y coordinate of associated tile. |
2 | type | Item type index. |
3 | mark | Item mark index. |
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.
Here is an example of how to parse the string data matrices in the gamestate log using python:
# reformat raw variable functions
def read_stringified_array(arr:str) -> List[int]:
"""Example:
>>> read_stringified_array("1,2,3,4,5,6,7,8")
[1,2,3,4,5,6,7,8]"""
if not arr:
return []
return [int(x) for x in arr.split(',')]
def array_to_mat(num_columns: int, arr: List[int]) -> List[List[int]]:
"""Example:
>>> array_to_mat(2, [1,2,3,4,5,6,7,8])
[[1,2],
[3,4],
[5,6],
[7,8]]
"""
assert len(arr) % num_columns == 0
return [arr[i:i + num_columns] for i in range(0, len(arr), num_columns)]
We can use the above functions to parse the following raw variables:
_tiles, _farmbits, _items = event["tiles"], event["farmbits"], event["items"]
# reformat array variables
_tiles = read_stringified_array(_tiles)
_farmbits = read_stringified_array(_farmbits)
_items = read_stringified_array(_items)
tiles = array_to_mat(4, _tiles)
farmbits = array_to_mat(9, _farmbits)
items = array_to_mat(4, _items)
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:
def tile_i_to_xy(i):
"""
>>> tile_i_to_xy(1512)
(12,30)
"""
ty = i//50
tx = i%50
return tx,ty
Example usage could be to create a farm_map: Dict[txy_coor, int]
that maps a txy_coor tuple like (12,25) to the type of farm:
for i,t in enumerate(tiles):
type = t[3]
if type in [9,10]: #farm or livestock
self.farm_map[tile_i_to_xy(i)] = type
The logging script (logging.js) was bundled (to bundle.js) using Browserify with Pako. NOTE: These are removed in v4.
- Browserify - Allows the use of Pako in the browser.
- Pako - zlib port to javascript used to gzip gamestates.