# Diff of /documentation/feebs.tex

revision 20 by gmilare, Sat Mar 15 22:01:02 2008 UTC revision 21 by gmilare, Sat Aug 7 13:40:44 2010 UTC
# Line 18  Line 18
18
19  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
20
21  %   Copyright (c) 2007,2008 Gustavo Henrique Milarï¿½  %   Copyright (c) 2007,2008 Gustavo Henrique Milaré
22  %  %
23  %   This file is part of The Feebs War.  %   This file is part of The Feebs War.
24  %  %
# Line 76  Line 76
76  \begin{abstract}  \begin{abstract}
77  \textit{The Feebs War} is a modified version of Planet of The Feebs \url{http://www.cliki.net/Planet\%20of\%20the\%20Feebs},  \textit{The Feebs War} is a modified version of Planet of The Feebs \url{http://www.cliki.net/Planet\%20of\%20the\%20Feebs},
78  a game made for people learn and improve their lisp and code manipulation  a game made for people learn and improve their lisp and code manipulation
79  tecniques. The graphics are now displayed using Lispbuilder \url{http://lispbuilder.sourceforge.net}'s  techniques. The graphics are now displayed using Lispbuilder \url{http://lispbuilder.sourceforge.net}'s
80  libraries, so the problems with portability from CMUCL and X Window  libraries, so the problems with portability from CMUCL and X Window
81  Sistem do not exist anymore. Also the code is cleaner and more extensible.  System do not exist anymore. Also the code is cleaner and more extensible.
82  \end{abstract}  \end{abstract}
83  \tableofcontents{}  \tableofcontents{}
84
# Line 87  Sistem do not exist anymore. Also the co Line 87  Sistem do not exist anymore. Also the co
87
88  The Feebs are intelligent and hostile creatures that live inside maze  The Feebs are intelligent and hostile creatures that live inside maze
89  tunnels. They also have no mercy with each other, so they frequently  tunnels. They also have no mercy with each other, so they frequently
90  throw a letal flame from through their mouth, getting rid of their  throw a lethal flame from through their mouth, getting rid of their
91  opponent and eatting the carcass left. But throwing flames have an  opponent and eating the carcass left. But throwing flames have an
92  energy cost, so they must keep tracking for food.  energy cost, so they must keep tracking for food.
93
94  This game is intended to help lisp newbies (or maybe a little more  This game is intended to help lisp newbies (or maybe a little more
# Line 108  the brain function to the new rules. Line 108  the brain function to the new rules.
108
109  The main reason of this project is that \textit{Planet of the Feebs}  The main reason of this project is that \textit{Planet of the Feebs}
110  is really interesting for (not just) newbies to learn lisp, but the  is really interesting for (not just) newbies to learn lisp, but the
111  difficulties to install, unportability and the ausence of competitors  difficulties to install, unportability and the absence of competitors
112  make it difficult to someone to be interested in making a feeb. So,  make it difficult to someone to be interested in making a feeb. So,
113  I hope that making these adjustments and maybe creating some contests  I hope that making these adjustments and maybe creating some contests
114  over the web make people be more interested in learning lisp.  over the web make people be more interested in learning lisp.
# Line 116  over the web make people be more interes Line 116  over the web make people be more interes
116  So, these are (some of) the changes:  So, these are (some of) the changes:
117
118  \begin{itemize}  \begin{itemize}
119  \item The graphics are not based on X Window Sistem anymore, but on \textit{Lispbuilder},  \item The graphics are not based on X Window System anymore, but on \textit{Lispbuilder},
120  and there are no CMUCL's event handler. This way, the code is more  and there are no CMUCL's event handler. This way, the code is more
121  portable and graphics can be improved. Just creating some image files  portable and graphics can be improved. Just creating some image files
122  of a feeb and your feeb is much more personalized!  of a feeb and your feeb is much more personalized!
123  \item Every element of the map (including walls) is a list, so the brain  \item Every element of the map (including walls) is a list, so the brain
124  of a feeb doesn't need to test all the time if the element is an atom  of a feeb doesn't need to test all the time if the element is an atom
125  or a list (wich, in my opinion, is really boring, unlispy and unnecessary  or a list (which, in my opinion, is really boring, unlispy and unnecessary
126  in this case). That was only a reason to duplicate code and work,  in this case). That was only a reason to duplicate code and work,
128  \item Many functions and variables are changed and others were added  \item Many functions and variables are changed and others were added
# Line 160  can be used to know them. Just remember Line 160  can be used to know them. Just remember
160  be a rational number (like 1/2).  be a rational number (like 1/2).
161
162  But don't panic! These parameters are just for one to know how the  But don't panic! These parameters are just for one to know how the
163  game is going to be, but in the begining there is no need to explicitly  game is going to be, but in the beginning there is no need to explicitly
164  use them when creating the brain of a feeb. The best way to create  use them when creating the brain of a feeb. The best way to create
165  a feeb is watching a game (among system feebs), improving it (it is  a feeb is watching a game (among system feebs), improving it (it is
166  defined in file brains.lisp) a little more, testing the changes...  defined in file brains.lisp) a little more, testing the changes...
# Line 202  throwing a flame. Line 202  throwing a flame.
202  turns that a fireball is guaranteed not to dissipate, unless it encounters  turns that a fireball is guaranteed not to dissipate, unless it encounters
203  a wall.  a wall.
204  \item [{{\textsf{\textbf{'fireball-dissipation-probability}}}}] Probability  \item [{{\textsf{\textbf{'fireball-dissipation-probability}}}}] Probability
205  of the flame to dissipate each turn after the apropriate time.  of the flame to dissipate each turn after the appropriate time.
206  \item [{{\textsf{\textbf{'fireball-reflection-probability}}}}] Probability  \item [{{\textsf{\textbf{'fireball-reflection-probability}}}}] Probability
207  of the flame to reflect when encountering a wall.  of the flame to reflect when encountering a wall.
208  \item [{{\textsf{\textbf{'flame-no-recovery-time}}}}] Number of turns  \item [{{\textsf{\textbf{'flame-no-recovery-time}}}}] Number of turns
209  that a feeb cannot fire.  that a feeb cannot fire.
210  \item [{{\textsf{\textbf{'flame-recovery-probability}}}}] Probability  \item [{{\textsf{\textbf{'flame-recovery-probability}}}}] Probability
211  of the feeb to recover the hability to throw a flame, after the apropriate  of the feeb to recover the ability to throw a flame, after the appropriate
212  time.  time.
213  \end{lyxlist}  \end{lyxlist}
214
# Line 216  time. Line 216  time.
216
217  There are two kinds of food, carcasses and mushrooms. Carcasses usually  There are two kinds of food, carcasses and mushrooms. Carcasses usually
218  give less energy than mushrooms, and may rot, but, while it does not  give less energy than mushrooms, and may rot, but, while it does not
219  rot, a feeb can feed as long as it wishes. Mushrooms disapear after  rot, a feeb can feed as long as it wishes. Mushrooms disappear after
220  being eaten. By eating food, the feeb will be able to recover energy,  being eaten. By eating food, the feeb will be able to recover energy,
221  wich is important because, if a feeb stays with 0 or less units of  which is important because, if a feeb stays with 0 or less units of
222  energy, it starves.  energy, it starves.
223
224  These are the quantities:  These are the quantities:
# Line 232  each turn that the feeb eats a carcass. Line 232  each turn that the feeb eats a carcass.
232  turns that a carcass will surely not rot. After these turns, it can  turns that a carcass will surely not rot. After these turns, it can
233  rot, depending on probabilities.  rot, depending on probabilities.
234  \item [{{\textsf{\textbf{'carcass-rot-probability}}}}] Probability of  \item [{{\textsf{\textbf{'carcass-rot-probability}}}}] Probability of
235  the carcass to rot, after the apropriate time.  the carcass to rot, after the appropriate time.
236  \item [{{\textsf{\textbf{'maximum-energy}}}}] Maximum amount of energy  \item [{{\textsf{\textbf{'maximum-energy}}}}] Maximum amount of energy
237  that a feeb can have eating.  that a feeb can have eating.
238  \item [{{\textsf{\textbf{'starting-energy}}}}] Amount of energy a feeb  \item [{{\textsf{\textbf{'starting-energy}}}}] Amount of energy a feeb
# Line 266  will clear it. Line 266  will clear it.
266  After processing the information available, the brain will take a  After processing the information available, the brain will take a
267  decision. If this decision is not one of the decisions listed down,  decision. If this decision is not one of the decisions listed down,
268  a warning will be signaled, and the result will be like \textsf{\textbf{:wait}}.  a warning will be signaled, and the result will be like \textsf{\textbf{:wait}}.
269  Then, if someone are testing a brain function, he or she will be able  Then, if someone is testing a brain function, he or she will be able
270  to know if something goes wrong.  to know if something goes wrong.
271
272  The possible values that the brain function can return are these:  The possible values that the brain function can return are these:
# Line 283  created next turn in the front square of Line 283  created next turn in the front square of
283  \item [{{\textsf{\textbf{:peek-left}}}}] Peek to the left around a corner.  \item [{{\textsf{\textbf{:peek-left}}}}] Peek to the left around a corner.
284  The creature does note actually move, but, in the next turn, the creature  The creature does note actually move, but, in the next turn, the creature
285  will have the same vision that it would have if he had moved one step  will have the same vision that it would have if he had moved one step
286  foward and turned left (and one step back because the feeb needs to  forward and turned left (and one step back because the feeb needs to
287  see what is actually in front of it). Peeking used so a feeb can analize  see what is actually in front of it). Peeking used so a feeb can analyze
288  a corridor before trespassing it.  a corridor before trespassing it.
289  \item [{{\textsf{\textbf{:peek-right}}}}] Peek to the right around a  \item [{{\textsf{\textbf{:peek-right}}}}] Peek to the right around a
290  corner, analogous to \textsf{\textbf{:peek-left}}.  corner, analogous to \textsf{\textbf{:peek-left}}.
# Line 326  The name of the feeb. Line 326  The name of the feeb.
326  \begin{flushleft}  \begin{flushleft}
327  Where the feeb is facing to, one of the constants provided: \textsf{\textbf{north}},  Where the feeb is facing to, one of the constants provided: \textsf{\textbf{north}},
328  \textsf{\textbf{east}}, \textsf{\textbf{south}} or \textsf{\textbf{west}},  \textsf{\textbf{east}}, \textsf{\textbf{south}} or \textsf{\textbf{west}},
329  wich are 0, 1, 2 and 3 respectivelly.  which are 0, 1, 2 and 3 respectively.
330  \par\end{flushleft}  \par\end{flushleft}
331
332  \item [{{\textsf{\textbf{(x-position}}\textsf{\emph{~status}}\textsf{\textbf{)}}}}]~  \item [{{\textsf{\textbf{(x-position}}\textsf{\emph{~status}}\textsf{\textbf{)}}}}]~
# Line 379  If \textsf{\textbf{T}} indicates that th Line 379  If \textsf{\textbf{T}} indicates that th
379
380
381  \begin{flushleft}  \begin{flushleft}
382  Related with timing. Returns \textsf{\textbf{T}} if the last move  Related to timing. Returns \textsf{\textbf{T}} if the last move
383  of feeb was aborted because of timing issues.  of feeb was aborted because of timing issues.
384  \par\end{flushleft}  \par\end{flushleft}
385
# Line 398  reincarnated. Line 398  reincarnated.
398  The brain receives also information about what is near the feeb and  The brain receives also information about what is near the feeb and
399  what the feeb sees. We note that, contrary to \emph{Planet of the  what the feeb sees. We note that, contrary to \emph{Planet of the
400  Feebs}, it is safe to change anything inside these structures, so  Feebs}, it is safe to change anything inside these structures, so
401  you are alowed to keep them stored and to modify them as you wish.  you are allowed to keep them stored and to modify them as you wish.
402
403  The structure \textsf{\emph{proximity}} has the contents of the squares  The structure \textsf{\emph{proximity}} has the contents of the squares
404  near the feeb (not affected by peeking) with these fields:  near the feeb (not affected by peeking) with these fields:
# Line 432  Contents of the left square of the feeb. Line 432  Contents of the left square of the feeb.
432  Contents of the square behind the feeb.  Contents of the square behind the feeb.
433  \par\end{flushleft}  \par\end{flushleft}
434
435  \item [{{The}}] vector \textsf{\emph{vision}} has the contents of the  The vector \textsf{\emph{vision}} has the contents of the
436  squares that are in front of the feeb. For example, \textsf{\textbf{(aref}}\textsf{\emph{~vision~}}\textsf{0}\textsf{\textbf{)}}  squares that are in front of the feeb. For example, \textsf{\textbf{(aref}}\textsf{\emph{~vision~}}\textsf{0}\textsf{\textbf{)}}
437  will return the contents of the square in front of the feeb, \textsf{\textbf{(aref}}\textsf{\emph{~vision~}}\textsf{1}\textsf{\textbf{)}}  will return the contents of the square in front of the feeb, \textsf{\textbf{(aref}}\textsf{\emph{~vision~}}\textsf{1}\textsf{\textbf{)}}
438  will return the contents of the next square, and so on. As said before,  will return the contents of the next square, and so on. As said before,
# Line 465  not the real ones, but just images with Line 465  not the real ones, but just images with
465  can access. It is allowed to keep and change its contents because  can access. It is allowed to keep and change its contents because
466  they won't be used internally.  they won't be used internally.
467
468  These are the accessors available (they read and change the fiels):  These are the accessors available (they read and change the flies):
469
470  \begin{lyxlist}{00.00.0000}  \begin{lyxlist}{00.00.0000}
471  \item [{{\textsf{\textbf{(feeb-image-name}}\textsf{~feeb-image}\textsf{\textbf{)}}}}]~  \item [{{\textsf{\textbf{(feeb-image-name}}\textsf{~feeb-image}\textsf{\textbf{)}}}}]~
472
473
474  \begin{flushleft}  \begin{flushleft}
475  The name of the feeb. (Maybe you know it's weakpoints?)  The name of the feeb. (Maybe you know it's weak points?)
476  \par\end{flushleft}  \par\end{flushleft}
477
478  \item [{{\textsf{\textbf{(feeb-image-facing}}\textsf{~feeb-image}\textsf{\textbf{)}}}}]~  \item [{{\textsf{\textbf{(feeb-image-facing}}\textsf{~feeb-image}\textsf{\textbf{)}}}}]~
# Line 543  time), m' represents a mushroom site an Line 543  time), m' represents a mushroom site an
543
544  If you want to create a new map, you can start by an empty template  If you want to create a new map, you can start by an empty template
545  of any size that is provided by \textsf{\textbf{(make-template}}\textsf{~x-size~y-size}\textsf{\textbf{)}},  of any size that is provided by \textsf{\textbf{(make-template}}\textsf{~x-size~y-size}\textsf{\textbf{)}},
546  or you can get a reandom map calling \textsf{\textbf{(generate-maze}}\textsf{~x-size~y-size~}\textsf{\textbf{:density}}\textsf{~density}\textsf{\textbf{)}}  or you can get a random map calling \textsf{\textbf{(generate-maze}}\textsf{~x-size~y-size~}\textsf{\textbf{:density}}\textsf{~density}\textsf{\textbf{)}}
547  The density is a number, recomended to be between 0.25 and 0.45, which  The density is a number, recommended to be between 0.25 and 0.45, which
548  tells the portion of the maze should be blank spaces. The function  tells the portion of the maze should be blank spaces. The function
549  quits after a while if it doesn't meet this portion. See its documentation  quits after a while if it doesn't meet this portion. See its documentation
550  for more details and options.  for more details and options.
# Line 556  With this version of the game, it's poss Line 556  With this version of the game, it's poss
556  of a feeb when creating it, so your feeb will be more personalized.  of a feeb when creating it, so your feeb will be more personalized.
557
558  The graphic of a feeb is defined by an image file, which should have  The graphic of a feeb is defined by an image file, which should have
559  three colunms by eight lines of pictures of the same size. The four  three columns by eight lines of pictures of the same size. The four
560  first lines must be the animations of the feeb walking up, left, down  first lines must be the animations of the feeb walking up, left, down
561  and right, respectively. The next four lines must be the pictures  and right, respectively. The next four lines must be the pictures
562  of the feeb flaming up, left, down and right, respectively. To see  of the feeb flaming up, left, down and right, respectively. To see
# Line 577  The game loop is started by calling \tex Line 577  The game loop is started by calling \tex
577
578  \section{Contests}  \section{Contests}
579
580  I sugest that you see this chapter only after you have created at  I suggest that you read this chapter only after you have created at
581  least a basic brain feeb, which is better than the (simple) provided  least a basic brain feeb, which is better than the (simple) provided
582  brain, or if you want to participate of a contest or a game with your  brain, or if you want to participate of a contest or a game with your
583  friends.  friends.
# Line 588  friends. Line 588  friends.
588  It is possible to get the maze map during the game, but with only  It is possible to get the maze map during the game, but with only
589  the corridors. Note that the function that gets the map is purposely  the corridors. Note that the function that gets the map is purposely
590  a little slow, so, invoking it too many times in a contest that uses  a little slow, so, invoking it too many times in a contest that uses
591  timing atributes is not a good idea; anyway, it is possible to invoke  timing attributes is not a good idea; anyway, it is possible to invoke
592  this function before defining the feeb, and store its value somewhere.  this function before defining the feeb, and store its value somewhere.
593  Also note that the map returned does not have any information about  Also note that the map returned does not have any information about
594  what is really in the maze, but only the possible ways.  what is really in the maze, but only the possible ways.
# Line 610  place. Line 610  place.
610  \item [{{\textsf{\textbf{nil}}}}] An {}empty'' place, i.e. neither  \item [{{\textsf{\textbf{nil}}}}] An {}empty'' place, i.e. neither
611  of the previous.  of the previous.
612  \end{lyxlist}  \end{lyxlist}
613  This map can safelly be used since \textsf{\textbf{(get-maze-map)}}  This map can safely be used since \textsf{\textbf{(get-maze-map)}}
614  makes a new copy every time it is called.  makes a new copy every time it is called.
615
616
617  \subsection{Timing}  \subsection{Timing}
618
619  There are also some timing atributes that can be given to the game.  There are also some timing attributes that can be given to the game.
620  The more time the feeb takes make a decision, greater is the probability  The more time the feeb takes make a decision, greater is the probability
621  of its command to be aborted.  of its command to be aborted.
622

Legend:
 Removed from v.20 changed lines Added in v.21