Fog and the like, how to?

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
Hey guys,

does anyone of you know a good tutorial on how to make fog? I mean, not with a script, but with (a) picture(s). I've tried a few things, but none of them worked.

Alternatively, if anyone knows how to explain the basic idea behind it, I think that would be enough, actually. I'm not that bad at eventing, it's just that I'm not sure about the basic idea.

Kind regards

Liak
 

Cronus

Social Awkward
Veteran
Joined
Mar 18, 2012
Messages
47
Reaction score
219
First Language
Portuguese
Primarily Uses
The way I do is really simple. You create an illusion of an endless fog by moving a picture until the point that it can repeat itself, and to achieve this effect you actually use an image that is duplicated like this one:


The original picture must have the same scale as the resolution your game is using. Usually it will be 544x416, on this case I'm using half the size to be economical (272x208), so I can scale it up to 200% on the Picture commands.
The logic is: you show one side of the picture covering the screen, make it move until the other side is covering and then you show the picture again on the same position it was on the beginning. Here's my event:

As you can see, I show the picture at X544 Y208 (Center) and move it to X0 Y208, so the picture loops from left to right. If I wanted to make it from right to left, I would show at x0 and move to X544. If I wanted to make a vertical loop, the original picture should be duplicated vertically, and for diagonal loops it's recommended to have 3 copies of the original fog on the same file (at 50% scale we would have a 544x416 image, with 4 cells).


I think you can pick the whole logic from this small example, and from that you can do much more things. If you want to mess with it, feel free to use this one:

 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you just wanted static fog, you'd just make the picture and use Show Picture to display it - no need to worry about movement. Show Picture will give you different blend modes, so you could experiment with those a bit a bit, and opacity, to see if you can get a good effect.


If you wanted moving fog, you would need to make a picture twice as wide or high as the game window (if you only want it to move horizontally, just double the width; if you only want it to move vertically, just double the height; if you want it to move diagonally, double both of them). Then in a parallel process event, use Show Picture and place the upper left at -544,-416 (or whatever width/height your window is). Then use Move Picture to move the upper left to 0,0, setting the Wait for Completion box. That will make it move across and down at the same speed - it may not be what you want, but it's necessary if you want seamless repetition.


I actually don't know if that will really work. That's what I'd try and do, if I wanted to do fog with pictures.


Edit: ninja'd! At least Cronus proves I was on the right track :)
 
Last edited by a moderator:

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
Oh, I see! Thank you guys! Doubling the width/height/both is the trick! In fact, I've almost been there, but I displayed the same picture twice. Which caused problems because there was always a line where both pictures were "glued" together, because the movement wasn't exactly in sync. Doubling the size. Wow. :) I'll try that right away!

EDIT: It worked! Thanks again! :) One thing I noticed, though, was that it was kind of "stuttering" when the process repeated itself. I had my picture move from -544 to 0 on the X axis. I tried moving it to only -1 before re-displaying it. That seems to reduce the stutter. Maybe that's something you want to try for the fog in Zu, as well, Cronus. Or anyone else reading this, of course.

Another EDIT: Hm, I do still have a problem here. On a large map, if the actor moved against the fog and the screen scrolls, the fog stops moving. Does anyone recognize this issue and has a solution to it? :/
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Are you using any fog/picture scripts? A picture should not stop moving when the actor moves, because a picture is locked to the window, not to the map.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
I don't have any scripts, and I even tested in a new project.



This is the event I am using. The fog picture is 1088*416, so I am moving it horizontally.

Oh, and I use a loop inside a parallel process because Cronus posted it like that and I thought maybe that'll do the trick. It didn't. So, also without the loop, I have the same issue.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Why are you moving it to -1 and not 0?


Why are you using Normal blending when you show it and Add blending when you move it?


Both of those will cause a very slight flicker.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
The -1 seemed to actually reduce flicker. In my post above I had an EDIT where I talked about that. :)

As far as the blending methods are concerned, I don't actually have an idea what they do. I was just testing things there.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You don't need a loop inside a parallel process. They loop by default.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
I know, I know. :) Cronus posted his event with a loop, so I wanted to see if that solves my problem, but unfortunately, it didn't. :/
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top