News: 11 March 2016 - Forum Rules

Author Topic: Using “light” as a game mechanic  (Read 1052 times)

Jean-Claude Van Damme

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Using “light” as a game mechanic
« on: October 13, 2021, 07:22:12 am »
So, I had an idea… lol! I wonder how many posts on here start like that. Anyways, I’m currently working on a hack of Zelda 2 for the 35th anniversary of Zelda in November. You can check it out in personal projects or you can click this link and check out the blog.

https://zeldaiitheadventureoflink35thanniversaryedition.wordpress.com/

After watching gameplay of rom hacks for Zelda 2 I noticed in one of them. I think it was winter solstice or journey of a day. They made it so when link enters certain areas he isn’t wearing a hood anymore and you can see his hair. I eventually was able to piece together that it was because of the multiple banks. (I know duh 🙄) but it inspired my idea. What I’d like to try to do revolves around the use of the candle and/or the fire spell. First thing is I would combine the two. When you get the candle it has the fire spell as it’s ability, a la the original Zelda game. Now, the banks with the caverns I would make it so links sprite is actually holding the candle in his hand (if he’s gotten the candle of course). This makes it so he can’t hold his shield, henceforth he cannot block. Somewhere in each cavern is hidden an unlit torch. Hit it with a fireball and the cavern lights up allowing link to see AND now carry his shield through the cavern.

My question is this, lighting has been handled many ways in games over the years, ideally the coolest way it could be executed would be like it was handled in ray man where you could only see a small radius around your character, however, I don’t think that would be possible and I’m sure it’d be hard to do if it even was. Zelda 2 already has a lighting mechanic built in. So… I assume that’s a switch, right? One that can be turned on and off? So, I have one of two options. Ideally I’d like the candle and shield to be equipable. Shield equipped cave lights off and blocking on, candle  equipped cave lights on and blocking off (I assumed that being able to turn blocking on/off would be possible if not fairly simple as it already exists in game as a mechanic). There would be a few hurdles to get over though that make me question the feasibility of this. First, the current in-game mechanic is just a palette swap. Hence it wouldn’t change the graphic of his sprite which really would only use links front upper sprite on a couple of his key poses. I’ve heard that’s easier to do with sprites that are already assigned to the object. I have a few left over from after I reworked them if that will even help. Another way I thought to do this was to expand the memory and have 2 separate identical cave banks one with his shield and one with his candle and just switch to the appropriate bank when you equip or unequip the candle. Not sure if I’m making sense as I’m still reading through the required source materials. The other hurdle is, how do I make these “items” equipable? In some cases I want multiple things to be assigned to an item, like the candle for instance. So, I’m thinking just rearrange the spell menu so it’s sectioned out to where things you can take on/off are in one area of the menu with spells in its own and passive/quest items in their own. You would equip items by going to the spell menu and choosing the equipment (which is just a modified spell that has had its name changed). It would also be nice to arrange that menu in a way where the “equipable” items graphics are instead lined up vertically along the left edge next to its name/spell it is meant to represent. If you go into the spell menu and equip an item it’s essentially just activating a spell and keeping it active until another is activated instead. In the case of the candle it replaces the shield sprite (if possible) turns on the cavern light switch turns off the ability to block and activates your fire spell indefinitely until shield or a different item is activated. I would then need to make something similar to the palace jewels mechanic where in a torch can be “activated” which would override the palette change portion of this process for all the caverns connected to the one with the (now) lit torch.

* side note about the fire spell. I’d like to make it so it functions like the fire that the orange Moa’s throw down so it stays on the ground and remains a hazard for enemies until it burns out. In addition it’d be nice if I could make it lob like the maces. (Though, this isn’t really relevant to the whole “lightning” thing)

That is the more involved preferred way I’d like it to be, but alternatively I would just make it a choice, shield or candle. This is NOT preferred as it robs the mechanic of some of it’s fun/usefulness and turns it into a visual gag that makes going through caves a pain in the ass!

The last idea I had regarding lighting and the candle is to make the palace the candle is housed in pitch black like in shadow of night but have the palette change gradually becoming more “lit” the closer you get to the room the candle is in. That way it helps the player locate which direction they should go to find the candle.

So, what do you guys think?

Is it doable?

If so, what part is the most difficult?

If not what things could be done instead or are there things I could drop in order to make something similar work.

Can you think of other lighting used in games similar to this, and how was it used?

For that matter, really, what IS possible?

Are they infinite assuming I have enough space in memory to do it?

I feel like if it were infinite that, building a whole new mechanic like the halo of light mechanic from rayman would take a hell of a lot more work than using the existing game mechanics.

Thanks for taking the time to read this. I appreciate the help

Jorpho

  • Hero Member
  • *****
  • Posts: 5063
  • The cat screams with the voice of a man.
    • View Profile
Re: Using “light” as a game mechanic
« Reply #1 on: October 13, 2021, 10:57:03 am »
Yes, that is a lot of reading. Most things are possible, but usually only after an extraordinary amount of work.

There has apparently been some work done on a Zelda 2 disassembly, but that will only help you so much.
https://lemmy.neocities.org/zelda2/zelda2.html

That was linked from this thread. (When considering what is "possible", it is always useful to consider what has already been done.)
https://www.romhacking.net/forum/index.php?topic=25751.0

If you don't care about maintaining compatibility with real hardware, some amazing things have been done with Lua scripts.
https://www.youtube.com/watch?v=U0XJmflEaXg
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Jean-Claude Van Damme

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Using “light” as a game mechanic
« Reply #2 on: October 14, 2021, 05:01:21 am »
I suppose what I'm trying to get help figuring out is this. In the very short time I've been doing this stuff I've come to realize that the main hurdle through the whole process (Programming or Graphics) continues to be how everything is "Linked" with one another in some way. Makes changing stuff suck sometimes. I'd bet money that the number one question asked on this site is "How do I add more (animation, tiles, or frames) to my character sprite?" At least in regards to the older games. that is mostly because of the fact that things are connected in that manner. I was able to work around this and I posted a detailed explanation of how in a blog post earlier but here's an image from it as an example.



https://zeldaiitheadventureoflink35thanniversaryedition.wordpress.com/2021/10/14/fixing-links-walk-cycle/

I'd like to determine the feasibility of my idea. There are a handful of you on here that have been inside this file a million times and know it like the back of their hand. Perhaps some of you may know a better way to go at this or maybe clue me in on the fact that some of this might not be possible based on the whole things being connected to each other thing. I mean, with this idea there is a lot going on all at once. you'd be getting multiple items at once. I'm trying to take abilities and/or attributes from one thing in the game and apply it to another. Is this crossover going to jack everything up? I suppose most important of all is... Is this even a good idea? I realize something like this is a massive undertaking, so, is it even worth it? Are any of you even interested to play this? I feel it would add something to the game, but do any of you think it does? or, is it just an idea that will make for an annoying mechanic?

I've been hearing a lot about lua lately and it sounds awesome. in fact, I had thought about turning all the concept sketches I did for this into an HD pack for it using lua somewhere down the line, but it is important to me that it be compatible with real hardware, so that wouldn't be an option for this hack.

Trax

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 609
    • View Profile
    • Trax ROM Hacking
Re: Using “light” as a game mechanic
« Reply #3 on: October 15, 2021, 01:12:19 am »
I like the idea of having to choose between the Candle and having the shield activated. But like Jorpho said, it requires a combination of many different and difficult modifications, mostly of programming nature. Here's a breakdown from the top of my head:

- There is no shield sprite. It's just part of the tiles used for the multiple sprites that make Link. If you wanted to show Link without shield, you would need 2 new tiles, and attribute them to the sprite (tiles 1-2 in your drawing) when needed. And you have to do this to all sprite animation frames. And then program the condition in the code.

- You have to display the sprite (8x16) that make the Candle item, somewhere in front of Link, and make sure it follows him accordingly.

- Change the background palettes when you switch between Candle and No Candle. This is probably the easiest part.

- If you want the game to remember which torch has been lit, then you need this information to be stored somewhere in RAM, and use it when you enter a room. If you want rooms to be gradually less lit as they are further from the Candle (nice idea), then this information must be coded in some way, and stored somewhere.

- If you want to have the Fire spell activate a torch, then you need to create a new enemy, stationary, that will have collision detection code with the Flame, and when it happens, modify the background palettes, and the torch itself, likely with a sprite. More complex code needed if you want animated transition between palettes.

- If you want a switching mechanism through the Pause pane, then it's all new code that needs to be written. Spells are programmed to be selected in the menu, then activated outside of it. You could have spells selected with Up/Down, and items selected with Left/Right.

- If you want the Flame (from Fire spell) to behave differently, then you need to make a new projectile routine, because it is shared between Link and some other enemies. This new routine will likely use new graphics and have collision detection with the terrain (because it has to detect the ground) and the enemies (to deal damage).

- There is likely enough free space on the ROM (although Bank 7 is particularly packed) and in RAM (Cartridge RAM has plenty of unused space).

So, there we are. And there's definitely many things that I didn't think about that needs to be addressed. I think the bare minimum functioning mechanism would be to switch between Candle and No Candle instantly via a palette change, using the Select button to cast a "Light" spell. From there, more coding is needed if we want a more detailed or complex execution.

Jorpho

  • Hero Member
  • *****
  • Posts: 5063
  • The cat screams with the voice of a man.
    • View Profile
Re: Using “light” as a game mechanic
« Reply #4 on: October 16, 2021, 02:32:41 pm »
I should probably add that there are at least two hacks for increasing the size of the ROM.
http://www.romhacking.net/hacks/2451/
http://www.romhacking.net/hacks/5080/

As I said, it is very useful to look at what has already been done.
http://www.romhacking.net/?page=hacks&game=753&startpage=1
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Jean-Claude Van Damme

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Using “light” as a game mechanic
« Reply #5 on: October 17, 2021, 05:22:18 am »
I should probably add that there are at least two hacks for increasing the size of the ROM.
http://www.romhacking.net/hacks/2451/
http://www.romhacking.net/hacks/5080/

As I said, it is very useful to look at what has already been done.
http://www.romhacking.net/?page=hacks&game=753&startpage=1

I did notice the hacks that upgrade this game to mmc3 and mmc5 but at this point I don't have any clue how to use this. So I didn't bother using these patches as I figured I could patch it in after I get all the normal in game graphics changed over. You are right, it is really useful to see what has been done before. What would be even more useful is a list of things in this game that have already been done AND in what hack. Which is why I am compiling one myself. When it is finished I will upload it for everyone to use