Sign in to follow this  
rhumbaflappy

LwmAreaFill without CTD in FS2004

Recommended Posts

I have tried generating LWM code with the following restrictions on the use of the AreaFill command:1) Never use the fill command in a transparent cell2) Never fill with the same type (land/water) as the cell attributeSo far no crashes after messing a bit arround in the map and gps. I do not think 2) has anything to do with it (it's just standard common sense optimization). Looking at how the cells are sorted it is clear that the attribute is a pretty important thing to FS - more important than the location of the cell, so FS could easily be in a different rendering mode once it makes it to the transparent cells (they are last in the list).Only problem so far is that it seems the LwmPolygons do not always show correctly in the map or GPS, while they appear fine in the views. I did not yet do anything to research this, so I have no idea why it happens.As I have done limted tests I am not fully confident in this. Did anyone experience CTD when generating LWM files according to one or both of the rules above?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Lars.This has been documented at this forum. AreaFills can only be used for the "base" LWM BGLs. If you replace the default LWM BGL, then you can freely use the AreaFill commands in that LOD5-sized area.Ground2K4 and SBuilder have code that can compensate for this by using LWM code to draw a poly rather than AreaFill.CTDs occur with the map or GPS view, and the addon AreaFills... again, if they completely replace the defaults, with the defaults erased or deactivated, then the AreaFills are fine.Most terrain designers are leaning towards replacing the huge default LWM BGLs for this reason, and because the default flattening of the water polys remain when the LWMs are overwritten.These are 2 bugs that the design team has chosen not to address in this version of the sim. They are aware of the problem, but it is a problem for 3rd party designers, not the design team. Hopefully, the next version of the sim will address these problems, and we can scale down our scenery 'corrections' to much smaller areas than an LOD5.Dick

Share this post


Link to post
Share on other sites

Strange, didn't find this when searching.My code should be safe then... untill something else comes up :)

Share this post


Link to post
Share on other sites

Sorry, we must be talking past each other.I have no problem finding posts mentioning crashes with area fill, nor that they can be avoided using LWMPolygons. Actually those posts are all over the place. :)But obviously LWMPolygons are not the best way to go for larger areas, hence I have made my program use the AreaFill commands when the cell attribute is set to water or land (i.e. not transparent) and then use the polygon fill in the edge of my scenery. I guess "not transparent" is what you call "Base", and a cell is what you call "Lod5". I tend to stick to Microsoft's SDKs so I am not overly familier with the terms used in other tools.I just wanted to check that my program will indeed work and not simply make the crashes less frequent so they will pass my tests.Well, I am heading into my cave again, trying to figure out how to automatically recognize the piers and harbors and avoid drawing a beach on them, or worst case make a program allowing me to point them out... sometimes I wish my data was slightly less detailed, there are a lot of harbors in Denmark :)

Share this post


Link to post
Share on other sites

Hi Lars.By base, I mean the default BGLs... nothing to do with transparent. If your BGL is not an actual replacement of the default BGL, which happens to be an LOD5 size, then the areafills will cause trouble.An LOD5 is equal to 64 LOD8s ( 64 Cells ).I have made several LOD5-sized LWM terrains with both Ground2K4 and SBuilder, and they both work just fine using Polygons, rather than AreaFills. The sim is quite robust in this regard. I have complete detailed US roads, streams, rails, shorelines and LWM polys with no problems, replacing default terrain BGLs, with no loss of framerates.You certainly can use AreaFills, but as I stated, they should be of the same area size as the defaults, and replace them completely... not just overwrite them.Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this