GithubHelp home page GithubHelp logo

fireblade-engine / ecs Goto Github PK

View Code? Open in Web Editor NEW
103.0 6.0 9.0 810 KB

A dependency free, lightweight, fast Entity-Component System (ECS) implementation in Swift

License: MIT License

Swift 99.56% Makefile 0.44%
entity-component-system swift ecs fireblade-engine spm entity swift-package-manager entitycomponentsystem game-development game-engine gamedev ios macos linux windows

ecs's Introduction

Fireblade ECS (Entity-Component System)

license macOS Linux Windows WASM documentation
codecov spi-swift-versions spi-swift-platforms

This is a dependency free, lightweight, fast and easy to use Entity-Component System implementation in Swift. It is developed and maintained as part of the Fireblade Game Engine project.

See the Fireblade ECS Demo App or have a look at documentation in the wiki to get started.

๐Ÿš€ Getting Started

These instructions will get you a copy of the project up and running on your local machine and provide a code example.

๐Ÿ“‹ Prerequisites

๐Ÿ’ป Installing

Fireblade ECS is available for all platforms that support Swift 5.1 and higher and the Swift Package Manager (SPM).

Extend the following lines in your Package.swift file or use it to create a new project.

// swift-tools-version:5.1

import PackageDescription

let package = Package(
    name: "YourPackageName",
    dependencies: [
        .package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.17.4")
    ],
    targets: [
        .target(
            name: "YourTargetName",
            dependencies: ["FirebladeECS"])
    ]
)

๐Ÿ“ Code Example

๐Ÿ›๏ธ Nexus

The core element in the Fireblade-ECS is the Nexus. It acts as a centralized way to store, access and manage entities and their components. A single Nexus may (theoretically) hold up to 4294967295 Entities at a time.
You may use more than one Nexus at a time.

Initialize a Nexus with

let nexus = Nexus()

๐Ÿ‘ค Entities

then create entities by letting the Nexus generate them.

// an entity without components
let newEntity = nexus.createEntity()

To define components, conform your class to the Component protocol

final class Position: Component {
	var x: Int = 0
	var y: Int = 0
}

and assign instances of it to an Entity with

let position = Position(x: 1, y: 2)
entity.assign(position)

You can be more efficient by assigning components while creating an entity.

// an entity with two components assigned.
nexus.createEntity {
	Position(x: 1, y: 2)
	Color(.red)
}

// bulk create entities with multiple components assigned.
nexus.createEntities(count: 100) { _ in
	Position()
	Color()
}

๐Ÿ‘ช Families

This ECS uses a grouping approach for entities with the same component types to optimize cache locality and ease up access to them.
Entities with the same component types may belong to one Family. A Family has entities as members and component types as family traits.

Create a family by calling .family with a set of traits on the nexus. A family that contains only entities with a Movement and PlayerInput component, but no Texture component is created by

let family = nexus.family(requiresAll: Movement.self, PlayerInput.self,
                          excludesAll: Texture.self)

These entities are cached in the nexus for efficient access and iteration. Families conform to the Sequence protocol so that members (components) may be iterated and accessed like any other sequence in Swift.
Access a family's components directly on the family instance. To get family entities and access components at the same time call family.entityAndComponents. If you are only interested in a family's entities call family.entities.

class PlayerMovementSystem {
	let family = nexus.family(requiresAll: Movement.self, PlayerInput.self,
                              excludesAll: Texture.self)

	func update() {
		family
			.forEach { (mov: Movement, input: PlayerInput) in
			
			// position & velocity component for the current entity
			
			// get properties
			_ = mov.position
			_ = mov.velocity
			
			// set properties
			mov.position.x = mov.position.x + 3.0
			...
			
			// current input command for the given entity
			_ = input.command
			...
			
		}
	}

	func update2() {
		family
			.entityAndComponents
			.forEach { (entity: Entity, mov: Movement, input: PlayerInput) in
			
			// the current entity instance
			_ = entity

			// position & velocity component for the current entity
			
			// get properties
			_ = mov.position
			_ = mov.velocity
			
			
		}
	}

	func update3() {
		family
			.entities
			.forEach { (entity: Entity) in
			
			// the current entity instance
			_ = entity
		}
	}
}

๐Ÿง‘ Singles

A Single on the other hand is a special kind of family that holds exactly one entity with exactly one component for the entire lifetime of the Nexus. This may come in handy if you have components that have a Singleton character. Single components must conform to the SingleComponent protocol and will not be available through regular family iteration.

final class GameState: SingleComponent {
    var quitGame: Bool = false
}
class GameLogicSystem {
    let gameState: Single<GameState>
    
    init(nexus: Nexus) {
        gameState = nexus.single(GameState.self)
    }
    
    func update() {
        // update your game sate here
        gameState.component.quitGame = true
        
        // entity access is provided as well
        _ = gameState.entity
    }
}

๐Ÿ”— Serialization

To serialize/deserialize entities you must conform their assigned components to the Codable protocol.
Conforming components can then be serialized per family like this:

// MyComponent and YourComponent both conform to Component and Codable protocols.
let nexus = Nexus()
let family = nexus.family(requiresAll: MyComponent.self, YourComponent.self)

// JSON encode entities from given family.
var jsonEncoder = JSONEncoder()
let encodedData = try family.encodeMembers(using: &jsonEncoder)

// Decode entities into given family from JSON. 
// The decoded entities will be added to the nexus.
var jsonDecoder = JSONDecoder()
let newEntities = try family.decodeMembers(from: jsonData, using: &jsonDecoder)

๐Ÿงช Demo

See the Fireblade ECS Demo App to get started.

๐Ÿ“– Documentation

Consult the wiki for in-depth documentation.

๐Ÿ’ How to contribute

If you want to contribute please see the CONTRIBUTION GUIDE first.

To start your project contribution run these in your command line:

  1. git clone [email protected]:fireblade-engine/ecs.git fireblade-ecs
  2. cd fireblade-ecs
  3. make setupEnvironment

Before commiting code please ensure to run:

  • make precommit

This project is currently maintained by Christian Treffs.
See also the list of contributors who participated in this project.

๐Ÿ” License

This project is licensed under the MIT License - see the LICENSE file for details

๐Ÿ™ Acknowledgments

Inspired by

ecs's People

Contributors

ctreffs avatar igorkravchenko avatar liamdon avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ecs's Issues

Iterate all entities in a `Nexus`?

Hi there,

is there a way to iterate over all entities in a Nexus without the need for a family? There is no way to create a FamilyTraitSet for "all" components without explicitly giving all possible components types(!).

What I try to achieve: I have a component instance(!) and try to find out which entity holds that component. Something along these lines:

  func componentChanged(_ component: Component) { // this can be any component
       guard let entity = nexus.getEntity(ofComponent: component.identifier) else { return }
       ...
  }

with

  extension Nexus {

       func getEntity(ofComponent: ComponentIdenfier) -> Entity? {
           ...
       }
  }

Unfortunately Nexus.componentIdsByEntity is not available outside of the module and there is no EntityIterator provided by Nexus to iterate over all entities.

Thanks,
Kaweh

Contiguous memory storage for your ECS buffers.

Hello! I stumbled upon this project while looking for something completely different and I immediately took interest since I've been writing a Swift hobby game engine and so Fireblade is really interesting to me! I have a suggestion based on my own learnings about Swift to make this ECS system much faster, and I figured I'd drop it here in case it's useful!

Something I learnt from writing my own Swift engine with a data oriented design is that at the moment it's impossible to (easily) contiguously allocate instances of classes in memory... Swift's memory model just doesn't allow for it. In your Component protocol, you enforce an 'AnyObject' inheritance, which means that your components will be reference types and allocated by the swift runtime (which ultimately calls malloc), and the pointers to these objects will be allocated to wherever malloc thinks is appropriate, in a non ecs/cache friendly way. ContiguousArray unfortunately won't fix this problem since it'll just allocate a contiguous array of references to your class instances. ContiguousArray isn't truly 'contiguous' for reference types, as far as I've investigated.

This means that whenever one of your systems is iterating over a group of entity/components, it will likely incur a large amount of cache misses as you access/process the data in every component, and won't be very performant.

I actually stumbled into this problem myself, and even went as far as trying to hack into the Swift runtime in order to solve this issue (and it is somewhat ultimately solveable, with very involved hacking), but ultimately it felt like I was working against the language design, and so I just decided to use value types for my components, so that any contiguous buffers are actually contiguous and cache friendly.

My suggestion is to go with value types for your ECS system, which should solve the problem neatly.

Great job on Fireblade! I really hope to see this develop. :)

Entity.assign no longer produces ComponentAdded event for NexusEventDelegate

Steps to reproduce:

import FirebladeECS

let nexus = Nexus()

class EventDelegate: NexusEventDelegate {
    func nexusEvent(_ event: NexusEvent) {
        if event is ComponentAdded {
            print("component added")
        }
    }
    
    func nexusNonFatalError(_ message: String) {}
}

let delegate = EventDelegate()
nexus.delegate = delegate

class Comp: Component {}
class Comp2: Component {}


nexus.createEntity().assign(Comp(), Comp2())

In 0.17.2 the ComponentAdded event is triggered.

Segmentation fault during compile for Swift 5.3 (XCode 12 Beta)

Hey!

When trying to compile the project with XCode 12 and Swift 5.3 with SPM integration, XCode can't compile the project because of Segmentation fault:

CompileSwift normal x86_64 /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family5.swift (in target 'FirebladeECS' from project 'FirebladeECS')
    cd /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Component.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/ComponentIdentifier.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Entity+Component.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Entity.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/EntityIdentifier.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/EntityIdentifierGenerator.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family+Coding.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family1.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family2.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family3.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family4.swift -primary-file /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family5.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/FamilyProtocols.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/FamilyTraitSet.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Foundation+Extensions.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Hashing.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/ManagedContiguousArray.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Component.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+ComponentsBuilder.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Entity.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Family.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Internal.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+SceneGraph.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/NexusEventDelegate.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/NexusEvents.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Single.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/UnorderedSparseSet.swift -emit-module-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5\~partial.swiftmodule -emit-module-doc-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5\~partial.swiftdoc -emit-module-source-info-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5\~partial.swiftsourceinfo -serialize-diagnostics-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5.dia -emit-dependencies-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5.d -emit-reference-dependencies-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5.swiftdeps -target x86_64-apple-macos10.10 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -I /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Products/Debug -I /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Products/Debug -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/kaspik/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity\=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -Xcc -working-directory -Xcc /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs -enable-anonymous-context-mangled-names -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/swift-overrides.hmap -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Products/Debug/include -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/DerivedSources-normal/x86_64 -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/DerivedSources/x86_64 -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG\=1 -target-sdk-version 11.0 -module-name FirebladeECS -o /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5.o -index-store-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Index/DataStore -index-system-modules

Stack dump:
0.	Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Component.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/ComponentIdentifier.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Entity+Component.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Entity.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/EntityIdentifier.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/EntityIdentifierGenerator.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family+Coding.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family1.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family2.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family3.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family4.swift -primary-file /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family5.swift -primary-file /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/FamilyProtocols.swift -primary-file /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/FamilyTraitSet.swift -primary-file /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Foundation+Extensions.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Hashing.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/ManagedContiguousArray.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Component.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+ComponentsBuilder.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Entity.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Family.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+Internal.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus+SceneGraph.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Nexus.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/NexusEventDelegate.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/NexusEvents.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Single.swift /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/UnorderedSparseSet.swift -supplementary-output-file-map /var/folders/z7/pq6rp3ss6ks4gm6bdnw7tpzr0000gn/T/supplementaryOutputs-2158a9 -target x86_64-apple-macos10.10 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -I /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Products/Debug -I /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Products/Debug -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/kaspik/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -Xcc -working-directory -Xcc /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs -enable-anonymous-context-mangled-names -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/swift-overrides.hmap -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Products/Debug/include -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/DerivedSources-normal/x86_64 -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/DerivedSources/x86_64 -Xcc -I/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -target-sdk-version 11.0 -module-name FirebladeECS -o /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Family5.o -o /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/FamilyProtocols.o -o /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/FamilyTraitSet.o -o /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Build/Intermediates.noindex/FirebladeECS.build/Debug/FirebladeECS.build/Objects-normal/x86_64/Foundation+Extensions.o -index-store-path /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/Index/DataStore -index-system-modules 
1.	Apple Swift version 5.3 (swiftlang-1200.0.22.4 clang-1200.0.25.1)
2.	While evaluating request TypeCheckSourceFileRequest(source_file "/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family5.swift")
3.	While type-checking extension of Requires5 (at /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family5.swift:59:1)
4.	While type-checking protocol conformance to 'FamilyEncoding' (at /Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/FamilyProtocols.swift:25:8) for type 'Requires5<A, B, C, D, E>' (declared at [/Users/kaspik/Library/Developer/Xcode/DerivedData/MonsterWorld-bvwotptpsysxciczgxwvsgdqzbpe/SourcePackages/checkouts/ecs/Sources/FirebladeECS/Family5.swift:12:8 - line:57:1] RangeText="struct Requires5<A, B, C, D, E>: FamilyRequirementsManaging where A: Component, B: Component, C: Component, D: Component, E: Component {
    public let componentTypes: [Component.Type]

    public init(_ types: (A.Type, B.Type, C.Type, D.Type, E.Type)) {
        componentTypes = [A.self, B.self, C.self, D.self, E.self]
    }

    public static func components(nexus: Nexus, entityId: EntityIdentifier) -> (A, B, C, D, E) {
        let compA: A = nexus.get(unsafeComponentFor: entityId)
        let compB: B = nexus.get(unsafeComponentFor: entityId)
        let compC: C = nexus.get(unsafeComponentFor: entityId)
        let compD: D = nexus.get(unsafeComponentFor: entityId)
        let compE: E = nexus.get(unsafeComponentFor: entityId)
        return (compA, compB, compC, compD, compE)
    }

    public static func entityAndComponents(nexus: Nexus, entityId: EntityIdentifier) -> (Entity, A, B, C, D, E) {
        let entity = nexus.get(unsafeEntity: entityId)
        let compA: A = nexus.get(unsafeComponentFor: entityId)
        let compB: B = nexus.get(unsafeComponentFor: entityId)
        let compC: C = nexus.get(unsafeComponentFor: entityId)
        let compD: D = nexus.get(unsafeComponentFor: entityId)
        let compE: E = nexus.get(unsafeComponentFor: entityId)
        return (entity, compA, compB, compC, compD, compE)
    }

    public static func relativesDescending(nexus: Nexus, parentId: EntityIdentifier, childId: EntityIdentifier) ->
        (parent: (A, B, C, D, E), child: (A, B, C, D, E)) {
            let pcA: A = nexus.get(unsafeComponentFor: parentId)
            let pcB: B = nexus.get(unsafeComponentFor: parentId)
            let pcC: C = nexus.get(unsafeComponentFor: parentId)
            let pcD: D = nexus.get(unsafeComponentFor: parentId)
            let pcE: E = nexus.get(unsafeComponentFor: parentId)
            let ccA: A = nexus.get(unsafeComponentFor: childId)
            let ccB: B = nexus.get(unsafeComponentFor: childId)
            let ccC: C = nexus.get(unsafeComponentFor: childId)
            let ccD: D = nexus.get(unsafeComponentFor: childId)
            let ccE: E = nexus.get(unsafeComponentFor: childId)
            return (parent: (pcA, pcB, pcC, pcD, pcE),
                    child: (ccA, ccB, ccC, ccD, ccE))
    }

    public static func createMember(nexus: Nexus, components: (A, B, C, D, E)) -> Entity {
        nexus.createEntity(with: components.0, components.1, components.2, components.3, components.4)
    }
")
0  swift                    0x0000000105c394c5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift                    0x0000000105c384c5 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x0000000105c39a7f SignalHandler(int) + 111
3  libsystem_platform.dylib 0x00007fff68731d7d _sigtramp + 29
4  libsystem_platform.dylib 0x00007fe400d0a360 _sigtramp + 18446743956006733312
5  swift                    0x00000001024ee53b swift::constraints::ConstraintSystem::simplifyRestrictedConstraint(swift::constraints::ConversionRestrictionKind, swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 779
6  swift                    0x00000001024de0f0 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 14960
7  swift                    0x00000001024e93d5 swift::constraints::ConstraintSystem::repairFailures(swift::Type, swift::Type, swift::constraints::ConstraintKind, llvm::SmallVectorImpl<swift::constraints::RestrictionOrFix>&, swift::constraints::ConstraintLocatorBuilder) + 12677
8  swift                    0x00000001024de085 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 14853
9  swift                    0x00000001024de4a9 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 15913
10 swift                    0x0000000102502e70 swift::constraints::ConstraintSystem::addConstraintImpl(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool) + 96
11 swift                    0x00000001024d9e82 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool) + 66
12 swift                    0x000000010270a9bd llvm::Optional<swift::RequirementMatch> llvm::function_ref<llvm::Optional<swift::RequirementMatch> (swift::Type, swift::Type)>::callback_fn<swift::matchWitness(llvm::DenseMap<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment, llvm::DenseMapInfo<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*> >, llvm::detail::DenseMapPair<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment> >&, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*)::$_1>(long, swift::Type, swift::Type) + 93
13 swift                    0x00000001026ebe5a swift::matchWitness(swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*, llvm::function_ref<std::__1::tuple<llvm::Optional<swift::RequirementMatch>, swift::Type, swift::Type> ()>, llvm::function_ref<llvm::Optional<swift::RequirementMatch> (swift::Type, swift::Type)>, llvm::function_ref<swift::RequirementMatch (bool, llvm::ArrayRef<swift::OptionalAdjustment>)>) + 8778
14 swift                    0x00000001026ed993 swift::matchWitness(llvm::DenseMap<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment, llvm::DenseMapInfo<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*> >, llvm::detail::DenseMapPair<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment> >&, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*) + 1187
15 swift                    0x00000001026ee4e2 swift::WitnessChecker::findBestWitness(swift::ValueDecl*, bool*, swift::NormalProtocolConformance*, llvm::SmallVectorImpl<swift::RequirementMatch>&, unsigned int&, unsigned int&, bool&) + 946
16 swift                    0x00000001026f8b83 swift::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) + 643
17 swift                    0x00000001026f3a65 swift::MultiConformanceChecker::checkIndividualConformance(swift::NormalProtocolConformance*, bool) + 14821
18 swift                    0x00000001026efb23 swift::MultiConformanceChecker::checkAllConformances() + 147
19 swift                    0x00000001026ff6d7 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 8295
20 swift                    0x00000001026abba8 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 18344
21 swift                    0x000000010276f401 swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 753
22 swift                    0x0000000102772289 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 953
23 swift                    0x000000010276ef84 swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 164
24 swift                    0x00000001018f04eb swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 6859
25 swift                    0x00000001017b1801 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6849
26 swift                    0x0000000101736157 main + 1255
27 libdyld.dylib            0x00007fff68503851 start + 1
error: Segmentation fault: 11 (in target 'FirebladeECS' from project 'FirebladeECS')

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci-linux.yml
  • actions/checkout v3
  • codecov/codecov-action v3.1.3
.github/workflows/ci-macos.yml
  • actions/checkout v3
  • actions/upload-artifact v3.1.2
  • codecov/codecov-action v3.1.3
  • actions/upload-artifact v3.1.2
.github/workflows/ci-wasm.yml
  • actions/checkout v3
  • swiftwasm/swiftwasm-action v5.8
.github/workflows/ci-windows.yml
  • actions/checkout v3
.github/workflows/documentation.yml
  • SwiftDocOrg/swift-doc 1.0.0-rc.1
.github/workflows/markdown-link-check.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.