by John McGlothlan

Fred: Simple Minded yet Visually Intelligent

Fred In A Dress And On A BombFred is an alien organism that appears (eventually) in the ARC games, though not in G Prime. Think of a space-faring jellyfish.  When thinking about Fred he needed to have very low intelligence.

In a nutshell Fred is dumb and on purpose.

This was very important as Fred needs to be part of The Rain but not the main objective.  In the initial development phase it was decided that Fred’s main thought is that Fred likes Fred.  That is the first and foremost thing in Fred’s simple mind.  After the initial direction of Fred was decided his other objectives were set.  Fred needs to eat and Fred has sensory ranges.

With those important decisions about Fred decided and set, Fred had a programming skeleton made.  Fred’s AI skeleton was simple:

  • Fred could sense other Fred at a set distance, his detection range.
  • Fred could smell food at an olfactory range.
  • Fred had several stages of hunger: Satisfied, Hungry and Starving.
  • Lastly a simple addition was added the Fred could hurt. Again three simple levels Healthy, Scared and Dead.

Once Fred’s squishy skeleton was created discussion of what states Fred could existed in were decided.  While this is the basis of all things Fred it also is the simplest form of AI.  The main states of Fred are Wander, Find Fred, Create Group, Join Group, Hunt and lastly Eat.

Wander is Fred’s base state.  Fred exists in the Wander state when Fred has a Fred friend.  Wander would become a simple mechanic where Fred chooses a direction and slowly goes in that direction. While slowly weaving to the left or right randomly.

Find Fred is his state when Fred is alone.  Fred wishes this state would never occur as being alone is sad. Fred hates sad. When Fred reaches this state Fred sets a waypoint and goes towards it with conviction. If Fred reaches the location he decides on a new location and follows that pattern until Fred finds a friend.

Create Group occurs whenever Fred is starving. If Fred is not in a group and no nearby Fred’s are in a group Fred will create a group.  Fred knows groups find food faster than Fred alone. Once a group is made Fred starts to hunt.

Join Group is a state when Fred is either hungry or starving.  If a Fred nearby is in a group while Fred is hungry or starving Fred will join the group in order to find food. As said earlier Fred knows groups find food faster than Fred alone.

Fred’s fastest state is Hunt. This is where a group decides to go to a location.  The group is slightly slower then Fred this allows Fred to swerve when searching for food maximizing Fred’s olfactory range. Once a single Fred has smelled food the entire Group is drawn to the food and summarily disbanded. Fred now eats.

Fred will Eat until Fred is satisfied. This can take longer or shorter based on Fred’s hunger. Once Fred is done Fred will go back to Wander.

As is stated – Fred is dumb.  Fred poses no threat to the world, yet Fred as a swarm understands simple mechanics to make Fred dangerous and smart.  When looking at Fred’s terrarium it seems so elegant in Fred’s world.  Fred glides through life making one feel at ease.  While watching Fred fly through space one can lose track of time.  As time is infinite its loss will never be known. Fred needs not worry about food as the rain keeps the food flowing.

World of FredNote Fred’s inability to quickly react to changes in his state due to Fred only “thinking” once a second (remember: Fred is dumb).  But Fred still reacts quickly enough to the changing environment.  Fred can follow moving Fooderoids™ and can “understand” complex navigation.  While Fred stays docile while Fred is happy, Fred’s hunger causes Fred to become a danger to anything smelling like Food. As all objects that process Fooderoids™ start to stink like Fooderoids™.  Fred starts to try and eat Ships, with Fred’s powerful jaws and tentacles even the strongest ships slowly break apart. (Spoiler) In the ARC series all player ships process Fooderoids™ at some level.  Thus Fred hunts player ships, making a seemingly docile character dangerous even without provocation.  When flying through space it will be easy to notice when Fred is searching for food. When you see a swarm of Fred’s you’ll want to keep your distance or Fred will follow you till the end to time.

Below is Fred’s AI in full. After Fred thinks he then asks if this state is greater than my current state.  As each state is more important than the previous.  This allows Fred to avoid confusion.

protected AIState UpdateAIState() {
        AIState myNewState = AIState.None;
        if (myHerd != null) {
            if (foodFound != null) {
                myNewState = AIState.Eat;
            } else {
                myNewState = AIState.Hunt;
            }
        } else {
            if (myHungerLevel == HungerLevel.Satisfied
|| myHungerLevel == HungerLevel.Hungry) {
                if (myFriends.Count != 0) {
                    if (myHungerLevel == HungerLevel.Hungry) {
                        if (FriendInGroup()) {
                            myNewState = AIState.JoinGroup;
                        } else {
                            myNewState = AIState.Wander;
                        }
                    } else {
                        myNewState = AIState.Wander;
                    }
                } else {
                    myNewState = AIState.FindFriends;
                }
            } else if (myHungerLevel == HungerLevel.Starving) {
                if (FriendInGroup()) {
                    myNewState = AIState.JoinGroup;
                } else {
                    myNewState = AIState.CreateGroup;
                }
            }
        }
        return myNewState;
    }

If Fred piques your fancy Freds full AI as a Unity3D downlaod and a terrarium where he plays can be found at http://somagames.com/ARC/terrarium.php

About the author
Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit