Comments (2)
I think I'm running into something similar, but for my use case it is only around modifications ( namely transform.SetWorldPosition(card, localPosition)
and transform.AppendChild(stack, card, false)
.
So far I'm suspecting it's related to the archetypes and how they get generated when the entity changes. In my case, calling transform.AppendChild
calls child.AddComponent(parentComponent)
which causes a new archetype to be created.
We discover and iterate through the archetypes via our calls to Each
.
So in the first run, the only archetype that World knows about is PositionData
.
After the add of DoActionData
, the world knows about two archetypes, PositionData
and one for PositionData, DoActionData
. So in the second run, the query matches both archetypes and you wind up with seemingly duplicate entries.
Here's a modification of your example to highlight it ~ https://go.dev/play/p/F0vrtZdKLol
(note, you can ignore the move of query outside of the receive player input; in playing around I came across the note here https://pkg.go.dev/github.com/yohamta/[email protected]/query#Query and was curious if it was related, but don't believe it is )
Thoughts?
some refs:
Line 71 in db59a18
donburi/internal/storage/iterator.go
Line 28 in db59a18
iter.Next()
call
from donburi.
Thanks a lot for submitting the issue with such details, that's really helpful. In donburi, for performance reasons, a SwapRemove is performed internally on a slice. Therefore, when Remove is executed, the last element is inserted at the index of the removed element. This might be causing the behavior you're observing 🤔 I think we might have to investigate deeper to identify the cause.
from donburi.
Related Issues (20)
- Create `features/dui` package
- Add ComponentType.Get(World, *donburi.Entry) Method HOT 1
- Deferred Entity Removal
- Add `Add()`, `Remove()` and `GetValue()` function to `ComponentType`
- Add `features/layers` package
- Add `features/collision` package (using `resolv`)
- Add `Tetra3D` example
- Add Query() method to Component
- Type-safe Queue
- Type-safe Archetype
- Panic on event Publishing HOT 1
- Project Suggestion HOT 3
- Refactoring to v3
- Adding Features
- Strong slowdown in the recent versions HOT 9
- Improvement / Feature Ideas
- Outdated Go/Ebitengine version.
- Headless/compile flag to disable rendering features HOT 6
- Getting a list of entity's components HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from donburi.