पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.10.1

dartemis

गेम विकास के लिए एक एंटिटी सिस्टम फ्रेमवर्क। Artemis पर आधारित।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
140
लाइक
13
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add dartemis

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

Dartemis एक हल्का एंटिटी-कंपोनेंट-सिस्टम (ECS) फ्रेमवर्क है, जो Dart में गेम विकास के लिए है, जिसका प्रेरणा Artemis फ्रेमवर्क से लिया गया है। यह खेल के एंटिटी, कंपोनेंट और सिस्टम को प्रबंधित करने के लिए एक संरचित दृष्टिकोण प्रदान करता है, जो प्रदर्शन और स्केलेबिलिटी को बढ़ावा देता है। Flutter के साथ उपयोग के लिए डिज़ाइन किया गया है, यह Android, iOS, Web, macOS, Windows और Linux जैसे कई प्लेटफॉर्मों का समर्थन करता है। इस फ्रेमवर्क के माध्यम से चिंता के विभाजन के माध्यम से दक्ष डेटा-आधारित गेम लॉजिक को संभव बनाता है, जो जटिल गेम आर्किटेक्चर के लिए आदर्श है। विकासकर्ता अपनी क्षमता को कस्टम सिस्टम और कंपोनेंट के माध्यम से आसानी से विस्तारित कर सकते हैं।

उपयोग

  • 2D/3D खेल निर्माण
  • बड़ी संख्या में गेम एन्टिटी का प्रबंधन
  • डेटा-आधारित गेम लॉजिक का कार्यान्वयन
  • मॉड्यूलर गेम सिस्टम बनाना
  • गेम लूप में प्रदर्शन को अनुकूलित करना

मुख्य विशेषताएँ

  • एंटिटी-कॉम्पोनेंट-सिस्टम आर्किटेक्चर
  • उच्च प्रदर्शन और कम मेमोरी ओवरहेड
  • क्रॉस-प्लेटफ़ॉर्म समर्थन
  • विस्तारयोग्य प्रणाली और घटक मॉडल
  • एम्बेडेड इवेंट और क्वेरी सिस्टम

इनके लिए उपयुक्त

  • Flutter का उपयोग करने वाले गेम डेवलपर्स
  • स्केलेबल एंटिटी प्रबंधन की आवश्यकता वाले प्रोजेक्ट
  • जटिल गेम मैकेनिक्स बनाने वाली टीमें
  • ईसीएस बेस्ट प्रैक्टिस की तलाश में विकासकर्ता
  • प्रदर्शन-महत्वपूर्ण अनुप्रयोग

विचार योग्य बातें

  • 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 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।