Code Monkey home page Code Monkey logo

Comments (3)

vittorioromeo avatar vittorioromeo commented on May 21, 2024

Hello,

I only officially support clang++ and g++. I've built ecst successfully on Windows using nuwen MinGW.

I've grabbed the vrm/core and vrm/pp code from Github and made sure it was included. Then, trying to compile the project:

1>l:_programming\projects\ecst-test\lib\vrm\pp\generated\output.hpp(782): fatal error C1112: compiler limit: '129' too many macro arguments, only '127' allowed

Seems like MSVC has an hardcoded limit for macro parameters. I use a script to generate variadic macro boilerplate in vrm_pp.

Even by tweaking the script, I doubt that MSVC will be able to compile ecst as it's using bleeding edge C++14 features and idioms. Sorry for the incovenience! Check out MinGW if you can.

but can I totally take over with my own architecture, such as an IntelTBB or similar job system, and hand out the ECS update work to that or to other similar systems?

There currently is no way of plugging in a different thread pool/scheduler without modifying ecst's source code, but the library's design could allow the pool/scheduler to be a template parameter. Making this easier is something planned for the future.

An externally-controlled update on an ECS-system-by-system basis, for example.

Could you elaborate on this? I don't think ecst is capable/designed for this particular use case.

from ecst.

BrodyHiggerson avatar BrodyHiggerson commented on May 21, 2024

I only officially support clang++ and g++. I've built ecst successfully on Windows using nuwen MinGW.

Ahh, that's a shame. I figured due to MSVC's popularity in games, a gaming-focused architecture would be there, although I can see what you mean re. the bleeding-edge compared to some of the others! All good.

An externally-controlled update on an ECS-system-by-system basis, for example.

Could you elaborate on this? I don't think ecst is capable/designed for this particular use case.

I meant something like, updating a 'Movement' system, which just finds all 'Position' + 'Velocity' component combinations and changes the position's values by velocity, in a parallel_for loop or similar. You know, being able to split the work of updating individual systems out to multiple threads/jobs, rather than calling 'Update' on a central object and letting it do the work.

EDIT: Do you have any personal recommendations, given your familiarity with the topic, of other C++ ECS libraries that may operate in this way? Thanks!

from ecst.

vittorioromeo avatar vittorioromeo commented on May 21, 2024

I meant something like, updating a 'Movement' system, which just finds all 'Position' + 'Velocity' component combinations and changes the position's values by velocity, in a parallel_for loop or similar. You know, being able to split the work of updating individual systems out to multiple threads/jobs, rather than calling 'Update' on a central object and letting it do the work.

Assuming you mean: having a single Movement system which automatically splits its workload in multiple sub-tasks that can run in parallel... this is what ecst does.

From pres_code.cpp:

struct velocity
{
    template <typename TData>
    void process(ft dt, TData& data)
    {
        data.for_entities([&](auto eid)
            {
                auto& p = data.get(ct::position, eid)._v;
                const auto& v = data.get(ct::velocity, eid)._v;

                p += v * dt;
            });
    }
};

The above code can run in parallel on various "slices" of the subset of entities that have both "Position" + "Velocity". You can control this through system signatures:

constexpr auto ssig_velocity =
    ss::make(st::velocity)
        .parallelism(split_evenly_per_core)
        .dependencies(st::acceleration)
        .write(ct::position);
        .read(ct::velocity)

from ecst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.