Hello, I would like if possible to discuss EnTT, indeed I really like this library, I see that since 2.5.0, a lot of improvement have been made. I am a VCPKG package manager user to avoid submodules, external downloads of CMake etc, I am very satisfied with VCPKG, I search on the github a roadmap to see if version 2.5.1 will be released soon, or if the version of vcpkg could be update on the respective port, but I did not find any information about it. Before embarking on my major engine project that would use EnTT, I would like to make the most of the latest features! Do you have a date of the next official release, and updates on the managers packages? I really like the work done so far and the discussions we had about optimization and the choice of a standard template library in another discussion.
indeed I really like this library [...] Before embarking on my major engine project that would use EnTT
Wow, really, really appreciated. Thank you.
Do not forget to star the project, so that other people can find it and contribute as you do!!
Honestly, I wanted to add more things within EnTT before to make a new release. My idea was to work also on custom allocators and a few other features, then release a v3 or something along this line.
However, I see that master contains a lot of changes that aren't part of v2.5.0 and you could want to use the version upstream. Because I'm not using semantic versioning, I could create a tag v2.6.0 and update vcpkg as well.
Let's see if other users are to leave a comment on this before to decide how to proceed.
We could keep this issue open for 24h and then take a decision. Is it fine for you?
it would be great to have a 2.6.0 in the meantime, just to start my project. I think it would be great to do mini-release once a month to get people used to it without making big changes every time.
Just out of curiosity, is your project a private one or can I take a look at it while you develop your engine?
Yes it is with great pleasure that I will introduce my engine, in the idea it's super simple, there are many templates and compile-time feature, it is especially the systems of the ecs that are interesting, divided into 3 kinds because there are 3 ways to update a system in the world of video games, the engine aims to let the user choose his layer to code his own games, (3 types of systems -> C ++ Header Only / Scripted (lua / Python) / C ++ DLL plugin (so / dll / dylib), I coded it with my own ecs, now I redo it entirely with EnTT, which does not depend on having to know these components at the compilation what will all change for me!
Old Engine -> https://github.com/SlyrisOrg/SFME
New Engine -> https://github.com/Milerius/shiva
The engine uses a lot of Modern CMake, I love the CMake, I do a lot! The engine is broken down into "CMake Modules" or "CMake Interface" which allows a huge flexibility in the development in fact, when I develop a "module", I only have access to what I need, and I have auto linkage libs I need, auto include etc
You can find all this information in the documentation section of SFME (that's from SFML with an authorization from the authors of SFML which support a lot this project)
The new name is SHIVA.
The new engine aims to use very powerful libs: EnTT, EASTL, SpdLog, Boost :: DLL, Boost :: Hana, Sol2
Finally I can open a very important subject in the days to come for EnTT: "The compile-time reflection", indeed if we want to easily mix Scripting and ECS, we must have the possibility of instropection functions from the register of entities, the same for the Dispatcher and others, but that's another very interesting subject that I'll keep you in the know, otherwise I'm easily reachable on cpplang.slack.com @Roman Sztergbaum
I had the reflection compile time in SFME and my ECS, and it was very very very powerful ...
Wow, it looks good. I'll find the time to look into your original project and I will follow your work with EnTT for sure!!
Your project looks very ambitious, my congrats. Thank you also for putting EnTT on the same line along with EASTL, Boost C++ Libraries and the others. It sounds definitely strange to me!! :-)
now I redo it entirely with EnTT, which does not depend on having to know these components at the compilation what will all change for me!
Yep. There are several companies out there I can't even mention that found this _feature_ pretty valuable.
It had been a great amount of work to keep the same performance of a compile-time ECS in a runtime ECS. EnTT contains a lot of optimizations all around to squeeze the best from... well, everything!!
Finally I can open a very important subject in the days to come for EnTT: "The compile-time reflection", indeed if we want to easily mix Scripting and ECS, we must have the possibility of instropection functions from the register of entities [...]
Tell me more about this, please. What do you mean exactly? It sounds interesting actually.
template <typename T>
void registerType() noexcept
{
_log(logging::Debug) << "register Type: " << T::className() << std::endl;
const auto table = std::tuple_cat(
std::make_tuple(T::className()),
T::reflectedFunctions(),
T::reflectedMembers());
std::apply(
[this](auto &&...params) {
this->_state.new_usertype<T>(std::forward<decltype(params)>(params)...); // this function register a type in sol2 (lua scripting), you have an equivalent in pybind11 for python and other things
}, table);
}
````
As you can see above, I have `T::reflectedFunctions ()`, `T::reflectedMembers()`, `T::className()` functions, these functions are vital in scripting. Why ?
then you can do a magical trick... ->
```CPP
registerType<TEntityManager>();
````
and then what happen in luaScripting ?
```lua
function testCreateEntity()
local id = entityManager:createEntity()
return id
end
function testGetEntity(id)
return entityManager:getEntity(id)
end
function testClearEntities()
if entityManager:nbEntities() == 1 then
entityManager:clear()
log_info("nbentities: " .. entityManager:nbEntities())
end
end
This is magic, all the function from my entityManager are now available in scripting, without any effort, can you believe ?
and what about registering systems ? (from SFME for example, but i think you should think about a systems like SFME)
```CPP
template
void registerSystem(SystemManager &&systemMgr) noexcept
{
using namespace std::string_literals;
_log(logging::Debug) << "register system: " << SystemType::className() << std::endl;
_state.set_function("get"s + SystemType::className() + "System",
&systemMgr {
return std::ref(systemMgr.template getSystem
});
};
template <typename SystemManager, typename ...Types>
void registerSystems(SystemManager &&systemMgr, meta::TypeList<Types...>) noexcept
{
(registerSystem<Types>(systemMgr), ...);
}
````
and that's all, you are done with scripting your game, and can now have systems, entity, and components in your game, (100 line of codes with compile times reflection, impressive no ?)
Ok, I got it. I did something similar with Duktape, even though much more rudimentary.
I didn't export systems because it was only a POC for users, but I exported some parts of the registry and some other thing. Did you see the mod.cpp file?
I did it without any reflection magic anyway. What you are proposing sounds interesting indeed. If there is a way to implement it without blending EnTT and its interface, it would be great.
Have you already thought about how to implement it?
There is an implementation made by @doom and @Milerius
```cpp
//
// Created by doom on 25/11/17.
//
namespace refl
{
template
using member_map_t = decltype(T::reflectedMembers());
template <typename T>
using function_map_t = decltype(T::reflectedFunctions());
template <typename T>
using class_name_t = decltype(T::className());
template <typename T>
using has_reflectible_members = meta::is_detected<member_map_t, T>;
template <typename T>
inline constexpr bool has_reflectible_members_v = has_reflectible_members<T>::value;
template <typename T>
using has_reflectible_functions = meta::is_detected<function_map_t, T>;
template <typename T>
inline constexpr bool has_reflectible_functions_v = has_reflectible_functions<T>::value;
template <typename T>
using has_reflectible_class_name = meta::is_detected<class_name_t, T>;
template <typename T>
inline constexpr bool has_reflectible_class_name_v = has_reflectible_class_name<T>::value;
template <typename T>
using is_reflectible = std::disjunction<has_reflectible_members<T>, has_reflectible_functions<T>>;
template <typename T>
inline constexpr bool is_reflectible_v = is_reflectible<T>::value;
namespace details
{
constexpr std::string_view skipNamespaceName(const std::string_view v) noexcept
{
return (v[0] == ':' && v[1] == ':') ? std::string_view{v.data() + 2, v.length() - 2}
: skipNamespaceName({v.data() + 1, v.length() - 1});
}
}
#define reflect_class(cls) \
static const std::string &className() noexcept \
{ \
static const std::string name = pp_stringify(cls); \
return name; \
}
template <typename MapT, typename KeyT, typename Function>
static inline constexpr bool getMember(MapT &&map, KeyT &&k, Function &&func) noexcept
{
return meta::find(std::forward<MapT>(map), std::forward<KeyT>(k), std::forward<Function>(func));
}
template <typename MapT, typename KeyT, typename Function>
static inline constexpr bool getFunction(MapT &&map, KeyT &&k, Function &&func) noexcept
{
return getMember(std::forward<MapT>(map), std::forward<KeyT>(k), std::forward<Function>(func));
}
template <typename MemberPtrT, typename MapT, typename KeyT>
static inline constexpr auto getMember(MapT &&map, KeyT &&k) noexcept
{
std::optional<MemberPtrT> result;
auto visitor = meta::makeVisitor([&result]([[maybe_unused]] auto &&k, MemberPtrT v) {
result = v;
}, []([[maybe_unused]] auto &&k, [[maybe_unused]] auto &&v) {
});
getMember(std::forward<MapT>(map), std::forward<KeyT>(k), visitor);
return result;
}
template <typename MemberPtrT, typename MapT, typename KeyT>
static inline constexpr auto getFunction(MapT &&map, KeyT &&k) noexcept
{
return getMember<MemberPtrT>(std::forward<MapT>(map), std::forward<KeyT>(k));
}
class MemberNotFound : public std::exception
{
public:
const char *what() const noexcept override
{
return "Member not found";
}
};
template <typename FunctionT, typename MapT, typename KeyT, typename Obj, typename ...Args>
static inline constexpr auto callFunction(MapT &&map, KeyT &&k, Obj &&obj, Args &&...args)
{
using ObjRawType = std::decay_t<std::remove_pointer_t<std::decay_t<Obj>>>;
using MemberFunctionT = FunctionT ObjRawType::*;
auto memberOpt = getMember<MemberFunctionT>(std::forward<MapT>(map), std::forward<KeyT>(k));
if (!memberOpt) {
throw MemberNotFound();
}
return std::invoke(*memberOpt, obj, std::forward<Args>(args)...);
}
}
````
pretty easy, but use c++ 17 std::invoke, may be need some tweak for c++ 14 compilers
i think i can implement it in c++ 14 for EnTT, if you need it, and i already checked your duktape file, but you do all the things manually, that's what i mean..
```cpp
const duk_function_list_entry js_DuktapeRegistry_methods[] = {
{ "identifier", &DuktapeRegistry::identifier, 0 },
{ "create", &DuktapeRegistry::create, 0 },
{ "set", &DuktapeRegistry::set, DUK_VARARGS },
{ "unset", &DuktapeRegistry::unset, 2 },
{ "has", &DuktapeRegistry::has, 2 },
{ "get", &DuktapeRegistry::get, 2 },
{ "entities", &DuktapeRegistry::entities, DUK_VARARGS },
{ nullptr, nullptr, 0 }
};
````
```cpp
exportType(ctx, registry, idx, tag
exportType(ctx, registry, idx, tag
````
same ^ for this
this is not needed anymore with compile time reflection
this is not needed anymore with compile time reflection
Yep, I know, that's why it sounds interesting. :-)
i think i can implement it in c++ 14 for EnTT, if you need it
Honestly, I want to port EnTT to C++17 starting from v3, then use pmr:: namespace for allocators and so on.
Therefore I'd say you can implement it with the latest standard.
If you are to develop it anyway because of your project, it would be great if you write code that can be reviewed and therefore merged with EnTT.
I can't promise it will be integrated as-is, but I'll do my best to turn it in an EnTT-like feature.
Otherwise, well, another line in the TODO list for future developments. ;-)
i can try to do module reflection in entt/src if you want, in my fork in c++17 ?
Honestly, I want to port EnTT to C++17 starting from v3, then use pmr:: namespace for allocators and so on.
Hmm did you see -> https://www.youtube.com/watch?v=FLbXjNrAjbc ? i think you should look this video
Fine for me. Thank you very much. Users are the fuel of the project. ;-)
A small POC would be enough, actually. It looks like you have much more experience than me with this, so it would speed up my work on EnTT at least.
No comments, good comments. Ready to cut v2.6.0 even though master contains breaking changes.
After all, EnTT doesn't follow a semantic versioning, so... I've a precise idea of what will deserve the v3 label after all.
I think I'll create the tag today evening if I find the time to turn on my laptop.
If anyone wants to comment, you still have a few hours to do it.
Created tag v2.6.0 as discussed.
@Kerndog73 @DavidHamburg
Can you help me to update both homebrew-entt and vcpkg, please?
Thank you very much.
I will update vcpkg, thanks you so much , you have discord for help with homebrew ?
Best regards
Télécharger Outlook pour Androidhttps://aka.ms/ghei36
From: Michele Caini notifications@github.com
Sent: Wednesday, May 30, 2018 10:59:46 PM
To: skypjack/entt
Cc: roman sztergbaum; Mention
Subject: Re: [skypjack/entt] Discussion abount EnTT (#85)
Created tag v2.6.0 as discussed.
@Kerndog73https://github.com/Kerndog73 @DavidHamburghttps://github.com/DavidHamburg
Can you help me to update both homebrew-entt and vcpkg, please?
Thank you very much.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/skypjack/entt/issues/85#issuecomment-393317539, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AUKP2Jxg-kPN_cVuAGnfJ7komRJjkCUQks5t3whCgaJpZM4UP521.
Good, thank you, really appreciated.
homebrew-entt is a repo I share with @Kerndog73 and I don't think there are problems to update it.
He's one of the most active users here and definitely a good contributor!! ;-)
@Milerius When you are done or at least when you reach a good point with your engine, feel free to ping me and to add your project to the list of projects that use EnTT at the end of the README.md. If you want, of course. I'd be glad to accept such a PR.
The homebrew formula has been updated to v2.6.0
Most helpful comment
The homebrew formula has been updated to v2.6.0