Vegetation Missing From Built Package

I’ve been working on a mod to clean up the southwestern corner of Ireland, removing incorrect vegetation, replacing inaccurate autogen buildings, adding literally hundreds of buildings where nothing was generated in the first place, etc. It’s all been going great until recently. For some reason, huge swaths of land are now missing all vegetation in the built package. In the scenery editor, everything looks fine, but when I load the sim with the package folder in Community, it’s anything but fine. Moreover, this happens not only in areas where I’ve placed polygons or buildings, but also in areas where I’ve modded nothing at all. Interestingly, the missing vegetation follows straight lines, like there’s a grid system at work. I drew a polygon along the edges, and took a screenshot. Any thoughts?


1 Like

Update: I’ve halfway figured out the cause of the problem, and I’m really hoping somebody here can explain the other half. Enabling “Debug Shapes” revealed giant rectangles excluding vegetation. The only trouble is that not only did I not draw them in the first place, I can’t see them in the scenery editor, so I have no idea how to delete them. I can’t draw an even bigger exclusion rectangle around them, because that would also exclude all of my own work. There must be a way to delete them.

Hi Pguin111, the “debug shape” shows - if I am not mistaken - ALL shapes in the area, not only yours. There should be a little dialogue window “vector data debug” where you can select “Draw package name”. Then you will know, to which package the shapes belong. Please see example.
shape names

I did that already, and it shows that the rectangles are from my package. The trouble is that I never created them, and can’t find them in the package.

The shapes now are written in the XML, should be easy to identify them by looking at the code alone

But before that, remove _PackageInt and Packages from your project, remove content.xml and sceneryIndexes.dat and rollingCache from your local cache, than try again to build your work

Cleaning up the _Packageint directory structure is definitively a good idea, directories and files will be recreated. I had problems with this in the past as well, so, I would follow MamuDesign’s tip (and stop reading here).

I personally never had problems with the rolling cache messing up a project.

And if you are confident (or curious or brave) enough to fiddle around with the xml files… They are stored in the “scene” subdirectory of the “packageSources” directory. Default name is objects.xml

a rectangle looks like this

<Rectangle width="30.000000" falloff="5.000000" surface="{6C0C6528-5CF1-483A-A586-2C905CF2757E}" priority="0" latitude="53.66826625089094" longitude="6.90329560535715" altitude="0.94585695397109" latitude2="53.66800477091135" longitude2="6.90340578045667" altitude2="0.94542339071631"/>

an Exclusion Rectangle looks like this

<ExclusionRectangle latitudeMinimum="53.68015263679175" latitudeMaximum="53.68390312019715" longitudeMinimum="7.06376268709399" longitudeMaximum="7.07475001047065" excludePolygons="TRUE"/>

In older projects of mine, polygons were stored in a mixture of XML, DBF and SHP files, the latter are binary files - for me that means: fingers off!

But that seems to have changed recently, now polygons can be in the objects.xml file as well:

<Polygon groupIndex="6" altitude="18.99704360961914">
		<Attribute name="UniqueGUID" guid="{359C73E8-06BE-4FB2-ABCB-EC942F7761D0}" type="GUID" value="{1A2D5D98-79A0-460F-9C5B-77D175AB075C}"/>
		<Attribute name="VegetationScale" guid="{6A043F59-E6F2-4117-A2E4-D510E7317C29}" type="UINT32" value="0"/>
		<Attribute name="VegetationDensity" guid="{41EFF715-C392-4B31-A457-50A504353A90}" type="UINT32" value="0"/>
		<Vertex lat="55.34545501607585" lon="-1.61241129873120"/>
		<Vertex lat="55.34506250000247" lon="-1.61248351096361"/>
		<Vertex lat="55.34485147623494" lon="-1.61251771603701"/>
		<Vertex lat="55.34473956294462" lon="-1.61247751343673"/>
		<Vertex lat="55.34462601553616" lon="-1.61184305844943"/>
		<Vertex lat="55.34439249539863" lon="-1.61175673195208"/>
		<Vertex lat="55.34442508168372" lon="-1.61084474418721"/>
		<Vertex lat="55.34453516626249" lon="-1.61112514141585"/>
		<Vertex lat="55.34460018856628" lon="-1.61044522683575"/>
		<Vertex lat="55.34482390757035" lon="-1.61051078429015"/>
		<Vertex lat="55.34479585396947" lon="-1.61083029496574"/>
		<Vertex lat="55.34509388956341" lon="-1.61083746424982"/>
		<Vertex lat="55.34503154567327" lon="-1.61123582468623"/>
		<Vertex lat="55.34501260066332" lon="-1.61172628807612"/>
		<Vertex lat="55.34515582109259" lon="-1.61209546219208"/>
		<Vertex lat="55.34549520032351" lon="-1.61209308729643"/>
		<Vertex lat="55.34554985826979" lon="-1.61227826656215"/>
	</Polygon>

But when you do that, you may create more problems than you solve. So, a project backup is mandatory!

I’ve been having this same problem in my recent project. I’ve stopped work on it until SU10 is out of beta. There’s too many little issues about at the moment with the sim.

As per your suggestion, @Pguin111 can search in his XML for polygons with 4 Vertex entries

One of them shoud be like 51.6705601, -8.4928139

Being those polygon a bit large that an usual vegetation correction, look at the position of the bold figures, you can expect those changing for the offending large poly only
While
In @KrimSect sample there is no change since its sample defines little shapea

I’ve had no luck finding those rectangles in my shape file. I strongly suspect that they’re being automatically generated during the build. If you look at pretty much any mod with “Debug Shapes” enabled, you’ll see polygons split precisely along the borders of scenery tiles. As an example, here’s a place where I drew a huge polygon to remove trees from a mountain:

You can see that the polygon has been neatly split along a grid. However, this doesn’t affect the end product, and it didn’t expand beyond the polygon I drew. My best guess is that the same process is at work on the newer part of my mod, except that something has gone badly wrong.

Just to make sure that I understand correctly:
you assume that when you create a very large polygon, the compiler “automatically” subdivides it along a regular grid, thereby creating a set of smaller (sub-)polygons. But the sum of the areas inside all sub-polygons is (or maybe: should be) equal to the area inside the very large polygon? And: it works in places, but not in your last mod?

Now I am guessing: you can confuse algorithms working on polygons if you make the border line cross. Simply speaking: create a shape like an “8” rather than like a “0”. In such a case, some part of the “inside” suddenly becomes “outside”. One point on the wrong side may already be enough. Could that be the case?

You were close. I just fixed two of the four rectangles, and the problem was that I had a vegetation exclusion polygon slightly overlapping a biome polygon, both straddling the border between scenery tiles. It took hours of trial and error–deleting polygons, building the package, relaunching the sim, etc.–but now that I know what to look for, it should be a little easier to fix the remaining two rectangles.

Sounds good!
In the meantime I had found out, that the compiler indeed automatically starts separating large polygons, once they reach a certain size. So, a work-around would have been to work with more yet smaller polygons. But you are obviously a step ahead already. :smiley:

I should add that the offending polygons were both quite small, covering just one field, which had been erroneously covered in trees and which I wanted to clean up. It was pure bad luck that this field was on the border between tiles. In fact, any and all polygons which straddle the border between scenery tiles get split, regardless of size.