패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.10.1

dartemis

게임 개발을 위한 엔티티 시스템 프레임워크. Artemis 기반.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
140
좋아요
13
Pub 점수
160

패키지 설치

flutter pub add dartemis

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Dartemis는 Artemis 프레임워크에서 영감을 받은 Dart로 게임 개발을 위한 경량 엔티티-컴포넌트-시스템(ECS) 프레임워크입니다. 게임 엔티티, 컴포넌트 및 시스템을 관리하는 구조적인 접근 방식을 제공하여 성능과 확장성을 높입니다. Flutter와 함께 사용하도록 설계되었으며 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 관심사의 분리를 통해 효율적인 데이터 기반 게임 로직을 가능하게 하여 복잡한 게임 아키텍처에 적합합니다. 개발자는 사용자 정의 시스템과 컴포넌트를 통해 기능을 쉽게 확장할 수 있습니다.

사용 사례

  • 2D/3D 게임 만들기
  • 대규모 게임 엔티티 관리
  • 데이터 기반 게임 로직 구현
  • 모듈러 게임 시스템 만들기
  • 게임 루프에서 성능 최적화

주요 기능

  • 엔티티-컴포넌트-시스템 아키텍처
  • 고성능 및 낮은 메모리 오버헤드
  • 크로스 플랫폼 지원
  • 확장 가능한 시스템 및 구성 요소 모델
  • 내장 이벤트 및 쿼리 시스템

적합한 대상

  • Flutter를 사용하는 게임 개발자
  • 확장 가능한 엔티티 관리를 필요로 하는 프로젝트
  • 복잡한 게임 메커니즘을 구축하는 팀
  • ECS 최적 실천 방법을 찾는 개발자
  • 성능 중심 응용 프로그램

고려 사항

  • ECS 패턴에 대한 이해가 필요합니다
  • 초보자를 위한 학습 곡선이 더 가파릅니다
  • 제한된 내장 그래픽 또는 오디오 지원
  • 완전한 게임 엔진이 아님
  • 디버깅을 위한 추가 도구와 함께 사용하는 것이 가장 좋습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

dartemis

Build Status Coverage Status Pub

Content

About

dartemis is a Dart port of the Entity System Framework Artemis.

The original has been written in Java by Arni Arent and Tiago Costa and can be found here: https://gamadu.com/artemis/ (archived) with the source available here: https://code.google.com/p/artemis-framework/

Ports for other languages are also available:

  • C#: https://github.com/thelinuxlich/artemis_CSharp
  • Python: https://github.com/kernhanda/PyArtemis

Some useful links about what an Entity System/Entity Component System is:

Getting started

  1. Add dartemis to your project by adding it to your pubspec.yaml:

    dependencies:
      dartemis: any
    
  2. Import it in your project:

    import 'package:dartemis/dartemis.dart';
    
  3. Create a world:

    final world = World();
    
  4. Create an entity from a list of components. Entities with different components will be processed by different systems:

    world.createEntity([
      Position(0, 0), 
      Velocity(1, 1),
    ]);
    

    A Component is a pretty simple structure and should not contain any logic:

    class Position extends Component {
      num x, y;
      Position(this.x, this.y);
    }
    

    Or if you want to use a PooledComponent:

    class Position extends PooledComponent {
      late num x, y;
     
      Position._();
      factory Position(num x, num y) {
        final position = Pooled.of<Position>(() => Position._())
          ..x = x
          ..y = y;
        return position;
      }
    }
    

    By using a factory constructor and calling the static function Pooled.of, dartemis is able to reuse destroyed components and they will not be garbage collected.

  5. Define a systems that should process your entities. The Aspect defines which components an entity needs to have in order to be processed by the system:

    class MovementSystem extends EntityProcessingSystem {
      late Mapper<Position> positionMapper;
      late Mapper<Velocity> velocityMapper;
    
      MovementSystem() : super(Aspect.forAllOf([Position, Velocity]));
    
      void initialize() {
        // initialize your system
        // Mappers, Systems and Managers have to be assigned here
        // see dartemis_builder if you don't want to write this code
        positionMapper = Mapper<Position>(world);
        velocityMapper = Mapper<Velocity>(world);
      }
    
      void processEntity(Entity entity) {
        Position position = positionMapper[entity];
        Velocity vel = velocityMapper[entity];
        position
          ..x += vel.x * world.delta
          ..y += vel.y * world.delta;
      }
    }
    

    Or using dartemis_builder

    part 'filename.g.part';
    
    @Generate(
      EntityProcessingSystem,
      allOf: [
        Position,
        Velocity,
      ],
    )
    class SimpleMovementSystem extends _$SimpleMovementSystem {
      @override
      void processEntity(Entity entity, Position position, Velocity velocity) {    
        position
          ..x += velocity.x * world.delta
          ..y += velocity.y * world.delta;
      }
    }
    
  6. Add your system to the world:

    world.addSystem(MovementSystem());
    
  7. Initialize the world:

    world.initialize();   
    
  8. Usually your logic requires a delta, so you need to set it in your game loop:

    world.delta = delta;
    
  9. In your game loop you then process your systems:

    world.process();
    

Documentation

API

Reference Manual

Example Games using dartemis

  • darteroids - Very simple example included in the example folder of dartemis, (Source)
  • Shapeocalypse - A fast paced reaction game using Angular, WebAudio and WebGL
  • damacreat - An iogame similar to agar.io about creatures made of dark matter (circles) consuming dark energy (circles) and other dark matter creatures (circles), which can shoot black holes (circles)

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.