[GpGiki 대문으로]

Usecode


분류: 분류 번역, 분류 설계패턴


유즈코드(Usecode)


Submitted by Zachary Booth Simpson on 12/5/2000

ⓒ 2000 - Zachary Booth Simpson.opied with permission from http://www.totempole.net. If you find any of this work useful, please sign Zack's guest book: http://www.totempole.net/cgi-bin/gbook.cgi.


날림 번역중... 2003-11-07 11:45, 파도


의도:

Create a simple and safe embedded language with which game designers and (potentially) end-users can build game logic.

게임 디자이너들과 (잠재적으로) 최종 사용자가 게임 로직을 생성할 수 있는 간단하고 안전한 내장 언어의 생성

문제:

Many game problems are inherently algorithmic. However, it is often desirable to allow designers and customers to create this logic without recompiling the game. Script languages are Interpreters which are designed to simplify the implementation of game specific puzzles or features.

대다수의 게임에서 발생하는 문제들은 본질적으로 일정하다(일정한 규칙을 가지고 있다.). 그래서, 종종 디자이너나 소비자는 게임의 재컴파일 없이 새로운 로직을 생성하기길 바라곤 한다. 스크립트 언어들은 이러한 게임에 특화된 퍼즐이나 특징의 구현을 단순화 시키기 위해 개발된 해석기들이라고 할수 있다.

해결책:

A language is designed with a small library appropriate for the game. A parser is typically implemented which translates this code into virtual machine code which is then loaded into the game and interpreted. Alternatively, the game may choose to implement the parser directly into the game and avoid the compilation step; this is called "immediate execution".

언어는 작은 라이브러리들과 함께 해당 게임에 어울리도록 설계한다. 일반적으로 파서는 이 언어로 설계된 코드를 게임속에서 로드되고 해석되는 가상 머신상의 코드로 변환하도록 설계된다. 선택적으로 파서를 직접 게임속에서 구현하여 편집 기능을 피하도록 할 수도 있다. ; (이를 "즉시 실행" 이라고 부른다.)

It is a common problem with Usecode implementations that they become very unwieldy. They have a tendency to grow and grow in scope until the problems they are solving might as well have been implemented in the native language (C, for example). If Usecode is used, it is best to keep a very limited scope on its implementation. When more sophisticated logic or libraries are needed, revert the native language. (A common solution is to use dynamiccly linked libraries with standard interfaces for this.)

Usecode 구현에 있어서 가장 일반적인 문제는 Usecode가 다루기 힘들다는 점이다. C와 같은 native 언어로 해결해온 문제들을 Usecode를 이용해 해결하도록 점점 더 그 구현 범위를 넓혀가는 경향이 있다. ( 역자> 그렇기 때문에 이렇게 구현 범위를 넓혀버리면 결국 일반 유저와 디자이너들이 사용하기 힘들게 된다는 의미인듯 하다.) 만약 Usecode를 사용한다면, 그 구현 범위에 있어서 제한을 두는게 바람직하다. 만약 더 정교한 로직이나 라이브러리들이 필요하다면 native 언어를 사용해라. (이경우 표준 인터페이스를 가지는 동적 링크 라이브러리를 사용하는게 일반적인 해법이다.)

구조:

지금은 없음.

예:

지금은 없음.

고려사항 및 위험요소

없음

관련 패턴들

Controller, Interpreter

용례 및 참고자료

.


제일 위로
최종 수정 일시: 11월 07일(2003년) 11:47 AM 편집 | 정보 | 차이 | 비슷한 페이지 DebugInfo
유용한 페이지들: 분류 분류 | 자유로운 연습장 SandBox | 무작위 페이지들 RandomPages | 인기있는 페이지들 MostPopular