Frictional Games Forum (read-only)
Do the lights that the player can carry in the game have a defined position? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Open Source Collaboration (https://www.frictionalgames.com/forum/forum-27.html)
+--- Forum: HPL1 Engine (https://www.frictionalgames.com/forum/forum-28.html)
+--- Thread: Do the lights that the player can carry in the game have a defined position? (/thread-24752.html)



Do the lights that the player can carry in the game have a defined position? - jorgeas80 - 03-03-2014

Hello,

The player can carry a glowstick, or a flashlight, to get some light in dark scenarios. I know the light sources that are present in the maps have a defined (X, Y, Z) position, like any other object. But, what about the glowstick or the flashlight? do they have a defined position when the player uses them? Maybe the player hands position (which I guess is updated when the player is moving)?

Many thanks in advance.


RE: Do the lights that the player can carry in the game have a defined position? - Deadon - 03-04-2014

well, with 131111 you can check the player position, that's where the light is so....


RE: Do the lights that the player can carry in the game have a defined position? - jorgeas80 - 03-04-2014

(03-04-2014, 03:05 AM)Deadon Wrote: well, with 131111 you can check the player position, that's where the light is so....

Sorry for my ignorance, but, what is 131111?


RE: Do the lights that the player can carry in the game have a defined position? - Romulator - 03-04-2014

Deadon, it's using HPL1 - Which is for Penumbra.

I cannot help much here, because I don't use Penumbra or HPL1, but I believe if anything has a light source on it as an entity, there would be a defined area for it relative to it's model's xyz = 0 co-ordinates, not the player's model.

I would try to confirm this, but it would require me getting Penumbra using... unnecessary tactics, which I will not mention here. I am only saying this because from Amnesia's aspect, examining every model, there is a light source which will illuminate a general area. On Amnesia's lantern itself, there is a light source in front of it by a few z co-ordinates and illuminates the surrounding area of the player.


RE: Do the lights that the player can carry in the game have a defined position? - jorgeas80 - 03-04-2014

(03-04-2014, 11:15 AM)Romulator Wrote: Deadon, it's using HPL1 - Which is for Penumbra.

I cannot help much here, because I don't use Penumbra or HPL1, but I believe if anything has a light source on it as an entity, there would be a defined area for it relative to it's model's xyz = 0 co-ordinates, not the player's model.

I would try to confirm this, but it would require me getting Penumbra using... unnecessary tactics, which I will not mention here. I am only saying this because from Amnesia's aspect, examining every model, there is a light source which will illuminate a general area. On Amnesia's lantern itself, there is a light source in front of it by a few z co-ordinates and illuminates the surrounding area of the player.

That makes total sense. The flashlight is just a 3D entity with the shape of a flashlight with a light source on it.

Ok, I'm learning a lot. Now, just need to know where, in the code, do those "moving" lights update their position. I guess it's the same code where the player (who carries the flashlight) update its attributes.

Thanks!


RE: Do the lights that the player can carry in the game have a defined position? - Romulator - 03-04-2014

I THINK it is more whenever the player moves, the light source (the light itself on the flashlight or glowstick) does not move. It stays relative to its co-ordinates defined by the model of either the flashlight or glowstick, but the MODEL of the source moves.

For example's sake; Let's say that the flashlight is 1m (Y-Axis) off the ground, and the light itself is 0.3 cm away from the torch (Z-Axis). When the player steps, the torch will drop 0.3cm (Y-Axis) to simulate a step, as will the light, but that will stay relative to the model in the Z-Axis.

Sorry if that doesn't make much sense..


RE: Do the lights that the player can carry in the game have a defined position? - jorgeas80 - 03-04-2014

No, it's ok. I get it. There are 2 different concepts here:
  • The position of an object (example: the flashlight object) in the World
  • The position of an object (example: the light source in the torch) in relation with another object that contains it (example: the flash light itself)

So, when the player moves, the flashlight also moves with him (because he's holding it), but the position of the light source doesn't change its coordinates, because is still in the same position in relation with the flashlight.

That could be the reason for the 2 set of coordinates that every single iLight3D object contains (LocalPosition and WorldPosition). Does it make sense?

Many thanks again!


RE: Do the lights that the player can carry in the game have a defined position? - Romulator - 03-04-2014

Well, I am only speculating, because I have never played Penumbra, I am going off Amnesia experience here Blush

But it seems to make sense, and if you can accomplish what you needed, I'm glad I could help! Big Grin
Good luck on your project(s)!


RE: Do the lights that the player can carry in the game have a defined position? - jorgeas80 - 03-04-2014

Sure thing! Many thanks for your help