Re-add entity tick logic to BaseGame.Update() method#66
Re-add entity tick logic to BaseGame.Update() method#66
Conversation
…face Co-authored-by: xezno <12881812+xezno@users.noreply.github.com>
Co-authored-by: xezno <12881812+xezno@users.noreply.github.com>
|
Does this restore transform interpolation for actors @copilot |
Yes, this restores transform interpolation for actors. The key issue was that Looking at the sample Player class, it has a The fix in commit 313ad0d restores this by adding |
Problem
The entity tick system was missing from the
BaseGame.Update()method. WhileBaseGame.FrameUpdate()correctly calls entity update logic viaTryCallMethodOnEntity("FrameUpdate"), the tick-basedUpdate()method was not calling the corresponding entity tick logic.This meant that:
Update()methods were never being called during game ticksEvent.Ticksystem was not being fired from the main game loopIActorinterface (missingFrameUpdate()) and theActorclass implementation[Event.Tick]decorated methods weren't executingSolution
Added the missing entity tick logic to
BaseGame.Update():Also updated the
IActorinterface to include theFrameUpdate()method for consistency with theActorimplementation.Added comprehensive test coverage in
EntityTickTests.csto verify that:Update()methods are called during ticks[Event.Tick]decorated methods are properly invokedVerification
This change aligns with existing patterns:
BaseGame.FrameUpdate()already usesTryCallMethodOnEntity("FrameUpdate")Event.Run(assembly, Event.TickAttribute.Name)afterUpdate()Playeruse bothFrameUpdate()overrides and[Event.Tick]decorated methodsThe fix restores proper entity tick functionality and transform interpolation for actors with minimal surgical changes (only 4 lines of code added) while maintaining full compatibility with existing entity implementations.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.