Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Darkness In Caves

I didn't see a mapping section, so I posted it here. First off, thank you to everybody who has been helping me out! I know I've been kinda flooding the Beginner forum, but I just have a lot of questions that I havn't found answers to via google.

I've seen some game demos on YouTube where the player would be walking around a cave, and everything around him was dark except a few feet around him ((as if he were holding a torch)).

How is this possible?

Also, if this can be done, can I make it so that the area of "light" is affected by whether or not the player is using a torch? If some of you ever remember playing the original DragonWarrior for the NES, your hero couldn't see a damn thing in front of him in a cave/dungeon unless he lit a torch.

Thanks again!

Example here:
gwaelin.PNG
 
A simple fix for this would be to go into photoshop or a similar program. Make a 640x480 size picture and fill it with black. Then erase a circle in the dead center. This hole should be transparent. You can get fancy with blurring and feathering and such, but it's not necessary. Then, whenever your character goes into a dark place, Show Picture with that picture you just made. Your character should be in the center of the transparent circle, and everything around him should be black.

Now keep in mind, the default way RMXP does pictures, if you reach the edge of the screen, the picture will stop moving, and your character can actually move out of his light circle. To remedy this just give a few tiles worth of breathing room on all edges of the map.
 

Jason

Awesome Bro

No second_crimson, don't give it "breathing room"

It's simple,

Just make the image as said, at 640x480, all black, with a white cutout circle in the center (Big enough for your character plus extra tiles), when done, make a NEW image, that's 1280x960 (Yup, double it), and place your new one in the CENTER of it (Make sure it's directly center alligned)

Once you've done this, import it into RMXP, and make the circle in the middle transparent, and when you show image, make it allign as center, and track the characters screen x and screen y (Which you'll do with two variables)

This way, even if you walk to the edge of a map (Literally the edge), then it won't look weird and you won't need to waste mapping space to give it "breathing room"
 
Is there a way to script it so that when character uses "Item A" ((aka. Torch)) that the "darkness" picture changes to a picture with a wider hole? Thus giving them a larger range of view?

And can such an item have a time limit or limit to the amount of steps he can take before it goes out?
 

mawk

Sponsor

using an item to widen the visible area can be dome with events. just create a common event that replaces the smaller ring of light picture with a larger one, and make an item that triggers that common event.

there is a default option to set a timer in rpg maker, but the timer would be visible to the player, and I'm not sure if that'd be totally alright with what you have in mind.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top