Skip to content

Latest commit

 

History

History
50 lines (28 loc) · 1.64 KB

File metadata and controls

50 lines (28 loc) · 1.64 KB

GOAPY SLIMES!

A hobby project to try implementing GOAP.

image

Slime feasting frenzy!!

 

slimes bouncing around

 

Each slime has has some AI which uses GOAP to find it's way in life.

Actions:

  • Seek food (walk around randomly)
  • Sleep (wait for food to appear)
  • Power up (become BIG!)

Goal:

  • Get BIG!

 

a big slime

 

The strategy is pretty simple: when there's food, walk around to find it, otherwise sleep, and power up when satiated (full with food).

Every update (it should be throttled...), the slime reads the world state and runs GOAP on the action graph to decide the next action to take.

The world spawns food at random every now and then. You can also click to spawn food at a location.

Boring implementation details

I used Dijkstra instead of A* because didn't have any heuristic function. The path-finding implementation is also embarrassingly generic just because I felt like it.

Check out ActionGraph.cpp and PathFinding.cpp, that's where most of the juicy stuff is.

Using SFML for graphics, etc.

NOTE: Very much NOT optimized code

Assets