On the 'wait for the frame to complete' part:
I think my current implementation of bMoving with StopWalking () being called from StopMoving() also does not wait for a frame, since:
StopWalking() commands all pieces to return to their default state immediately, and this overwrites any previous commands from Walk().
I'm trying to avoid many short frames, and use good interpolation because:
1. longer frames are easier to scale with unit movement speeds
2. Less frequent frames = better performance?
Am I thinking correctly here?
Is there any guarantee what order threads will be executed in? Because I was thinking along the following:
Code: Select all
UnitSpeed(){
set-signal-mask SIG_WALK;
while(TRUE){
set animspeed;
sleep animspeed;
}
}
StartMoving(){
start-script UnitSpeed();
start-script Walk();
}
StopMoving(){
signal SIG_WALK;
call-script StopWalking();
}
The key here being that animspeed would thus be updated exactly on time. Or should I just update animspeed from Walk() as it doesnt matter?