Hire Us For Your Game!

Affordance Interactions in Greek Tragedy (Survival Horror)

TLDR : Interactions may be represented simply and elegantly by generic, re-usable components on gameobjects. This may sound simple, but if you ever find yourself writing components like “Door” for a door gameobject, or “Banana” for a banana gameobject, this may be worth reading.

Greek Tragedy is a survival horror game, which means players will want to investigate, study the environment, collect things, push things, etc– we need a way for designers to quickly add expressive interactions to gameobjects without needing to write any custom code.

Enter “Affordances”. Gameobjects “afford” some interaction.

Affordance Examples

Want the player to pick up this healthy apple gameobject?

An apple

Slap the “AffCollect” component on there– The AffCollect affordance component Any gameobject with an AffCollect component may be stored in the inventory for later usage.

Want the player to be able to read this note (literally a yellow quad)? A note

Give the note gameobject the AffDocument component– The AffDocument affordance component AffDocument triggers a document view (ex, showing a note) when the player interacts. The document may get be stored for later review.

Want to let the player to move to a new location after interacting with this door? A door

Use the AffTravel component– The AffTravel affordance component The AffTravel component handles allows us to warp the player gameobject, fade to black, reset enemies, etc

The Larger Picture

Affordance (“Aff”) components derive from a base “Affordance” class, and are usually fairly simple, overriding an “execute” function to perform its work. Any gameobject with an affordance on it may quickly be found by our interaction / selection system (the system that figures out what the player wants to interact with based on the player avatar’s looking direction, what the player can see, etc).

Affordance component code The AffSetActive affordance is one of our simplest– it sets a gameobject to active or inactive when the player interacts with it. Good for opening things, turning off / on lights, etc

The selection system When the game figures out what the player probably wants to interact with, it will spawn an icon (in this case, a mouse click)

Around 20 different affordances exist in Greek Tragedy, and many are flexible / expressive (from allowing the player to push / move gameobject, to traveling, to setting checkpoints, refilling ammo, launching minigames, etc). Once programmed, this toolbox of components allows designers to easily add functionality to various gameobjects without writing any code– creating puzzles, lore, and interesting interactions quickly (if each gameobject needed its own custom script, this would be a very painful genre to work in o_O).

Subscribe to Future Devblogs!

Subscribe here to be notified when we publish future devblogs, tutorials, etc.