Re: [Flightgear-devel] An2 fixes for MP

2007-06-04 Thread AJ MacLeod
On Monday 04 June 2007 06:15, Yurik V. Nikiforoff wrote:
 When I write model, I don't take care about MP abilites, so I say big
 thanks for you and you work.
 Let's it to go to CVS.
No problem - it likely would have gone unnoticed for much longer had it not 
been for the volume of traffic at EDDI last week :-)

 What's a rules for right MP animations? Should I not use leading slashes
 for properties? for default properties only or for custom props too?

Basically, the leading slash makes the path absolute; so for 
example /surface-positions/flap-pos-norm will always be controlled by the 
main, local FDM running.

That means that if your 3d model uses that path to animate the flaps, in MP 
everyone who sees an An2 will see the flaps on that model controlled by their 
own FDM, not the other pilot.

If you use the relative surface-positions/flap-pos-norm for the animation 
though, when the An2 is used as an AI model as in MP, the actual path that is 
read might be /ai/models/multiplayer[0]/surface-positions/flap-pos-norm and 
the animations will then be relevant to each particular instance of the An2.

For custom properties there is not quite the same urgency since they're not 
passed by the MP protocol (yet), but unless there is a good reason to use an 
absolute path I think it would be wise to avoid them.

In my patch I left some of your custom properties with leading slashes - they 
should probably be removed too, but I didn't want to interfere with someone 
else's model more than absolutely necessary.

Hopefully the above is fairly correct, it's still a bit early on a Monday 
morning for me to be thinking ;-)

Cheers,

AJ

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] An2 fixes for MP

2007-06-02 Thread AJ MacLeod
Attached is a diff for the An2 which makes it work properly in MP sessions.

The FDM modifications just provide the standard normalised control surface 
position outputs and don't affect the flight characteristics at all.

Leading slashes in the model.xml have been removed, and the standard 
properties (created in the FDM update, above) are used to animate the control 
surfaces.

Yurik - could you check and approve this, so it can go into CVS?

Cheers,

AJ
? an2.diff
? an2.diff.1
Index: an2.xml
===
RCS file: /var/cvs/FlightGear-0.9/data/Aircraft/an2/an2.xml,v
retrieving revision 1.3
diff -u -p -r1.3 an2.xml
--- an2.xml	24 May 2007 20:41:58 -	1.3
+++ an2.xml	2 Jun 2007 13:05:06 -
@@ -243,6 +243,7 @@
 min -1 /min
 max  1 /max
   /clipto
+  outputfcs/elevator-pos-norm/output
/summer
 
aerosurface_scale name=Elevator Control
@@ -274,6 +275,14 @@
   /range
   outputfcs/left-aileron-pos-rad/output
/aerosurface_scale
+   aerosurface_scale name=Left Aileron Control norm
+  inputfcs/roll-trim-sum/input
+  range
+min -1 /min
+max  1 /max
+  /range
+  outputfcs/left-aileron-pos-norm/output
+   /aerosurface_scale
 
aerosurface_scale name=Right Aileron Control
   inputfcs/roll-trim-sum/input
@@ -283,6 +292,14 @@
   /range
   outputfcs/right-aileron-pos-rad/output
/aerosurface_scale
+   aerosurface_scale name=Right Aileron Control norm
+  inputfcs/roll-trim-sum/input
+  range
+min -1 /min
+max  1 /max
+  /range
+  outputfcs/right-aileron-pos-norm/output
+   /aerosurface_scale
 
   /channel
 
@@ -305,6 +322,15 @@
   outputfcs/rudder-pos-rad/output
/aerosurface_scale
 
+   aerosurface_scale name=Rudder Sum
+  inputfcs/rudder-command-sum/input
+  range
+min -1 /min
+max  1 /max
+  /range
+  outputfcs/rudder-pos-norm/output
+   /aerosurface_scale
+
   /channel
 
 channel name=Flaps
Index: Model/an2-model.xml
===
RCS file: /var/cvs/FlightGear-0.9/data/Aircraft/an2/Model/an2-model.xml,v
retrieving revision 1.3
diff -u -p -r1.3 an2-model.xml
--- Model/an2-model.xml	24 May 2007 20:41:58 -	1.3
+++ Model/an2-model.xml	2 Jun 2007 13:05:06 -
@@ -1009,7 +1009,7 @@
 	object-nameobj71/object-name
 	condition
 		less-than
-			property/engines/engine/rpm/property
+			propertyengines/engine/rpm/property
 			value600/value
 		/less-than
 	/condition
@@ -1020,7 +1020,7 @@
 	object-nameobj83/object-name
 	condition
 		greater-than
-			property/engines/engine/rpm/property
+			propertyengines/engine/rpm/property
 			value600/value
 		/greater-than
 	/condition
@@ -1032,7 +1032,7 @@
 	
 	typespin/type
 	object-nameobj71/object-name
-	property/engines/engine/rpm/property
+	propertyengines/engine/rpm/property
 	
 	center
 		x-m0/x-m
@@ -1050,7 +1050,7 @@
 	
 	typespin/type
 	object-nameobj70/object-name
-	property/engines/engine/rpm/property
+	propertyengines/engine/rpm/property
 	
 	center
 		x-m0/x-m
@@ -1068,7 +1068,7 @@
 	
 	typespin/type
 	object-nameobj83/object-name
-	property/engines/engine/rpm/property
+	propertyengines/engine/rpm/property
 	factor0.005/factor
 	center
 		x-m0/x-m
@@ -1095,7 +1095,7 @@
 animation
 	typerotate/type
 	object-namerudder/object-name
-	property/controls/flight/rudder/property
+	propertysurface-positions/rudder-pos-norm/property
 	factor-28/factor
 	axis
 		x1-m5.52/x1-m
@@ -1113,7 +1113,7 @@
 animation
 	typerotate/type
 	object-namerear_wheel/object-name
-	property/controls/flight/rudder/property
+	propertysurface-positions/rudder-pos-norm/property
 	factor-28/factor
 	axis
 		x1-m4.60/x1-m
@@ -1133,7 +1133,7 @@
 	object-nameobj75/object-name
 	object-nameelev_trim_left/object-name
 	object-nameelev_trim_right/object-name
-	property/controls/flight/elevator/property
+	propertysurface-positions/elevator-pos-norm/property
 	interpolation
 		entryind	-1/inddep	-42/dep/entry
 		entryind	0/inddep	0/dep/entry
@@ -1156,7 +1156,7 @@
 animation
 	typerotate/type
 	object-nameobj79/object-name
-	property/controls/flight/aileron/property
+	propertysurface-positions/left-aileron-pos-norm/property
 	interpolation
 		entryind	-1/inddep	30/dep/entry
 		entryind	0/inddep	0/dep/entry
@@ -1178,7 +1178,7 @@
 animation
 	typerotate/type
 	object-nameobj76/object-name
-	property/controls/flight/aileron/property
+	propertysurface-positions/right-aileron-pos-norm/property
 	interpolation
 		entryind	-1/inddep	14/dep/entry
 		entryind	0/inddep	0/dep/entry
@@ -1202,7 +1202,7 @@
 animation
 	typerotate/type
 	object-nameobj81/object-name
-	property/surface-positions/flap-pos-norm/property
+	propertysurface-positions/flap-pos-norm/property
 	factor39/factor
 	center
 		x-m-1.35/x-m
@@ -1219,7 +1219,7 @@
 animation
 	typetranslate/type
 	object-nameobj81/object-name
-	property/surface-positions/flap-pos-norm/property
+