Skip to content

Sensor type: Raycast #122

@Enitoni

Description

@Enitoni

Currently the only sensor functionality in alien is in my opinion very lacking. There are several issues:

  • It can only target a set density of cells, limited to one target per sensor
  • Targets can be selected through walls
  • Targeting is inconsistent, it can suddenly switch to a different target. This means the creature isn't able to work with consistent sensory input, which makes it hard to develop neural networks to process the information

In other words, it's too limited and doesn't offer a lot of flexibility. That's why I'll be creating a set of issues suggesting new sensor types, starting with this one: A raycast sensor.

Though I am sure there could be performance implications I think it should be doable.

Instead of targetting an organism or density of cells, the raycast sensor casts a cone divided by 4 rays out in the direction that the sensor is not covered with its own cells (to prevent it from targeting its own cells or cast rays through itself). Once the ray hits another cell or the connection between two cells (at which the cell closest to the collision point is chosen), the outputs are as follows:

Channel 0: Distance of the cell hit by ray 1
Channel 1: Color of the cell hit by ray 1
Channel 2: Distance of the cell hit by ray 2
Channel 3: Color of the cell hit by ray 2
Channel 4: Distance of the cell hit by ray 3
Channel 5: Color of the cell hit by ray 3
Channel 6: Distance of the cell hit by ray 4
Channel 7: Color of the cell hit by ray 4

Where distance is a multiple of the maximum distance of the sensor (based on its color). So if a sensor's max sensing distance is 50 for example, any cell outside that range should report 0, and a cell right next to the sensor should report 1. And where color is simply a value that represents the color index.

This I think allows for more flexibility and granular processing of an organism's environment, which I think is needed for more interesting behavior to evolve. Would love to hear your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions