weather effect (fog)

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply

Should I finish this game?

No, an OHR game must be based upon original idea!
0
No votes
No, we have enough newbie games!
0
No votes
No, learn some pixel graphics before!
0
No votes
 
Total votes: 0

roboman
Red Slime
Posts: 41
Joined: Fri Sep 23, 2011 6:09 pm
Contact:

weather effect (fog)

Post by roboman »

Image

Let me explain what is shown in the picture. This is my new(bie) game, Ravenloft, which tries to retell a Ravanloft story: The Night of the Walking Dead. Not so original, but I think mankind has urgent need of a game like this (made with OHRRPGCE). So in the picture there some reed, some wood, let's call it swamp, and there is a vistani coach, or something.

That grey stuff around the hero wants to represent Ravenloft's fog. Is it a good solution for foggy weather, or there are better ways of illustrating the fog? I did it with a simple script, plotscripting is a very enjoyable activity for me. It is easier to make rain or snow, but I wonder the possibilities of making fog. As a Ravenloft game, it's primary to create some fog. You know what I mean.

I got some of my ideas from Escape the Wolf OHR, Wandering Hamster, The Myth of Sysiphus etc, and I try to make it with many original graphics (which is, I don't know whether good or bad). I didn't want to reserve a whole topic for this game, but it happened like this. I'm really curious for the weather thing.
User avatar
Mystic
Metal Slime
Posts: 322
Joined: Wed Jul 23, 2008 4:32 am

Post by Mystic »

I don't like it, and in motion it probably looks really, really bad.

But I think you can do fog in a nice way. You can consider lots of different things.

This way simply doesn't cut it.
roboman
Red Slime
Posts: 41
Joined: Fri Sep 23, 2011 6:09 pm
Contact:

Post by roboman »

It is not as bad as you could think at first look. I use a script which refresh it in every step. But I'm open to better solutions, that's why I opened this topic.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I don't know the first thing about Ravenloft, but I wish you well in this project.

Is the fog done with slices or done with a map layer?
roboman
Red Slime
Posts: 41
Joined: Fri Sep 23, 2011 6:09 pm
Contact:

Post by roboman »

It is done with the map layer.
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

I don't think it looks terrible, but I think it would look better if you rounded it off, you know, make it a little bit less square.
User avatar
Mogri
Super Slime
Posts: 4598
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

I don't think it looks so bad. You only need two changes to get it looking decent. First is what Giz said. A rounder area will make this look much more natural. The second is to simply change the color of your fog. You ideally want a color that's similar to your background, but a little grayer and a little lighter. It's okay that your fog is too gray, but I'd make it a bit darker to match the background you have.

If you want to go one step further, make the thickness of the fog increase as the radius increases. This is a lot more work than the previous suggestions, though.
User avatar
Baconlabs
Liquid Metal Slime
Posts: 1067
Joined: Mon Nov 02, 2009 6:29 am
Location: Middlin, TN

Post by Baconlabs »

You could just go for plain, pitch-black, un-see-through-able squares. Thracia 776 did it for the first implementation of the series' "Fog of War" mechanic, and though it was [s]a little[/s] extremely annoying, it did what it was supposed to and added a great sense of caution and suspense to an otherwise boring map. You couldn't see terrain at all past the black square "fog", which isn't that bad in practice if you (the map-maker) handle it well and omit as many dead ends from your map as possible. Items that increase your field of vision are precious and useful, though I'm not sure how you'd implement that in a standard RPG game.

I'm getting ahead of myself, though. That's supposed to be fog, not ink or darkness, so the idea is to have things baaarely visible beneath the veil, correct? Well, the problem here is that the dithering method just doesn't work at all for some people (like me) who can't see a thing behind it. Maybe you're right, maybe it is easier to see when things are in motion and you're actually playing the game, but I've seen this dithering-in-lieu-of-opacity thing in a looot of games before (it was really common back before Game Maker supported sprites with an alpha channel), and it just never looks good. It's passable if you're in a high-speed environment (I once made a "toxic clouds" themed level in a Sonic fan game with dithered clouds in the foreground moving against the flow of the level, and it looked pretty good since it was a fast-paced game), but for something slow and exploratory like a standard RPG, it just gets in the way.

If I were designing a map with fog in CUSTOM, I'd pick between either making a gameplay challenge for the player or setting a mood with ambience, and I'd stick entirely to one or the other. For the former, I'd use the black square method I mentioned above; for ambience, I'd just change the palette of the background (and maybe the sprites) to one that mostly appeared milky-white. It wouldn't obscure anything, it'd just be a similar aesthetic to the "dye everything blue" method of making it "night time" in an OHR game.

Long story short, you're not going to get the ideal fog effect you're looking for any time soon with the OHRRPGCE.

(James updated the Will the OHRRPGCE ever use alpha transparency? page less than three months ago, saying "Eventually, yes, but not soon." So we won't be getting this feature any time in the foreseeable future, from what I can divine.)
roboman
Red Slime
Posts: 41
Joined: Fri Sep 23, 2011 6:09 pm
Contact:

Post by roboman »

Thank you for fast and detailed replies, I will follow your advices to make the fog more close to the reality. Maybe I'll try the rounded edges and the rest. It's a pity that we can't use alpha transparency, but I do with it.
User avatar
shakeyair
Slime Knight
Posts: 215
Joined: Fri Jun 12, 2009 6:15 am

Post by shakeyair »

I had an idea for something a week or two ago, because I am currently working on a survival horror game. It would be difficult.

What you do:

Code: Select all

EASY PREPARATION

make a tileset
export it as a .bmp
import it as backdrop 1
edit the .bmp, make it 'foggier'
import it as backdrop 2
edit the .bmp, make it even 'foggier'
import it as backdrop 3
edit the .bmp, make it straight gray
import it as backdrop 4
(adjust number of backdrops to taste)

THAT WAS EASY... THIS ISN'T!

write a script which overlays container slices over the maptiles, set the slices to clipping, give each one a child which is backdrop 1, adjusted spacewise so the correct part of that backdrop shows. (the part which corresponds to the tile placed on the map)

make a timer which sets off the following script every 1,2,3,4, or 5 ticks as desired.

write a script which cycles through all of these slices and checks their distance from the player. If the slice is near the player, the slice's child backdrop is set to backdrop 1, if further, backdrop 2, if even further, backdrop 3, and if it is very far from our hero set it to backdrop 4.

CONSIDERATIONS:

is the player the only object which gives off 'light'? adjusting for a zone to be 'fog immune' would be fairly easy. (someone might need to comment on how hard that is on the engine, though)

it will be easier on the engine if you only ever have the tiles which are showing on the screen loaded as slices. perhaps necessary if your maps are very large.

the slice 'tiles' don't have to be 20x20. you could have 10x10 and i bet even 5x5 with probably no slowdown. especially true if you are only calculating for slices on the screen.

better fog could be shown by having each slice animate between 2-4 frames where the fog 'rolls.' if done carefully, this could look flat out amazing.

even better fog could be done by also having random, small slices which blend in with the fog and float around the screen, appearing and disappearing but never leaving the thick fog so they blend in with the animation. These, too, could animate. This would be far, far, far more work than it is worth.
Personally, I take forever to do things and the movement engine will be complicated enough in my game when I start to add enemies, so I figure the OHR will have alpha transparency by the time I'm anywhere near done. But if you're feeling ambitious, go ahead and try. :)
Last edited by shakeyair on Fri Aug 24, 2012 2:46 am, edited 1 time in total.
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

Personally, I don't see anything wrong with dithered fog. Done correctly, it could work. Though, of course, I may be a bit biased because I also use dithered fog effects.

It's not exactly extremely refined, but if you want I can give you the files and scripts I used for my hiatused game 17 Peach Street.

On the other hand, shakeyair's solution might be a bit easier to implement, as that way you wouldn't have to muck about with existing scripts and spaghetti code to customize it to what you want, hehe.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
shakeyair
Slime Knight
Posts: 215
Joined: Fri Jun 12, 2009 6:15 am

Post by shakeyair »

i am surprised by how extremely good that solution looks. i had read that thread a while ago but i guess it slipped my mind. would you mind just posting a summary of how you did it? are you writing map tiles?
User avatar
KF Harlock
Slime Knight
Posts: 194
Joined: Wed Oct 22, 2008 10:45 am
Location: East Coast USA
Contact:

Post by KF Harlock »

If you check out my latest game "Dungeonmen: Men of Dungeons", I have a similar thing going on but with darkness rather than fog. I used a backdrop slice that was black, save for a transparent circle in the middle, the edges of which were dithered to transition into full blackness at about 5 tiles out from the hero in each direction. I imagine if you changed the color of such a slice to grey instead of black, it would look quite a bit like the fog you're trying to go for. If you use while-loops, you can even ANIMATE this, and have it cycle through a number of backdrops, so that the edges of the fog waft mysteriously and such instead of just sitting there. This can also be seen in Dungeonmen with the poison gas and explosion trap effects.
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! <a href="http://www.slimesalad.com/forum/viewgam ... 4363">Grab it today!</a>
roboman
Red Slime
Posts: 41
Joined: Fri Sep 23, 2011 6:09 pm
Contact:

Post by roboman »

BMR wrote:It's not exactly extremely refined, but if you want I can give you the files and scripts I used for my hiatused game 17 Peach Street.
It'll be great. It's exactly what I need. I don't mind the spaghetti code, either. I will also take a look at KF Harlock's new game, Dungeonmen, because Spellshard is one of my favourites even though I can't beat the main boss at the end (yet) Shakeyair's proposal is also seems to be good. Thank you for the so many suggestions, I'm sure I can choose the best solution now.
Post Reply