[the-feebs-war-devel] document reviewed

Gustavo gugamilare at gmail.com
Wed Aug 4 14:00:58 UTC 2010


2010/8/4 Xie, WenSheng <WenSheng.Xie at harman.com>

>  Hi, Gustavo:
>
>
>
> Great to hear that you are thinking of working on this project later on.
>

It became a matter of honor :)

>
>
> It’s fun to practice my lisp with this project.
>
>
>
> What’s your plan to make it a network/web-based multi-user game?
>

Well, I actually didn't have this plan, but that is a nice idea. Back in
2008 my thoughts were to use the mailing list for communication and someone
would run the program.

If the graphics part is created "modularly enough", it should be possible to
change the backend - one backend would be the machine itself running the
game and the other would be a wrapper around a web socket.

Security is complicated, thought. The file defining the feeb's brain would
not be allowed to have any internal symbol from the package :the-feebs-war
nor to create or use any packages, restricted to the exported symbols from
:feebs and :cl, and perhaps :alexandria. Timeouts would be used to prevent
users from creating infinite loops, but any user would still be able to
exhaust the memory (or the stack), now I don't know how to prevent this.

I'll only set up a server if there are enough users interested in it,
though, you are the first in 2 years.

>
>
> Further, I modify the graphics/graphics.lisp slightly to make clearer
> display: (in red below)
>
>
>
> (in-package :the-feebs-war)
>
>
>
>  (defun print-direction (dir)
>
>   (case dir
>
>     (0 #\N)
>
>     (1 #\E)
>
>     (2 #\S)
>
>     (3 #\W)))
>
>
>
> (defun print-map ()
>
> *  (format t "~%")  ;add this line*
>
>   (dotimes (y *maze-y-size*)
>
>     (dotimes (x *maze-x-size*)
>
>       (let ((elt (aref *maze* x y)))
>
>         (apply 'format t
>
>                (cond
>
>                  ((wallp elt)
>
>                   (list " XX"))
>
>                  ((feeb-p (car elt))
>
>                   (list " F~a"
>
>                         (print-direction (feeb-facing (car elt)))))
>
>                  ((fireball-p (car elt))
>
>                   (list " *~a" (print-direction (fireball-direction (car
> elt)))))
>
>                  ((eq (car elt) :mushroom)
>
>                   (list " mm"))
>
>                  ((eq (car elt) :carcass)
>
>                   (list " cc"))
>
>                  (t (list "   "))))))
>
>     (format t "~%"))
>
> *  (format t "~%")) ;add this line*
>
>
>
> (defun simple-play (&optional layout)
>
>   (if layout
>
>       (change-layout layout))
>
>   (make-auto-feebs (- 10 (length *feebs-to-be*)))
>
>   (initialize-feebs)
>
>   (start-round)
>
> *  (loop until (finish-game-p)*
>
> *     do*
>
> *       (play-one-turn)*
>
> *       (print-map)*
>
> *       (sleep 0.7))*
>
> *  (format t "Game Over!!~%~%Scores:~%~%")*
>
> *  (let ((scores nil))*
>
> *    (dolist (feeb *feebs*)*
>
> *      (push (list (feeb-name feeb) (feeb-score feeb)) scores)) ;collect
> living feebs' scores*
>
> *    (dolist (feeb *dead-feebs*)*
>
> *      (push (list (feeb-name feeb) (feeb-score feeb)) scores)) ;collect
> dead feebs' scores*
>
> *    (sort scores #'> :key #'second)                               ;sort
> the scores in decreasing order*
>
> *    (dolist (score scores)*
>
> *      (format t "~30@<~a:~> ~@d~%" (first score) (second score)))))
> ;print out scores*
>
>
>
> Please check if there are helpful when you have time.
>

I'll definitely change the repository to git. It is easier to create and
apply patches, and I'm more used to it than to svn.

>
>
> Best regards,
>
> XIE Wensheng
>
>
>  ------------------------------
>
> *From:* Gustavo [mailto:gugamilare at gmail.com]
> *Sent:* Wednesday, August 04, 2010 8:55 AM
> *To:* the-feebs-war-devel at common-lisp.net
> *Subject:* Re: [the-feebs-war-devel] document reviewed
>
>
>
> Hello, XIE Wensheng,
>
> I'm sorry for not approving your post, but it's been so much time that I've
> lost the admin password.
>
> As you can see, the project is a little dead :S
>
> I might work on it again at the end of this year or beginning of the next
> one, but no promises.
>
>
>
> The document file has been reviewed and some spelling errors are corrected.
>
>
> Thank you for reviewing the .tex file, I'll take a look at it and commit
> later, and sorry for the spell mistakes.
>
>
>
> One question:
>
>
>
> Why the parameter ‘fireball-guaranteed-lifetime is not used in the program?
>
> How to use it?
>
>
> It's a bug, I missed it, thanks for reporting. Now it is (hopefully) fixed
> and committed (fortunately I remember the svn password :)
>
> In case you wonder, these are the changes: in systems.lisp, create a slot
> named lifetime:
>
> (defclass object ()
>   ((direction  :accessor object-direction  :initarg :direction)
>    (x-position :accessor object-x-position :initarg :x-position)
>    (y-position :accessor object-y-position :initarg :y-position)
>    (lifetime   :accessor object-lifetime   :initarg :lifetime :initform
> 0)))
>
>
> add a method for make-move:
>
> (defmethod make-move :after (object move)
>   (incf (object-lifetime object)))
>
>
> and, in definitions/rules.lisp, make these changes:
>
> (def-feeb-parm 'fireball-guaranteed-lifetime 3
>   "Number of turns that a fireball is guaranteed not to dissipate,
> unless it encounters a wall.")
>
> (defmethod make-move-choice ((fireball fireball))
>   (cond
>    ((wallp (get-forward-pos fireball))
>     (if (chance (get-feeb-parm 'fireball-reflection-probability))
>         :turn-around
>         :dissipate))
>    ((and (>= (object-lifetime fireball)
>              (get-feeb-parm 'fireball-guaranteed-lifetime))
>          (chance (get-feeb-parm 'fireball-dissipation-probability)))
>     :dissipate)
>    (t :move-forward)))
>
>
> Regards,
> Gustavo.
>
> _______________________________________________
> the-feebs-war-devel mailing list
> the-feebs-war-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/the-feebs-war-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/the-feebs-war-devel/attachments/20100804/a175fe80/attachment.html>


More information about the the-feebs-war-devel mailing list