Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor »

Yes, to avoid flooded stairs you would then need water tiles instead of the ocean object... Unless you make a custom 3D mesh with a hole in the middle of the size of your island ?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

The water shader fades out when outside the boundaries of a 32x32 map, regardless of the model(s) it's attached to. Using more models, moving the models, enlarging the models, or changing the geometry of the models doesn't change this behaviour. Increasing the size of the map beyond 32x32 doesn't change this behaviour. There is no way around this that I know of.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Ask a simple question, get a simple answer

Post by petri »

This sounds a little weird.. for example in the Shipwreck Beach the water extends well beyond the grid. Maybe I'm misunderstanding what you mean, but I think there should be no problem?
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

petri wrote:This sounds a little weird.. for example in the Shipwreck Beach the water extends well beyond the grid. Maybe I'm misunderstanding what you mean, but I think there should be no problem?
A few months back I made a map that used two Ocean models, back to back (with the seam in the middle of the map), and placed two shipwrecks on the beach, and the seam was effectively invisible.

Another time after, I made total Ocean map (with a mountain on the horizon ~well past the edge). It initially used an arrangement like this:
Image
(This works, and it's easy, but the waves oppose at the seams.)

The better way (as far as appearance goes), is to have the (3) West & East Ocean objects facing the same direction [East/Right in this case] , and using script to move one of the West Ocean objects 90 units further out [West/Left] past the edge. This way the waves match at the East & West seams across the map.

The result is that the player cannot see the seams unless they are right on top of the North or South edge.

(Of course the other option ~once one starts moving the objects in script), is to place several Ocean objects exactly end to end, and have the waves all aligned.

One could (I suppose) define a custom Ocean with several beach_Ocean models pre-offset in the onInit hook; (I've not tried it).
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

petri wrote:This sounds a little weird.. for example in the Shipwreck Beach the water extends well beyond the grid. Maybe I'm misunderstanding what you mean, but I think there should be no problem?
My mistake: it appears to fade based on the camera's position rather than map boundaries.
The best way I can explain what I mean is with a series of screenshots.
Screenshot 1 - This scene mostly looks okay near the camera, but further away the water appears to fade out.
Screenshot 2 - If you view the level from the opposite side, you see a similar effect: the water seems to fade out somewhat near the shore, producing a weird strip below it.
Screenshot 3 - Moving the camera further away makes the effect clear. You can see the boundaries of the water model, and you can see that the water pretty much disappears near the shore. Most obvious is the red and black sphere: the places where the water is in front of it are almost exclusively showing the skybox and foam, because of the party's distance making the rest of the water shader (including the non-sky reflection and refraction) fade out.
Screenshot 4 - This is how the reflection/refraction of the red and black sphere look if you move closer.
Screenshot 5 - This is a similar view to the one in screenshot 3, but the water has been upscaled by 400%. The model is much larger now but the fading effect is still the same.

Note: I don't show it in the screenshots, but changing the FOV of the camera doesn't change the behaviour, only changing the position of the camera does.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Ask a simple question, get a simple answer

Post by petri »

Oh, I think what's going on. In the main campaign when you look at the ocean you always look at the horizon (and never towards the beach from far away). (except in the main menu background which is a special case). I remember I made a tweak in the shader that fades out the water surface based on distance from the camera. This makes the ocean-sky intersection in the horizon look much better (the fade out tries to mimic the haziness that appears in the real world).

Unfortunately I can't think of any way to disable this behavior...
User avatar
Eleven Warrior
Posts: 745
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

I try that out Isaac thxs for the help :)
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

petri wrote:Oh, I think what's going on. In the main campaign when you look at the ocean you always look at the horizon (and never towards the beach from far away). (except in the main menu background which is a special case). I remember I made a tweak in the shader that fades out the water surface based on distance from the camera. This makes the ocean-sky intersection in the horizon look much better (the fade out tries to mimic the haziness that appears in the real world).

Unfortunately I can't think of any way to disable this behavior...
I never meant to imply it was a bad thing.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

How [exactly] is AnimationComponent:crossfade(name, length) used in the game, and in user script?

Minimal info online that I've found suggests an LOD dissolving fade.

Also: What are the acceptable strings for Champion:showAttackResult(any, string)
*And what's "any"?
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor »

TimerComponent:getTimerInterval(number)
What is the number parameter there ?
Post Reply