Aus öffentlichen Paketdaten erstellte Orientierung.
Dartemis ist ein leichtgewichtiges Entity-Component-System (ECS)-Framework für die Spieleentwicklung in Dart, das von dem Framework Artemis inspiriert wurde. Es bietet einen strukturierten Ansatz zur Verwaltung von Spielentitäten, Komponenten und Systemen und fördert Leistung und Skalierbarkeit. Für die Verwendung mit Flutter entwickelt, unterstützt es mehrere Plattformen wie Android, iOS, Web, macOS, Windows und Linux. Durch die Trennung der Verantwortlichkeiten ermöglicht das Framework eine effiziente datengesteuerte Spiellogik und ist daher ideal für komplexe Spielarchitekturen. Entwickler können die Funktionalität problemlos durch benutzerdefinierte Systeme und Komponenten erweitern.
Anwendungsfälle
2D/3D-Spiele erstellen
Verwaltung einer großen Anzahl von Spielentitäten
Implementierung datengesteuerter Spiellogik
Modulare Spiel-Systeme erstellen
Leistungssteigerung in Spiel-Schleifen
Hauptmerkmale
Entität-Komponente-System-Architektur
Hohe Leistung und geringer Speicherbedarf
Plattformübergreifende Unterstützung
Erweiterbares System- und Komponentenmodell
Eingebautes Ereignis- und Abfragesystem
Geeignet für
Spielerentwickler, die Flutter verwenden
Projekte, die eine skalierbare Entitätenverwaltung erfordern
Teams, die komplexe Spielmechaniken entwickeln
Entwickler, die nach besten Praktiken für ECS suchen
leistungskritische Anwendungen
Hinweise
Erfordert Verständnis von ECS-Mustern
Steilere Lernkurve für Anfänger
Eingeschränkter integrierter Grafik- oder Audio-Unterstützung
Kein vollständiger Spiel-Engine
Am besten mit zusätzlicher Werkzeugunterstützung zur Debugging verwendet
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
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/
A Component is a pretty simple structure and should not contain any logic:
classPositionextendsComponent{
num x, y;
Position(this.x, this.y);
}
Or if you want to use a PooledComponent:
classPositionextendsPooledComponent{
latenum x, y;
Position._();
factoryPosition(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.
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:
classMovementSystemextendsEntityProcessingSystem{
lateMapper<Position> positionMapper;
lateMapper<Velocity> velocityMapper;
MovementSystem() : super(Aspect.forAllOf([Position, Velocity]));
voidinitialize() {
// 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);
}
voidprocessEntity(Entity entity) {
Position position = positionMapper[entity];
Velocity vel = velocityMapper[entity];
position
..x += vel.x * world.delta
..y += vel.y * world.delta;
}
}
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)