Jump to content
Make Love Not War

AttachToWithMovement: Walkable Vehicle Interriors and Exterirors

Recommended Posts

Development

A couple of weeks back ProGamer contacted me asking for help with formulating a feedback ticket requesting an attachToWithMovement type SQF command for A3. Meaning, allow one object to be attached to a second, moving object, yet simultaneously allow for the attached object to move independently on its own impetus. Or, to put it in a more concrete way, allow a soldier to walk about while riding on the inside or on the outside of a moving vehicle. I responded that the best method for ascertaining what might be needed within such a command would be to create a mock-up or proof-of-concept using the tools currently at our disposal. Working off an excellent idea presented earlier this year by JDog (HERE), I quickly wrote up a script attempting to emulate one possible method for implementing such a feature within the game. The results were much more impressive than either myself or ProGamer had anticipated.

Script

The most recent version of the attachToWithMovement script can be downloaded HERE. Note, you will also need to D/L the WIP PhysX enabled LCS 2 trimaran addon from HERE in order to play the demo mission. As it stands currently, the script allows a player unit to move about and perform all regular actions - ie., walk, run, crawl, shoot, etc. - while riding a moving vehicle which has a properly defined roadway LOD. Furthermore, both the attached and attachedTo objects are still affected by the PhysX component of the engine. So, the effects of wave action and friction, for instance, are automatically handled by the underlying RV engine.

The script has also been successfully tested on a land "vehicle", namely a moving shipping container. Although the initial versions of the script were somewhat glitchy when moving over rough terrain, the latest (yet unreleased) builds offer a pretty smooth ride. With further modifications, this should also work for aircraft interiors - such as the cargo bay of a Osprey - but I haven't directly investigated such an application yet. Although I can already predict some of the issues that an airplane would cause, I believe they should be solvable. No guarantees, however, until a working example has been implmented.

Limitations

Ok, now for the not-so-awesome news. Driving around in land vehicles while attached to another object is extremely problematic. Without getting too deep into the technical details, the primary issue is wheels (the ones contacting the ground and not the one in the driver hands) animations. While a wheeled vehicle can be scripted to move around, say, a ship deck, the RV engine handles vehicle and infantry simulation quite differently. Whereas using the script, the soldier anims will play without any problems, vehicle suspension and wheels rotations does not sync properly to the perceived actions of the two objects.

The second big limitation ATM is AI. In short, AI are unable to move around using normal methods. So, giving them a waypoint elsewhere on the ship deck is useless, for instance. Third, roadway LODs need to be defined within the model p3d, and those are missing from most BIS objects. So, you cannot, for instance, ride around on the back of a HEMTT using just this script. Finally, everything so far has been written with SP in mind and without a thought towards MP useability. And one final final caveat: these are the limitations that I am aware of and spring immediately to mind. Who knows what undiscovered issues and bugbears may lurk. Hopefully no unforseen showstoppers.

Future

The next step in my plan is to try and enable use of this script with BIS native models. In theory, one should be able to attach an invisible roadway LOD to an object so that the roadway is just above the model surface one wants to ride on. I did some preliminary testing of this concept last week and it seemed promising, although there was some unfortunate and unexpected glitchiness, so it remains to be seen whether this will ultimately prove satisfactory. Next, as already mentioned, I would like to attempt an adaptation of this concept for aircraft. After that an attempt to see if AI can be hacked into the script. Off-hand it should be possible, at least in terms of footmobiles, although it's a major undertaking as I expect all the movement, animations (and pathfinding?) would need to be done "by hand" from within the script.

Thank You

First off, a thank you to JDog for his extremely informative post. Also, mankyle and Gnat for creating and working on the PhysX enabled LCS 2 ship. A quick mention to zooloo75 for some testing and feedback an early build. And, finally, last but not least, ProGamer who provided both the original impetus as well as continued support for this little project. Without his testing, feedback, questions, advice, promotion, passion and tireless encouragement none of this would have happened. Thanks, buddy! He should also be shortly posting some really nice YT vids he made of the script in action.

Share this post


Link to post
Share on other sites

Quick, someone tell Sakurachan so I can walk around in the C130 port.

Edit :

Also, couldn't you use this to make larger vehicles?

For example, lets say there was a hypothetical Nimitz Class carrier mod. Hypothetically. But as it stands currently, the limitations of Arma do not allow for extremely large vehicles. Wouldn't this enable you to create a central Nimitz "block" and have the other pieces attached with appropriate lods and have a Nimitz that moves?

Edited by HJohnson

Share this post


Link to post
Share on other sites
Quick, someone tell Sakurachan so I can walk around in the C130 port.

Edit :

Also, couldn't you use this to make larger vehicles?

For example, lets say there was a hypothetical Nimitz Class carrier mod. Hypothetically. But as it stands currently, the limitations of Arma do not allow for extremely large vehicles. Wouldn't this enable you to create a central Nimitz "block" and have the other pieces attached with appropriate lods and have a Nimitz that moves?

I am not exactly sure I know what you mean but this is a script for walking on a moving vehicle. It doesn't make a model bigger.

Share this post


Link to post
Share on other sites

This script could potentially work for man class objects with a Nimitz-sized carrier provided that the carrier could be made to move. I'd be very surprised, however, if somebody was able to create a PhysX enabled carrier of that size. The other - and much more deadly - problem with a moving fleet-sized carrier is the vehicles. Proper functioning of wheeled vehicles would be essential, and I'm not even close to developing a technique that works for those.

Share this post


Link to post
Share on other sites

Thank you for this friend.

It is among my dreamed features.

I hope and wish you ll take it to the end ;)

Share this post


Link to post
Share on other sites

Wow, DayZ Standalone and "walking on moving ships" on the same day!

.... And they said it'd never happen.

Well done MLNW, great start.

HEY BI ! ... Are you lookin at this ... What's your excuse

Share this post


Link to post
Share on other sites
Thank you for this friend.

It is among my dreamed features.

I hope and wish you ll take it to the end ;)

My pleasure. :) I'll take things as far as I am able! What would you like to see me attempt next?

Gnat;2580240']Wow' date=' DayZ Standalone and "walking on moving ships" on the same day!

.... And they said it'd never happen.

Well done MLNW, great start.

[b']HEY BI ! ... Are you lookin at this ... What's your excuse[/b]

Gnat, do any of you modelling gurus know why the man class falls through the LCS deck, and whether it could potentially be fixed or is this always going to be a problem with models of this size? If it's the latter, I could probably come up with something (ugly and hacky) that works around it. Also, I can't get any of the intersect commands to return the LCS object. Checked through all the available LODs - "FIRE", "VIEW", "GEOM", "IFIRE" - and can't get anything. Again, is this just a WIP problem or a pernament limitation? I ask because one of the easiest and best ways of formulating the logic for determining when to attachToWIthMovement one object ot another is simply checking to see what is directly underneath an unit. In short, if he's standing on top of a vehicle, then we can attach him so that he can ride it. This method currently doesn't work with the LCS.

As for why BI hasn't done this yet: to be fair to them, in order to implement a feature like this from their end would require a lot more work. Remember, this is a proof-of-concept; to fully integrate something like this into the game would require that it works for All The Things and in all situations. MP is also a big potential stumbling block. OTOH, maybe BI will look at this script and perhaps realize that such a feature is closer to realization than they previously thought. Hoping this might inspire a dev or two, if you will.

Share this post


Link to post
Share on other sites

One word, two questions, one request, MLNW.

Word: wow!

Question 1: Launch ramps/deck - would it be possible to be able to drive (for example) a CRRC up a ramped deck of another, larger, ship and use some sort of friction coef or anything like that to slow it to a stop? Same could be said about a LPD/LHD type of well deck; would vehicles be able to drive up and down a moving ships ramp deck?

Question 2: Does this script restrict being able to access/get into vehicle turrets/positions (if the getinpos was on the deck rather than on the exterior of the ship)?

Request: Would this be possible in an MP environment at all? It would be game changing if it was.

Share this post


Link to post
Share on other sites
One word, two questions, one request, MLNW.

Word: wow!

Question 1: Launch ramps/deck - would it be possible to be able to drive (for example) a CRRC up a ramped deck of another, larger, ship and use some sort of friction coef or anything like that to slow it to a stop? Same could be said about a LPD/LHD type of well deck; would vehicles be able to drive up and down a moving ships ramp deck?

Question 2: Does this script restrict being able to access/get into vehicle turrets/positions (if the getinpos was on the deck rather than on the exterior of the ship)?

Request: Would this be possible in an MP environment at all? It would be game changing if it was.

1.) It's not using friction to have the unit stick to the ship or vehicle. Friction would be nice but sadly Physx does help with that part. As is said above, infantry already works but vehicles will take more time. For Physx to work for vehicles similar to how Physx works in VBS, we would need BI to take a interest in this.

2.) It has not been tested yet but should work if it is set correctly.

3.) As said above, multiplayer support is on the list of things to do. But has it's own issues.

Edited by ProGamer

Share this post


Link to post
Share on other sites

Thanks for the response, Programer; regardless I can't wait to see where this goes.

I would be so disappointed if the BI Dev's didn't even chime in on this thread after seeing those videos. (highlighted for BI!)

Edit: doh

Edited by SpectreRSG

Share this post


Link to post
Share on other sites
One word, two questions, one request, MLNW.

Word: wow!

Thanks!

Question 1: Launch ramps/deck - would it be possible to be able to drive (for example) a CRRC up a ramped deck of another, larger, ship and use some sort of friction coef or anything like that to slow it to a stop? Same could be said about a LPD/LHD type of well deck; would vehicles be able to drive up and down a moving ships ramp deck?

Since the vessels would just slide up the ramp without any need for wheel or track animations, driving a CRRC up a moving LHD's well deck ramp should be doable. Friction co-efficient of the surface materials would be the ideal way to bring a boat like that to a stop, but failing that - or if the PhysX somehow interferes with the operation - it wouldn't be terribly hard to script some custom physics functions to handle such events.

Don't consider this a promise or anything. Because the RV engine uses a multitude of systems to handle different things, one constantly runs into unexpected behaviours when trying to adapt any given script solution to a differnt situation. So, we can't start counting chickens until an actual working implementation is in place, but I believe this should be possible. Do you - or does anyone else - have an LHD model with a roadway LOD'ed ramp included that I could experiment on? FFAA mod perhaps?

Question 2: Does this script restrict being able to access/get into vehicle turrets/positions (if the getinpos was on the deck rather than on the exterior of the ship)?

Well, the currently released demo is a very quick demonstration, so there's pretty much little else you can do with this specific code other than run around the LCS deck. But, in the more general sense, don't think this script technique would incur any such restrictions. The attached object can be either on the outside or on the inside (like an interior deck) of the attachedTo object, and it shouldn't be a problem to get in and out of an attachedTo vehicle's positions after the attach and detach logic was properly updated.

Request: Would this be possible in an MP environment at all? It would be game changing if it was.

Sure. There's no reason per se that this technique wouldn't work in an MP environment, but the real question is desync and smooth performance. I imagine the first step would be to ensure all attached objects have the same locality as the object they are attached to, so any desync would be visual rather than simulated within the world itself. But I'm a total MP coding noob, so I can't offer much more ATM. Maybe somebody with MP coding experience could chime in?

Share this post


Link to post
Share on other sites

MLNW, thanks for your PM I have only just managed to get Internet access (with my phone unfortunately) however this is groundbreaking, Hero of Arma series... And OFP, for that matter, do you know how long this immunity has waited for this? Bravo that man.

Your question with regards to man class falling through the deck is to do with the geometry LoD, I found this out (With help from my teammate phantom, gnat, smoke and mankyle, thank you folks) while developing the frigate, if you would like to walk on a surface ensure that the part within the geo LoD is totally solid, ie no joins, now obviously that can be difficult especially if using split models but whenever feasible, go for a solid component block.

Adding a roadway LoD to bis vehicles might be more than a little tricky, I remember somewhere that there was a mod for the bis osprey from arma 2 which fitted a minigun to the side of the aircraft, I don't know how well that worked in practice but I believe it would work in the same premise. If an addon was created with purely a roadway and geometry LoD that could be attached to the HEMTT then I reckon that it would work, you would have to overcome the geometry LoD of the vehicle however. If it couldn't be done at least now addons makers should be able to to add a roadway LoD to their vehicles and have them working.

About to test this script with the frigate, warning.. I may melt with happiness.

Share this post


Link to post
Share on other sites

Gnat, do any of you modelling gurus know why the man class falls through the LCS deck, and whether it could potentially be fixed or is this always going to be a problem with models of this size?

Yep, the later. Small works fine, i.e. my FSF. (Which I should "A3", so you have another (smaller) test craft)

If it's the latter, I could probably come up with something (ugly and hacky) that works around it. Also, I can't get any of the intersect commands to return the LCS object. Checked through all the available LODs - "FIRE", "VIEW", "GEOM", "IFIRE" - and can't get anything. Again, is this just a WIP problem or a pernament limitation?

Huh? Whats the intersect commands?

As for why BI hasn't done this yet: to be fair to them .....

Booo ! Who wants to be fair :D lol

They weren't listening back in A1 days :)

Share this post


Link to post
Share on other sites

So what are the plans for the future of this script any plans to introduce an activation zone or an action to activate?

Share this post


Link to post
Share on other sites

+5 Gnat :popcornsmilie:

As for why BI hasn't done this yet: to be fair to them, in order to implement a feature like this from their end would require a lot more work. Remember, this is a proof-of-concept; to fully integrate something like this into the game would require that it works for All The Things and in all situations.

Most of us from the beginning have been asking for the same features for the past 6-7 years (able to walk and shoot on moveable vehicles, a actual finished 3d Editor, working bipods, fastroping.... etc..etc..) and nothing has ever been done, always leaving the community to make lemonade out of lemons or in this case watermelons. :yay:

Edited by Sig [USMC]

Share this post


Link to post
Share on other sites

video's are very impressive.

even if you could only get it to work properly for players in MP, you'd be my hero!

And if you ask me, if you'd get it to work for all vehicletypes, you'd definitely have a shot at the contest's prize.

Share this post


Link to post
Share on other sites

So does this work on a per frame basis?

It looks FANTASTIC so far MLNW !! Well done mate. I'm very impressed.

Share this post


Link to post
Share on other sites

Wow nicely done!!

Gnat;2580443'](Which I should "A3"' date=' so you have another (smaller) test craft)[/quote']

:yay:

Share this post


Link to post
Share on other sites
MLNW, thanks for your PM I have only just managed to get Internet access (with my phone unfortunately) however this is groundbreaking, Hero of Arma series... And OFP, for that matter, do you know how long this immunity has waited for this? Bravo that man.

Honestly, I'm in quite a bit of disbeleif that I got even this far on such a long standing problem. Thanks for the kind words. :)

Your question with regards to man class falling through the deck is to do with the geometry LoD, I found this out (With help from my teammate phantom, gnat, smoke and mankyle, thank you folks) while developing the frigate, if you would like to walk on a surface ensure that the part within the geo LoD is totally solid, ie no joins, now obviously that can be difficult especially if using split models but whenever feasible, go for a solid component block.

Yeah, I discovered the no joins thing myself while creating my invisible roadway LOD objects for BIS vehicles.

Adding a roadway LoD to bis vehicles might be more than a little tricky, I remember somewhere that there was a mod for the bis osprey from arma 2 which fitted a minigun to the side of the aircraft, I don't know how well that worked in practice but I believe it would work in the same premise. If an addon was created with purely a roadway and geometry LoD that could be attached to the HEMTT then I reckon that it would work, you would have to overcome the geometry LoD of the vehicle however. If it couldn't be done at least now addons makers should be able to to add a roadway LoD to their vehicles and have them working.

Thanks for the info. Very useful. I'm off to see if I can sort out some of the issues I was getting with the HEMTT last week.

About to test this script with the frigate, warning.. I may melt with happiness.

Word of warning, in order to make the current script work with a different object you'll have to go into the 'position.sqf' file in the 'init' folder and fiddle with the player positioning as it's currently hardcorded to work specifically with LCS. Let me know if you run into any problems and we can try and work them out together.

EDIT:

Gnat;2580443']Yep' date=' the later. Small works fine, i.e. my FSF. (Which I should "A3", so you have another (smaller) test craft)

[/quote']

Damn. That's unfortunate about the LCS. OK, I have an idea for a possible work around, but it's going to be a PITA. This should also work in A2 using the CBA per frame handler, but I'm going to stick with A3 for the moment.

Gnat;2580443']

Huh? Whats the intersect commands?

These guys: intersect' date=' lineIntersects, lineIntersectsWith.

Gnat;2580443']

Booo ! Who wants to be fair lol

They weren't listening back in A1 days

Cool. From the video it looks like there was already a solution six years ago? It's frustrating that the devs aren't more communicative about these things. Also' date=' BSim has apparently implemented this feature into VBS3. Quoting from their press release:

Support for large-scale 3D models for recreating ships, etc. It is now possible to build large-scale, fully-functional 3D models that can can be hundreds of meters long, and consist of millions of polygons. It is possible for characters to walk on them, they can move using any type of vehicle simulation and they can have animated components.

So, this is clearly possible within the RV engine. Maybe we'll see it officially ported to A3 within the year? Who knows?

So what are the plans for the future of this script any plans to introduce an activation zone or an action to activate?

Yes. The attach/detach logic is specifically hardcoded for the purposes of this basic demonstration at this point. It's not a fully operational script, by any means. Couldn't get it working for the frigate? See my earlier comments above.

I'm going to try this with the C-17 and report back

It won't work! For starters, I'm translating the attached object's position relative to the attachetTo object in 2D right now; for an aircraft I'm going to have to do it in 3D.

;2580639']+5 Gnat

Most of us from the beginning have been asking for the same features for the past 6-7 years (able to walk and shoot on moveable vehicles' date=' a actual finished 3d Editor, working bipods, fastroping.... etc..etc..) and nothing has ever been done, always leaving the community to make lemonade out of lemons or in this case watermelons. [/quote']

Yeah, watching some DayZ streams last night and often scratching my head and thinking "Hey, that's a feature the Arma community has been requesting for months. Why isn't this in A3 yet?" Like, functional, animated bipods or functional pistol holsters, for instance. Yup, even DayZ seems to be moving ahead of Arma on the tech curve.

What has frustrated me the most is not even that BIS won't implement features, but that they often won't address outstanding scripting command issues which prevent us from fixing many of these things ourselves. BIS, please try and give us one or the other. It can get incredibly frustrating at times. :(

video's are very impressive.

even if you could only get it to work properly for players in MP, you'd be my hero!

And if you ask me, if you'd get it to work for all vehicle types, you'd definitely have a shot at the contest's prize.

I will defintely try it all! As for the contest: I don't think this is something for the contest. This is an outstanding technical issue that has frustrated Arma players for years, but I don't think the contest is at all about feats of script engineering. It's about delivering an interesting and unique gameplay experience (and not so much from a military sim standpoint either).

So does this work on a per frame basis?

It looks FANTASTIC so far MLNW !! Well done mate. I'm very impressed.

Thank you. Yes, curently it works using the onEachFrame command, but the CBA display EH method would also probably work as well. Don't see how it could be done any way other than re-drawing the attached object's position and facing per render frame.

Again, thanks for all the encouragment, guys! We'll try and take this as far as the technology allows.

Edited by Make Love Not War

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×