Author Topic: Army Ants (preview)  (Read 1768 times)

0 Members and 1 Guest are viewing this topic.

pkohut

  • Guest
Army Ants (preview)
« on: June 17, 2009, 04:01:36 PM »
coming soon.  Army ants is an ant simulator that users write Ant Controller
Programs (ACP) in autolisp.  The goal is to control your ants actions by
collection as much food to your ant hill in the allotted time.  Simple enough
except there are 2 ACPs each with the same goals.

Are your ants able to outwit and outfight the other team?  Can you make
your ants smarter? Can your ants hold up to a full day being "King of the Hill"
against the brain power here in the swamp?

The program is just about finished and we're trying to figure out a means to
do some sort of competition, that's just in the idea stage for now.

In the meantime I want to release a small video and the nearest thing there is
to documention, the requirements doc, to the group.  In a couple days the
application with source code will be released.

Sorry about the grainy video, it shows 2 ACPs one is AimlessGather
and the other is Thugs.  Aimless gather has no cares in the world and if it
happens to find a food source it will carry it around until it reachs its anthill.
These ants also do not fight, so they can easily be over run.

Thugs, well here's the lisp code to controll thugs, and TIA:
Paul

Code: [Select]
;;; Thugs
;;; These ants are just plain thugs, and not very bright ones
;;; at that.  If they encounter oppenant ants then they will
;;; attack.  In their freanzy to fight they will also mark
;;; the fight spot with a full scent blast.
;;;
;;; If they happen to find food then they will carry
;;; it as well, either until they find their own ant hill or
;;; go into attack mode.
;;; If they happen to be in a spot of a past fresh battle then
;;; they have a 50/50 chance of forgetting that they might be
;;; carrying food.
(defun c:rpkThugs (mainMap foodMap     myAntMap  opAntMap
  myScentMap opScentMap   myDeathMap  opDeathMap
  / row col action mark
 )
  (if (= (nth 12 opAntMap) 0)
    (progn
      (setq row   (- (rand1 0 2) 1) ;_ set row from -1 to 1
   col   (- (rand1 0 2) 1) ;_ set col from -1 to 1
   action 1 ;_ action carry
   mark   0 ;_ no scnet
      )

      (if (and (>= (nth 12 myScentMap) 100)
      (>= (nth 12 opDeathMap) 100)
 )
;; ant is very excited because the smell of a past battle is
;; in the air.  Give 'em a 50/50 chance to remember they
;; might have food to carry.
(setq action (rand1 0 1))
;; set action from 0 to 1
      )
    )
  
  (progn
    ;; go into attack move and blast the spot with scent
    (setq row 0
 col 0
 action -1
 mark 100
    )
  )
    )
  ;; Carry out orders
  (list row col action mark)
)

pkohut

  • Guest
Re: Army Ants (preview)
« Reply #1 on: June 17, 2009, 04:23:40 PM »
Here is the requirements doc again, cause it's kind of hard to spot in
the above message.  :-)

Paul