Re:Flecs – A fast entity component system for C and C++
by nyanpasu64 on Tuesday April 04, 2023 @02:42AM
(#35435943)
One trick I found is to gate mutable access to state behind a "transaction object" which sets a flag for each object mutated, then once the transaction object's destructor is called, recomputes all derived state based on which flags were set. Using a destructor might not be the best idea since I ended up not marking it noexcept, it may be better to add an explicit "recompute" function called at the end, but this breaks the convenience of `state().cursor_mut() = new_cursor;` automatically recomputing derived state once the state() object is destroyed.
Re:Flecs – A fast entity component system for C and C++
by pavlov on Tuesday April 04, 2023 @03:00AM
(#35436066)
> “the bug goes away as soon as the mouse is moved, so it's usually not a big deal”
This reminds me of:
https://thedailywtf.com/articles/Hidden-Tax-Moves
"Wait, let me try," Bruce said, grabbing the mouse.
"Whoa, what just happened?" a teammate exclaimed. "What did you do? A ton of traffic just came through!"
Re:Flecs – A fast entity component system for C and C++
by crabmusket on Tuesday April 04, 2023 @04:05AM
(#35436521)
Incredible. It's like the opposite of JS logic, where you are encouraged to do as little as possible in event handlers.
Re:Flecs – A fast entity component system for C and C++
by fileeditview on Tuesday April 04, 2023 @04:07AM
(#35436538)
> After several meetings, it was decided that it wasn't the best idea to put critical code in an app's MouseMove event.
Prove that the story is real ;)
Re:Flecs – A fast entity component system for C and C++
by Ygg2 on Tuesday April 04, 2023 @04:50AM
(#35436877)
Experienced worse.
At one company we had a deployment script written in English. That support from India would execute. Except they would occasionally inject their undocumented codes to fix their own issues.
That and the component oriented distributed monolith that ran on single machine. It was monolith architecture but it was made to run on multiple machines. However it was never distributed and starting the components was an arcane science.
Re:Flecs – A fast entity component system for C and C++
by fileeditview on Tuesday April 04, 2023 @07:39AM
(#35438039)
Oh i guess we all have these horror stories.. I was more hinting at the fact that it took several meetings to decide something obvious.
I'm not sure how this translates to ECS architecture - probably depends on your library, but if you're in charge of the main loop it shouldn't be a problem.