Comments (7)
Fixed!
from flecs.
Which are the floating-point numbers that are used in Flecs' built-in systems? I can think of delta_time
and other timing related functionality, but you can roll you own, and call ecs_progress
to move the world one step forward. There might also be the possibility of overriding ecs_ftime_t
with a non-floating-point type.
Can't speak on your other questions.
from flecs.
Yes it can. Like @copygirl mentioned you can override the ecs_ftime_t
type (see flecs header) to an integer type, which will change all floating point time keeping features to use an integer. You can also call ecs_progress
with a fixed/application specified time value.
Flecs has a reflection framework that lets you build any kind of serialization on top of it. Take a look at the JSON code for an example.
from flecs.
- If I change ecs_ftime_t to uint32_t, the following code would cause an infinite loop: https://github.com/SanderMertens/flecs/blob/a666b506c74ceaabd79d35c09b67c5df4259503c/flecs.c#L24078
- I have also found several uses of floating point numbers in the source code, and I cannot evaluate whether they will affect deterministic calculations.
- After performing Json serialization, can it be guaranteed that the states of the two ends are completely consistent, such as the order of execution of entities in the next frame, the allocation logic of ecs_id, and so on?
from flecs.
Ah, the infinite loop sounds like an issue that was recently reported on the Discord as well. I'll take a look at that.
There are plenty of cases where floating point numbers are used in the code, though all usages related to time use the ecs_ftime_t
type. That's the only one that should affect gameplay code because of delta_time
, unless you explicitly build your game logic on other floating point values (which you shouldn't do if you want it to be deterministic).
The JSON serializer is not deterministic. I mentioned it because it's an example of a serializer that's built on top of the reflection framework. You can build a deterministic serializer on top of the reflection framework, there's nothing in it that'd prevent you from doing that.
from flecs.
@SanderMertens thank your answer. when infinite loop fixed i will close this issue.
from flecs.
@SanderMertens , I am currently attempting network synchronization with Lockstep based on Flecs.
- When referring to the Json serialization solution, I noticed that information such as ecs_id cannot be overwritten to the client. After tracing the source code, I understood that I need to serialize the status and entity id information in
ecs_world_t.store.entity_index
. However, there seems to be no public API to accessecs_entity_index_t
. Is there a reasonable way to complete the above function? (Modifying the source code is acceptable) - Could you provide a list of
system states
that need to be serialized? I am unsure whether the initial state consistency and calculation order are satisfied after completing the id status initialization synchronization.
Also, thank you for providing such a clean ecs solution for the community to use.
from flecs.
Related Issues (20)
- observer loss event HOT 2
- [Question] Best way to share a component between differents entities HOT 3
- README link is broken HOT 1
- Compilation failed with errors when declaring 'free' as a macro. HOT 1
- Explorer hierarchy incomplete HOT 6
- free(): invalid pointer when using sorted query with std::list HOT 1
- Bug or question - HOT 1
- filter_builder() assert fail, when use term().or_() HOT 2
- Queries with Or terms and wildcard terms cause internal error HOT 1
- entity::set(T*) writes garbage HOT 1
- ECS crash after conditionally adding to an entity when using Explorer HOT 7
- flecs crashes at startup when using clang built from git
- I get exception errors in ms visual studio 2019 before the main function HOT 7
- Unintuitive behavior of setting entity names as numbers HOT 4
- Enabling or disabling a component between defer_suspend and defer_resume keeps the world deferred after progress HOT 1
- World destruction with symmetric relationship and child causes assertion HOT 1
- Add flecs.c and flecs.h as download artefacts for releases HOT 3
- Strings not freed on runtime components HOT 5
- ecs_set() doesn't work C HOT 4
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 flecs.