fireblade-engine / ecs Goto Github PK
View Code? Open in Web Editor NEWA dependency free, lightweight, fast Entity-Component System (ECS) implementation in Swift
License: MIT License
A dependency free, lightweight, fast Entity-Component System (ECS) implementation in Swift
License: MIT License
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.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
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
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. :)
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')
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.