Change particle width (e.g. on fertilizers)

Your forum for all discussions around Modding.
User avatar
this_is_gav
Posts: 1756
Joined: Wed Sep 20, 2017 11:36 pm

Change particle width (e.g. on fertilizers)

Post by this_is_gav »

I'm trying to edit the widths of a fertilizer spreader. I've done the working widths and AI (seems the same as FS19 except for adding the incremental widths).

However I'm having a problem changing the particle width. You could do this in the I3D file in FS19, however on FS22 it seems it's stored in, or references, a DDS file which must be a custom type and contain extra information. There is one DDS file for the left and another the right side.

As a result currently it seems we are limited to 42m, 18m or 12m widths (those of the in-game fertilizer spreaders).

In the below the fertilizerEffectLeftArray.dds and fertilizerEffectRightArray appear to be the culprits. Adjusting the numRows only stops the particles showing at all. Adjusting the scale value doesn't affect the particles.

Code: Select all

    <sprayer fillUnitIndex="1">
        <usageScales workAreaIndex="1" scale="1" />
        <animationNodes>
            <animationNode node="spreaderLeft"  rotSpeed="-2500" turnOnFadeTime="0.6" turnOffFadeTime="2" />
            <animationNode node="spreaderRight" rotSpeed="2500" turnOnFadeTime="0.6" turnOffFadeTime="2" />
        </animationNodes>

        <effects>
            <effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectLeft">
                <motionPathEffect textureFilename="$data/vehicles/amazone/zats3200/fertilizerEffectLeftArray.dds" numRows="22" rowLength="32" minFade="0.03" isLeft="true"/>
            </effectNode>
            <effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectRight">
                <motionPathEffect textureFilename="$data/vehicles/amazone/zats3200/fertilizerEffectRightArray.dds" numRows="22" rowLength="32" minFade="0.03" isLeft="false"/>
            </effectNode>
        </effects>
    </sprayer>
Has anyone managed to get custom particle widths in FS22?.

Image
Click for full size
User avatar
MAurUS
GIANTS Software | Gameplay Programmer
Posts: 133
Joined: Thu Jun 16, 2011 11:54 am
Location: ER
Contact:

Re: Change particle width (e.g. on fertilizers)

Post by MAurUS »

Hi this_is_gav,

The arrays from the Amazone spreader are not limited to the working widths we use there. The width of the effect is set based on your variableWorkWidth setup. If you have a closer look at the sections in the xml file, you'll see the "maxWidthNode" attributes. These nodes also define how much of the effect is visible. So for example you have the "section02" node at X translation of 18 -> this results in 18m visible effect on the left side while this section is active.

Let me know if you need further help on this and maybe post the variableWorkWidth xml setup as well.
User avatar
this_is_gav
Posts: 1756
Joined: Wed Sep 20, 2017 11:36 pm

Re: Change particle width (e.g. on fertilizers)

Post by this_is_gav »

Hi Maurus and thanks for replying,

I'm now just working on a mod of the Amazone ZA-TS 3200 (rather than Kverneland mod, to rule out other issues) and the variableWorkWidth seems to work correctly (22, 20, 18, 16, 14 and 12m settings for testing), and the particle width decreases, but this time it's bigger than the actual working area, by maybe 5-8 metres each side.

Here is the variableWorkWidth part of the Amazone XML you mentioned plus the sectionNodes that I think I also need to alter:

Code: Select all

    <variableWorkWidth>
        <sections>
            <section isLeft="true" maxWidthNode="section01"/>
            <section isLeft="true" maxWidthNode="section02"/>
            <section isLeft="true" maxWidthNode="section03"/>

            <section isLeft="true" maxWidthNode="section04"/>
            <section isLeft="true" maxWidthNode="section05"/>
            <section isLeft="true" maxWidthNode="section06"/>

            <section isLeft="false" maxWidthNode="section08"/>
            <section isLeft="false" maxWidthNode="section09"/>
            <section isLeft="false" maxWidthNode="section10"/>

            <section isLeft="false" maxWidthNode="section11"/>
            <section isLeft="false" maxWidthNode="section12"/>
            <section isLeft="false" maxWidthNode="section13"/>
        </sections>

        <sectionNodes>
            <sectionNode node="workAreaHeight" isLeft="true"  minTrans="6 0 -9"  maxTrans="11 0 -5"/>
            <sectionNode node="workAreaWidth"  isLeft="false" minTrans="-6 0 -9" maxTrans="-11 0 -5"/>

            <sectionNode node="aiMarkerLeft"  isLeft="true"  minTrans="6 0 -9"  maxTrans="11 0 -5"/>
            <sectionNode node="aiMarkerRight" isLeft="false" minTrans="-6 0 -9" maxTrans="-11 0 -5"/>
            <sectionNode node="aiMarkerBack"  isLeft="false" minTrans="0 0 -11"    maxTrans="0 0 -7"/>
        </sectionNodes>
    </variableWorkWidth>
    
Other than that, I've only changed <workingWidth>22.0</workingWidth> (just store data as far as I know) and in the I3D the workAreaWidth and workAreaHeight, aiMarkerLeft and aiMarkerRight and of course the sections are now 11, 10, 9, 8, 7 and 6 (and their minus values for the other side).

I've repeated this twice to rule out heavy fingers. Have I missed something else that needs changing?

Image
Click for full size
User avatar
MAurUS
GIANTS Software | Gameplay Programmer
Posts: 133
Joined: Thu Jun 16, 2011 11:54 am
Location: ER
Contact:

Re: Change particle width (e.g. on fertilizers)

Post by MAurUS »

Hi Gav,

After checking out your mod I saw that there is currently no option to reuse array textures with a different max. working width. I fixed this now for an upcoming patch (not the exact next update, but the one after). Then you could use the attribute "textureRealWidth" similar to how it us used on cutters already. This attribute defines the width of the array texture in world space. For the ZA-TS 3200 effects this would be 21m. After adding this the effect would be correctly displayed for your 11m working width per side.

The only option for now would be to scale the effect link node by factor 0.52, so from 21m to 11m. Creating a custom array would of course also work.
User avatar
this_is_gav
Posts: 1756
Joined: Wed Sep 20, 2017 11:36 pm

Re: Change particle width (e.g. on fertilizers)

Post by this_is_gav »

That's excellent news that it's being fixed in the future Maurus.

I'm also relieved I'm not going completely mad.

Thanks for all your help.
mats42
Posts: 11
Joined: Mon Feb 12, 2024 7:44 pm

Re: Change particle width (e.g. on fertilizers)

Post by mats42 »

Late to the party but I can confirm that textureRealWidth works. Just made a 54M version of the ZA-TS 3200
Post Reply