|
Archibald Grommet
Registered User
Join date: 9 Apr 2005
Posts: 4
|
04-13-2005 01:34
I suspect this has been suggested before but I couldn't find it after a little hunt: keyframe animation for primitives. I think it could add a lot of life to the world with minimal server load. Consider the possible uses: elevators, trains, sliding doors, smoothly animating see-saws and swings... those are just off the top of my head. Essentially you would pass a list of [integer time, vector pos, rotation rot, ...] to a function to set up the key frames, then activate or deactivate the animation as needed. Since the animation is exactly the same on the client and server it wouldn't require any special synchronisation except to say when it started or stopped. Since it's a fixed path, it can be verified on creation for objects moving out of the area etc, rather than dynamically. It can interact predictably with the physics simulator. It's 100% deterministic so you can know the exact position and orientation with a single timestamp. The data is relatively lightweight and, heck, even with a lot of restrictions it could be incredibly useful. [On a sidenote I've only been playing for a few days but I've already been impressed by the creativity of the community and the scope of the game world. I've been waiting for a creation-based game like this for years and it's good to see other people are thinking the same way. Keep up the good work, Linden Lab!  ]
|
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
04-13-2005 08:06
Something like this? As far as I know, the Lindens were interested in streamlining the process... but something like that takes time, and they're quite busy last I checked. In the meantime, I would highly suggest learning LSL. 
_____________________
---
|
|
Archibald Grommet
Registered User
Join date: 9 Apr 2005
Posts: 4
|
04-13-2005 09:19
No, not like that at all! I'm not talking about importing geometry or poser files; I'm talking about the ability to do smooth animation in-game, like llTargetOmega() but more flexible and synchronised between the client and server. Far from wanting full skeletal animation, I just want to be able to move objects back and forth along a line. Learning llScript was the first thing I did!  I realise there are hacks where one can shuffle things along a step at a time but it's far from smooth.
|
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
04-13-2005 10:40
Guess it all depends on how you want to accomplish this. For a simple elevator, you can do it smoothly in a very simple manner: float top = 40.0; // In sim coords float bottom = 10.0; // In sim coords integer is_controlled = FALSE; // control boolean float step = 2.0; // step distance
default { // Touch or collide with the object in question to start up this script!
collision_start(integer total_number) { if(!is_controlled) llRequestPermissions(llDetectedKey(0),PERMISSION_TAKE_CONTROLS); }
touch_start(integer total_number) { if(!is_controlled) llRequestPermissions(llDetectedKey(0),PERMISSION_TAKE_CONTROLS); } run_time_permissions(integer perm) { if(perm) { is_controlled = TRUE; llTakeControls(CONTROL_UP | CONTROL_DOWN, TRUE, FALSE); llSetTimerEvent(60.0); llMoveToTarget(llGetPos,0.3); llSetStatus(STATUS_PHYSICS,TRUE); llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE); } }
control(key id, integer level, integer edge) { vector current = llGetPos(); llSetTimerEvent(60.0);
if(level & CONTROL_UP) { current += <0,0,step>; if(current.z > top) current = <current.x,current.y,top>; } if(level & CONTROL_DOWN) { current -= <0,0,step>; if(current.z < bottom) current = <current.x,current.y,bottom>; } llMoveToTarget(current,0.3); llSleep(0.3); } timer() { llSetTimerEvent(0.0); llReleaseControls(); llSetStatus(STATUS_PHYSICS,FALSE); llStopMoveToTarget(); is_controlled = FALSE; } Something like this quick hack will move nicely and smoothly; it's all about using the physics engine intelligently to perform the action you wish to achieve. Note I just typed that up in the window, so if it doesn't work, let me know and I'll fix it. Regardless, adding a form of "keyframing" engine would likely be done through LSL anyway. The reason I bring up the BVH importer is it does utilize keyframes in animation effects - it's just a bit more complex than what you're asking. At any rate, it would be interesting to see residents put together such a system - because we can. It's all about making these things user friendly. 
_____________________
---
|
|
Archibald Grommet
Registered User
Join date: 9 Apr 2005
Posts: 4
|
04-13-2005 12:13
That's a neat trick! I don't doubt there are lots of clever cheats for getting the physics engine to do more or less what I want-- but it's still going to produce choppy motion for anything but the simplest animation because it has to send server messages back and forth every time the direction changes. As soon as you have more than a couple of these things moving around it's going to swamp the connection; native keyframing would be much more lightweight and would allow LOTS of moving objects. Besides, I'm merely suggesting this as a feature for some time in the distant future. I have plenty to get my teeth into as it is. Cheers for the code snippet though! It gave me a few ideas for things to make. As if I'm not swamped with ideas already... 
|
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
04-13-2005 13:19
Hmmm.... client-side movement... That's just crazy enough to work! 
_____________________
---
|
|
Archibald Grommet
Registered User
Join date: 9 Apr 2005
Posts: 4
|
04-14-2005 13:44
Ok, I proposed it on the vote thing. I'd love to see it as a feature some time in the future so everyone, please vote. 
|