Elektrine lite

← Feed

@dolanor@hachyderm.io

2025-08-30 01:30 UTC

it highlighted a problem where the display didn't show the logic, which is a code smell to me, and that's something I introduced while adapting to 3D. On ebiten, the entities will be drawn every frame based on their location. On g3n, I set their position at creation, and then the engine will render them where they are positioned. But the collision would happen on another part. I wonder how I can make sure that WYSIWYG without coupling logic too much.

Replies (2)

  • @dolanor@hachyderm.io 2026-03-30 11:46

    small update from last session https://hachyderm.io/@dolanor/116309858986405398

    Open ##5199187

  • @ppxl@social.tchncs.de 2025-08-30 05:32

    @dolanor@hachyderm.io reading your text, I guess an mediator/event driven pattern could address this. Having built an ego shooter decades ago, I know it's a PITA to get things right. But 3D games are an example of Things-need-to-go-fast and additional computational iterations could skew the view building/physics calc etc. In my view that's the reason they end up rather strongly coupled. An event bus controller could even trigger different goroutines for different calculation types like model change, view render, physics. Synchronizing all these at the right game tick would be a challenge. Some might be cancelled or rendered if even wrong to benefit following calls of the same type.

    Open ##5199207