Skip to content
/ goap-cpp Public

An implementation of GOAP in C++ with slimes

Notifications You must be signed in to change notification settings

Lumbi/goap-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An implementation of GOAP in C++ with slimes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published