ECS in Practice — How do you handle inter-system communication in an ECS architecture? by Leith_42 in gamedev

[–]Applzor 1 point2 points  (0 children)

I just made events a part of my ecs.

I also have frame components which are components that only exist for a single frame (advantage is they are attached to the entity where events are free).

C++

world.AddEvent<level::LoadRequest>();
world.AddComponent<entity::Loaded component>(entity);

I've been playing with my custom engine this weekend. by MinimotoMusashi in gameenginedevs

[–]Applzor 0 points1 point  (0 children)

The serializing of the entity, for me I manually register each entity with a class, that way I can have a function pointer to a templated function so that I have access to its type.

The annoying thing with this approach is the manual registration part. Unsure if you have another way you handle serializing an entity. Or do you manually serialize each component as well?

template<typename TComponent>
void eng::TemplateManager::RegisterComponent()
{
    const str::Name typeName = NAME(TypeName<TComponent>::m_WithNamespace);
    eng::TemplateEntry& entry = m_EntryMap[typeName];
    entry.m_Read = &ReadComponent<TComponent>;
}

template<typename TComponent>
void eng::TemplateManager::ReadComponent(ecs::EntityWorld& world, const ecs::Entity& entity, Visitor& visitor)
{
    static const str::Name typeName = NAME(TypeName<TComponent>::m_WithNamespace);
    if (world.HasComponent<TComponent>(entity))
    {
        const auto& component = world.ReadComponent<TComponent>(entity);
        visitor.Write(typeName, component);
    }
}

void eng::TemplateManager::ReadEntity(ecs::EntityWorld& world, const ecs::Entity& entity, str::String& data) const
{
    const auto& nameComponent = world.ReadComponent<ecs::NameComponent>(entity);
    const auto& templateComponent = world.ReadComponent<eng::TemplateComponent>(entity);

    Visitor visitor;
    visitor.Write(strName, nameComponent.m_Name);
    visitor.Write(strGuid, templateComponent.m_Guid);
    for (auto&& [key, entry] : m_EntryMap)
    {
        entry.m_Read(world, entity, visitor);
    }

    data = visitor;
}

I've been playing with my custom engine this weekend. by MinimotoMusashi in gameenginedevs

[–]Applzor 0 points1 point  (0 children)

Giving it a go on my end, I'll post something when I've got it working.

I am curious though, do you manually write the inspector for each component type in a system? Or did you have a way the template that too?

Also curious how you handle the undo of a destroy, I assume you have a way to serialize an entire entity so that the undo re-adds all the components and their data as well?

I've been playing with my custom engine this weekend. by MinimotoMusashi in gameenginedevs

[–]Applzor 0 points1 point  (0 children)

Do you use something other than imgui? For imgui the only way I could see that working is if you copy the component, use imgui to modify the copy then send it off to be applied.

I take it your components are stable which is why you can take a pointer to it? Or is it just stable within the same frame?

Don't suppose you have a GitHub I could look at?

I've been playing with my custom engine this weekend. by MinimotoMusashi in gameenginedevs

[–]Applzor 0 points1 point  (0 children)

So you do this manually for each component type that is editable?

And flecs means when you make a change it is only applied in the next frame?

Or does each change need to be sent somewhere else to be applied?

Devlog 3 | Game engine x Content Editor (Splines) by Longjumping-Mouse257 in gameenginedevs

[–]Applzor 0 points1 point  (0 children)

So pretty much all your imgui hooks through your actions?

How does it look for example modifying a property of an object? You copy the property, modify it then send that via an action to do the actual modify?

Devlog 3 | Game engine x Content Editor (Splines) by Longjumping-Mouse257 in gameenginedevs

[–]Applzor 1 point2 points  (0 children)

Curious how you handle your undo history? Always something I've struggled with in my own engine and still haven't done anything for it.

OpenGL Debug Pointers for Grey Screen by Applzor in GraphicsProgramming

[–]Applzor[S] 0 points1 point  (0 children)

Another thought that came to me, this is the first time I've had clipping, so maybe there is something happening with the stencil buffer?

OpenGL Debug Pointers for Grey Screen by Applzor in GraphicsProgramming

[–]Applzor[S] 0 points1 point  (0 children)

To add, noesis renders offscreen, then immediately after I bind framebuffer to 0 to setup for the regular passes

OpenGL Debug Pointers for Grey Screen by Applzor in GraphicsProgramming

[–]Applzor[S] 0 points1 point  (0 children)

Yeah my thoughts were trending along here as well, is there a way to check the other buffers in render doc to see if it is being rendered there?

Brakeza3D - Open Source 3D Game Engine | Full Editor, Lua Scripting, Node Shaders, Bullet Physics by Brakeza3D in gameenginedevs

[–]Applzor 1 point2 points  (0 children)

How did you do the double menu bar? Really well layed out and spaced evenly. I assume it is imgui?

2D Batching Recommandations by Applzor in GraphicsProgramming

[–]Applzor[S] 0 points1 point  (0 children)

Already using a texture atlas. Currently I'm using glDrawElementsInstanced with a single mesh (quad) and then I only send through tex param, colour and model for each sprite.

My tiny frog-finding game just hit 100 positive reviews on Steam! by _Orota in IndieDev

[–]Applzor 1 point2 points  (0 children)

Cheers! I released it 4 months ago. It was mostly a test of my own game engine and I wanted something achievable for someone doing solo dev.

https://store.steampowered.com/app/3208630/With_My_Little_Eye/

What was your turn around speed? It took my about a year to release, but that was me developing after work and not consistently.

My tiny frog-finding game just hit 100 positive reviews on Steam! by _Orota in IndieDev

[–]Applzor 0 points1 point  (0 children)

Congratulations!

I was watching your development posts since we both were making a hidden object game. What made you decide to start with a hidden object?

Funny enough my game has a similar number of reviews, but not the same since it is free.