MS/FS Netpipes SDK ObjectID question

G

Guest

Guest
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)

Hello, my goal is to drive microsoft flight sim using an external data
source. I read the netpipes SDK and am in the process of creating the
binary conversion program from my data source to the "flight video"
..fsr format. I have questions about the section regarding the
"ObjectID" field in the "OBID" data section. According to the SDK:

"The object ID is an ID for a class of objects. Specific instances of
the object will be given a compound ID created from two keys. The
object ID will be in the upper 4 bits of the word, and the lower 12
bits will be the instance ID. Because of this arrangement, the object
ID in the Object Definition must be provided under the mask 0xf000. The
lower 12 bits of this field MUST be 0 in this record."

3 questions arise from this. First, it's my assumption that this
objectID has a direct relationship to a single plane i.e. the one
you're flying. Am I correct?

Second, if my first assumption is true then that means that there are
only 4 bits or 16 unique IDs available. Meaning that there can only be
16 planes (15 surrounding + the one you're flying) that can be
recorded/played back in the flight video. This seems small but then
again, 16 planes in your field of view is a lot I guess. Again, is
this a correct assumption?

Third, I haven't worked with bitwise operations in a while. How do I
get my identifying bits to the left-most 4 bit positions? i.e. WORD
objectID = 12; would have the following bit positions:

0000000000001100
Since I need to use only the left-most 4 bit positions for my objectID,
then I need to somehow move the rightmost 4 bits to the opposite side.
How do I do this in c++?

Thanks for any help/pointers anyone can provide. If I'm in the wrong
group for this, please _kindly_ point me to the correct group.
 
G

Guest

Guest
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)

This is off topic as it has everything to do with flight sims and nothing to
do with politics, religion, etc. <grin>

Actually, I think everyone here that knew enough about programming to answer
your question was chased away by all the politics / religion, etc posts
long, long ago.

There are a lot of more technically oriented (and faithfully on topic)
discussion groups associated with web sites... I'd pic my sim of interest
and try there. If nothing else, let me suggest
alt.games.microsoft.flight-sim... lots of folks on there that are better
able to answer such a technical question than here.


<netkev@gmail.com> wrote in message
news:1117236841.215653.5720@g14g2000cwa.googlegroups.com...
> Hello, my goal is to drive microsoft flight sim using an external data
> source. I read the netpipes SDK and am in the process of creating the
> binary conversion program from my data source to the "flight video"
> .fsr format. I have questions about the section regarding the
> "ObjectID" field in the "OBID" data section. According to the SDK:
>
> "The object ID is an ID for a class of objects. Specific instances of
> the object will be given a compound ID created from two keys. The
> object ID will be in the upper 4 bits of the word, and the lower 12
> bits will be the instance ID. Because of this arrangement, the object
> ID in the Object Definition must be provided under the mask 0xf000. The
> lower 12 bits of this field MUST be 0 in this record."
>
> 3 questions arise from this. First, it's my assumption that this
> objectID has a direct relationship to a single plane i.e. the one
> you're flying. Am I correct?
>
> Second, if my first assumption is true then that means that there are
> only 4 bits or 16 unique IDs available. Meaning that there can only be
> 16 planes (15 surrounding + the one you're flying) that can be
> recorded/played back in the flight video. This seems small but then
> again, 16 planes in your field of view is a lot I guess. Again, is
> this a correct assumption?
>
> Third, I haven't worked with bitwise operations in a while. How do I
> get my identifying bits to the left-most 4 bit positions? i.e. WORD
> objectID = 12; would have the following bit positions:
>
> 0000000000001100
> Since I need to use only the left-most 4 bit positions for my objectID,
> then I need to somehow move the rightmost 4 bits to the opposite side.
> How do I do this in c++?
>
> Thanks for any help/pointers anyone can provide. If I'm in the wrong
> group for this, please _kindly_ point me to the correct group.
>
 
G

Guest

Guest
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)

thanks, I'll try there. BTW, I found the answer to the third question.
"var <= 12" will shift the bits to the left 12 times which will move
the right-most 4 bits to to the left-most 4 bits.
 
G

Guest

Guest
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)

It dosen't sound to me like you are limited to only 16 planes. I can
see how you would be limited to 16 TYPES of planes. To me, snippet of
documentation provided below does not imply any specific limit to the
number of INSTANCES (well, 4095 is presumably the max, since that is
the capacity of the remaining 12 bits). I'm sure the practical max is
far lower than that!

Each instance would have 4 bits of object ID data, and 12 bits of
instance id data... So you could have 3 instances of P51D Mustang.
Each having the same object ID, but with a different instance ID.

This is just my 2 cents. Please note that I have read NONE of the SDK
documentation other than what you posted.



On 27 May 2005 16:34:01 -0700, netkev@gmail.com wrote:

>Hello, my goal is to drive microsoft flight sim using an external data
>source. I read the netpipes SDK and am in the process of creating the
>binary conversion program from my data source to the "flight video"
>.fsr format. I have questions about the section regarding the
>"ObjectID" field in the "OBID" data section. According to the SDK:
>
>"The object ID is an ID for a class of objects. Specific instances of
>the object will be given a compound ID created from two keys. The
>object ID will be in the upper 4 bits of the word, and the lower 12
>bits will be the instance ID. Because of this arrangement, the object
>ID in the Object Definition must be provided under the mask 0xf000. The
>lower 12 bits of this field MUST be 0 in this record."
>
>3 questions arise from this. First, it's my assumption that this
>objectID has a direct relationship to a single plane i.e. the one
>you're flying. Am I correct?
>
>Second, if my first assumption is true then that means that there are
>only 4 bits or 16 unique IDs available. Meaning that there can only be
>16 planes (15 surrounding + the one you're flying) that can be
>recorded/played back in the flight video. This seems small but then
>again, 16 planes in your field of view is a lot I guess. Again, is
>this a correct assumption?
>
>Third, I haven't worked with bitwise operations in a while. How do I
>get my identifying bits to the left-most 4 bit positions? i.e. WORD
>objectID = 12; would have the following bit positions:
>
>0000000000001100
>Since I need to use only the left-most 4 bit positions for my objectID,
>then I need to somehow move the rightmost 4 bits to the opposite side.
>How do I do this in c++?
>
>Thanks for any help/pointers anyone can provide. If I'm in the wrong
>group for this, please _kindly_ point me to the correct group.
 
G

Guest

Guest
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)

Good point but you missed the second half the SDK I posted.

"Because of this arrangement, the object
ID in the Object Definition must be provided under the mask 0xf000. The

lower 12 bits of this field MUST be 0 in this record."

I have no control over the last 12 bits; I must make them 0 and they
are used internally in flight sim.