Any reason for no torchlight?

This forum is for anything that doesn't specifically have to do with Better Than Wolves
Post Reply
User avatar
MrPlatypus
Posts: 88
Joined: Mon Feb 18, 2013 12:11 pm

Any reason for no torchlight?

Post by MrPlatypus »

Let me start off by saying that this is *not a suggestion, but is simply a question as to why a feature has not been implemented in vMC.
My question is why do torches not give off light when held in the hand. From a developing stand point, how hard would this be to implement? I can imagine that a moving light source could be pretty resource demanding, but to me it seems like a plausible idea. The reason I ask this is because I was recently playing Terraria with a friend who said that he could not believe that held-torch functionality was not in Minecraft. Anyways, this post is really just to satisfy my curiosity, so if you have any input it would be much appreciated.
Last edited by MrPlatypus on Sun Mar 31, 2013 8:06 pm, edited 1 time in total.
User avatar
Azdoine
Posts: 270
Joined: Thu Apr 05, 2012 11:50 pm

Re: Any reason for no torchlight?

Post by Azdoine »

Because it is really laggy and intensive on the minecraft engine. Every time you move, every block affected by the torchlight has a block update.

It's also a feature not a lot of people would use, because if a place is dark and you need to light it up, you would be wanting to hold a sword.
Last edited by Azdoine on Sun Mar 31, 2013 8:13 pm, edited 1 time in total.
User avatar
MrPlatypus
Posts: 88
Joined: Mon Feb 18, 2013 12:11 pm

Re: Any reason for no torchlight?

Post by MrPlatypus »

I thought about this, but I have seen similar things done in plenty of other games. I guess im just out of my league here and don't know what im talking about :)
User avatar
Thorium-232
Posts: 121
Joined: Wed Jul 11, 2012 3:20 am

Re: Any reason for no torchlight?

Post by Thorium-232 »

Coles Notes version: It's because of the block update system and how lighting affects it. If you place a torch, the blocks within its reach only update once, to reflect the torch being placed. If you had a mobile torch, every block in its reach would have to update every single time it moved. So every "frame" (if you will, it's more complex than that) of every step Steve took, all blocks that were affected by that torch would have to update. This would have a brutal effect on computation and would slaughter performance.

edit: and that doesn't even touch on the lighting engine itself, as Azdoine mentioned above.
Stormweaver wrote:Then you can just use the day/night cycle to separate out the adults, and put the kids in storage till you're ready to murder them.
User avatar
Shengji
Posts: 638
Joined: Sun Jul 10, 2011 8:35 pm

Re: Any reason for no torchlight?

Post by Shengji »

Every game engine has it's strengths and weaknesses depending on what it was designed to do - you're doing the equivalent of asking why a tractor can't use the motorways or why a Lamborghini isn't sold with a tow hook.
7 months, 37 different border checks and counting.
User avatar
Thorium-232
Posts: 121
Joined: Wed Jul 11, 2012 3:20 am

Re: Any reason for no torchlight?

Post by Thorium-232 »

Shengji wrote:Every game engine has it's strengths and weaknesses depending on what it was designed to do - you're doing the equivalent of asking why a tractor can't use the motorways or why a Lamborghini isn't sold with a tow hook.
This is a very good way to look at it too. FC mentioned in a thread a while back how the Mojang team was disregarding efficiency in order to do things "the right way" (and how wrong an approach that was). It might not seem it at first glance, but how Minecraft works is really quite remarkable. In order to get the sandboxy depth and scale, some other things had to be compromised on, and dynamic lighting is one of those things. In order to get the two to work together you'd need a computer far outside the average gamer's budget.
Stormweaver wrote:Then you can just use the day/night cycle to separate out the adults, and put the kids in storage till you're ready to murder them.
User avatar
MrPlatypus
Posts: 88
Joined: Mon Feb 18, 2013 12:11 pm

Re: Any reason for no torchlight?

Post by MrPlatypus »

Thanks guys. These explanations make a lot of sense and have completely answered my question.
0player
Posts: 65
Joined: Tue Jan 15, 2013 7:24 am

Re: Any reason for no torchlight?

Post by 0player »

MrPlatypus wrote:I thought about this, but I have seen similar things done in plenty of other games. I guess im just out of my league here and don't know what im talking about :)
If you're interested in more detail:
In games with moving light sources they are usually merely shaders applied to world. Thanks to GPU, it's damn fast nowadays. But in Minecraft, light is actually assigned to world cells. Minecraft is not really suited for moving light in that all light updates are schedlued into a list and handled in pretty simplistic way. But given the best algorithm, you'd still need to update at least 4 n (n-1) + 2 or so tiles (slightly more than the surface cubes of an octahedron), and that's 730 tiles for n=14 (a torch). In reality, you'll need update inner cubes, as well, so about 4/3 n^3 (more than 3k cubes). So, you see, that's totally impossible to do fast.
User avatar
agentwiggles
Posts: 188
Joined: Fri Apr 06, 2012 2:31 pm

Re: Any reason for no torchlight?

Post by agentwiggles »

Just wanted to pop up out lurker-ville and say that I very much enjoyed reading this thread (as a CS major). Most of this is probably common knowledge to a lot of the people here, but I just never knew some of that stuff, so thanks to all of you who explained/analyzed it in a way that let me learn something.
Kaitocain
Posts: 46
Joined: Sun Mar 17, 2013 2:29 pm

Re: Any reason for no torchlight?

Post by Kaitocain »

0player wrote:
MrPlatypus wrote:I thought about this, but I have seen similar things done in plenty of other games. I guess im just out of my league here and don't know what im talking about :)
If you're interested in more detail:
In games with moving light sources they are usually merely shaders applied to world. Thanks to GPU, it's damn fast nowadays. But in Minecraft, light is actually assigned to world cells. Minecraft is not really suited for moving light in that all light updates are schedlued into a list and handled in pretty simplistic way. But given the best algorithm, you'd still need to update at least 4 n (n-1) + 2 or so tiles (slightly more than the surface cubes of an octahedron), and that's 730 tiles for n=14 (a torch). In reality, you'll need update inner cubes, as well, so about 4/3 n^3 (more than 3k cubes). So, you see, that's totally impossible to do fast.
That would explain why the shader mod for Minecraft is incredibly laggy, because the engine isn't equipped to handle dynamic lighting in that matter.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Any reason for no torchlight?

Post by FlowerChild »

Kaitocain wrote:That would explain why the shader mod for Minecraft is incredibly laggy, because the engine isn't equipped to handle dynamic lighting in that matter.
It's not just a matter of it not being equipped though. It's a dynamic world, and dynamic lighting in other games that you are used to is usually applied to a static world (as in fixed level design with only a few dynamic elements at most).

That's really what this whole topic boils down to: MC has a fully dynamic world, which is rather unprecedented. It's both what makes it great, and what also demands technical sacrifices to make it possible.

As a result, you can't expect it to do the same things that other games take for granted, and this is why so many threads like this boil down to face palms from the more technically knowledgeable amongst us.

When in doubt, and if you don't know any better based on hard experience, it's a safe bet to assume that things are the way they are because they need to be.
User avatar
Gears
Posts: 146
Joined: Tue Dec 04, 2012 8:21 pm
Location: California

Re: Any reason for no torchlight?

Post by Gears »

It's been done before in AdventureCraft and the Dynamic Lights mod, and it looks pretty nice.

However, these effects are purely aesthetic. They have no effects on the actual light levels of the world around it. Meaning that you can carry around a torch, it will light the area, but the game will still regard the area as 'dark' and it will allow monsters to spawn from spawners and cave ambiance to take place.

So technically you can have a mobile "light source", but beyond lighting up the area it serves no purpose. However judging from what you were asking this is what you wanted.
FlowerChild wrote:For example, I'm feeling such a whim right now, and look forward with anticipation to the feeling of satisfaction that shall come from acting upon it.
Former Drill Sergeant and cranky gamer
User avatar
PatriotBob
Posts: 276
Joined: Mon Sep 10, 2012 10:47 pm

Re: Any reason for no torchlight?

Post by PatriotBob »

Gears wrote:It's been done before in AdventureCraft and the Dynamic Lights mod, and it looks pretty nice.

However, these effects are purely aesthetic. They have no effects on the actual light levels of the world around it. Meaning that you can carry around a torch, it will light the area, but the game will still regard the area as 'dark' and it will allow monsters to spawn from spawners and cave ambiance to take place.

So technically you can have a mobile "light source", but beyond lighting up the area it serves no purpose. However judging from what you were asking this is what you wanted.
This is more or less the case. The only real way to make that manner of dynamic lighting work in fully dynamic world is deferred lighting/shading. And that is a complete rewrite of the entire rendering engine. And as gears said it's a purely visual effect. So tracking light levels for gameplay purposes would have to be separately from the visual. I won't say it's not possible, but the amount of work required for that type of change is quite significant and in the end may not even result in a workable game.
Image
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Any reason for no torchlight?

Post by Gilberreke »

PatriotBob wrote:This is more or less the case. The only real way to make that manner of dynamic lighting work in fully dynamic world is deferred lighting/shading. And that is a complete rewrite of the entire rendering engine. And as gears said it's a purely visual effect. So tracking light levels for gameplay purposes would have to be separately from the visual. I won't say it's not possible, but the amount of work required for that type of change is quite significant and in the end may not even result in a workable game.
Well, except for the fact that multiple mods already did it of course, without the drawbacks you mention.

It's actually fairly trivial to add hand-held torches that are purely visual. It causes a performance hit, but a rather minor one for anyone with a decent PC (if you don't have performance problems running MC, the hit will not be noticeable).

As for the light source being purely visual, that's not a problem for monster spawning, as the reach of the torch is within the area monsters can't spawn in anyway, due to player presence. I guess it does cause problems with light detectors and similar things not registering it correctly.

I used to run the miner's helmet mod for ages, never had any problems with it.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
Post Reply