• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

LOD asm code problem

Messages
187
Country
hungary
Hello,

i'm trying to create a LOD model for my tower. I read the tutorial in the wiki.

here is my main code:

Code:
header label word
    dw      0001            ; 00 World set number   
    dd      000507448H          ; 02 North bound        
    dd      000507440H          ; 06 South bound        
    dd      00DB1C815H          ; 10 East bound         
    dd      00DB1C813H          ; 14 West bound         
    dw      20 dup(0)                               
    dd      (offset OBJECT_DATA) - (offset header)
    dw      33 dup(0)                               

OBJECT_DATA label word                                  
    db  21              ;;LATBAND_REL                   
    dw  0283Ah          ;;lat min (inclusive) 512M units
    dw  0283Bh          ;;lat max (exclusive)           
    dd  (offset OBJECT_0) - (offset OBJECT_DATA)        
    db  0               ;;EOL                           
OBJECT_0 label    BGLCODE
    db  12                      ; NEAR_FAR_HUGE_OBJECT_HEADER
    dd  000507444h,00DB1C814h           ; latitude,longitude          
    db  100                     ; image power                 
    dd  (offset OBJECT_0_END) - (offset OBJECT_0)             
OBJECT_0_START label word
    IFIN1       OBJECT_0_FAIL, image_complex, 2, 32767
    ADDOBJ      OBJECT_0_SCALE
    SHADOW_CALL OBJECT_0_SCALE
OBJECT_0_FAIL label    BGLCODE
    BGL_JUMP_32 OBJECT_0_END  
OBJECT_0_SCALE label    BGLCODE
    SCALE_AGL   OBJECT_0_RETURN, 10000, 35, 131072, 000507444h, 0C60Bh, 00DB1C814h, 0FEECh, 0, 0
    BGL_CALL        OBJECT_0_BEGIN
OBJECT_0_RETURN label word
    BGL_RETURN
OBJECT_0_BEGIN label word
model_outside    label    BGLCODE
    BGL_CALL model_crash

    IFSIZEV object_LOD_0000_1L, 10000, 1000
    BGL_JUMP_32 LOD_0000_0L
    object_LOD_0000_1L label word
    BGL_JUMP_32 LOD_0000_1L

model_shadow label BGLCODE

model_inside  label    BGLCODE
    BGL_RETURN
model_crash label BGLCODE
    BGL_CRASH_START   model_crash_end, 8
    BGL_CRASH_OCTTREE  crash_end_1
    dw     CRASH_FLAG_OBJECT            ; crash type
    dw     16            ; nodes used
    real4  -7.758383,0.000000,-4.647968      ; Box x,y,z 
    real4  22.965607,68.896820,22.965607      ; Box w,h,d 
    dw   1,   8,   8,  16,  16,  16,  16,  16    ; base offset into node table, one for each top-level branch
    ; So if you take branch 2 (count from 0), you add 8 to indices you encounter on that branch
    ; Nodes (254=empty 255=full, else an index into branch)
    OCTTREE_NODE     0, 254,   0, 254, 254, 254, 254, 254           ; node   0
    OCTTREE_NODE     1,   2,   3,   4,   5, 254,   6, 254           ; node   1
    OCTTREE_NODE   254, 254, 254, 255, 254, 255, 255, 255           ; node   2
    OCTTREE_NODE   254, 254, 254, 254, 255, 254, 255, 254           ; node   3
    OCTTREE_NODE   254, 254, 254, 254, 254, 255, 254, 255           ; node   4
    OCTTREE_NODE   254, 254, 254, 254, 255, 254, 255, 254           ; node   5
    OCTTREE_NODE   254, 255, 254, 255, 254, 254, 254, 254           ; node   6
    OCTTREE_NODE   254, 255, 254, 255, 254, 254, 254, 254           ; node   7
    OCTTREE_NODE     1,   2,   3,   4,   5, 254,   6,   7           ; node   8
    OCTTREE_NODE   254, 254, 254, 254, 254, 255, 254, 255           ; node   9
    OCTTREE_NODE   254, 254, 254, 254, 255, 254, 254, 254           ; node  10
    OCTTREE_NODE   254, 254, 255, 255, 254, 255, 255, 255           ; node  11
    OCTTREE_NODE   254, 254, 255, 255, 254, 254, 255, 255           ; node  12
    OCTTREE_NODE   254, 255, 254, 254, 254, 254, 254, 254           ; node  13
    OCTTREE_NODE   254, 254, 255, 255, 254, 254, 254, 255           ; node  14
    OCTTREE_NODE   254, 254, 255, 254, 254, 254, 255, 254           ; node  15
crash_end_1 label word
model_crash_end label word
    BGL_RETURN


LOD_0000_0L label word
include tower_1_0.asm

LOD_0000_1L label word
include tower_0_0.asm


OBJECT_0_END label word
EOF

Whats the problem with it? In FS only visible the tower_1_0.asm model and the other one never.
 
Hi,

First, is there a good reason why you still use the Fs2002 gamepack for this? In general it would be best to use the Fs2004 gamepack.

Now to the problem, the code looks correct. Are you sure that the values you used are realistic? It could be that the condition never fails.
 
arno said:
Hi,

First, is there a good reason why you still use the Fs2002 gamepack for this? In general it would be best to use the Fs2004 gamepack.

Now to the problem, the code looks correct. Are you sure that the values you used are realistic? It could be that the condition never fails.


Hmm yeah, maybe the values are the problems. But i found another way to do lods (with dummys).

Are you sure that the 3D objects exported with FS2004 gamepack produce better FPS?
 
They seems to give slightly better performance in general, although it depends on a lot of factors of course (like always).

Also it is obviously a better path for the future.
 
Back
Top