Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:26
    skypjack commented #575
  • 04:59
    s9w commented #575
  • 02:41
    AustinCarter closed #577
  • 02:41
    AustinCarter commented #577
  • 02:07
    AustinCarter edited #577
  • 01:26
    AustinCarter opened #577
  • Oct 23 21:28
    Innokentiy-Alaytsev commented #575
  • Oct 23 21:23

    skypjack on doc

    (compare)

  • Oct 23 21:23

    skypjack on experimental

    doc: add a note on registry::tr… doc: updated links (compare)

  • Oct 23 21:21
    skypjack commented #575
  • Oct 23 21:19

    skypjack on dev

    [meta] Meta-function overload s… (compare)

  • Oct 23 21:19
    skypjack closed #538
  • Oct 23 21:17
    Innokentiy-Alaytsev commented #575
  • Oct 23 21:16

    skypjack on doc

    doc: updated links (compare)

  • Oct 23 21:13
    skypjack commented #576
  • Oct 23 21:12

    skypjack on doc

    doc: add a note on registry::tr… (compare)

  • Oct 23 21:12
    skypjack closed #576
  • Oct 23 21:09
    skypjack commented #575
  • Oct 23 21:05
    skypjack edited #576
  • Oct 23 20:55

    skypjack on doc

    (compare)

Sebastian Werhausen
@s9w
Ofc that is a stupid number of entities.
Michele Caini
@skypjack
The default id allows for 2^20-1 entities, try it in debug an it will assert
If you need more, you can set uint64 as default though
In this case, the limit is 2^40-1
Sebastian Werhausen
@s9w
ooh bingo, didn't know that thanks
Michele Caini
@skypjack
You're welcome :+1:
EnTT has a lot of debug asserts for when you're in doubt
If you ever hit something that seems strange, give them a shot
Sebastian Werhausen
@s9w
Right. I was doing some performance tests, hence the release-only
Michele Caini
@skypjack
Sure, not a problem, just e heads-up :wink:
Let me know if something interesting pops out from your tests :+1:
timotankwagen
@timotankwagen
Hi, is it possible to add a meta object to the registry? I managed to construct an instance of my struct using the meta system but was wondering if there was an easy way to add this instance to the scene/registry.
Michele Caini
@skypjack
You can add a meta function that does it. Meta types also support free functions and such that aren't necessarily part of the original type.
Moreover, with the upcoming version I'll make it possible to attach directly the functions from the registry, so that they'll appear as static functions of the meta type and consume their first arguments to set the this for the invocation.
Maxime Griot
@yamashi
hey guys,
I am hitting a very odd bug that I cannot pin point to anything, basically I use find_if to locate a specific entity but I get an access violation when reading the component in my lambda
the code is very simple :
auto view = m_world.view<RemoteComponent>();
const auto itor = std::find_if(std::begin(view), std::end(view), [id = acEvent.ServerId, view](entt::entity entity) {
        return view.get<RemoteComponent>(entity).Id == id;
    });
Any ideas? I thought about a race condition but the app is single threaded so I am a bit lost
Michele Caini
@skypjack
Put aside that the view has a find method for that :) have you tried to run it in debug to see if EnTT detects a violation somewhere?
Maxime Griot
@yamashi
Didn't know about find :o I will try in debug, I just pulled entt and haven't been able to reproduce the bug since, it wasn't consistent before so I don't know if it's fixed or just didn't hit the issue
Michele Caini
@skypjack
It sounds like an UB somewhere
Maxime Griot
@yamashi
okay so I get an assert somewhere else in the code
when calling emplace
on an entity I get from a view
I am a bit confused on how that could happen
Maxime Griot
@yamashi
oh I figured it out, emplaced the same component twice
Michele Caini
@skypjack
:+1:
emplace_or_replace if you're in doubt
Maxime Griot
@yamashi
I assume the cost is small enough to just always use that unless you call it a thousand time per frame?
Michele Caini
@skypjack
It's an extra if, so dunno, it depends on what you're doing I guess, but it's unlikely this will be your bottleneck, yeah
Sebastian Werhausen
@s9w
So I had some performance tests running.. very impressive. I'm not even sure how it's possible to be faster than iterating over a std::vector
Michele Caini
@skypjack
Use the components in your tests. Otherwise the compiler will optimize everything and emit no code. :)
Sebastian Werhausen
@s9w
I do! I even compare the results
Michele Caini
@skypjack
:+1:
Sebastian Werhausen
@s9w
So all those wrapper types annoyed me a bit.. what's the public opinion on wrapping types like the Value type in https://github.com/s9w/terminal_moo/blob/master/src/entt_types.h ?
Michele Caini
@skypjack
Why do you wrap types?
Sebastian Werhausen
@s9w
Wrapping maybe a misleading term. I mean instead of always new structs that contain only a value, and using them with xx.value all the time, this abstracts it away and has implicit conversion operations. Which might itself not be super clean, but you can use the type like a native double, int etc
Michele Caini
@skypjack
It's something lot of people like, I've not a strong opinion on that, but I also tend to not do it often
Sebastian Werhausen
@s9w
Alright. I like that it does away with the .value things, and I think it wraps all math functions properly. But I also missed things probably
Michele Caini
@skypjack
I've nothing against it, do not misunderstand me. I'm just lazy. :)
LiliumAtratum
@LiliumAtratum
Quick question: if I have entt::collector.update<Something>().where<stuff...>(), will it also capture the case where Something is first created, or do I need to add entt::collector.group<Something>().where<stuff...>() as well? I think I vaguely read that every on_construct is followed by on_update, but I cannot find it anymore and I could be totally mistaken (mixing it from a different lib with different observers for example)
Michele Caini
@skypjack
Uhm... no, afaik it intercepts only updated
But you can combine multiple matcher in a single observer
So, you can have an observer that intercepts both creation and update
LiliumAtratum
@LiliumAtratum
Ok, clear. Thanks! :)
Filip Strugar
@fstrugar
Really stupid question: I've just noticed that when I registry.create entities from empty, I get IDs that are 0 1 2 3 4...; however when I enumerate using .each, they get iterated through in the reverse order! any way I can make .each go through them from the front? the answer is probably obvious but it escapes me :)
Michele Caini
@skypjack
@fstrugar they are returned backwards on purpose, so that you can add entities while you iterate them
Filip Strugar
@fstrugar
Ahh that makes sense. Any way to reverse iterate?
Michele Caini
@skypjack
Uhm, I don't think so at the moment, it wouldn't be difficult to add though
To be honest, this is the first time someone pops out with such a request :)
Filip Strugar
@fstrugar
Eheh I only have one place where I need it so I now simply dump entities to vector and std::reverse it.
It's in the code that does serialization to human-readable hierarchical json format; the loader will then create them in the reverse order - doesn't affect anything functionally but the file contents would be reversed for every load/save cycle.
I honestly doubt I'll need it anywhere else to be honest :)