Getting collisions to move with TranslateTo

Post » Thu Jun 21, 2012 10:36 am

Alright.... some good news... I found a way to get collision with an object DURING a transTo... it's actually pretty funny to smack the Whiterun horse around during my testing (it's a fairly neutral test-cell I use.. wrext16). As I mentioned earlier, I use Vanilla collision that best fits my needs (eg: a dock column for a stowed sail/yard, and a riften floor for basic platformage of the deck.. which I'll tweak eventually).

[NIF with collision for an activator that moves]
(using NifSkope and the CK...versions shouldn't really matter at this point, unless you're using NifSkope from Obliv heheh)
- copy/paste over the appropriate collision WITH it's visible geometry (the whole bsFade node)
- place that bsFadeNode under the root node (so it adds one extra child to the root)
- translate/rotate/scale that bsFadeNode as needed (to position the collision)
- in the spliced bsFadeNode, delete the visible geometry after it's positioned (the niTriShapes/etc, but LEAVE the bhkColl and the bsxFlags if there is one)
- the root node needs a bsxFlags set to 130 (there shouldn't be any other bsxFlags anywhere.. at least there doesn't HAVE to be, I know that much.. for what I need anyways)
- convert the collision's 'body node' to a bhkRigidBodyT (regular rigidBody won't work.. no collision)
- select that bhkRigidBodyT; set the 'layer' and the 'layer copy' both to ol_anim_static (ol_static will correct the collision after the transTo is done, but doesn't work during the transTo)
- set the 'motion system' to mo_sys_box (dynamic makes it jumpy, box_stablized doesn't move during transTo)
- the 'deactivator type', 'solver deactivation', and 'quality type' should be set to never, off, and invalid (respectively)
= then of course create an activatorObject pointing to that NIF in an appropriate folder


Now about the moving platform thing... I've given it some thought, and did a bit of experimenting. Not exactly for what you (Phinix) want, but the info should help nevertheless. If an object on a platform has a light enough weight ('mass' in the NIF), and the 'friction' is high enough to keep it from slipping... it'll stay on a moving platform - whether it be a generic collision box or custom collision (like above).

BUT that doesn't address you're query as to achieve 'inertial mass'... but I may have to resort to something in my ship mod which you are trying to do (hence my bit-o-thought). From what I read, it sounds like you've been making a single box and trying to contain something in it. That will almost certainly never work, as collision only works one-way (though in Obliv I think it may have been different).

My idea, that I'll be testing soon enough, is to have several boxes - since things react to the OUTSIDE of them (one for each direction). It's no problem scripting-wise... I've successfully gotten over a dozen objects to move relatively in-synch (especially when their invisible like coll-boxes heheh). It's a matter of whether the SPEED and MASS will cause the collision to break (and maybe 'restitution'.. which affects bounciness from what I understand). But from what I saw with that horse I was slapping around with a telephone pole.... there's a good chance it can be pulled off.

It isn't the same line of thought, and it CERTAINLY won't help what you want regarding jumping, but using a setVehicle creates VERY smooth movement (since only one object is scripted to move). I use this as an alternative view-mode in my ship mod.. for those who have lower-end systems, don't like the jittery-ness I like, or simply want a better view while sailing. There's not much to the NIF structure to pull it off.. lemme know if that's something you or anyone else is interested in.
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Thu Jun 21, 2012 4:54 pm

Interesting... I have tried about every combination of the settings you mentioned as well as mass, friction, velocity, etc., and the best I can get is where MOST of the time the player only skips a little, and remains in the same place for the most part. Occasionally however they will slip and when they do, they sail all the way off the platform.

So, I have given up on that method being possible. If the engine had a setting coded to treat colliding objects like part of the object in motion unless acted upon by another object (or player controls) it would work flawlessly, but apparently that option was not coded into the math for the .NIF file format for collisions.

The idea you suggest regarding vehicles seems like it MIGHT work, and it how Bethesda themselves seem to have gotten around this problem. I was toying with the idea, but the snag I ran into was, how do you set up a vehicle with MULTIPLE furniture markers? (For companions, etc.)

The command to SetVehicle seems to only allow you to set it or un-set it. There doesn't seem to be any option for positions. One position per vehicle seems to be the rule. But then, how do they get Ulfric and the horse thief to ride the same cart as the player?

I can't seem to locate the start game cart outside Helgen to investigate...
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Thu Jun 21, 2012 5:15 pm

The command to SetVehicle seems to only allow you to set it or un-set it. There doesn't seem to be any option for positions. One position per vehicle seems to be the rule. But then, how do they get Ulfric and the horse thief to ride the same cart as the player?
They have a different idle animation for each seating position. I don't really know anything about animations, so I'm not sure how the animations are set up. The couple I've tried didn't have any horizontal movement, but I think that's because I re-used furniture animations where the furniture marker (or its keyword?) defines character initial offset and final rotation.
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Thu Jun 21, 2012 2:01 pm

Phinix, I don't know how useful it would be to you, but I recently saw a mod called DragonKiller Cart that lets you load up a cart full of junk and your followers, strap your own horse into it and then pilot it, with player controls, around Skyrim. Maybe you should take it apart to see how it works.
User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm

Post » Thu Jun 21, 2012 11:38 pm

Yea... that thing about only one position I came across too. The way I get around it is to have multiple NIFs set up for the setVehicle system. Since I have multiple objects anyway, it wasn't too far of a stretch; and actually helped me eliminate code. I attach the horse to one of them, and Player has the option to use the same... though is setAlpha(0) so you can't see the overlap; and both are setGhost. But if you only have a single object (eg: a platform), I would suggest making however many different NIFs of the same mesh, then have each with different setVe positioning (which I actually employ this technique)... script the appropriate one to be in-game when needed of course.

Now something about setVehicle that kinda precludes what you want - I haven't been able to get a NIF with collision AND set up for setVehicle... the collision never shows up in-game (no matter the settings or placement in the NIF itself). So that kinda svcks - but I have collision in yet-other objects that I'm getting 'strategic' with.. ie: placing spliced invisi-collision in places that particular NIF shouldn't have, to make up for the collision-less ones.


About the inertial mass thing... I just found that Player can still jump in the middle of a transTo, given the transTo is long enough. Since I don't need the movement to fire but every .3 seconds or so (not .03), that's long enough for it to hop. But transTo is immediately stopped when ANOTHER transTo is called (regardless if an actor, static, etc)... so the timing is what makes the biggest difference.

Also, I noticed that if allowed to jump high enough (long enough transTo), Player does NOT move forward as you want (the actual inertial mass, and lack threreof). But if you keep the timing short enough, it kind LOOKS like Player travels with the Platform; but I doubt it'd be exactly what you want. Another possibility for actually pulling it off: I have Player scripted relative to my ship... if you script it relative to its own position, that may work; but keep in mind to put scripted 'distance-restraints' so that Player can't jump off the platform (which, as you know, breaks the whole sequence).

I still haven't tried doing a collision-box-made platform as I suggested though (5 boxes, all scripted to move with Player; 1 on each side and underneath). That's gunna require a bit more scripting and calculations, and I've been fixing my ship mod instead of outright experimenting.. so you'll have to wait a bit if not attempting it yourselves.

I do know that collision boxes seem to be 'stronger' than NIF collision though... meaning that I haven't seen an actor break it yet; UNLESS setPos/moveTo either the actor or the box so that they overlap. If one does that, it's actually quite difficult to get Player un-stuck from inside it... whereas NIF collision just a simple jump fixes it.
User avatar
Evaa
 
Posts: 3502
Joined: Mon Dec 18, 2006 9:11 am

Post » Thu Jun 21, 2012 8:27 pm

Thanks everyone again for the pointers.

SLuckyD, that sounds about like what I've been attempting. I don't know if it's the "right" way or not, but I copied a BSFurnitureMarkerNode into my "platform" in NifSkope, and set it up as the appropriate type and offset values.

This does show up in the CK, though I haven't been able to find an Animation Type for simply standing. Everything is sitting or laying down...

Another issue I have been having is that the SetVehicle() command isn't working on my custom furniture object. I have been all through CarriageSystemScript, CarriageDriverScript, and CartDriverScript and I can't see what I'm doing wrong, though those aren't exactly well documented scripting examples.

It may be the way I set up my custom furniture object was wrong. Something else I am curious about, was how to set up my own multi-point furniture nodes, like the cart you ride in with Ulfric and the horse thief, only with more nodes, or if you just have to use a stock example.

Also, if there is any way to specify which position followers end up in, or if they are just added in sequence.

I am pretty sure I can work out the scripting magic, that's my strong suit. The problem is getting these essential work-around components actually working! ;)
User avatar
Richus Dude
 
Posts: 3381
Joined: Fri Jun 16, 2006 1:17 am

Post » Thu Jun 21, 2012 2:08 pm

Even if I do manage to get vehicles working, it still strikes me as odd the engine wouldn't support simple moving platform collisions somehow natively.

Every game engine from World of Warcraft to Age of Conan to Everquest to FFXIV all had some form of boat you could move around on naturally while it moved. It seemed almost like something that every game engine would incorporate, a fundamental physics of attaching objects dynamically to rigid bodies in motion and having them inherit inertia just like if they were fixed to them like in the case of vehicles.

That is why I haven't totally given up on getting it to work the way I want.

I have scripted battle scenes where spells and weapons are being fired at the platform as it moves and the player really needs to be able to move to avoid these, otherwise the whole scene as I intended becomes rather boring.
User avatar
Adriana Lenzo
 
Posts: 3446
Joined: Tue Apr 03, 2007 1:32 am

Post » Fri Jun 22, 2012 12:03 am

Marked one more theory off the list tonight: Room bounds and portals can't be dynamic!

I had thought it might be possible to create a room bound around the platform with "windows" to the surrounding area and move that, but alas, no joy!

I am certain this is possible in PhysX and the .NIF file format. Trouble is, even the NIFTools documentation has like 30% of functions listed as "unknown."

There really isn't any public resource available that describes the full capacity of the .NIF format, which is a shame. Gamebryo should have a public DOC page.
User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Thu Jun 21, 2012 4:13 pm

Going to work on another project for a while. But I plan to come back to this. I've been watching some youtube videos for Maya and the PhysX exporters it uses for Gamebryo. It certainly seems like the physics system would allow for this. A moving static with a dunamic "rider," but so far I haven't seen anyone deal with that process specifically.
User avatar
Mrs shelly Sugarplum
 
Posts: 3440
Joined: Thu Jun 15, 2006 2:16 am

Post » Thu Jun 21, 2012 4:01 pm

Another issue I have been having is that the SetVehicle() command isn't working on my custom furniture object. I have been all through CarriageSystemScript, CarriageDriverScript, and CartDriverScript and I can't see what I'm doing wrong, though those aren't exactly well documented scripting examples.

Also, if there is any way to specify which position followers end up in, or if they are just added in sequence.

Phinix, I am VERY familiar with those scripts for my ScenicCarriage mod (I've rewritten all of them) so feel free to ask away. And I'd be happy to send you custom code if you want to speed up your process.

I also have followers on my carriage and the seat positions are determined by the idle I use. There's an idle for each of the 4 seat positions.
User avatar
Cool Man Sam
 
Posts: 3392
Joined: Thu May 10, 2007 1:19 pm

Post » Thu Jun 21, 2012 3:41 pm

I still haven't tried doing a collision-box-made platform as I suggested though (5 boxes, all scripted to move with Player; 1 on each side and underneath). That's gunna require a bit more scripting and calculations, and I've been fixing my ship mod instead of outright experimenting.. so you'll have to wait a bit if not attempting it yourselves.

I do know that collision boxes seem to be 'stronger' than NIF collision though... meaning that I haven't seen an actor break it yet; UNLESS setPos/moveTo either the actor or the box so that they overlap. If one does that, it's actually quite difficult to get Player un-stuck from inside it... whereas NIF collision just a simple jump fixes it.

IIRC there's an open box of some sort in the basemant of the Riften player home. Since you know how to splice stuff with Nifskope, how about taking the collision from that, and replacing the collision in something like the bookshelf containers? Its NiTriShape is set as an EditorMarker, so the model itself will be invisible in the game.
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Fri Jun 22, 2012 2:36 am

Phinix, I am VERY familiar with those scripts for my ScenicCarriage mod (I've rewritten all of them) so feel free to ask away. And I'd be happy to send you custom code if you want to speed up your process.

Thanks, that would be very helpful. Specifically I am having trouble with the sequence of commands involving disabling of the player controls, and also where the player has to be relative to the furniture object for SetVehicle to work. I am also not sure if I am copying over the furniture node correctly, though it does show up in the editor.

I would also like to customize the layout of that node a bit, since I want to attach an existing furniture node onto a custom platform mesh, it would be nice to be able to space companions around instead of clumping them up as if they were in a wagon, and also, to get more than a few to show up.

Oh yes, and I can't seem to find a set of furniture nodes with an idle that leaves them standing, that was the other thing. I don't want my "riders" to actually be sitting down for the trip.

IIRC there's an open box of some sort in the basemant of the Riften player home. Since you know how to splice stuff with Nifskope, how about taking the collision from that, and replacing the collision in something like the bookshelf containers? Its NiTriShape is set as an EditorMarker, so the model itself will be invisible in the game.

Thanks for the tip... I checked the Riften player house (Honeyside, right?) and the only box I could find was the mist which has no collisions. This IS how I would much prefer to handle it, but I have scoured the game and as far as I can tell, Bethesda use no moving platforms to translate the player whatsoever.

They have some static animations that bump you around a bit (Dwemer pipes) but as far as what I am attempting, I can't find an example of where they have used an invisible collision volume to attach the player's vector and inertia to a parent object.

It must be something to do with PhysX processing, I just can't figure it out from the material available to study. Not without going into debt to take some college classes in Maya, and general game development, which I wouldn't be against, if college weren't the latest American scam like the housing market.

Other civilized nations PAY for you to go to college up to Masters because education is valued and seen as a way to enrich society. Here, the average cost is over $100k in debt, and 1 in 3 graduates of that scam are presently under or unemployed.

So, I just can't afford it. :(
User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm

Previous

Return to V - Skyrim