|
Noble Ape
The Central Directories of the Noble Ape Simulation.
|
Historically this represented the Noble Ape but moreso now it represents the Noble Ape's interface to something external. being.c also now connects to the social, brain, body and metabolim simulations through to external simulations. More...
Go to the source code of this file.
Data Structures | |
| struct | being_draw |
| struct | being_from_name_loop_struct |
| struct | being_find_closest_struct |
| struct | being_find_child_struct |
| struct | being_find_name_struct |
| struct | being_listen_struct |
| struct | being_index_loop_struct |
Macros | |
| #define | VISIBILITY_MAXIMUM (2000) |
| #define | VISIBILITY_SPAN (VISIBILITY_MAXIMUM / ((15+16) >> 1)) |
| #define | WALK_ON_WATER(pz, w) (((pz)<w) ? w : (pz)) |
| #define | GENE_SWIM(gene) GENE_VAL_REG(gene, 9, 11, 13, 7) |
| #define | GENE_SPEED(gene) GENE_VAL_REG(gene, 14, 5, 12, 10) |
| #define | GENE_STAGGER(gene) GENE_VAL_REG(gene, 12, 14, 3, 11) |
| #define | GENE_HILL_CLIMB(gene) GENE_VAL_REG(gene, 4, 6, 5, 2) |
| #define | NAMES_SURNAMES 64 |
| #define | NAMES_FIRST 256 |
| #define | FAMILY_NAME_AND_MOD (NAMES_SURNAMES - 1) |
| #define | FIRST_NAME_AND_MOD (NAMES_FIRST - 1) |
| #define | UNPACK_FAMILY_FIRST_NAME(packed_family_name) (packed_family_name & FAMILY_NAME_AND_MOD) |
| #define | UNPACK_FAMILY_SECOND_NAME(packed_family_name) ((packed_family_name / NAMES_SURNAMES)&FAMILY_NAME_AND_MOD) |
| #define | GET_NAME_FAMILY(f0, f1) ((n_byte2)((f0&FAMILY_NAME_AND_MOD)|((f1&FAMILY_NAME_AND_MOD)*NAMES_SURNAMES))) |
Variables | |
| const n_string | body_inventory_description [INVENTORY_SIZE] |
| const n_string | relationship_description [RELATIONSHIPS] |
| const n_string | EnglishNames [576] |
Historically this represented the Noble Ape but moreso now it represents the Noble Ape's interface to something external. being.c also now connects to the social, brain, body and metabolim simulations through to external simulations.
Definition in file being.c.
| #define FAMILY_NAME_AND_MOD (NAMES_SURNAMES - 1) |
| #define FIRST_NAME_AND_MOD (NAMES_FIRST - 1) |
| #define GENE_HILL_CLIMB | ( | gene | ) | GENE_VAL_REG(gene, 4, 6, 5, 2) |
| #define GENE_SPEED | ( | gene | ) | GENE_VAL_REG(gene, 14, 5, 12, 10) |
| #define GENE_STAGGER | ( | gene | ) | GENE_VAL_REG(gene, 12, 14, 3, 11) |
| #define GENE_SWIM | ( | gene | ) | GENE_VAL_REG(gene, 9, 11, 13, 7) |
| #define GET_NAME_FAMILY | ( | f0, | |
| f1 | |||
| ) | ((n_byte2)((f0&FAMILY_NAME_AND_MOD)|((f1&FAMILY_NAME_AND_MOD)*NAMES_SURNAMES))) |
| #define UNPACK_FAMILY_FIRST_NAME | ( | packed_family_name | ) | (packed_family_name & FAMILY_NAME_AND_MOD) |
| #define UNPACK_FAMILY_SECOND_NAME | ( | packed_family_name | ) | ((packed_family_name / NAMES_SURNAMES)&FAMILY_NAME_AND_MOD) |
| #define VISIBILITY_SPAN (VISIBILITY_MAXIMUM / ((15+16) >> 1)) |
| void being_add_state | ( | noble_being * | value, |
| being_state_type | state | ||
| ) |
| n_uint being_affect | ( | noble_simulation * | local_sim, |
| noble_being * | local, | ||
| n_byte | is_positive | ||
| ) |
| n_byte being_awake | ( | noble_simulation * | sim, |
| noble_being * | local | ||
| ) |
This checks to see if the Noble Ape is awake
| sim | The simulation pointer |
| reference | The specific Noble Ape checked for being awake |
if it is not night, the being is fully awake
if it night the being is...
... fully awake to swim
... slightly awake to eat
... slightly awake to slow down
... asleep
Definition at line 2076 of file being.c.
| n_byte* being_brain | ( | noble_being * | value | ) |
| n_byte* being_braincode_external | ( | noble_being * | value | ) |
| n_byte* being_braincode_internal | ( | noble_being * | value | ) |
| n_int being_brainstates | ( | noble_being * | value, |
| n_int | asleep, | ||
| n_byte2 * | states | ||
| ) |
| enum inventory_type being_carried | ( | noble_being * | value, |
| enum BODY_INVENTORY_TYPES | location | ||
| ) |
| void being_change_selected | ( | noble_simulation * | sim, |
| n_byte | forwards | ||
| ) |
| void being_cycle_awake | ( | noble_simulation * | sim, |
| noble_being * | local | ||
| ) |
tmp_speed is the optimum speed based on the gradient
delta_energy is the energy required for movement
amount of body fat in kg
If it sees water in the distance then turn
horizontally oriented posture
When swimming drop everything except what's on your head or back. Note that the groomed flag is also cleared
swimming proficiency
bathing removes parasites
adjust speed using genetics
is the being to which we are paying attention within view?
Find the closest beings
eating when stopped
remember eating
grow
orient towards a goal
a certain time after giving birth females become receptive again
zero value indicates ready to conceive
A mother could have multiple children, so only find the youngest
Birth
mother carries the child
Compute the mass of the unborn child. This will be added to the mass of the mother
child follows the mother
orient towards the mother
suckling
child moves from back to front
sucking causes loss of grooming
hungry mothers stop producing milk
mother loses energy
child gains energy
set child state to suckling
child acquires immunity from mother
no longer carrying the child
rescale familiarity values
Definition at line 2698 of file being.c.
| void being_cycle_universal | ( | noble_simulation * | sim, |
| noble_being * | local, | ||
| n_byte | awake | ||
| ) |
| void being_dead | ( | noble_being * | value | ) |
| void being_dec_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| void being_delta | ( | noble_being * | primary, |
| noble_being * | secondary, | ||
| n_vect2 * | delta | ||
| ) |
| n_int being_dob | ( | noble_being * | value | ) |
| n_int being_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| void being_drop | ( | noble_being * | value, |
| enum BODY_INVENTORY_TYPES | location | ||
| ) |
| n_int being_energy | ( | noble_being * | value | ) |
| void being_energy_delta | ( | noble_being * | value, |
| n_int | delta | ||
| ) |
| n_int being_energy_less_than | ( | noble_being * | value, |
| n_int | less_than | ||
| ) |
| noble_episodic* being_episodic | ( | noble_being * | value | ) |
| void being_erase | ( | noble_being * | value | ) |
| n_byte being_facing | ( | noble_being * | value | ) |
| void being_facing_towards | ( | noble_being * | value, |
| n_vect2 * | vector | ||
| ) |
| void being_facing_vector | ( | noble_being * | value, |
| n_vect2 * | vect, | ||
| n_int | divisor | ||
| ) |
| n_byte being_family_first_name | ( | noble_being * | value | ) |
| n_byte2 being_family_name | ( | noble_being * | value | ) |
| n_byte being_family_second_name | ( | noble_being * | value | ) |
| n_genetics* being_fetal_genetics | ( | noble_being * | value | ) |
| noble_being* being_find_name | ( | noble_simulation * | sim, |
| n_byte2 | first_gender, | ||
| n_byte2 | family | ||
| ) |
| n_byte being_first_name | ( | noble_being * | value | ) |
| noble_being* being_from_name | ( | noble_simulation * | sim, |
| n_string | name | ||
| ) |
return the being array index with the given name
| sim | Pointer to the simulation object |
| name | Name of the being |
Definition at line 738 of file being.c.
| n_byte2 being_gender_name | ( | noble_being * | value | ) |
| n_uint being_genetic_comparison | ( | n_genetics * | primary, |
| n_genetics * | secondary, | ||
| n_int | parse_requirements | ||
| ) |
| n_genetics* being_genetics | ( | noble_being * | value | ) |
| n_string being_get_select_name | ( | noble_simulation * | sim | ) |
| n_int being_height | ( | noble_being * | value | ) |
| n_byte being_honor | ( | noble_being * | value | ) |
| n_int being_honor_compare | ( | noble_being * | first, |
| noble_being * | second | ||
| ) |
| void being_honor_inc_dec | ( | noble_being * | inc, |
| noble_being * | dec | ||
| ) |
| void being_honor_swap | ( | noble_being * | victor, |
| noble_being * | vanquished | ||
| ) |
| void being_immune_transmit | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_byte | transmission_type | ||
| ) |
| void being_inc_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| n_int being_index | ( | noble_simulation * | sim, |
| noble_being * | local | ||
| ) |
| void being_index_loop | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| void being_ingest_pathogen | ( | noble_being * | local, |
| n_byte | food_type | ||
| ) |
| n_int being_init | ( | n_land * | land, |
| noble_being * | beings, | ||
| n_int | number, | ||
| noble_being * | local, | ||
| noble_being * | mother, | ||
| n_byte2 * | random_factor | ||
| ) |
Initialise the ape's variables and clear its brain
| sim | Pointer to the simulation object |
| mother | Pointer to the mother |
| random_factor | Random seed |
this is the being to be born
Set learned preferences to 0.5 (no preference in either direction. This may seem like tabla rasa, but there are genetic biases
clear the generation numbers for mother and father
initially seed the brain with instructions which are genetically biased
has no social connections initially
default type of entity
friend_or_foe can be positive or negative, with SOCIAL_RESPECT_NORMAL as the zero point
randomly initialize registers
initialize brainprobes
this is the same as equals
ascribed social status
produce an initial distribution of heights and masses
These magic numbers were found in March 2001 - feel free to change them!
Definition at line 3287 of file being.c.
| void being_init_braincode | ( | noble_being * | local, |
| noble_being * | other, | ||
| n_byte | friend_foe, | ||
| n_byte | internal | ||
| ) |
initialise inner or outer braincode
initially seed the brain with instructions which are random but genetically biased
initialise based upon a similar being
Find the entry in the social graph with the most similar friend or foe value. The FOF value is used because when two beings meet for the first time this value is calculated based upon a variety of genetic and learned dispositions. Notice also that the search includes index zero, which is the self.
Copy braincode for the most similar individual
Definition at line 3084 of file being.c.
| void being_listen | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| void being_living | ( | noble_being * | value | ) |
| n_byte2* being_location | ( | noble_being * | value | ) |
| n_int being_location_x | ( | noble_being * | value | ) |
| n_int being_location_y | ( | noble_being * | value | ) |
| void being_loop | ( | noble_simulation * | sim, |
| being_loop_fn | bf_func, | ||
| n_int | beings_per_thread | ||
| ) |
| void being_loop_no_thread | ( | noble_simulation * | sim, |
| noble_being * | being_not, | ||
| being_loop_fn | bf_func, | ||
| void * | data | ||
| ) |
| n_byte being_los | ( | n_land * | land, |
| noble_being * | local, | ||
| n_byte2 | lx, | ||
| n_byte2 | ly | ||
| ) |
This checks to see if a Noble Ape can see a particular point
| sim | The simulation pointer |
| reference | The specific Noble Ape checked for being awake |
| lx | The x location of the point to be seen. |
| ly | The y location of the point to be seen. |
Definition at line 783 of file being.c.
| n_int being_mass | ( | noble_being * | value | ) |
| n_int being_memory | ( | noble_simulation * | local, |
| n_byte * | buffer, | ||
| n_uint * | location, | ||
| n_int | memory_available | ||
| ) |
| void being_move | ( | noble_being * | local, |
| n_int | rel_vel, | ||
| n_byte | kind | ||
| ) |
This moves the specified Noble Ape outside the core simulation movement interface - think mouse movement or keyboard movement.
| local | The pointer to the noble_being being moved. |
| rel_vel | The movement variable used - historically the velocity hence the variable name. |
| kind | The kind of movement used - 0 = turning around pivoting on the z-axis (ie a standing turn), 1 = move forwards or backwards based on the direction facing, 2 = cursor like movements along the X and Y axis useful when operating the arrow keys (but not much else). |
Definition at line 2010 of file being.c.
| n_int being_name_comparison | ( | noble_being * | value, |
| n_byte2 | gender_name, | ||
| n_byte2 | family_name | ||
| ) |
| void being_name_simple | ( | noble_being * | value, |
| n_string | str | ||
| ) |
| n_byte being_posture | ( | noble_being * | value | ) |
| n_int being_posture_under | ( | noble_being * | value, |
| enum posture_type | post | ||
| ) |
| n_int being_pregnant | ( | noble_being * | value | ) |
| n_byte2 being_random | ( | noble_being * | value | ) |
| void being_recalibrate_honor_loop | ( | noble_simulation * | local, |
| noble_being * | value, | ||
| void * | data | ||
| ) |
| void being_remains | ( | noble_simulation * | sim, |
| noble_being * | dead | ||
| ) |
| void being_remains_init | ( | noble_simulation * | sim | ) |
| void being_remove_final | ( | noble_simulation * | local_sim, |
| being_remove_loop2_struct ** | brls | ||
| ) |
| being_remove_loop2_struct* being_remove_initial | ( | noble_simulation * | local_sim | ) |
| void being_remove_loop1 | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| void being_remove_loop2 | ( | noble_simulation * | local_sim, |
| noble_being * | local, | ||
| void * | data | ||
| ) |
| void being_reset_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| void being_set_family_name | ( | noble_being * | value, |
| n_byte | first, | ||
| n_byte | last | ||
| ) |
| void being_set_location | ( | noble_being * | value, |
| n_byte2 * | from | ||
| ) |
| void being_set_posture | ( | noble_being * | value, |
| n_byte | post | ||
| ) |
| void being_set_select_name | ( | noble_simulation * | sim, |
| n_string | name | ||
| ) |
| void being_set_speed | ( | noble_being * | value, |
| n_byte | sp | ||
| ) |
| void being_set_state | ( | noble_being * | value, |
| being_state_type | state | ||
| ) |
| noble_social* being_social | ( | noble_being * | value | ) |
| n_byte being_speed | ( | noble_being * | value | ) |
| n_byte2 being_state | ( | noble_being * | value | ) |
| void being_take | ( | noble_being * | value, |
| enum BODY_INVENTORY_TYPES | location, | ||
| enum inventory_type | object | ||
| ) |
| void being_tidy_loop | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
the more body fat, the less energy is lost whilst swimming
going uphill
hairy creatures are better insulated
this simulates natural death or at least some trauma the ape may or may not be able to recover from
Definition at line 3557 of file being.c.
| void being_wander | ( | noble_being * | value, |
| n_int | wander | ||
| ) |
| n_int episode_description | ( | noble_simulation * | sim, |
| noble_being * | local_being, | ||
| n_int | index, | ||
| n_string | description | ||
| ) |
| const n_string body_inventory_description[INVENTORY_SIZE] |
| const n_string EnglishNames[576] |
Surname = 64, Male = 256, Female = 256
| const n_string relationship_description[RELATIONSHIPS] |
1.8.1.1