Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:21

    skypjack on wip

    doc: updated links (compare)

  • 07:21
    skypjack updated the wiki
  • 07:15
    skypjack commented #36
  • Nov 28 15:52
    MohitSethi99 commented #36
  • Nov 28 14:40
    skypjack labeled #958
  • Nov 28 14:40

    skypjack on wip

    entt_traits: split basic impl, … doc: a note about listeners dis… (compare)

  • Nov 26 17:57

    skypjack on wip

    sparse_set: * break dependency … algorithm: local non-static con… helper: local non-static conste… and 4 more (compare)

  • Nov 25 09:43
    skypjack commented #958
  • Nov 24 11:37
    phisko commented #958
  • Nov 24 11:26
    phisko commented #958
  • Nov 24 10:45
    phisko commented #958
  • Nov 24 10:43
    skypjack commented #958
  • Nov 24 10:41
    skypjack commented #958
  • Nov 24 10:39
    phisko commented #958
  • Nov 24 10:32
    skypjack commented #958
  • Nov 24 10:19
    phisko commented #958
  • Nov 24 10:17
    skypjack commented #958
  • Nov 24 10:12
    skypjack labeled #958
  • Nov 24 10:12
    skypjack assigned #958
  • Nov 24 09:46
    phisko opened #958
Michele Caini
@skypjack
They're all iterators
David Delassus
@linkdd
right yes :P thank you
Green-Sky
@green:g-s.xyz
[m]
@linkdd: when you sort the same container multiple times without huge modification, insertion sort is faster
Green-Sky
@green:g-s.xyz
[m]
i used sorting for my network state sync code, and icremental sort over all dirty state was way faster. except the first sort, which is way slower
Green-Sky
@green:g-s.xyz
[m]
@skypjack: should i open an issue with the sorage to fwd stuff, or do you remember it? :)
Michele Caini
@skypjack
No, no, I remember it, no worries :sweat_smile:
I've a couple of things I want to put into a patch release soon
Feel free to open an issue if you feel more confident but also stay assured that I won't forget about it, I've literally the changes ready to push on my machine
Green-Sky
@green:g-s.xyz
[m]
nice, i was looking though the wip branch and did not see them. thats why i asked :P
Green-Sky
@green:g-s.xyz
[m]
still working on the same game. here with multiplayer. using eventual consistent state sync on the registry
Michele Caini
@skypjack
Is it a private project?
1 reply
Anton Fosselius
@maidenone
I am writing some collision handling where we need to handle several intersections between different entities. What is "best" put intersection entities on the registry and sort them or put them in a "global" vector in collision system and sort them?
The intersections will be created each loop of the "collision system" and deleted at the end of the loop.
The real question is, what is the performance penelty of using registry instead of vector when doing frequent create and destroy.
Michele Caini
@skypjack
Frequent create/destroy in a vector are a pain if you plan to create/destroy in the middle, while the storage is a sparse set with O(1) complexity for this kind of operations
So, it could perform well or even better in some cases but it really depends on the implementation and the details of what you're doing, to which I've no access :slight_smile: so, take all this with a grain of salt, just thinking aloud to help your reasoning if possible
Anton Fosselius
@maidenone

We have >1000 objects that we move each timestep, we get a list of potential intersection pairs from a OcTree implementation, like <Entity1, Entity2> .. etc.
from this we sort based on Entity id and then on distance between entity1 and entity2.
we then handle the collisions in order.
when all collisions are handled we clear the intersection list.

std::vector<intersections> list
SetupIntersections(list)

for (intersect : list)
{
handeCollision(intersect)
}

list.clear();

2 replies
David Delassus
@linkdd
image.png
@green:g-s.xyz btw, I love your entt editor lib <3
Green-Sky
@green:g-s.xyz
[m]
@linkdd: :D thanks. feel free to leave any feedback :)
David Delassus
@linkdd
@skypjack i made a scene system which create entities when the scene is entered, and destroy them when it exits the scene. i keep track of the created entity ids in a std::vector, and then use registry.destroy(m_entities.begin(), m_entities.end());
But if i manually destroyed an entity via @green:g-s.xyz 's editor, my vector now contains an invalid entity and the program exits with a failed assertion in registry.destroy() which seems logical, but what is the correct solution here? should i filter my vector before giving it to registry? should the registry have an option to ignore invalid entities (which would avoid iterating the vector twice) ? or should I tweak my usage of the editor to remove the entity id from my vector (which can be tricky) when it destroys it?
3 replies
Green-Sky
@green:g-s.xyz
[m]
https://g-s.xyz/dist/gh-prot3_particle_spawner_trail.mp4
did some particle spawner shenanigans :P
2 replies
Green-Sky
@green:g-s.xyz
[m]
but i know from Personal experience that the meta system might seem daunting 🤔
Green-Sky
@green:g-s.xyz
[m]
@skypjack: my stuff now compiles with latest wip :)
Michele Caini
@skypjack
Minor release early next week @green:g-s.xyz :+1:
Glad to know that it works
Anton Fosselius
@maidenone

I am thinking of how to improve our meny, right now we have imgui widgets that gets called by a "menu system". everything is "hard coded". when we add a new component to an entity we have to add the componentWidget::draw() inside menu::draw(). How do you do this in a generic way? i want to connect the component with its componentWidget::draw() function. I have looked at the entt::Poly but adding a draw function in every component feels "object oriented". And how would the render call work?
i guess what i want is something like:

for(entity : view)
   for(component : entity)
      component->drawWidget()

where the component and drawWidget is seperated.

7 replies
Anton Fosselius
@maidenone
Is there a way to get this to "work"? tried to get old deprecated code for this thread to work:
skypjack/entt#481
see:
https://godbolt.org/z/E4cxdqd56
Michele Caini
@skypjack
Define this :slight_smile: you can use the storage() function of the registry to iterate the pools and get the elements for the entity as void * using get
Anton Fosselius
@maidenone
when i call draw(any) where any is a transform component. i want the draw(const transform& t) { cout << t.value << endl;} to be called, not draw(const entt::meta_any &).
my problem is going from void * to component type, draw(void*) makes sad face...
Michele Caini
@skypjack
Ahaaaaa ok, well, no, that's how type erasure works: you don't know the type and so cannot the language/library/whatever :sweat_smile:
However, you can flip the problem on its head and have any->invoke("draw"_hs) (remember that you can attach free functions to a meta type, even if they aren't part of the C++ class definition :point_left: that is, your draw free functions)
Anton Fosselius
@maidenone
Great :D i knew i was trying to do something stupid, but could not figure out what ;)
Michele Caini
@skypjack
Not a problem, note that the last version of EnTT has meta_type::from_void -> meta_any and it's literally meant for that :sweat_smile:
The storage returns you the type info, you can use it to retrieve the meta type and the rest is likely obvious :+1:
Green-Sky
@green:g-s.xyz
[m]
@maidenone: if you are looking for a reference https://github.com/Green-Sky/imgui_entt_entity_editor
Anton Fosselius
@maidenone
thanks, thats actually what i am trying to do :D
1 reply
Green-Sky
@green:g-s.xyz
[m]
@skypjack: ran into a problem with meta props on 3.10.3 (still waiting for 3.11.1 :P).
entt::meta<my_type>().type("reflected_type"_hs).prop("tooltip"_hs, "message");
does not compile. might be my gcc9, not sure. i worked around this for now with using a string_view for "message".
Michele Caini
@skypjack
Yeah, sorry, I'm a bit late on the scheduling because I've a relative to the hospital and I'm going back and forth to visit this person
1 reply
What does it mean that it doesn't compile? What error do you get?
2 replies
Green-Sky
@green:g-s.xyz
[m]
also required from ‘entt::meta_factory<Type> entt::meta_factory<Type, Spec ...>::prop(PropertyOrKey&&, Value&& ...) [with PropertyOrKey = entt::basic_hashed_string<char>; Value = {const char (&)[8]};...
Michele Caini
@skypjack
What version is this? Still 3.10?
2 replies
Green-Sky
@green:g-s.xyz
[m]
anyway, its fixed in 3.11, still dont understand how i never hit that before
Michele Caini
@skypjack
I guess that's due to the nature of the value, that is a const char [N] from a template perspective
This causes some troubles that I clearly solved by chance in the new version :joy:
JohnWick
@deepgrace
Green-Sky
@green:g-s.xyz
[m]

sooo, i have come across an error i had before, but dont remember how i solved it

error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘<unresolved overloaded function type>’ to binaryoperator<’
   57 |   .func<&component_emplace_json<T>>("emplace_json"_hs)

(still on 3.10)

wait, was it sprinkling template ?
yes. sorry. solved it. just wasted 30min on this.
Michele Caini
@skypjack
Yeah, pretty common :slight_smile: