Jump to content
Sign in to follow this  
NightIntruder

Dynamic Flight Model of helicopter - my try

Recommended Posts

What I want to achieve (with great help of silderoy and others) is to make changes in FM of helicopter by introducing dependency on how many soldiers are onboard. I made several sets of boxes (actually 20) with different mass assigned to them in Geo LOD (only there). By hide na unhide specific set I hoped to change FM constantly during a mission. Beside the fact that counting soldiers works (max cargo is 20), a rest of things don't. Of course, bones and sections were properly declared and the classAnimations content was also copied into model.cfg.

Probably the problem is that value of variable "_inChopper" (H21cargo.sqf) doesn't fuel variable "hideValue" in classAnimations part of config.cpp, as I can see now. How to resolve that? By adding classUserAction? By another script? Is it even doable? Do you see any errors apart from it?

Having this problem solved, I guess it may be used for changing FM depending on fuel onboard, amount of crates, lifted vehicles and so on.

config.cpp - class AnimationSources

	class AnimationSources
	{
		class WipersOn
		{
			source = "user";
			animPeriod = 1.5;
			initPhase = 0;
		};
		class WipersOff
		{
			source = "user";
			animPeriod = 1.5;
			initPhase = 1;
		};
		class 4800mass_hide
		{
			source="user";
			animPeriod = 0.01;
			initPhase = 0;
		};
		class 4800mass_unhide
		{
			source="user";
			animPeriod = 0.01;
			initPhase = 0;
		};
.
.
.
.

		class 8800mass_hide
		{
			source="user";
			animPeriod = 0.01;
			initPhase = 0;
		};
		class 8800mass_unhide
		{
			source="user";
			animPeriod = 0.01;
			initPhase = 0;
		};

config.cpp - class eventhandlers

	class eventhandlers
	{
		init = "[_this select 0] exec ""\int73_h21c\init.sqf""";
	};

config.cpp - classAnimations

	class Animations
	{
		class 4800mass_hide
		{
			type="hide";
			source="user";
			selection="4800mass";
			axis=""; 
			memory=0;
			animPeriod=0;
			sourceAddress="clamp";
			minValue = 0;
			maxValue = 20;
			hideValue = 1;
		};
		class 4800mass_unhide
		{
			type="hide";
			source="user";
			selection="4800mass";
			axis=""; 
			memory=0;
			animPeriod=0;
			sourceAddress="mirror";
			minValue = -20;
			maxValue = 0;
			hideValue = 0;
		};
.
.
.
		class 8800mass_hide
		{
			type="hide";
			source="user";
			selection="8800mass";
			axis=""; 
			memory=0;
			animPeriod=0;
			sourceAddress="clamp";
			minValue = 0;
			maxValue = 20;
			hideValue = 20;
		};
		class 8800mass_unhide
		{
			type="hide";
			source="user";
			selection="8800mass";
			axis=""; 
			memory=0;
			animPeriod=0;
			sourceAddress="mirror";
			minValue = -20;
			maxValue = 0;
			hideValue = 19;
		};
	};
};		

init.sqf - it works, just as a reference

_heli = _this select 0

[_heli] execVm "\int73_h21c\scripts\H21wipers.sqf";
[_heli] execVm "\int73_h21c\scripts\H21cargo.sqf";

#mainloop
~0.1
?!(alive _heli): exit
#cont

goto "mainloop"

H21cargo.sqf - it also works since I receive continues counting in hint of "Man in cargo: X"

_heli = _this select 0;
while {alive _heli} do {
_inChopper = {vehicle _x == _heli} count allUnits;
hint format ["Man in cargo: %1%", _inChopper];
sleep 5;
};  

Edited by NightIntruder

Share this post


Link to post
Share on other sites

Anyone, please ?

I'm looking for someone who will explain me relations between "hide" function + its values and scripting on the other side. Someone must know how to put value of a variable into config.cpp!

EDIT: I added class userActions but it didn't help.

class UserActions
	{
		class mass
		{
			displayName = "";
			position = "action";
			radius = 5;
			condition = "";
			statement = true;
			onlyforplayer = 1;
			priority = 0;
			showWindow = 0;
		};
		class 4800mass_hide : mass
		{
			condition = "_inChopper != 0";
		};
		class 4800mass_unhide : mass
		{
			condition = "_inChopper = 0";
		};
.
.
.
		class 8800mass_hide : mass
		{
			condition = "_inChopper != 20";
		};
		class 8800mass_unhide : mass
		{
			condition = "_inChopper = 20";
		};

Edited by NightIntruder

Share this post


Link to post
Share on other sites

In AnimationSources you only need a _hide. You dont need another one called _unhide

I assume you errored

The 2nd "config.cpp - classAnimations"

Assume thats MODEL.CFG

So same applies for "Animations", you only need a _hide. You dont need another one called _unhide

Wheres your skeleton ?

Does it have "4800mass" in it ?

In future I'd suggest you post ALL code if you want some help.

By the way, from my prior experiements with moving/animated weights ...... didn't work. Model weight is STATIC once the addon is loaded into memory.

(I was animating wing tip weights, trying to change aircraft roll-rate)

Just saying. Maybe RV engine might have changed since.

Edited by [APS]Gnat

Share this post


Link to post
Share on other sites

Hello. good job to attempt that. chopper flight model could use an improvement !

Share this post


Link to post
Share on other sites

GNAT, griffz

Thanks for replies gents.

@GNAT

Yes, all sets of weight from GeoLOD have been declared in both skeleton and section parts of the config.cpp. All required information from config.cpp have been copied into model.cfg including bones, sections and animations. Still I don't know why it doesn't work. So far, it seems that all "weight sets" are added toghether during binarize and baked into model consequently the weight of the heli remains constant (and enormous!). Anyway, thanks for tip on AnimationSources, I will give it a try. If it doesn't help I will paste all code here tomorrow.

I hope someone from BIS staff is able to answer the question whether it is doable or not. I just wasting my time with endless tries which may end up with....well just waste.

@griffz

Do you mean that you have tried this method and the attempt was succesfull?

Share this post


Link to post
Share on other sites

Since I don't know everything that you're doing, I might be out to lunch here. But, considering armas behaviour, I don't think adding mass will achieve what you think it would achieve in a rational world. This means you might have to do a lot of experimentation to find the behaviour in the outside boundaries of mass in Arma.

A very important consideration in the handling of a helicopter is its available power. Weight plays a significant factor in the way a helicopter behaves because of the reduction of that. Arma doesn't really model engine power in any way, shape, or form. There is an assumption that the vehicle will have enough power to perform at any weight.

In the real world, adding weight to any aircraft will decrease its top speed and fuel efficiency. In ArmA, adding weight to any vehicle makes it faster, and given that it's faster, also makes it more fuel efficient. Adding weight has some effect on maneuverability, but not so much as to make you unable to pull aerobatics. In fact, the Arma engine is very sensitive to weight distribution, so increasing a vehicle's weight near the centre of mass will actually make it way more agile.

Case and point, the cwr2 ah-1's total weight is 7,000 kg. The hind is 11,000 kg. The added 36% (4,000kg!) in weight makes the hind the faster aircraft, and the added width makes it the more benign to fly. And to fly the hind, you certainly don't notice the hind is lacking in any engine power or maneuverability.

Another thing I found is that the engine REALLY doesn't like a lot of mass volumes. Originally I had mass volumes for all of the major weight contributing components like ammunition, fuel, engine, transmission, crew, etc and the result was the aircraft would 'fall out' of the flightmodel and tumble erratically until it hit the ground.

Share this post


Link to post
Share on other sites

Well, thats a very resonable point of view Max. I don't want to play with the system how the ARMA deal with mass/fuel/air efficiency, because I've already found out what you have mentioned - it gives directly opposite results. The goal is to make the difference in steering of helicopter to make just immersion of greater weight of heli for pilots, not to find a bypass of ARMA engine limitations. Those "weight boxes" (mass volumes?) are to be added far from CoG in order to make the immersion. At the moment, I just stucked in the situation where all boxes are counted which means that H21 with empty weight of 4100 kg became an aircraft carrier with its weight equal 100 000 kg. I can easily remove unwanted boxes and live with it, but I wanted to explore possibilities given by the ARMA's engine. By the way, I did a lot of tries with mass volumes and didn't notice a strange behaviours of the heli but the truth is that they are all outside the heli's fuselage.

I need a clear answer to the question (whether hiding/unhiding objects in GeoLOD affect the model's weight dynamically) to stop or develop DFM. Maybe some day someone will come up with more clever way of dealing with the problem.

Thanks for you input Max, I appreciate it.

Edited by NightIntruder

Share this post


Link to post
Share on other sites

I don't think anyone has done that before so I think you'd have to do a test. You could do a top speed test at a given weight, and then make an unhide animation similar to a wheeled vehicle's destroyed wheel proxy. You don't even have to have it unhide at any point. If the top speed is different then you know.

Another issue might be that helicopters never really get that sluggish to command inputs so the difference in handling may be subtle.

Share this post


Link to post
Share on other sites

Well, actually I recieved answer today by PM which says that changes in weight and balance of the model during gamplay are not possible. It says also that you can hide/unhide/animate objects in GeoLOD however it doesn't affect flying characteristics unfortunatelly. Only geometric bounds of the model are affected. It's pitty but that's life. Big thanks goes to everyone involved in this issue.

Share this post


Link to post
Share on other sites
I don't think anyone has done that before

As I did, Rock (RKSL-Rock) has in the past. We had a chat about it last year. Rock commented he thought it was broken but hadnt tested recently.

@NightIntruder

Don't count on BIS chipping in on this thread, they don't often answer technical questions.

Get ready to have to prove it yourself.

Tip: place copies of your named "boxes" into the Resolution LOD during the testing phase so you can actually see whether the boxes is animated/moving or hiding/unhiding.

Share this post


Link to post
Share on other sites
Well, actually I recieved answer today by PM which says that changes in weight and balance of the model during gamplay are not possible. It says also that you can hide/unhide/animate objects in GeoLOD however it doesn't affect flying characteristics unfortunatelly. Only geometric bounds of the model are affected. It's pitty but that's life. Big thanks goes to everyone involved in this issue.

As Gnat said I've already been through this a couple of years ago and I came to several conclusions:

  1. The flight characteristics appear only to be read properly at init.
  2. The faster the model moves the less often the geometry is "read" and has less real time effect.
  3. Hide animation makes no difference to mass once initialized.
  4. Unhiding mass after init also makes no difference.
  5. Moving mass via animation in flight makes little or no difference.

I had a pretty extensive plan for dynamic flight models at the time. I spent nearly 6 months experimenting with each new patch and got some mixed results. But When tabulated they really made very little difference but only at low speed. Increase the speed to over 150kph and you might as well forget it. Maybe with ArmA3 and PhysX this will change.

Share this post


Link to post
Share on other sites

@GNAT

Thanks for great tip! I will give it a try.

@RKSL

I hope so. Thanks mate for sharing your experience. If my try fails then waiting would be the only option left , but this is not a real dissaster. Simply, the model would have one feature less and I would have a little free time more to explore other things;)

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
Sign in to follow this  

×