Git Product home page Git Product logo

uecs's Issues

I have red some of UECS, there is a issue

Chunk.cpp 69 std::size_t Chunk::Erase(std::size_t idx)

movedEntityIdx = reinterpret_cast<Entity*>(dstBuffer + head->GetCmptInfos()[entityTypeIdx].offset + sizeof(Entity) * srcIdxInChunk)->index;

the sizeof(Entity), I think it may something like sizeof(tagSize), for
I think you put the Entity as a component with its compoents , right?
But this is an old version, may be you have changed ,or something I understood wrong

build with cmake 3.16.6 vs 2019

CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/FetchContent.cmake:915 (message):
Build step for ucontainer failed: 1
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.16/Modules/FetchContent.cmake:1006 (__FetchContent_directPopulate)
C:/Program Files/CMake/share/cmake-3.16/Modules/FetchContent.cmake:1047 (FetchContent_Populate)
build/_deps/ucmake-src/cmake/UbpaPackage.cmake:78 (FetchContent_MakeAvailable)
build/_deps/ucmake-src/cmake/UbpaPackage.cmake:85 (Ubpa_AddDepPro)
CMakeLists.txt:11 (Ubpa_AddDep)

Possible problems

  1. 请问是否可能存在 entityTableFreeEntry.size() 大于 entityTable.size() 的情况?
    比如: 先创建几个实体, 然后将他们全部销毁, 最后调用 EntityMngr::TotalEntityNum() 试图获取实体数量.

    std::size_t TotalEntityNum() const noexcept { return entityTable.size() - entityTableFreeEntry.size(); }

  2. 请问 e.index 是否可能在 EntityMngr::entityTableFreeEntry 中呢?

    return e.index < entityTable.size() && e.version == entityTable[e.index].version && entityTable[e.index].archetype;

因为没有完整的阅读源码, 若我有地方没注意到请见谅.

erase the Entity, the chunk idx changed

Archetype.cpp
std::size_t Archetype::Erase(EntityAddress addr)
chunks.erase(std::find(chunks.begin(), chunks.end(), chunk));

you erase a vector, so the index of the elements after the iterator all changed;
but in entityTable in EntityMngr, some may still ref to the old index , is this some bug?

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.