This page used to contain a duplicate of the Background section of the acorn page available by clicking on "Acorn" at the top of the column on the right.

I'm currently using this page to contain a Rules document in progress which aims to target users and developers; combining the rules of the game with enough details of design that a programmer could use it to write the game. I'm experimenting with a separation of the user (player) documentation and the developer extensions by using color for the developer specific extension to the user/player rules, for generalities that will need to be expanded, and for open questions. [2/23/00 - dean]

Acorn Rules Handbook



     Table Of Contents
        [ver 1.1]
Overview                 1.0
Getting Started          2.0
    Launching a game     2.1
    Beginnng Play        2.2
The Merchant             3.0
Pigs                     4.0
The Butcher              5.0
    The Sty              5.1
    Sausages             5.2
Crabs                    6.0
Skeletons                7.0
Wolves                   8.0
Appendix: Additional Developer Notes
[Bottom]

1.0 Overview

Welcome to the village of Argiliac. As a player, you are in the business of raising pigs. You buy piglets from a merchant in town. You herd the piglets through the forests surrounding town so they can fatten up on acorns. When you think the pigs have reached optimum weight, you sell the pigs to the butcher in town, take your profits and reinvest in more piglets. You repeat this process trying to be the first player to earn 100 pence in profits.

There are three obstacles you will have to manage in order to raise your pigs: crabs, skeletons and wolves. Dealing with each as well as the merchant, butcher and the pigs themselves, are the substance of these rules. Did I say three obstacles? Watch out for the other players!

2.0 Getting Started

2.1 Launching a game - Starting the game brings the player to The Meeting Room where players gather to find other players. This section will contain instructions on how to start play.

Here is the map:

+-----------------------------------------------+
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............+-+............................|
|...............+-+..()........................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
|...............................................|
+-----------------------------------------------+

One square = 10 meters

The distance in meters between subsequent trees going row by row, is given by the function: round( 1 + 10 * sin(N)^2 )

  1. g., the first 10 trees are spaced out at: 8, 9, 1, 7, 10, 2, 5, 11, 3, 4 meters

+-+ - Pig pen +-+ () - Butcher

2.2 Beginnng Play - This section will contain the basics the player will need to get started. We need to decide if players will start with money, one or more piglets, or a combination of the two. Will they start in town or in the forest somewhere? We don't want the first seconds to be a race to be the first to find the merchant unless we allow the merchant to deal with more than one player at a time.

3.0 The Merchant

The pig seller sells piglets that weigh 5 kgs for 10 pence each. Clicking on the merchant will present a simple interface which will show how much money you have and the price of piglets. Clicking the BUY button on this interface will deduct 10 pence from your accumulated wealth and a piglet will appear at your feet and slowly start wandering around looking for acorns to eat.

You may buy as many piglets as you have money for and think you can handle.

3A Merchant/Player
Exchange: receives 10 pence gives piglet.
Exchange: receives anything else tells player the above rule.

4.0 Pigs

All around the game world are acorn trees that drop acorns on the ground that the pigs can eat and fatten up on. The more acorns they eat, the fatter they get, but moving around requires energy expenditure. Fatter pigs take more energy to move than little pigs. Pigs left alone will get hungry and tend to wander off looking for acorns.

Pigs start moving when you bump into them and stop when they find an acorn or when someone says "souwee" aloud. They also start moving when they get hungry. Piglets, are hungry all the time with only a brief rest after consuming an acorn.

Pigs are afraid of crabs, skeletons and wolves with good reason. Crabs will eat any pigs they can catch that are less than 10 kg although they ignore larger. Wolves will eat pigs of any size when hungry. Pigs try to stay 10 meters away from any crabs or skeletons or wolves. While skeletons don't eat or kill pigs, they will scare them off. When a skeleton catches a pig the pig becomes hysterical and runs at top speed squealing for several seconds. During this period it will not respond to the call "souwee". If you don't want to lose your pigs or to have to chase them all over the forest, keep skeletons away from your pigs. See the sections on each for additional information on what dangers they pose and how to handle them.

When you call "souwee" nearby pigs will stop for about 10 seconds. This will allow you to position yourself in such a way that "bumping" against the pig will "herd it" in the desired direction. Bumping a resting pig can also be used to encourage a resting pig to move in the direction of more acorns.

Pigs of all sizes consume energy all the time. At rest, the energy consumption should be minimal (minimum rate value). The high end of that spectrum would be the fattest of hogs while moving (maximum rate value). For this demo there would only be three speeds resting and walking and running. Later implementations could factor in either running or implement movement as a spectrum. If we use an arbitrary scale for energy availability of say 0 to a Maximum Energy Pool value, MaxEnergy, we could say that a pig consuming an acorn gains N units of energy to a Current Energy value, CurrentEnergy. A formula factoring in the pig's weight and rate of movement would then be used to periodically subtract from CurrentEnergy. The maximum weight for a hog would be established at the point where the energy consumption for the pig to move would equal the rate at which they could find and consume acorns.

When a pig's energy level (CurrentEnergy) is reduced to a certain level (weight-based formula or static value?), the pig becomes hungry and starts searching for food (starts moving in a random direction). If a pig's CurrentEnergy level reached zero, the pig would decrease in weight and the CurrentEnergy would be replenished (Yes, a pig could conceivably starve to death). When the pig's CurrentEnergy is increased through the consumption of acorns to MaxEnergy, the pig's weight would increase by 1kg and the CurrentEnergy value would be reduced by 25%. The pig would then rest until it becomes hungry or is "tended" by having the player (and well-fed wolf?) cause the pig to move along. Thus a pig would continue to gain weight when left alone but would gain weight faster when the player keeps the pig moving.

For most collisions the pig will continue at its current speed in a randomly reflective direction from the angle of impact. For the most part, however,pigs avoid collisions.

4G Piglets/Acorns
Collision: Piglet eats acorns. [Alternative, simple implementation]Piglet pauses a few seconds before becomming hungry and starting to move looking for more acorns. Piglet's weight increases 100g per acorn. When the piglet's weight increases to 10kg it becomes a pig (graphic changes). When the pig's weight increases to 50kg it becomes a hog (graphic changes). Hog's weight continues to increase.

4H Piglets/Crabs
Collision: Pigs are eaten by crabs.
4I Piglets/Skeletons
Sight: Pigs try to stay 10 meters away from any nearby skeletons.
Collision: When a skel catches a pig the pig becomes hysterical and runs at top speed squealing for 10 seconds. This will create extra motivation for players to keep skeletons away from their pigs.
4J Piglets/Wolves
Sight: Pigs try to stay 10 meters away from any wolves.
Collision: Pigs are eaten by wolves if the wolf is hungry.

5.0 The Butcher

The butcher pays you for each pig you bring him at the rate of 1 pence per kg. You give your pigs to the butcher by means of the sty or pen.

5.1 The Sty

Click on the sty gate and it will open. Drive your pigs into the pen and close the door to "close the deal" :-)

For this game I suggest the money magicly appear in inventory rather than requiring players to go to the butcher to get paid. Do we need some mechanism to keep some other player from closing the gate for you and stealing your payment?

5.2 Sausages

Clicking on the bucher presents an interface similar to the merchant's. It shows how much money you have and the price of sausage. Each time you click the BUY button one pence is deducted from your accumulated wealth and one sausage appears in you inventory.

2A Butcher/Player
Exchange: receives pig gives 1 pence per kg
Exchange: receives money gives 1 sausage link for each pence
Exchange: receives anything else tells player the above rules
Collision: Says 'Can I help you?'

Is "inventory presentation" left to client implementor?

6.0 Crabs

Crabs eat piglets that are less than 10 kg but ignore anything larger. If they eat a piglet they will rest until they become hungry again and then start to hunt.

Noises (made when the player strikes trees or calls to the pigs) tends to alert the crabs, making them come nearer.

Crabs don't like to be within 20 meters of wolves. Resting crabs will start to move away from any wolf that comes within that distance. If a wolf can catch a crab, the crab dies and the wolf gets to eat 40 kgs of meat (and promptly start resting for a long time since he's so well fed.)

Hearing has at least two parts. How loud is the noise and how good is the entity's hearing. The quality of the entity's hearing can be simulated by means of a "hearing radius". I'm looking for suggestions on implementing volume in certain situations including these two. One part of that may be to have all crabs be attracted to a /shout, while only being attacted to player conversation when the player is within the crabs' hearing radius.

8A Crabs/Player
Hearing: Crab turns in the direction of the sound. Any player calling "souwee" or making any kind of shout will be heard by all crabs. If the player is within the crab's hearing radius the crab will hear regular conversation.
8D Crabs/Piglets
Collision: Crabs eat piglets that are less than 10 kg.
8E Crabs/Pigs
Crabs ignore pigs equal to or greater than 10 kg.
Sight/Collision: Crab avoids collision going off in a reflective direction.
8F Crabs/Acorn Trees
Hearing: Any player collision with a tree creates a noise which can be heard by all crabs within a crab's hearing radius. On hearing a tree collision a crab will turn in the direction of the tree.
Sight/Collision:Crab avoids collision going off in a reflective direction.
8H Crabs/Crabs
Sight/Collision: Crab avoids collision going off in a reflective direction.
8I Crabs/Skeletons
Sight/Collision: Crab avoids collision going off in a reflective direction.
8J Crabs/Wolves
Sight: Crabs are afraid of wolves. When a crab comes within 20 meters of a wolf it turns and moves away.
Collision: If wolf is hungry, crab dies (Wolf eats crab) otherwise crab avoids collision going off in a reflective direction.

7.0 Skeletons

Skeletons will scare off your pigs! Skeletons can see about 30 meters and are attracted to motion - either things in motion or trees being struck. Skeletons ignore pigs that are less than or equal to 20 kgs but they will chase pigs that are more than 20 kgs. If a skeleton starts after your pig try bumping it to get it to move in another direction.

While skeletons are slower than pigs, if they should catch one, the skeleton will let out a "skeletal" laugh and pause while the hysterical pig runs off at full speed. They will then pause until attracted by some motion.

Skeletons ignore stationary crabs and wolves but are attracted to their movement in the same way that they are attracted to all moving objects.

Skeletons are attracted to anything that moves that has over 20 kg mass. Skeletons are themselves less than 20 kg as are piglets. They are also attacted to the movement trees make when they are struck by players. Skeletons avoid collisions by changing directions unless they are chasing a pig.

Skeletons will (and should) seem kind of schitzo when there are lots of moving things around. Skeleton clumps, or "walking graveyards", may be possible, and if so it may be possible for players to artificially create them (perhaps collaboratively), all of which falls into the "acceptable gameplay tactics" category.

9A Skeletons/Player
Sight: Skeletons can see 30 meters and are attracted to motion.
Collision: Skeletons will turn away from the player. This is one way a player might stop skeletons from chasing his pigs.
9B Skeletons/Butcher
Sight: Skeletons can see 30 meters and will stay away from the butcher.
9C Skeletons/Merchant
Sight: Skeletons can see 30 meters and will stay away from the merchant.
9D Skeletons/Piglets
Sight: Skeletons ignore pigs that are equal to or less than 20 kgs.
Collision: Skeleton pauses briefly then continues in the same direction. The piglet will run off.
9E Skeletons/Pigs
Sight: Skeletons can see 30 meters and will chase pigs that are more than 20 kgs. While skels are attracted by movement, they change directions to chase a pig when they see one. Once chasing a pig they will either continue chasing that pig until some incident like a player bumping them changes this or they will switch to a larger pig if they see one. Note: Pigs can see skeletons at 20 meters and will move away from skeletons closer than that. In order for skeletons to chase pigs they have to be able to see farther than pigs. There are a couple other options for initiating the chase (e.g. pigs don't notice skeletons while eating) but this should be the simplest to implement.
Collision: While skeletons are slower than pigs, if they should catch one, the skeleton will let out a "skeletal" laugh and pause while the hysterical pig runs off at full speed. They will then pause until attracted by some motion. If the pig moves out of the skeleton's range of sight the skeleton slows to minimum speed and becomes distracted by the next movement it sees. Make sure skeleton.maxVelocity < pig.maxVelocity

9F Skeletons/Acorn Trees
Sight: A tree being bumped by a player will cause motion. That motion can be seen by any skeletons within that skeleton's sight radius of any part of the tree. On seeing the motion the skeleton will turn in the direction of the motion.
Collision: Skeleton avoids collision going off in a reflective
Enhancement: make skeletons fall into a pile of bones for a few seconds if they bump into a tree.
9H Skeletons/Crabs
Sight: Skeletons ignore non-moving crabs but are attracted to moving crabs in the same way that they are attracted to all moving objects.
Collision: Skeleton avoids collision going off in a reflective direction.
9I Skeletons/Skeletons
Sight/Collision: Skeleton avoids collision going off in a reflective direction.
9J Skeletons/Wolves
Sight: Skeletons ignore non-moving wolves but are attracted to moving wolves in the same way that they are attracted to all moving objects.
Collision: Skeleton avoids collision going off in a reflective direction.

8.0 Wolves

Wolves may be a help or a hindrance. It's up to you. Wolves like to eat 1 kg of pork every few minutes. The nice thing about wolves is that they scare off crabs. Crabs don't like to be within 20 meters of wolves. If a wolf is hungry it will first look for pigs and eat the smallest pig it sees. If no pigs are within sight it will eat any available crab instead.

If you feed a wolf sausage, which is available from the butcher, it will follow you around until it becomes hungry again. Try "leading" the wolf to a crab to destroy it. But once it has eaten a crab, it always rests, and thereafter returns to its wild state (i.e., If you want it to follow you around and scare off the crabs you will have to feed it a sausage again.)

Note the implication here that while the wolf won't hunt the crab when it is not hungry, it can be led into bumping into the crab.
(See rules/pigs for a discussion of food/energy/hunger).

10A Wolves/Player
Exchange: On receipt of food (sausages), the wolf will follow the player until the wolf becomes hungry again. The player can "lead" the wolf to a crab, thereby destroying it, but once it has eaten a crab, it always rests, and thereafter returns to its wild state (i.e., no more friendliness.)
10B Wolves/Butcher
Sight: Wolf goes off in a reflective direction
10C Wolves/Merchant
Sight: Wolf goes off in a reflective direction
10D Wolves/Piglets
Sight or Collision (wolf is not hungry): No Op
Sight (wolf is hungry): Wolf changes direction to pursue piglet. If more than one pig/piglet is within sight, the Wolf pursues the smallest one.
Collision (wolf is hungry): Pig dies
10E Wolves/Pigs
Sight or Collision (wolf is not hungry): No Op
Sight (wolf is hungry): Wolf changes direction to pursue pig. If more than one pig/piglet is within sight, the Wolf pursues the smallest one.
Collision (wolf is hungry): Wolf eats pig
10F Wolves/Acorn Trees
Sight/Collision: wolf avoids collision going off in a reflective direction.
10H Wolves/Crabs
Wolf is hungry:
Sight: wolf changes direction to pursue crab if no pigs are available.
Collision: Crab dies. Wolf gets to eat (40?) kgs of meat and promptly start resting for a long time since he's so well fed. After resting the wolf returns to its wild state.
Wolf is not hungry:
Sight/Collision: wolf avoids collision going off in a reflective direction unless it is following or pursuing somethin in which case it continues.
10I Wolves/Skeletons
Sight/Collision: wolf avoids collision going off in a reflective direction unless it is following or pursuing something in which case it continues.
10J Wolves/Wolves
Sight/Collision: wolf avoids collision going off in a reflective direction unless it is following or pursuing something in which case it continues.

Appendix: Additional Developer Notes

Creation/destruction of entities: While some entities are more or less static (There will always be one Merchants, one Butcher, the trees, etc.), at the beginning of the game other entities will be created using a ratio to be determined during a "tuning phase" of development such that

#players > # crabs > # wolves > # skeletons.

As the game progresses the crabs will be killed off and the wolves will be "adopted" by players, so that by the end of the game only the skeletons will be of concern.

There are at least two types of specifications that need to be examined for each relationship: collisions and exchanges. Certain behaviors mentioned in the background imply at least two or three kinds of collisions for scripted entities: contact and sight and in some cases hearing (and perhaps smell).

Sight could be implemented as a special type of collision where the object being "seen" only has to fall within a radius from the entity doing the seeing. Each entity would have his own sight radius defined. A skeleton's radius would be larger than a pig's, for example. Sight is necessary for behaviors to be triggered from a distance (e.g. A skeleton would "see" a pig and then begin to chase it.

Hearing is needed to implement the "souwee" command. ;-) When a player calls "souwee" we won't want every pig in the game to stop so a hearing radius will need to be defined at least for pigs.

Why scripted entities only? Why not players too? With this pilot project I don't think we want to get into more feature creep. Such a concept would be a kind of "fog of war" and I suspect would add significant coding to support. It is for the same reason I'm currently making a number of like entities (e.g. crab/crab and Skeleton/Skeleton) simple collisions (or collision avoidance mechanism) with reflective properties only. Enhancements could be added later to make the crabs fight or something but I don't think we want to get into that at this point.

Resting: Pigs, wolves and crabs all eat and thereafter rest. Certain events will prompt them to move: hunger, being bumped (collision), and sight - any event which would normally cause the entity to move away. For example a resting pig or crab would start moving when a wolf moves within its sight radius (Enhancement: sleeping). There will also be some random perturbation effect, that periodically causes them to stop and "rest" for a period of time, and after a certain amount of time, begin moving again. The rules for this are yet to be determined.