2009. 8. 20.

첫번째 게시물..

이제 이글루스 게시물을 가져올 것임..

2009. 8. 4.

환영받지 못할 기업의 자세

이윤추구체인 기업을 호불호의 대상으로 삼는다는 점이 다소 껄끄럽기는 하지만, 세상에는 이미 그런 기업들이 존재한다. 이런 감정은 기업이 가지는 많은 이미지를 통해 생성되고 강화되는데, 이러한 이미지에 대한 판단은 개개인이 가진 가치관에 따라 존재할 것이다.

요 즘 IT쪽에서 많이 회자되는 기업이 Apple 이다. 감성에 호소하는 제품들, 새로운 라이프 사이클을 구성하는 탁월함, 사용하는 것만으로 Cool 하다고 느낄 수 있는 그런 만족감을 주는 회사였는데, 요즘 들어서 일하는 모습을 보면, 태생적으로 기업이 가질 수 밖에 없는 뻔뻔함이랄까, 그런 점을 느낀다.

영국에서 한 소녀가 구입한 iPod 이 과열로 보이는 폭발(explode)로 인해 망가졌는데, 이 가족에게 배상을 하는 조건으로 이 일에 대해 외부에 알릴 경우 법적인 조치가 취해질 수 있다는 문건에 서명해줄 것을 권유했다고 한다. The Times 지 보도

국 내에서도 몇몇 Apple 제품이 과열로 보이는 문제점을 보이면서, 리콜관련 실랑이 소식이 들려왔었다. Apple 뿐 아니라 각종 소비자관련 사이트에 들어가면 기업에서 제품에 대한 하자에 대한 보상을 주고, 쉬쉬하고 덮으려는 모습을 너무 쉽게 본다.

인 터넷을 통해 수많은 의견이 생산, 재생산되는 요즈음에 이러한 기업의 자세는, 그동안 쌓아놓았던 호감을 서서히 갉아먹는 나쁜 요소에 불과하게 된다. 보다 적극적인 대응과 솔직한 사과가 회사의 이미지를 지키고, 소비자에게 안심을 주게 하는 등, 선순환적인 요소로 기업에 이득이 된다는 점은 많은 사례를 통해 알려진 바 있다.

하지만, 이런 식으로 무마하려는 노력은, 자칫 잘못하면 더 큰 악영향을 순식간에 불러일으키고 나아가 제품뿐 아니라 기업자체에 심각한 이미지 손상으로 닥쳐올 수 있다는 점을 기업이 인식했으면 하는 소망이다.

2009. 7. 20.

내 리눅스 박스가 자꾸 지저분해지는 이유..

세상 만사 조용하게 살면 좋겠지만 내 리눅스 박스는 전혀 그렇지못하다.

어제도 OpenGL 테스트를 하다가 문제없어야할 프로그램이 뻗어대고 있는 것이었다.

데비안 트리에 들어가서 소스까지 컴파일해다가 올려봤는데 결국은 실패했다.

마침내 얻은 해결책은 CLISP 업그레이드.. 데비안 5.0에 포스팅 된 버전은 2.44.1 인데 현재는 2.47.x..

새로 컴파일해서 돌려보니 정상적으로 운영되기 시작했다.

내 시스템이 잘 정리된 패키지만으로 운영되기를 바라지만 절대 그것은 불가능..

소스를 받아다가 컴파일해서 올려야하다보니 프로그램들은 여기 저기 흩어지기시작하고, 나중에 패키지가 업그레이드어서 새버전이라고 깔릴참이면 기존 버전 지우랴.. 의존성 걸린 패키지들 다시 조정해주랴 정신이 산만해져야한다.

이런 상황이라면 결국 시스템 포맷후 재설치...

패키지만으로도 잘 운영되는 시스템은 역시 꿈일라나... 패키지 관리자가 부지런했으면 하는 소망이지만 봉사자들에게 그런것까지 요구하기는 좀 그렇지.. 아마..

2009. 6. 3.

HTML5 의 Web 게임 가능성..

Google Chrome 이후로 자바스크립트에 많은 관심이 간다.
그중에 하나가 브라우저 상에서의 애니메이션을 제어하는 기술이다.
HTML 5 상에서의 CANVAS로 수행하는 상당히 많은 예제를 보고 있자면 실제로 사용이 가능한 경우가 상당히 많을 것으로 생각한다.
오늘자 Slashdot에서는 플래시 없이 동영상을 VIDEO태그로 실행하는 사이트가 올라왔다. Firefox 3.5 에서만 볼 수 있는 것이 아쉽지만, 앞으로 HTML 5 가 플러그인 시장에 얼마나 엄청난 타격을 입힐지는 기대가 된다.

말하자면 컴퓨터쪽에서의 강력한 연산기능대신 비디오/오디오 등에 특화된 CPU가 있다면, 서버쪽에서 대부분의 연산을 담당하고 클라이언트에서는 웹브라우저가 실제 플랫폼을 대신하는 상황도 생각할 수 있다.

Erlang , LISP으로 만든 게임에서 플레이어 DB데이터와 게임액션을 Erlang이 담당하고, 게임상의 상태처리, 길찾기, API등을 Lisp으로 처리하는 방식은 상당히 좋은 Role Model이 될 수 있을듯하다.

ARM등의 비디오/오디오 강화 CPU에 실연산처리는 클라우드를 포함하는 대규모 서버군이 처리하고, 광대역 처리만 제대로 된다면 기존의 플러그인없이도 HTML 5 만으로도 훌륭한 게임이 나올 수 있을 듯하다.



관련링크


2009. 6. 1.

LISP으로 어드벤처 게임을... Ch 12

이제 각 방별로 해당 방에 들어갔을때 설명을 출력하도록 한다.

;;;; 게임의 Castle 구성하기..
;;; north south east west up down mobs
(defvar *castle*
  '((0 2 0 0 0 0 0 ("You are in the hall way." "There is a door in south." "Through window to the north you can see secret herb garden"))
    (1 3 3 3 0 0 0 ("This is the audience chamber" "There is a window to the south. By looking to the right" "Through it you can see the entrance of the castle" "Doors leave this room to the north, east, and south" ))
    (2 0 5 2 0 0 0 ("You are in great hall, all-shaped room" "There is doors to the east and to the north" "In the alcove is a door to the west"))
    (0 5 0 0 0 0 0 ("This is the monarch's private meeting room" "There is a single exit to the south"))
    (4 0 0 3 15 13 0 ("This inner hallway contains a door to the north." "And one to the west, and a circular stairwell" "passes though the room" "You can see ornamental lake through here"))
    (0 0 1 0 0 0 0 ("You are at the entrance to a fobidding-looking" "stone castle. You are facing east"))
    (0 8 0 0 0 0 0 ("This is castle's kitchen. Though windows in" "The north wall you can see secret herb garden." "A door leave the kitchen to the south" ))
    (7 10 0 0 0 0 0 ("You are in store room admist spices" "vegatables, and vast sacks of floud and" "Other provisions. There is a door to the north" "and one to the south"))
    (0 19 0 8 0 8 0 ("You are slowly descends."))
    (8 0 11 0 0 0 0 ("You are in the real vestibule." "There are windows to the south from which" "you can see ornamental lake" "There is an exit to the east and " "one to north"))
    (0 0 10 0 0 0 0 () )
    (0 0 0 13 0 0 0 ("you are in dank dark dungeon" "There is single exit, a small hole in" "wall towards to east"))
    (0 0 12 0 5 0 0 ("You are in the prison guardroom in the " "basement of the castle. The staiwell" "ends in the room. There is one other" "exit, a small hole in the east wall") )
    (0 15 17 0 0 0 0 ("You are in the master bedroom on the upper" "level of the castle..." "Looking down from the window to the west, you" "can see the entrance to the castle, while the" "secret herb garden is visible below to the north" "window. There are doors to the east and" "to the south"))
    (14 0 0 0 0 5 0 ("This is L-shaped upper hallway." "To the north is a door, and there is a strairwell in the hall as well. You can see" "the lake through the south windows."))
    (17 0 19 0 0 0 0 ("This room was used as the castle treasury in" "by-gone years..." "There are no windows, just exits to the" "north and to the east"))
    (18 16 0 14 0 0 0 ("Ooooh.. you are in the chembermaids' bedroom" "There is an exit to the west and a door " "TO the south"))
    (0 17 0 0 0 0 0 ("This tiny room on the upper level is the" "dressing chamber. There is a window to the" "north. with a view of the here garden down" "below. A door leaves to the south."))
    (9 0 16 0 0 0 0 ("This is a small room outside the castle" "lift which can be entered by a door to the north" "another door leads to the west, you can see" "the lake through the southern windows"))))

설명을 출력할 부분을 만든다.

먼저 방에서 각 요소를 가져오는 함수에, 새로 설명을 출력할 부분을 추가한다.

;;; 방의 리스트에서 각 요소를 가져오는 함수
(defun get-rooms-element (room element)
  (cond ((char= element #\n) (car room))
        ((char= element #\s) (nth 1 room))
        ((char= element #\e) (nth 2 room))
        ((char= element #\w) (nth 3 room))
        ((char= element #\u) (nth 4 room))
        ((char= element #\d) (nth 5 room))
        ((char= element #\m) (nth 6 room))
        ((char= element #\v) (nth 7 room))
        (t
         nil)))

다음으로 해당하는 방의 설명을 출력하는 함수를 만든다.

;;; 방의 모습을 설명하는 루틴
(defun describe-room ()
  (format t "The room is ~A~%" *room*)
  (print-room *room*)
  (if (= *room* 9) (setf *room* 10)))

9번방에 들어온 경우에는 자동으로 10번방으로 이동한다.

;;; 방의 내역을 출력하기
(defun print-room (which-room)
  (let ((desc-list (get-rooms-element (get-room which-room ) #\v)))
    (labels ((iter (field)
               (cond ((null field) )
                     (t
                      (format t "~a~%" (car field))
                      (iter (cdr field))))))
      (iter desc-list))))

마지막으로 플레이어가 11번방으로 들어왔다면 게임을 종료한다.

;;; 전체 이벤트 루프

(defun event-loop ()
  (let ((k (get-rooms-element (get-room *room*) #\m))
        (game-over nil))
    (loop
       (status-report)
       (cond ((= *room* 11)
              (progn
                (format t "Congratulation, you escape the castle")
                (setf game-over t)))
             (t
              (let ((input-key (keyboard-event)))
                (cond ((string= input-key "n") (go-direction #\n))
                      ((string= input-key "s") (go-direction #\s))
                      ((string= input-key "e") (go-direction #\e))
                      ((string= input-key "w") (go-direction #\w))
                      ((string= input-key "u") (go-direction #\u))
                      ((string= input-key "d") (go-direction #\d))
                      ((string= input-key "c") (consume-food))
                      ((string= input-key "f") (fight))
                      ((string= input-key "r") (runaway))
                      ((string= input-key "q") (setf game-over t))
                      ((string= input-key "m") (magic-amulet))
                      ((string= input-key "p") (picking-up))
                      ((string= input-key "i") (inventory))))))
       (if (eq game-over t)
           (return-from event-loop)))))

다음 부터는 완성된 버전을 LISP식으로 조금씩 변화시켜나가보도록 하겠다.

2009. 5. 28.

LISP 으로 어드벤처 게임을... Ch 11

전투 모듈에서는 몹에 대한 공격과 방어가 확률에 의해 진행된다.
방어구를 입은 경우 넘겨야할 난이도를 75%정도로 낮추어서 게임 진행을 쉽게 한다.

;;; 전투모듈
(defun fight ()
  (prompt-read "press return to fight")
  (cond ((= *suit* 1)
         (progn
           (format t "Your armor increases your chance of success~%")
           (setf *ff* (* 3 (floor (/ *ff* 4)))))))
  (cond ((and (= *axe* 0) (= *sword* 0))
         (progn
           (format t "You have no weapons~%You mush fight with Base hands~%")
           (setf *ff* (+ *ff* (floor (/ *ff* 5))))))
        ((and (= *axe* 1) (= *sword* 0))
         (progn
           (format t "You have only an axe to fight with~%")
           (setf *ff* (* 4 (floor (/ *ff* 5))))))
        ((and (= *sword* 1) (= *axe* 0))
         (progn
           (format t "You mush fight with your sowrd~%")
           (setf *ff* (* 3 (floor (/ *ff* 4))))))
        (t
         (let ((z (parse-integer (prompt-read "Which weapon? 1- Axe, 2- Sword"))))
           (cond ((= z 1) (setf *ff* (* 4 (floor (/ *ff* 5)))))
                 ((= z 2) (setf *ff* (* 3 (floor (/ *ff* 4)))))))))
  (taking-arms))
실제 전투모드에서는 확률에 의거해 공방을 결정하고, 전투가 끝나는 것도 확률로 결정한다.
전투종료시 난이도 값을 얼마나 남겼는지를 확인해서 승패를 결정한다.

;; 배틀모드
(defun taking-arms ()
  (let ((prob1 (random 10))
        (prob2 (random 10))
        (prob3 (random 10))
        (prob4 (random 100))
        (prob5 (random 10)))
    (cond ((> prob1 5)
           (format t "~a attacks~%" *monster*))
          (t
           (format t "you attack~%")))
    (cond ((> prob2 5)
           (progn
             (format t "You manage to wound it~%")
             (setf *ff* (floor (* 5 (/ *ff* 6)))))))
    (cond ((> prob3 5)
           (progn
             (format t "The monster wounds you!~%")
             (decf *strength* 5))))
    (cond ((> prob4 35)
           (taking-arms))
          (t
           (cond ((> (* prob5 1.6) *ff*)
                  (progn
                    (format t "~%and you managed  to kill the ~a" *monster*)
                    (incf *mk*)
                    (setf (nth 6 (nth (- *room* 1) *castle*)) 0)))
                 (t
                  (progn
                    (format t "The ~a defeated you." *monster*)
                    (setf *strength* (floor (*strength* 2))))))))))

2009. 5. 27.

LISP 으로 어드벤처 게임을 ... CH 10

여기서 만들게 될 함수들은 상점, 음식먹기 등에 해당한다.
먼저 지난번에 만들었던 Event Loop를 살짝 수정했다.

(defun event-loop ()
  (let ((k (get-rooms-element (get-room *room*) #\m))
        (game-over nil))
    (loop
       (status-report)
       (let ((input-key (keyboard-event)))
         (cond ((string= input-key "n") (go-direction #\n))
               ((string= input-key "s") (go-direction #\s))
               ((string= input-key "e") (go-direction #\e))
               ((string= input-key "w") (go-direction #\w))
               ((string= input-key "u") (go-direction #\u))
               ((string= input-key "d") (go-direction #\d))
               ((string= input-key "c") (consume-food))
               ((string= input-key "f") (fight))
               ((string= input-key "r") (runaway))
               ((string= input-key "q") (setf game-over t))
               ((string= input-key "m") (magic-amulet))
               ((string= input-key "p") (picking-up))
               ((string= input-key "i") (inventory))))
       (if (eq game-over t)
           (return-from event-loop)))))


마법 아뮬렛이 있을때 수행할 함수를 만든다.
;;; 마법 아뮬렛을 사용할 때 수행할 곳(6번과 11번은 제외 )
(defun magic-amulet ()
  (let ((ro (+ (random 19) 1)))
    (cond ((or (= ro 6) (= ro 11)) (magic-amulet))
          (t
           (setf *room* ro)))))


또한 음식을 먹는 함수를 만든다.

;;; 음식 먹기
(defun consume-food ()
  (cond ((>= food 1)
         (progn
           (format t "You have ~a units of food~%" *food*)
           (format t "How many do you want to eat? :")
           (let ((z (parse-integer (read-line))))
             (if (> z food)
                 (consume-food)
                 (progn
                   (decf *food* z)
                   (incf *strength* (* 5 z)))))))))


이제 방에 보물이 있는 경우 집는 함수를 만든다.
;;; 방의 물건 집기
(defun picking-up ()
  (let ((treasure (get-rooms-element
                   (get-room *room*)
                    #\m)))
    (if (< treasure 10)
        (format t "There is no treasure to pickup")
        (progn
          (incf *wealth* treasure)
          (setf (nth 6 (nth (- *room* 1) *castle*)) 0)))))

마지막으로 상점에서 물건을 구입하는 함수를 만든다.
;;; Show shop
(defun show-shop ()
  (format t "You can buy 1 - Flamming Torch ($15)~%")
  (format t "            2 - Axe ($10)~%")
  (format t "            3 - Sword ($20)~%")
  (format t "            4 - Food ($2 per unit)~%")
  (format t "            5 - Magic of Amulet ($30)~%")
  (format t "            6 - Suit of Armor ($50)~%")
  (format t "            0 - To continue Adventure ~%"))

;;; Shop에서 물건사기
(defun inventory ()
  (format t "Provision & Inventory~%")
  (cond ((> *wealth* 0)
         (progn
           (show-shop)
           (let ((z (parse-integer (prompt-read "Enter no of item:"))))
             (cond ((= z 1)
                    (progn
                      (setf *light* 1)
                      (decf *wealth* 15)))
                   ((= z 2)
                    (progn
                      (setf *axe* 1)
                      (decf *wealth* 10)))
                   ((= z 3)
                    (progn
                      (setf *sword* 1)
                      (decf *wealth* 20)))
                   ((= z 4)
                    (progn
                      (let ((q (prompt-read "how many food do you want")))
                        (cond ((> (* q 2) *wealth*)
                               (format t "You Can't Get enough money"))
                              (t
                               (progn
                                 (incf *food* q)
                                 (defc *wealth* (* q 2))))))))
                   ((= z 5)
                    (progn
                      (setf *amulet* 1)
                      (decf *wealth* 30)))
                   ((= z 6)
                    (progn
                      (setf *armor* 1)
                      (decf *wealth* 50)))))))
        (t
         (format t "You have no money~%"))))

일단 기본적인 툴이 모두 마련되었다.
다음장에서는 전투에 대한 부분을 살펴보자.