Jump to content

Recommended Posts

In response to dsawan's thread (https://combatace.com/forums/topic/93782-moon-scenery/), I decided to create a realistic Moon scenery. I will use this thread to remind myself that I have one in the making, LOL. Jokes aside, I have encountered various limitations of the game engine in regards to the environmentsystem.ini file, but hopefully I will solve everything. I wish guys like @Stary were still around, their knowledge would be of help. Gravity and Inclination Angle are that of the Moon. Earth phases have been created as well.

The terrain features a high quality 250m heightmap of an area between Mare Crisium and Mare Smythii. Right now, I am using some repainted objects as stand-in Space AAA guns and SAMs. I also modified two fictional aircraft available here (KF-2 and KF-1) to be used for this scenario. The scenario pits a joint alliance (United States Space Force, Russian Space Forces and People's Liberation Army Strategic Support Forces) against a fictional Settlement Defense Front, in the years 2038-2048. Those interested are invited to contribute with fictional yet "realistic" objects of a future Moon settlement, as well as new aircraft designs (IIRC X-Plane had some study aircraft designs for flight on Mars).img00001.thumb.JPG.a57b72bba0ffa24803e3226be54aba7c.JPG

img00002.thumb.JPG.a69757149f824c50bbeef69fc38799b9.JPG

 

Edited by Menrva
  • Like 7

Share this post


Link to post
Share on other sites

Quote

What happens If you eject?

remember the BSG episode with Apollo floating around in space? That's why you have a self-contained system (ie: Pressure suit with air and etc. Of course, in THIS game, you'll probably just die

Don't forget Russ new Angel interceptor! (now we'll need, Swifts, Eagles and Hawks, too....more work for the 3d guys!)

OPA!! OPA!!! Remember the Cant!!!

Free Mars (with purchase of Ceres or Eros)

Share this post


Link to post
Share on other sites

Hi, thanks for taking up my suggestion. I do hope you can use that scenery in the pic i provied from that article but anything will do. But yeah I remember BSG since I still watch it regulary even today and know that episode. The kamikaze strike by the cylons on galactica and apollo and starbuck float around the ship outside to set charges to battle the landing bay blaze. 

Share this post


Link to post
Share on other sites

Other shots of the Moon terrain. The environment system has been tweaked to allow for stars to appear even during daylight hours.

Unfortunately, the stars are the same as seen from Earth, and a day lasts 24 hours as if it was Planet Earth. At least the gravity is correct.

MoonSS_Height.thumb.jpg.770038d7f934c8b3c74773c46bfde267.jpg

img00001.thumb.JPG.e17345702c4ba32622439396d692e204.JPG

5d7a335920adb_img00003(2).thumb.JPG.9d5e4ee8e815a618ce4eb015e0d12be2.JPG

5d7a335b6715b_img00004(2).thumb.JPG.13debc7804dd7c1a01fdd4b18fba55fa.JPG

 

And "here" we have blue-ish sunsets... orange skies... hmm...

MarsSS_Height.thumb.jpg.b6f9341ea2f3b0da79fd9e26ca45513d.jpg

img00004.thumb.JPG.a6f6fbe73c520cc42215da1ee252103c.JPG

img00003.thumb.JPG.896765c32957a78b183684c5c4055c61.JPG

img00013.thumb.JPG.90f5524859f2afd419d7e2ee78049718.JPG

img00005.thumb.JPG.432aac8aa50c91c1673000edc64ebcb0.JPG

img00011.thumb.JPG.e081c21fc0dd6ac3401a6d795d599de6.JPG

img00007.thumb.JPG.4a6b91d3435190ae616ec19f5d39f2af.JPG

 

Edited by Menrva
  • Like 9
  • Thanks 2

Share this post


Link to post
Share on other sites

Right when TK is trying to fund an update, I uncover other "bugs" or limits, so to speak, of the terrain engine. It seems that the Overcast and Inclement cloud layer's height is hard coded, and on terrains with extreme elevation changes, the cloud layers directly spawn below the terrain, creating an horrible game-breaking bug.

img00001.thumb.JPG.dc0d70203ec37a837da5f7e6a239fa97.JPG

MarsSS_Height_000.jpg.e859c23a0adef5679d8cb381c946a08f.jpg

That shot was taken on my Mars terrain. The aircraft is sitting on an airbase at an altitude of around 7000. You can see the bug, below there's a repainted cloud layer (Overcast and Inclement are meant to represent dust storms on the planet). The terrain is not rendered at all, because it's as if I was above the cloud layer already. The minimum heightmap's height is around 1000. For testing purposes, I added a square at height 0 (meaning sea level); as a side effect, the cloud layer spawned even more below. This means that the cloud layer's height is locked and dependent on the minimum height of the terrain.

To put it short, it's impossible to have a terrain with such extreme, interesting elevation changes, without triggering this bug on those weather conditions. The only way to fix it is to reduce elevation changes by a lot, and I have to say goodbye to the beautiful canyons. An awesome idea being strongly limited by a stupid, hard-coded thing.

PS: I even tried some fancy tweaks, like adding a big ZBufferOffset to the CloudLayerMaterial. It doesn't work, of course.

Share this post


Link to post
Share on other sites

Unless someone in the terrain modding department comes up with an idea on how to overcome the issue explained in the previous post, I guess I will have to halt development. Such a pity, but there's no point in proceeding if I cannot produce things as they are meant to be. Unless there's some desire from users to have uninteresting terrains with almost flat canyons and craters.

Edited by Menrva

Share this post


Link to post
Share on other sites
11 minutes ago, Gepard said:

Do you have tried to mod the ENVIRONMENTSYSTEM.ini file?

But of course, Gepard! I have edited everything to achieve orange skies, custom dust clouds, different altitude for the 3d clouds, etc. I created specific environmentsystem.ini files for the Moon and Mars. There's nothing to alter the height of those cloud layer bitmaps, I'm afraid. TK locked their altitude, it's dependent on the heightmap's minimum height, as I already stated above. The only way to fix the issue is to lower everything heightmap-wise, to the point that such impressive canyons become much uninteresting. I don't know why TK should have made it like this. I know that stock SF2 terrains are not meant to feature such deep canyons, but it's such a wasted opportunity.

Share this post


Link to post
Share on other sites

Think out of the box, they say. And I did. I saved a mission file, having inclement weather. Opening the .MSN file revealed the following Weather statements;

[Weather]
WeatherType=INCLEMENT
WeatherAlt=2677.597168
WeatherThickness=480.078125
HasHighLayer=FALSE
FogAmount=0.664001
ContrailAlt=8007.995605
StartWindDirection=57.425541
StartWindSpeed=7.938888
WindGustingAmount=7.626858

By changing WeatherAlt to an higher value, say 20000.0, I fixed the issue! However, what we need is for this to be applied before flying the automatically generated single missions. The way the game is coded, it always assigns such low values to WeatherAlt for Inclement and Overcast weathers. I tried to put that statement inside the terrain's environmentsystem.ini, but to no avail.

Looks like I am on my own in this battle. Anyone remotely interested in those Moon and Mars terrains, please wish me luck on finding a solution.

Edited by Menrva
  • Like 2

Share this post


Link to post
Share on other sites

That "issue" was introduced in one of the patches, iirc, before NA was released. That and the 'no longer can expand the border' from the 80km Wall to further out. Fucked up a LOT of terrains. 

I haven't played the CBI map in quite a while or the (really old and messed up) Himalya terrain, but I do remember cloud issues with them as well around the high mountains, post patch.

Share this post


Link to post
Share on other sites
13 hours ago, Wrench said:

That "issue" was introduced in one of the patches, iirc, before NA was released. That and the 'no longer can expand the border' from the 80km Wall to further out. Fucked up a LOT of terrains. 

I haven't played the CBI map in quite a while or the (really old and messed up) Himalya terrain, but I do remember cloud issues with them as well around the high mountains, post patch.

That's true, Wrench. However, 3d clouds' altitude CAN be changed with a specific environmentsystem.ini for high terrains. Those horrible Overcast and Inclement cloud layer bitmaps, instead, always spawn at a low altitude, no matter what. There's no way to get rid of those (it would be what I need for the Moon terrain) because the game is coded to have such layer anyway, in those Weather conditions. By editing a saved mission's WeatherAlt value, I can temporarily solve the issue, I can put the layer as high as I want. Unfortunately, that statement does not alter anything if put inside the environmentsystem.ini file, and that's something I would need; I need to alter such value for when the single mission is automatically generated by the game. But TK coded it to work this way, with such low values being assigned to those weather types. It seems the only real solution is to flatten the heightmap and get rid of those deep canyons, which ATM is a big NO from me.

12 hours ago, russouk2004 said:

This is what your current world looks like in 3ds max...

That's how I always imagined it, LOL! I knew that the sky had that kind of shape. By editing the environmentsystem.ini, with extreme values on certain statements (there's one about the sky's max vertex height, for instance), you can uncover how the sky is modelled. Anyway, the Cloud Layer bitmaps are another thing. Those only spawn on Overcast and Inclement weather types. Otherwise, they do not exist at all.

Edited by Menrva

Share this post


Link to post
Share on other sites

I just messed with it a little. Seems the overcast cloudlayer altitude is random from about 3 km to a maximum of 5,5 km. Changed some values in the ini and even changed some defaults that I found in the EnvironmentSystem.dll file, with hex edits. But the cloudlayer altitude did not budge. The randomness makes it rather annoying to test it.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, gerwin said:

I just messed with it a little. Seems the overcast cloudlayer altitude is random from about 3 km to a maximum of 5,5 km. Changed some values in the ini and even changed some defaults that I found in the EnvironmentSystem.dll file, with hex edits. But the cloudlayer altitude did not budge. The randomness makes it rather annoying to test it.

That's the kind of help and thinking I need. Thanks for the effort, mate.

Keep in mind what I stated about the WeatherAlt statement inside .msn files. Manually editing that one works. The Mission Editor by TK only allows a maximum value of 20,000 for Weather Altitude, and it does not do the job in my case. It's all about finding which .dll applies this logic and its value and where. Could it be that it's hardcoded in the TerrainEngine.dll instead? I have no idea. Worst case is that it's hardcoded in the .exe, I guess. AFAIK, it's the Mission Editor thing that broke a lot of stuff, FAC included!

I even tried to trick the terrain engine into thinking that the terrain's heightmap has different values than in reality, using HeightMapOffset statements inside the terrain's _data.ini. Nothing.

PS: There's no way to limit selectable weather types, otherwise there would be no issue. I can only put WeatherChance values, and those affect campaign missions only. In the single missions menu, you can always choose Inclement and Overcast. I managed to disable the heavy fog on those two weather types for the Moon terrain. By being able to give an extremely high value to the Weather Altitude, even the Moon terrain would gain a proper feeling.

PS No.2: if anyone like gerwin is willing to look into the matter, let me know and I'll PM you and send the terrains for troubleshooting.

Edited by Menrva

Share this post


Link to post
Share on other sites

Yeah I understood what you wrote earlier. It is very helpful.

I gave it a second try and may have found the hardcoded value involved.

Singlemission.dll double float value 3000.0. In hexadecimal code this is "00 00 00 00 00 70 A7 40". It is at offset 0x8B560 in SF2 May 2012 version.

I just changed it to 10000.0, hex code "00 00 00 00 00 88 C3 40". And the overcast cloud layer was at 10km in a random single mission.  But I only tested it once.

XVI32 is simple tool to do this hexedit, make sure to only 'overwrite', the dll file size must stay exactly the same.

 

 

 

 

  • Like 3

Share this post


Link to post
Share on other sites

@gerwin Wow, that is very informative! Yes, I do some Hex editing and know about the file size thing (my proudest work of that type was to enable a disabled feature by hex editing the executable, for a very old videogame). Back to the issue, I was hoping to find an easier way than some potentially harmful hex editing (not user friendly, so to speak), but this is surely a huge step in the right direction! So, thank you very much! I am busy in the next two days, but I'll be glad to test and report back when possible! BTW, I am on the latest patch level, July 2013.

Edited by Menrva

Share this post


Link to post
Share on other sites
2 hours ago, gerwin said:

Yeah I understood what you wrote earlier. It is very helpful.

I gave it a second try and may have found the hardcoded value involved.

Singlemission.dll double float value 3000.0. In hexadecimal code this is "00 00 00 00 00 70 A7 40". It is at offset 0x8B560 in SF2 May 2012 version.

I just changed it to 10000.0, hex code "00 00 00 00 00 88 C3 40". And the overcast cloud layer was at 10km in a random single mission.  But I only tested it once.

XVI32 is simple tool to do this hexedit, make sure to only 'overwrite', the dll file size must stay exactly the same.

 

 

 

 

I think is the first time I've seen such edition done in TK sims. My hat off Gerwin!

Share this post


Link to post
Share on other sites

@gerwin I successfully hex edited the .dll and it works, but only for the Overcast layer. The Inclement layer uses another value, I think it's something between 1500 and 2000. The problem is that this is a global change that would affect all terrains. I wish there was a more local way to fix it...

Share this post


Link to post
Share on other sites
4 hours ago, Menrva said:

@gerwin I successfully hex edited the .dll and it works, but only for the Overcast layer. The Inclement layer uses another value, I think it's something between 1500 and 2000. The problem is that this is a global change that would affect all terrains. I wish there was a more local way to fix it...

Inclement default base is 2500.0, hex code "00 00 00 00 00 88 A3 40" . It is at offset 0x8B570 in SF2 May 2012 version.

It is the nature of hex edits that one can disable things and modify a little. Adding things, like a new variable to read, may technically be possible by appending new code at the end of the file, but I am not going to attempt such.

To make it easier on the end user you can use a patch engine, that can automate the hexedit by generating an executable with a patch + restore button. I can send you one.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, gerwin said:

To make it easier on the end user you can use a patch engine, that can automate the hexedit by generating an executable with a patch + restore button. I can send you one.

Thank you, Gerwin. I will let you know. I'd like to investigate other solutions heightmap wise, first. This hexedit fix is unfortunately global, and such high overcast layers would look wrong and out of place in the usual Earth terrains. Still, this bit of info you have uncovered will be surely useful to those experiencing such rendering bug. Now we know exactly how it happens.

Share this post


Link to post
Share on other sites
1 hour ago, russouk2004 said:

Anomaly on mars discovered by Russian sattelite...

Thanks, I needed to smile a bit. Although it makes you think about what we humans are doing to Earth.

Share this post


Link to post
Share on other sites
11 hours ago, Menrva said:

Thanks, I needed to smile a bit. Although it makes you think about what we humans are doing to Earth.

Yeah it does....But I think Mother Nature will destroy us before we destroy it.

Edited by russouk2004

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  

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..