Skip to content

Commit

Permalink
#47 documented most of the level entry for critters
Browse files Browse the repository at this point in the history
  • Loading branch information
dertseha committed May 1, 2017
1 parent 55998a4 commit 28d6f9e
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions levelObjects/14_Critters/levelCritterEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,52 @@

**Level Critter Data** (40 bytes)

000C int16 state timeout

0000 int32 Pending Z-rotation. Values up to 0x608000 seen.
0004 int32 Fixed forward velocity. Rare values of 0x0D000 and 0x090000 seen.
0008 [2]byte Unknown, Unused
000A int16 Hastiness. Values of 0x0050 and 0x0030 seen.
000C int16 State timeout
000E int16 Unknown - set to 0x0002 for a few critters.
0010 int16 Unknown - set to arbitrary values.
0012 [2]byte Unused
0014 byte Roaming critter state
0015 byte Primary critter state
0016 byte Secondary critter state

0017 byte Tertiary critter state
0018 [6]byte AI coordinates A
001E byte Always 0xFF
001F byte AI coordinates B
0020 [2]int16 Loot object indices
0024 [2]byte Unknown, Unused
0026 [2]byte Unknown
0026 [2]byte Unknown, set only for a few roaming critters.


```Pending Z-rotation``` is a rotation value that the critter wants to perform next. Only when this value is zero, it continues with its regular state.

```Fixed forward veloctiy``` is used for a few critters to give them a fixed forward speed. This speed can be different than their normal speed, and even make them slower than regular.

```Hastiness``` makes a few critter appear as if they were under the effect of a speedup-stimulant. Their actions, including their animations, are quicker.

```State timeout``` is an indicator on how long the critter will stay in this state. Observed only in "cautious" state.
This time is reduced as long as the hacker is in the vicinity. When the time reaches zero, the critter becomes hostile.
The time value is typically quite low. A few high values like 0x0062 have been observed.

```AI coordinates A``` and ```B``` appear to be some sort of coordinates. Changing them has no visible effect, so they may be scratch values for the AI, determining where to go next. They are used only for roaming critters.

```Always 0xFF``` must always be set to ```0xFF```, otherwise the critter is immediately hostile, regardless of where it is on the map. All critters in the main game have it set to ```0xFF```.

### Critter states

The state a critter is in is goverend by four bytes, which have meanings on their own, as well as combined effects. For simple cases, only the ```Primary critter state``` is used. This value is also the one modified by the "Set critter state" action.

A roaming critter has the ```Roaming critter state``` value set, and also needs other states to be set. Working combinations found so far are:
* ```03 01 01 00```
* ```02 01 01 00``` (not found in archive.dat)
A critter only roams on its own if the hacker is within a radius of about 6 tiles.

The ```Primary critter state``` holds the state the critter is currently behaving in. This state is also reported by the targeting tool.

**Critter State** (1 byte)
**Primary Critter State** (1 byte)

0x00 docile
0x01 cautious
Expand All @@ -37,3 +66,4 @@ The ```Primary critter state``` holds the state the critter is currently behavin
0x06 tranquilized
0x07 confused

> Various combinations of the state values can be found in the main game. While they have different effects, their pattern is not clear.

0 comments on commit 28d6f9e

Please sign in to comment.