Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / [LOCKED] [Question] For modders like us that mod source code (Skybox and Water Issue)

Author
Message
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 14th Dec 2012 23:02 Edited at: 14th Dec 2012 23:15
We are seeking some input from the other modders that mod the source code of FPSC like us (Flatlander, Scene Commander, TZK, etc).

Cathy and I still work in v1.17 and have three developments that are half way completed in this version, so upgrading is not an option at this time. In our source version, we have ported water and it works great. There is one issue we have been trying to solve that has us totally stumped, which involves water and skyboxes. Warning- there are quite a few images posted to demonstrate our issue.

Creating a test level, we add our water which is turned on via trigger when the player hits it at the start of the level. I am noticing that the skybox looks like it is "bleeding through" an enclosed level. I have some screenshots to demonstrate what I mean.

These first two show the level with water. The line in the "setuplevel.fpi" that defines the skybox is commented out (in other words, no skybox). The water looks perfect for us.





Now I switch the line in the "setuplevel.fpi" to use a skybox. It is a desert skybox 9brown sand, blue sky). When you are looking at the water, you will see the "brownish" color of the skybox appear along the water edge.





Now we change the skybox to use a "black" skybox. It is not fully black, but RGB 5/5/5. You can see the "black" along the edges in a few spots.





In the above examples, it appears that the level that uses water in an enclosed area will need to ensure no skybox is used for the enclosed level to keep any "skybox bleeding" into the water.

Here is another enclosed level for our Egyptian game. I used the "black" skybox for this test. As I look across the water, it looks normal. If I look upward slightly, I see a black distortion", and returning normal it disappears.







But, if I comment out the skybox in that same level, the water never shows that "distortion".







I have checked our water code and it is in line with the current source (r725). I am stumped at the skybox/water/enclosed levels. Why does not using a skybox appear to be the best for enclosed levels? Does the media being used (such as segment walls for the sub level, cave wall entities in the other level) have anything to do with this?

We've come to the conclusion that commenting the skyboxes out for the enclosed levels only that use water is the best approach for us at least in the version we use. This issue is not affecting our ability to complete the development, but is one of those things that we keep coming back to at our age saying "oh yeah, we need to solve this issue and not leave it". We would appreciate any insight to this.


There's no problem that can't be solved without applying a little scripting.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 14th Dec 2012 23:04 Edited at: 15th Dec 2012 00:28
Apologies- post issue above solved. I missed a "dash" in the file name for the image. All should be showing now.

Here is a video showing the issue with water and skybox. The level is the first stage development of the game's ending. I had made the water an "orange-brown" and did an "orange-brown" skybox. At 0:56 into the video, you see the "orange" appear.



This second video is the second stage development of the level. I have defined a "slate grey" colored skybox, and the water is set to the following:



No distortions from the skybox appear at all.




As mentioned, it has left us the conclusion that defining no skybox for enclosed areas was the best method for us, but then the slate grey skybox shot that theory as no distortions appeared. We're just stumped as to why this happens. Does the water color and skybox color have anything to do with this?


There's no problem that can't be solved without applying a little scripting.
The Zombie Killer
15
Years of Service
User Offline
Joined: 27th Mar 2011
Location: Gold Coast, Australia
Posted: 15th Dec 2012 01:31
Quite a strange bug, but I'm pretty sure I've encountered this in stock FPSC as well. I wouldn't know how to fix it myself (yet), because I haven't even looked at the water code, let alone touched it.

I guess this just requires a long and boring look through the water code.

Good luck on your game by the way, it looks really cool.

-TZK

Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 15th Dec 2012 02:39
I'm confused.

Quote: "Apologies- post issue above solved. I missed a "dash" in the file name for the image. All should be showing now."


Are you still having an issue or are you not?

THEORY - you know everything but nothing works. PRACTICE - when everything works but don't know why. For me, theory and practice are combined: nothing works and I don't know why.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 15th Dec 2012 02:55 Edited at: 15th Dec 2012 02:57
Quote: "Are you still having an issue or are you not?"


The issues I mentioned about before are solved. When I first posted, the last portion of images did not display but only the comments. I then took them and posted in a second post thinking the forum was not allowing so many images in one post. Hence my comment of having issues. Then I realized I made the error in a few file names by forgetting a dash. It's all good- each image I need to display is showing.

Quote: "Quite a strange bug, but I'm pretty sure I've encountered this in stock FPSC as well. I wouldn't know how to fix it myself (yet), because I haven't even looked at the water code, let alone touched it.

I guess this just requires a long and boring look through the water code."


Yes, the long read was something I was not looking forward to. Fortunate for me rewriting our source and having it organized, I know where to jump to.

Quote: "Good luck on your game by the way, it looks really cool."


Yes, it is shaping up nicely, particularly with the excellent skills of Rosstradamus, Cosmic, Willow, Rolfy, and BlueFox. We are looking forward to publishing this Egyptian game. The only other one we know of was one development called "sands of Myth" by Scurvy Lobster. He was the reason we wanted to do this, and the fact no one else seems to touch this genre.


There's no problem that can't be solved without applying a little scripting.
Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 15th Dec 2012 07:02
Both the reflection and refraction of the water utilize a camera to render the scene from a certain perspective. In this case it appears that the issue may be caused by the reflection camera. The reflection camera uses a camera angle relative to that of the player's camera except the X-Angle is inverted. And the camera is placed at the same position as the player on the X and Z and on the Y is placed a bit below the player. So whatever the player's camera is looking at, the reflection camera is looking at the direct opposite.

Now, this issue sounds to me like one of the cameras (either reflection camera or refraction camera, but more than likely the reflection camera) is clipping parts of the universe that it shouldn't be. Easiest way to debug this would be to display the camera's render image in the corner of the screen so you can see exactly what's going on.


Sean

BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 15th Dec 2012 07:19 Edited at: 16th Dec 2012 03:27
Quote: "Now, this issue sounds to me like one of the cameras (either reflection camera or refraction camera, but more than likely the reflection camera) is clipping parts of the universe that it shouldn't be. Easiest way to debug this would be to display the camera's render image in the corner of the screen so you can see exactly what's going on."


That's a good idea. Since we have a minimap already, I can piggyback the camera's render image to that, which would require little code change on my part. Thank you for the suggestion- we will put that to the test in the morning.

I guess what really confused us is the first two screens and the last three screens in the first post are good with no skybox defined, and the second video where we defines a slate grey colored skybox was also okay with no distortion. That made us stop and think either the media or the skybox was the issue, or we had to use a skybox where the color was as close as possible to the water color defined.

**Update** Problem has been solved. Thanks for the input.


There's no problem that can't be solved without applying a little scripting.
uman
Retired Moderator
21
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 16th Dec 2012 18:55
Locked at the Original Thread creators request an account of the issues being solved.

Login to post a reply

Server time is: 2026-07-03 05:01:10
Your offset time is: 2026-07-03 05:01:10