godotecs / godex Goto Github PK
View Code? Open in Web Editor NEWGodex is a Godot Engine ECS library.
License: MIT License
Godex is a Godot Engine ECS library.
License: MIT License
https://github.com/AndreaCatania/godot/tree/customizable_iterator should be in this organization.
Not able to use the standard Godot import tooling to import entities. We want to import the packed scene into entity and entity3d format.
Chosen option "Write a plugin in C++" because it was the fastest and does not require a separate addon.
We go over the packed scene and convert them to a packed scene using Godex components. Godex components are added based on the type and the properties.
For Node2D we passthrough.
Everything else stays the same until we have a conversion for it.
Automate manual option in GDscript.
Automate manual option in C++.
In scene importer add a checkbox for conversion and it is enabled by default.
Add the Storage
accessor to allow add / remove components from a GDScript system.
I'm proposing three features:
@AndreaCatania, would you prefer a PR, or would you rather implement these yourself? Please let me know if I'm missing something.
Right now the GDScript
System
Resource
doesn't have any unit test: https://github.com/GodotECS/godex/blob/main/godot/nodes/ecs_utilities.h#L14
Consider to add it.
Regarding events, we should have a common base that works. So to be really solid. In the other game engines, I saw until now, I feel like the events mechanism is just an hack and doesn't properly integrate with ECS workflow.
For Godex I been contemplating the idea that the event should be a piece of that can be associated to an entity easily; so a System
can perform operations on it like any other system. Check my idea.
The event is a special Component
(In a sec you understand what I mean by special) that when emitted it's directly attached to the entity who triggered it.
Let's say you have to build an FPS and you have this bullet that has to deal the damage when hit a Collider
. The system that moves such bullet and perform the collision check, when detects a collider append the event component DamageEvent
on such entity.
Later on the pipeline you have a system like this:
extends System
## This system computes the damages of your entities. It's here where you want to check eventual shields and so on.
func _prepare():
with_component("Health", MUTABLE)
with_component("DamageEvent", IMMUTABLE)
func _for_each(health_component, damage_events):
for event in damage_events:
health_component.health -= event.damage
The above system, computes the health loss for all the entities that have an Health
component and the event component DamageEvent
.
If you, later add a new feature to the game, let's say, an Area Of Effect that deals damage to the characters that goes in: you can emit the event and so attach it to the entity that entered that area. You just need to add the system that emits such event, and anything else because the System
that catches and pairs the DamageEvent
with the Health
event already exists.
Before, I said that this event component is special. It is, because unlikely the other component, it's destroyed at the end of each processing automatically so that you can't catch the same event twice with the same System
.
This seems to be a new bug. Previously, I recall the WorldECS window being treated as a sub-window, but now it is treated as the whole window and everything else disappears. I'm not sure if there's some button I'm missing that will take me back.
The Godot build in question uses Godex 114646e and the recommended commit of Godot from the README. I'm happy to provide any other information if requested.
Consider use binary search or another storage algorithm for ChangeList
.
The ChangeList
is used to mark an Entity
Component
as changed:
Entity
is already marked as changed nothing should happen.Entity
is not yet marked as changed, it is stored inside an array.Note: The data to marked as changed, is not sorted.
Sometimes you may want to process a specific component, depending on some runtime events.
Let's suppose you have a set of rooms, composed by tiles, and you need a query that takes all the obstacle tiles for that specific room.
Each room has it's own tag: Room1
, Room2
, Room3
, RoomN
, so you can query those tiles in this way:
void search_near_obstacle(Query<Room1, Tile, TileObstacle> &p_query){
// Do cool stuff.
}
Depending on some events, you may want to do the same thing for Room2
or Room3
so you are forced to create a System
per each room.
A better solution would be expand that system per each room, so that it's possible to fetch just the needed room.
void search_near_obstacle(Query<Runtime<Room1, Room2, Room3>, Tile, TileObstacle> &p_query){
switch(event){
case event_a:
p_query.set_runtime<Room1>(0);
break;
case event_b:
p_query.set_runtime<Room2>(0);
break;
case event_c:
p_query.set_runtime<Room3>(0);
break;
};
// Do cool stuff.
}
Consider improve the syntax.
When applying the patch in a windows build, the git throws errors that the patch does not apply:
git apply modules/godex/patches/add_custom_iterator.patch
error: patch failed: SConstruct:543
error: SConstruct: patch does not apply
error: patch failed: core/config/engine.h:88
error: core/config/engine.h: patch does not apply
error: patch failed: main/main.cpp:1284
error: main/main.cpp: patch does not apply
error: patch failed: main/main.h:54
error: main/main.h: patch does not apply
I think this might due to linespacing formatting issues between unix and windows systems.
The following command successfully applied the patch with no errors:
git apply --ignore-space-change --ignore-whitespace modules/godex/patches/add_custom_iterator.patch
BUT will not allow it to build successfully:
C:\Users\Carlos\Documents\Godot\godot\modules\godex\iterators\../storage/storage.h(206): error C2663: 'MeshComponent::set': 2 overloads have no legal conversion for 'this' pointer
C:\Users\Carlos\Documents\Godot\godot\modules\godex\iterators\../storage/storage.h(201): note: while compiling class template member function 'void Storage<const C>::insert_dynamic(EntityID,const Dictionary &)' with [ C=MeshComponent ]
C:\Users\Carlos\Documents\Godot\godot\modules\godex\systems\../iterators/query.h(201): note: see reference to class template instantiation 'Storage<const C>' being compiled with [ C=MeshComponent ]
C:\Users\Carlos\Documents\Godot\godot\modules\godex\systems\../iterators/query.h(195): note: while compiling class template member function 'bool QueryStorage<const MeshComponent,const TransformComponent>::has_data(EntityID) const'
C:\Users\Carlos\Documents\Godot\godot\modules\godex\systems\../iterators/query.h(263): note: see reference to function template instantiation 'bool QueryStorage<const MeshComponent,const TransformComponent>::has_data(EntityID) const' being compiled
C:\Users\Carlos\Documents\Godot\godot\modules\godex\systems\../iterators/query.h(230): note: see reference to class template instantiation 'QueryStorage<const MeshComponent,const TransformComponent>' being compiled
C:\Users\Carlos\Documents\Godot\godot\modules\godex\systems/system_builder.h(87): note: see reference to class template instantiation 'Query<const MeshComponent,const TransformComponent>' being compiled
C:\Users\Carlos\Documents\Godot\godot\modules\godex\systems\system_exe_funcs.gen.h(12): note: see reference to class template instantiation 'SystemBuilder::DataFetcher<P1>' being compiled with [ P1=Query<const MeshComponent,const TransformComponent> & ] modules\godex\register_types.cpp(113): note: see reference to function template instantiation 'void SystemBuilder::system_exec_func<RenderingServerDatabag*,Query<const MeshComponent,const TransformComponent>&>(World *,void (__cdecl *)(P0,P1))' being compiled with [ P0=RenderingServerDatabag *, P1=Query<const MeshComponent,const TransformComponent> & ]
scons: *** [modules\godex\register_types.windows.tools.64.obj] Error 2
scons: building terminated because of errors.
If you need to read the entity Component
, or a Databag
, from a standard GDScript
function, it's possible to use the ECS
singleton in this way:
func _ready():
var component = ECS.get_active_world().get_entity_component(get_entity_id(), ECS.TransformComponent)
The function get_active_world
is used to get the currently active world, however, this function is really verbose. Is it possible to make it shorter?
The function get_entity_component
is good, but still verbose. Is it possible to make this shorter?
What about this?
Is still understandable?
Worth it?
func _ready():
var component = ECS.get_world().get_component(get_entity_id(), ECS.TransformComponent)
Bound with #39
The SystemBundle
is a collection of System
s that allow to add System
s, to the pipeline, in bulk. This is useful to speed-up and make easier the pipeline composition.
Some example are:
RenderingBundle
PhysicsBundle
SystemBundle
just contains actual System
s that can still be added one by one.SystemBundle
is just an Editor
concept so it doesn't bloat the actual godex::pipeline
core.CI disable debug symbols to reduce binary size
The query changed filter is indispensable to properly detect changed components and perform one time task. Right now, it's missing on the Mesh
updated. The transform of each Mesh
is updated even if it doesn't change.
Add a way to chose the component storage type from scripting.
Each component can have different storages:
DenseVectorStorage
stores the components in a condensed vector.BatchDesenseVectorStorage
can store more components per each entity, in a condensed vector.You can:
Is it possible to patch to 3.2 branch as well?
Consider use Set
on the SystemExeInfo
https://github.com/GodotECS/godex/blob/main/systems/system.h#L16 to simplify the code.
Add hierarchy sorting at the end of each iteration. The grouping must take care of:
The call
function are not using StringName
to compare the methods:
if (String(p_method) == "insert") { // TODO make this a static StringName to improve the check.
Please improve it by making "insert"
a static StringName insert("insert")
so to optimize GDScript function call.
Do it for:
I am on this commit of Godot: godotengine/godot@0e77dc6
I am on Windows and this is the command I ran:
scons -j8 p=windows tools=yes target=release_debug
Here are the errors I get:
PS F:\godot> scons -j8 p=windows tools=yes target=release_debug
scons: Reading SConscript files ...
Configuring for Windows: target=release_debug, bits=default
Found MSVC version 14.2, arch amd64, bits=64
YASM is necessary for WebM SIMD optimizations.
WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[ 2%] Compiling ==> platform\windows\os_windows.cpp
[ 3%] os_windows.cpp
[ 3%] rc /DDEBUG_ENABLED /DWINDOWS_SUBSYSTEM_CONSOLE /DWINDOWS_ENABLED /DWASAPI_ENABLED /DWINMIDI_ENABLED /DTYPED_METHOD_BIND /DWIN32 /DMSVC /DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DNOMINMAX /D_WIN64 /DVULKAN_ENABLED /DCUSTOM_ITERATOR /DCUSTOM_PHYSICS_ITERATOR /DTOOLS_ENABLED /DMINIZIP_ENABLED /DZSTD_STATIC_LINKING_ONLY /Ithirdparty\freetype\include /Ithirdparty\libpng /Ithirdparty\vulkan /Ithirdparty\vulkan\include /Ithirdparty\vulkan\loader /Ithirdparty\zstd /Ithirdparty\zlib /Iplatform\windows /I. /nologo /foplatform\windows\godot_res.windows.opt.tools.64.obj platform\windows\godot_res.rc
[ 3%] Generating enabled modules header.
[ 15%] Compiling ==> thirdparty\miniupnpc\miniupnpc\miniwget.c
[ 15%] Compiling ==> thirdparty\miniupnpc\miniupnpc\minisoap.c
[ 15%] miniwget.c
[ 16%] minisoap.c
[ 40%] Compiling ==> modules\godex\register_types.cpp
[ 40%] register_types.cpp
[ 40%] Compiling ==> modules\godex\godot\editor_plugins\components_gizmo_3d.cpp
[ 40%] Compiling ==> modules\godex\godot\editor_plugins\editor_world_ecs.cpp
components_gizmo_3d.cpp
[ 40%] Compiling ==> modules\upnp\upnp_device.cpp
editor_world_ecs.cpp
[ 40%] Compiling ==> modules\upnp\upnp.cpp
[ 40%] Compiling ==> modules\upnp\register_types.cpp
upnp_device.cpp
[ 40%] upnp.cpp
Compiling ==> main\main.cpp
register_types.cpp
main.cpp
[ 40%] Compiling ==> modules\text_server_adv\text_server_adv.cpp
text_server_adv.cpp
[ 40%] Compiling ==> modules\register_module_types.gen.cpp
register_module_types.gen.cpp
[ 40%] Linking Static Library ==> modules\modules.windows.opt.tools.64.lib
[ 40%] Compiling ==> modules\text_server_adv\dynamic_font_adv.cpp
dynamic_font_adv.cpp
[ 40%] Compiling ==> modules\godex\godot\editor_plugins\entity_editor_plugin.cpp
entity_editor_plugin.cpp
[ 40%] Linking Static Library ==> modules\module_upnp.windows.opt.tools.64.lib
[ 40%] Compiling ==> modules\godex\godot\nodes\ecs_world.cpp
F:\godot\modules\godex\godot\editor_plugins\editor_world_ecs.h(169): error C3668: 'EditorWorldECS::_changed_callback': method with override specifier 'override' did not override any base class methods
ecs_world.cpp
modules\godex\godot\editor_plugins\editor_world_ecs.cpp(694): error C2039: 'remove_change_receptor': is not a member of 'WorldECS'
F:\godot\modules\godex\godot\editor_plugins\../nodes/ecs_world.h(79): note: see declaration of 'WorldECS'
modules\godex\godot\editor_plugins\editor_world_ecs.cpp(707): error C2039: 'add_change_receptor': is not a member of 'WorldECS'
F:\godot\modules\godex\godot\editor_plugins\../nodes/ecs_world.h(79): note: see declaration of 'WorldECS'
modules\godex\godot\editor_plugins\editor_world_ecs.cpp(719): error C2039: 'remove_change_receptor': is not a member of 'PipelineECS'
F:\godot\modules\godex\godot\editor_plugins\../nodes/ecs_world.h(18): note: see declaration of 'PipelineECS'
modules\godex\godot\editor_plugins\editor_world_ecs.cpp(725): error C2039: 'add_change_receptor': is not a member of 'PipelineECS'
F:\godot\modules\godex\godot\editor_plugins\../nodes/ecs_world.h(18): note: see declaration of 'PipelineECS'
modules\godex\godot\editor_plugins\editor_world_ecs.cpp(1094): error C2039: '_change_notify': is not a member of 'WorldECS'
F:\godot\modules\godex\godot\editor_plugins\../nodes/ecs_world.h(79): note: see declaration of 'WorldECS'
scons: *** [modules\godex\godot\editor_plugins\editor_world_ecs.windows.opt.tools.64.obj] Error 2
F:\godot\modules\godex\godot/editor_plugins/editor_world_ecs.h(169): error C3668: 'EditorWorldECS::_changed_callback': method with override specifier 'override' did not override any base class methods
F:\godot\modules\godex\godot/editor_plugins/entity_editor_plugin.h(42): error C3668: 'EntityEditor::_changed_callback': method with override specifier 'override' did not override any base class methods
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(745): error C2039: '_change_notify': is not a member of 'Entity3D'
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(94): note: see declaration of 'Entity3D'
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(744): note: while compiling class template member function 'void EntityInternal<Entity3D>::update_components_data(void)'
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(202): note: see reference to function template instantiation 'void EntityInternal<Entity3D>::update_components_data(void)' being compiled
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(98): note: see reference to class template instantiation 'EntityInternal<Entity3D>' being compiled
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(745): error C2039: '_change_notify': is not a member of 'Entity2D'
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(221): note: see declaration of 'Entity2D'
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(744): note: while compiling class template member function 'void EntityInternal<Entity2D>::update_components_data(void)'
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(293): note: see reference to function template instantiation 'void EntityInternal<Entity2D>::update_components_data(void)' being compiled
F:\godot\modules\godex\godot\editor_plugins\../nodes/entity.h(225): note: see reference to class template instantiation 'EntityInternal<Entity2D>' being compiled
scons: *** [modules\godex\register_types.windows.opt.tools.64.obj] Error 2
scons: *** [modules\godex\godot\editor_plugins\components_gizmo_3d.windows.opt.tools.64.obj] Error 2
modules\godex\godot\nodes\ecs_world.cpp(40): error C3861: '_change_notify': identifier not found
modules\godex\godot\nodes\ecs_world.cpp(49): error C3861: '_change_notify': identifier not found
modules\godex\godot\nodes\ecs_world.cpp(69): error C3861: '_change_notify': identifier not found
modules\godex\godot\nodes\ecs_world.cpp(74): error C3861: '_change_notify': identifier not found
modules\godex\godot\nodes\ecs_world.cpp(354): error C3861: '_change_notify': identifier not found
modules\godex\godot\nodes\ecs_world.cpp(359): error C3861: '_change_notify': identifier not found
scons: *** [modules\godex\godot\nodes\ecs_world.windows.opt.tools.64.obj] Error 2
F:\godot\modules\godex\godot\editor_plugins\entity_editor_plugin.h(42): error C3668: 'EntityEditor::_changed_callback': method with override specifier 'override' did not override any base class methods
scons: *** [modules\godex\godot\editor_plugins\entity_editor_plugin.windows.opt.tools.64.obj] Error 2
scons: building terminated because of errors.
Here is a project that you should be able to clone/get submodules (for godex)
Windows CI fails when cachech is on.
Windows cache removed with this: d749d99
The Changed
components are reset each frame; if your listening System
is registered after the one that change a component the event is lost.
Expose Databag functions to scripts so will be possible to:
Entity
from WorldCommdans
Entity
from WorldCommdans
Add support to filter nesting on the DynamicQuery
like done for the Query
here: #111.
3D Game
Wanted better performance on skeleton animation and IK
Define skeletons in ecs
???
IK and Skeleton is thousands of lines of code.
GDScript is slow
It would be nice to have a simpler component and systema registration/removal.
I would propose the Component and System registration to be automatic. I mean, the posibility to choose any resource .gd script as a System or Component without the needing of first registering it as one to the ECS world. The registration would take place behind the scenes after the "ok" or double click.
Also, a list of current registered Components and Systems in the editor to remove one if wanted.
Review the mechanism to add an entity from a System, especially in GDScript.
Impressive work, thanks for sharing it. I wanted to try it out before finding out that my card is probably too old, I create this issue only FYI, close it when you want.
I tried to build master first then the branch mentioned in the wiki Setup page, without the godex module and without the patch I can build and run both, if I add the module and apply the patch I have errors with both:
Debian/sid gcc-10
branch master:
[ 33%] Compiling ==> modules/godex/main.cpp
[ 33%] Compiling ==> modules/godex/register_types.cpp
In file included from modules/godex/register_types.cpp:17:
modules/godex/godot/editor_plugins/editor_world_ecs.h:137:7: error: 'void EditorWorldECS::_changed_callback(Object*, const char*)' marked 'override', but does not override
137 | void _changed_callback(Object *p_changed, const char *p_prop) override;
| ^~~~~~~~~~~~~~~~~
In file included from modules/godex/register_types.cpp:18:
modules/godex/godot/editor_plugins/entity_editor_plugin.h:42:15: error: 'virtual void EntityEditor::_changed_callback(Object*, const char*)' marked 'override', but does not override
42 | virtual void _changed_callback(Object *p_changed, const char *p_prop) override;
| ^~~~~~~~~~~~~~~~~
In file included from modules/godex/godot/editor_plugins/components_gizmo_3d.h:3,
from modules/godex/register_types.cpp:16:
modules/godex/godot/editor_plugins/../nodes/entity.h: In instantiation of 'void EntityInternal<C>::update_components_data() [with C = Entity3D]':
modules/godex/godot/editor_plugins/../nodes/entity.h:202:33: required from here
modules/godex/godot/editor_plugins/../nodes/entity.h:745:9: error: 'class Entity3D' has no member named '_change_notify'
745 | owner->_change_notify("components_data");
| ~~~~~~~^~~~~~~~~~~~~~
modules/godex/godot/editor_plugins/../nodes/entity.h: In instantiation of 'void EntityInternal<C>::update_components_data() [with C = Entity2D]':
modules/godex/godot/editor_plugins/../nodes/entity.h:293:33: required from here
modules/godex/godot/editor_plugins/../nodes/entity.h:745:9: error: 'class Entity2D' has no member named '_change_notify'
scons: *** [modules/godex/register_types.linuxbsd.tools.64.o] Error 1
scons: building terminated because of errors.
detached branch over 36c943260ed40c6e31a6ecff7f6e1674714b4fcb:
[ 30%] Linking Static Library ==> modules/libmodule_gridmap.linuxbsd.tools.64.a
Ranlib Library ==> modules/libmodule_gridmap.linuxbsd.tools.64.a
[ 30%] Compiling ==> modules/godex/components/child.cpp
In file included from modules/godex/components/../systems/../iterators/query.h:5,
from modules/godex/components/../systems/system_builder.h:7,
from modules/godex/components/../ecs.h:11,
from modules/godex/components/component.h:5,
from modules/godex/components/child.h:3,
from modules/godex/components/child.cpp:1:
modules/godex/components/../systems/../iterators/../storage/storage.h: In member function 'void ChangeList::notify_updated(EntityID)':
modules/godex/components/../systems/../iterators/../storage/storage.h:50:14: error: 'class LocalVector<EntityID>' has no member named 'remove_unordered'
50 | changed.remove_unordered(index);
| ^~~~~~~~~~~~~~~~
modules/godex/components/../systems/../iterators/../storage/storage.h:55:13: error: 'class LocalVector<EntityID>' has no member named 'remove_unordered'
55 | changed.remove_unordered(index);
| ^~~~~~~~~~~~~~~~
scons: *** [modules/godex/components/child.linuxbsd.tools.64.o] Error 1
scons: building terminated because of errors.
static_assert(std::is_trivially_copyable<T>::value);
and static_assert(std::is_trivially_copyable<D>::value);
to make sure all registered Component
s and Databag
s are trivially copyable.Batch
also trivialAdd the possibility to register Component, System, Databag, via script.
Issue
The current GDScript System
syntax, doesn't allow to create System
s without a Query
. This is an example:
extends System
func _prepare():
with_component("TransformComponent")
with_databag("WorldCommands")
func _for_each(transform_comp, world):
print(transform_comp)
If you want to perform some operations like add or remove Entities
that are not coupled with a Query
there is no way to do it.
Proposal
If we add a new function _execute
that receives the query as an accessor:
extends System
func _prepare():
with_component("TransformComponent")
with_databag("WorldCommands")
func _execute(query, world):
# So `world` is usable regardless the query.
while query.is_done() == false:
var accessors = query.get()
print(accessors.0)
However, the function _for_each
would not be removed.
Hi, I am Sairam, I am working on OpenSkyCity, and I wanted to take a look into Godex, but since my computer is too bad, I can't build the godot. I would like to get a download link of the build.
Thank you.
Consider remove WorldECSCommands
so the WorldCommands
databag can be used to add remove Entities
.
The shape's gizmo doesn't update when changing value from inspector
The gizmos disappears when changing scene
Problem
It is not clear how we can get the Godot api to work in the ECS context. As an example, using Godot physics api to detect collisions or make physics simulation in a ECS system. I can see there is a Shape3dComponent but It is not clear how it can be used to access the Godot physics api which relies on kinematic, static bodies and other classes. The same applies for other classes and features. Maybe it is about documentation.
Proposal
As an idea, I don't know how feasible it is to get Godot scenes registered as components to have the full Godot api available in ECS systems. While adding complex scenes as components is not what ECS is about it could integrate Godot in the ECS paradigm.
When compiling with LLVM the compilation fails. When compiling without LLVM it works fine.
scons -j8 platform=linuxbsd use_llvm=yes use_lld=yes
In file included from modules/godex/components/dynamic_component.cpp:1:
In file included from modules/godex/components/dynamic_component.h:3:
modules/godex/components/component.h:99:39: error: 'target' is a private member of 'DataAccessor'
return static_cast<const T *>(comp->target);
^
modules/godex/components/../systems/../iterators/../world/../ecs_types.h:388:8: note: declared private here
void *target = nullptr;
^
Gist with the complete log
OS: Solus x86_64 (Kernel 5.11.6-174.current)
GCC: 10.2.0
LLVM: 10.0.1
scons: v3.1.1
scons -j8 platform=linuxbsd
compiles successfully. Compiling with LLVM but without godex compiles successfully.
Following the Compiling wiki page with Godot at this commit and Godex at this commit, I ran git apply modules/godex/patches/add_custom_iterator.patch
.
That resulted in this error:
error: patch failed: core/config/engine.h:88
error: core/config/engine.h: patch does not apply
error: patch failed: main/main.cpp:2497
error: main/main.cpp: patch does not apply
I can successfully apply the patch after checking out a previous—albeit recent—commit of Godot like so:
git checkout 2e66e5d5992a521fe27dc88fee92c680f4adf98b
Understandably Godot's master branch is hectic, so the patch will inevitably fall out of sync until this PR is merged. It's probably kind of annoying to maintain the patch. If it helps, I'd be happy to update Godex's wiki by mentioning that last-known compatible Godot commit.
Edit: Actually, I had to make a some minor changes to Godex for Godot to compile with it. I'm wondering, which commit of Godot is safest to use with Godex? I want to avoid recompiling a bunch of times.
When adding a system via UI it will not become available to use.
WorldECS
nodeSystem
Here is the system script I used:
extends System
func _prepare():
with_databag(ECS.FrameTime, IMMUTABLE)
with_component(ECS.TransformComponent, MUTABLE)
func _for_each(frame_time, transform):
var new_basis = transform.transform.basis.rotated(Vector3.UP, frame_time.delta)
transform.transform.basis = new_basis
OS: Solus x86_64 (Kernel 5.11.6-174.current)
Godot: godotengine/godot@ae6b2d6e
Godex: 59a955b
I tried debugging this a bit but did not find a solution yet (and don't have much time to investigate further). Here is what I found so far:
EditorEcs::save_script()
is calledThis is a snippet from my project.godot
file after trying to register the system:
[ECS]
System/scripts="MySystem.gd"
To me this looks like it is saved as a string instead of an array. Could this be a hint to the problem?
Release binary builds of GodotECS from master as Github releases.
Possible cicd pipelines:
For the Hydro project we found a way to sync editor help with wiki help, I think you can do the same for godex.
The ComponentBundle
is a collection of Component
; it can be added to an Entity
: all the contained Component
s are added to that Entity
.
This is useful to speed-up Entity
composition, for standard things like RigidBody
, Meshes
, etc... .
There is a new Component
type, which name is ComponentEvent
.
It represent an Event
in Godex
: The difference to a standard Component
is that it's automatically removed from the World
at the end of the processing.
You can see how to use it, in C++, https://github.com/GodotECS/godex/blob/main/tests/test_ecs_system.h#L532-L564 TEST_CASE("[Modules][ECS] Test event mechanism.") {
Expose it to Scripting.
3D Game
Unable to recreate parent to child transform. So I'm not able to write a scene root to packed scene converter.
Allow the creation of a parent to child relationship spatially.
The component contains the parent entity ID. A system resolve those transforms, before updating the meshes position.
Not trivial done by a few lines of script.
Could be a gd script component.
The shape's gizmo doesn't show if first the value is not changed
Regression introduced by: #135
When the Entity transform is changed via gizmo (by dragging it around with the mouse), the 3D object doesn't change the position immediately: It seems like the editor lags. I don't think it's a performance issue because the editor is still running at pretty high FPS. Rather, I suppose that in some function is missing the new notify_property_list_changed
call.
Bound with #38
issue
When a new pipeline is added, it's created without any System
s in it, so the developer has to populate it before even be able to use it.
proposal
To improve it, a solution would be pre populate the pipeline, so the developer can immediately use it.
In addition to this the WorldECS
could come with the pipelines already setup: this would reduce beginners entry cost, and improve usability.
Tracker
PipelineBuilder
. #186PipelineBuilder
warning messages on the WorldECS node #192PipelineBuilder
warning messages on the editor world ecs #192I am getting the following compilation error message:
modules/godex/components/../systems/../iterators/query.h: In member function 'std::tuple<Batch<typename remove_filter::type>...> QueryStorage::get(EntityID, Space) const':
modules/godex/components/../systems/../iterators/query.h:39:103: error: cannot deduce template arguments for 'tuple' from ()
std::tuple<Batch<remove_filter_t>...> get(EntityID p_id, Space p_mode) const { return std::tuple(); }
^
scons: *** [modules/godex/components/child.linuxbsd.tools.64.o] Error 1
scons: building terminated because of errors.
I am using latest stable Godot and Godex versions and compiling as described in the wiki.
Any idea to fix it? Thanks.
Add Tracy profiler to godex https://github.com/wolfpld/tracy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.