Fix Upgrades/Models overlapping first model in Showroom(Spinner)

Discussion in 'Car Modding' started by svictor, Jan 22, 2020.

  1. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    565
    Likes Received:
    3,593
    This issue/bug has been mentioned a few times before, there are some insightful discussions, but solution wasn't clearly pieced together.
    Two important discussions that mentioned a core reason behind the issue, which is naming:
    Very Annoying problem with Spinner and Upgrades
    Annoying upgrade problem
    After a long time of searching and testing, I finally come to some working solutions.

    The issue(or bug):
    1. If a car has multiple upgrades of a single part, let's say "Front Bumper", and you go into showroom to select one of the "Front Bumper" upgrades that isn't the first one on the list, you will see this "Front Bumper" is overlapping with the first one/3D model, same applies to all the other upgrades that ain't the first one.
    2. This overlap issue only happens in Showroom(Spinner), everything works fine on track.

    Reason/Cause:
    1. Some weird naming is forced on upgrades, if you choose the wrong naming format, your upgrades will overlap each other, but this is not the only cause.
    2. The <something> substitute must be a complete substitute of a file name, otherwise your upgrades will also overlap each other.

    Solution:
    1. All the <something> substitute MUST contain/start with the same name from that "Instance" in SPINNER.gen.
    Example:
    if instance named "Instance=FBUMPER", then "FBUMPER" will be the prefix that you have to use for every substitute, such as <FBUMPER01>, <FBUMPER_BIG>, <FBUMPERCOOL>.
    What won't work: anything doesn't start with "FBUMPER", such as <01FBUMPER>, <FRONTBUMPER01> etc.

    2. Next, you need to fully substitute a file name in SPINNER.gen.
    Example:
    In SPINNER.gen wrote: MeshFile=<FBUMPER01> CollTarget......
    Then in UPGRADES.ini wrote: GEN=<FBUMPER01>=CAR_FBUMPER_LODA.gmt
    What won't work: a common practice is partially substitute a file name, which will cause ovelapping in Showroom, such as "MeshFile=CAR_FBUMPER_<FBUMPER01>.gmt".

    3. Now if you really want to partially substitute a file name (which makes life a lot easier for main .gen file), you can just replace the partial one with full substitution in SPINNER.gen, then add a corresponding entry in UPGRADES.ini as showroom workaround.
    Example:
    in main .gen
    Instance=FBUMPER
    {
    Moveable=True
    <MAX> MeshFile=CAR_FBUMPER_LOD<FBUMPER_TYPE>.gmt
    <HIGH> MeshFile=CAR_FBUMPER_LOD<FBUMPER_TYPE>.gmt
    <MED> MeshFile=CAR_FBUMPER_LOD<FBUMPER_TYPE>.gmt
    }

    in SPINNER.gen
    Instance=FBUMPER<UPNUMBER>
    {
    Moveable=True
    MeshFile=<FBUMPER01>
    }

    in UPGRADES.ini
    UpgradeType="Front Bumper"
    {
    Instance="FBUMPER"
    UpgradeLevel="Type A"
    {
    GEN=<FBUMPER01>=CAR_FBUMPER_LODA.gmt // showroom workaround
    GEN=<FBUMPER_TYPE>=A // for main gen
    }
    UpgradeLevel="Type B"
    {
    GEN=<FBUMPER01>=CAR_FBUMPER_LODB.gmt // showroom workaround
    GEN=<FBUMPER_TYPE>=B // for main gen
    }
    }

    ------------------------------------------------------
    There is also another workaround: just hide the model in first upgrade level, so nothing can be overlapped, but not really useful.

    Last, there is still some very rare case where the above solution wouldn't work (I have only encountered one so far). If DEV saw this, please take a look at this whole spinner issue. If there is anything missing or wrong, please help and comment, thanks.
     
  2. Bernd

    Bernd Registered

    Joined:
    Jul 9, 2013
    Messages:
    1,509
    Likes Received:
    752
    Some more things to care for:
    In the SPINNER.gen:
    - all instances that have upgrades, have to be tagged with <UPNUMBER>.
    Example: Instance=whatever<UPNUMBER>
    - before the first upgrade is used, there must be the entry <STARTUPGRADES>, that should get an own line.
    And behind of the last upgrade, you can use the tag <STOPUPGRADES>

    One important thing in the upgrades.ini is, that you don't use the same Instance= entries for different upgrades.
    Example:
    You want to have upgrades for the rims and for the brakediscs.
    These parts are together in the "main" gen files 4 XXTIRE instances.
    So you normally would have to use the entries
    Instance=LFTIRE
    Instance=RFTIRE
    Instance=LRTIRE
    Instance=RRTIRE
    for both of the upgrade types in the upgrades.ini.
    But that can cause conflicts with the selection.

    The Instance=... entries in the upgrades.ini, that are also important for the naming of the upgrade placeholders, have to match the instances= entries in the spinner gen only!
    It don't matters in which instance the upgrades appear in the main gen file.

    So for the example above, where you want to use upgrades for rims and brakediscs, just create new instances in the spinner gen.
    For the rims, for example:
    Instance=LFRIM
    Instance=RFRIM
    Instance=LRRIM
    Instance=RRRIM
    Placeholders are <LFRIM...>, <RFRIM...>.....
    and for the brakediscs, for example:
    Instance=LFBDISC
    Instance=RFBDISC
    Instance=LRBDISC
    Instance=RRBDISC
    Placeholders are <LFBDISC...>, <RFBDISC...>.....
    In this way, you can avoid any conflicts.

    A good example of "how to not set it up properly", ist he camaro GT3 2012, where you don't see the rims changing in the spinner, when you switch between model 2012 and 2013. :)
     
    svictor likes this.
  3. DelayedMeteor43

    DelayedMeteor43 Registered

    Joined:
    Aug 6, 2019
    Messages:
    11
    Likes Received:
    0
    I want the body of my car to change depending on the type of race track, just graphically speaking though. I have the models converted I just need to know how to implement them into the .gen, spinner.gen, and upgrades.ini so you can graphically see the changes?
     
  4. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,118
    Likes Received:
    1,597
    Look at the skip barber in the devmode folder, you'll want the TrackConfigBase file to force the upgrades on certain tracks.
     
  5. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    565
    Likes Received:
    3,593
    Just discovered one more thing relate to HDV upgrades:

    HDV file must contain at least one empty line after the last line entry (usually is BrakeGlow), otherwise any HDV upgrades selected in showroom won't work. Also this empty line is needed for rF2 Online-Tools' flex chassis generator to generate correct HDV, otherwise the last entry will get deleted.
     
    Gilles Benoit and Mauro like this.
  6. doddynco

    doddynco Registered

    Joined:
    Dec 13, 2017
    Messages:
    382
    Likes Received:
    759
    I tried everything but I couldn't get the parts to swap in the showroom. I could get the part to detach as the rest of vehicle rotated, and I believe this is because the rear wing was under 'Instance=SLOT<ID>' in the spinner. I tried to create its own instance but then it separated. I want to swap the whole body in the upgrades too but I couldn't find a way to do it either- is that possible? Spent far too many hours trying the figure that out.

    Does visual part swapping in the showroom still definitely work?
     
  7. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    6,010
    Likes Received:
    3,490
    I convinced @Corti to add a tall wing (historically incorrect so a HUGE THANKYOU TO Corti) to the M8c Mclaren Can-Am car. But in the showroom, all you can see is the original low wing option. Here is hoping somebody figures this out.
     
  8. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,118
    Likes Received:
    1,597
    Can you post your spinner gen?
     
  9. doddynco

    doddynco Registered

    Joined:
    Dec 13, 2017
    Messages:
    382
    Likes Received:
    759
    I would like to load thl1_carbody.GMT and thl1_rearwing.gmt in the upgrades menu. In the main gen file, these are loaded under Instance=SLOT<ID> and Instance=RWING respectively.




    //----------------------------------------
    Instance=SLOT<ID>
    {
    Moveable=True
    MeshFile=thl2_carbody.GMT CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_seat.GMT CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    ///////////Suspensions/////////////
    MeshFile=thl2_lf_susp.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_lf_br_cool.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rf_susp.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rf_br_cool.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_lr_susp.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rr_susp.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_swheel_spin.gmt CollTarget=False HATTarget=False LODIn=(0.0) LODOut=(10.00)
    //////////tires/////////////////
    MeshFile=thl2_lf_tire_spin.gmt CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_lf_cal.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_lf_bd.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_rf_tire_spin.gmt CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rf_cal.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_rf_bd.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_lr_tire_spin.gmt CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rr_tire_spin.gmt CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_lr_bd.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_rr_bd.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_lr_cal.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    MeshFile=thl2_rr_cal.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(99) Reflect=True
    //////////axles/////////////////
    MeshFile=thl2_lr_axle.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rr_axle.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid, 64, 64) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_frontwing.gmt CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    MeshFile=thl2_rearwing.gmt CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid, 512, 512) LODIn=(0.0) LODOut=(350.0) Reflect=True
    }
     
  10. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    565
    Likes Received:
    3,593
    It works. Chief's F1 70 & 60 style is best example (I have helped write upgrades file).

    A few things to note:
    1. Upgrades file must have intance name matches the one written in spinner.gen (main gen file doesn't care about instance matching, and no interaction with showroom). If its in Instance="SLOT" section, then add Instance="SLOT" in Upgrades.ini (though it is best to add individual instance section)
    2. make sure all brackets { } are correctly placed & closed in all GEN & upgrades file.
    3. Substitute name must use "instance name + suffix" format.

    For example in spinner.gen (colored text is most important part):

    <STARTUPGRADES>


    Instance=Carbody<UPNUMBER>
    {
    Moveable=True
    MeshFile=<Carbody_config> CollTarget=False HATTarget=False ShadowCaster=(Dynamic, Solid) LODIn=(0.0) LODOut=(350.0) Reflect=True
    }
    <STOPUPGRADES>


    Then in upgrades.ini:


    UpgradeType="Carbody Configuration"
    {

    Instance="Carbody"
    Instance="SLOT"

    UpgradeLevel="Carbody Flat"
    {
    Description="Carbody Flat"

    GEN=<Carbody_config>=f170_carbodya_2.gmt <-----THIS IS FOR spinner gen
    GEN=<Carbody1>=f170_carbodya_2.gmt <-----THIS IS FOR MAIN gen
    }

    UpgradeLevel="Carbody High"
    {
    Description="Carbody High"

    GEN=<Carbody_config>=f170_carbodya_1.gmt <-----THIS IS FOR spinner gen
    GEN=<Carbody1>=f170_carbodya_1.gmt <-----THIS IS FOR MAIN gen
    }
    }

    And this is how main gen looks like (doesn't matter where this line resides):
    MeshFile=<Carbody1> CollTarget=False HATTarget=False LODIn=(0.00) LODOut=(8.0) ShadowCaster=(True, Solid) Reflect=True Damageable=true


    Last, would suggest check out Chief's F1 70 & 60 style mod as example case, which includes almost every possible combination of parts (include visible tyre compound selection as well). hope helps.
     
    Last edited: Jun 7, 2022
    Mauro and Corti like this.
  11. doddynco

    doddynco Registered

    Joined:
    Dec 13, 2017
    Messages:
    382
    Likes Received:
    759
    Excellent thank you for the help guys. I forgot about Chiefs modular mods but now I realise that is a perfect example.
     
    Corti likes this.
  12. Corti

    Corti Registered

    Joined:
    Sep 29, 2014
    Messages:
    1,087
    Likes Received:
    1,907
    All correct here, maybe different version? v0.95 is the last
    upload_2022-6-7_15-44-1.png
    upload_2022-6-7_15-44-15.png
     
    Mauro and doddynco like this.
  13. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    6,010
    Likes Received:
    3,490
    The high wing displays correctly on track, it is just in the showroom where, even with the high wing chosen, the low wing is displayed. Looks like you have to add about a page of text to the upgrade mas file....Not a real problem, I thought it was core code issue.
    A BIG THANKYOU again for the option!!!
     
    Corti likes this.
  14. DJCruicky

    DJCruicky Registered

    Joined:
    Jan 25, 2012
    Messages:
    1,392
    Likes Received:
    733
    The 2 screenshots from Corti is from the showroom. That is the Silverstone Showroom. The tall wing works for me as well. Nice car, never drove it before :), but rF2's new sound engine does not work well with it I found (sorry for the off topic).
     
  15. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    6,010
    Likes Received:
    3,490
    well! shows ya I haven't been paying attention....again.... :)
     
  16. Corti

    Corti Registered

    Joined:
    Sep 29, 2014
    Messages:
    1,087
    Likes Received:
    1,907
    You are right, the people who know me know that I am a disaster to take note of the improvements. :rolleyes:

    yes, the known sound problem :oops:

    sound error.jpg
     
  17. MileSeven

    MileSeven Registered

    Joined:
    Apr 1, 2014
    Messages:
    461
    Likes Received:
    196
    Thanks for all of this info - it has been very useful in progressing an issue where we wanted to give the option of a bannered and bannerless windscreen.

    We’ve got this working in the spinner and main situations for the external windows (‘windows out’) - whereas, before, the external windows would not update in the spinner due to the bug - but for some reason (lack of explicit windows-in entries in the upgrade and .gen files?) the main.gen view from inside the car (I.e. windows in) does not update…
     
    doddynco likes this.
  18. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    2,631
    Likes Received:
    1,446
    The Structure, to get Upgrades working properly, has to follow some Requirements.
    If you need some Help with it, feel free to send me a Mail. ;)
     
    MileSeven likes this.
  19. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    565
    Likes Received:
    3,593
    Hi, you can try take a look at Chief's new F1 60s style (or F1 70s) mod, which they include almost all kinds of possible upgrade parts combination, and also fully works with genstring system.

    Key thing:
    Main gen file has NO care about instance name, which means all you need is a correct & matching substitute name in both main gen & upgrades.ini.

    While Spinner gen DO care about instance name that written in upgrades.ini which matches the instance name in spinner.gen only. And to avoid overlapping, every substitute name must use instance name + suffix format. And spinner.gen must have <STARTUPGRADES> and <STOPUPGRADES> and <UPNUMBER> placed in correct place.

    For example, for Fwing instance as Instance=Fwing<UPNUMBER>, then substitute must be something like MeshFile=<Fwing_config>, where _config is the unique suffix only for spinner. And include Instance="Fwing" in upgrades.ini with GEN=<Fwing_config>=front_wing1.gmt

    And most importantly, make sure every bracket, which is { and } , are started and closed at right place correctly (as it is important for game to parse the file, and one of the restrict fact in many programming language). Wrong or missing bracket can lead to malfunction, which is a very common mistake.

    The best way to avoid confusion, is to treat main.gen & spinner.gen as two totally separated type of thing, and only do one of them at a time (really the two gen has no real connections).
     
    Last edited: Aug 8, 2022
    Emery likes this.
  20. MileSeven

    MileSeven Registered

    Joined:
    Apr 1, 2014
    Messages:
    461
    Likes Received:
    196
    Thanks both.

    The spinner is working fine now - as are the outer windows in Main - so I think I’ve got the basics correct now thanks to this thread.

    I just can’t get the inner windows to change in main anymore - at all - which suggests that I’m referencing the wrong thing entirely (rather than botching up the .gen structure and requirements).
     

Share This Page