Raised This Month: $32 Target: $400
 8% 

[TF2] Pyro Flamethrower Light Emittion (1.3)


Post New Thread Reply   
 
Thread Tools Display Modes
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 12-10-2010 , 10:14   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #21

Yeah light_dynamics are 'cheap' entities, meaning they require little resources but can be inaccurate. They shouldn't kill fps at all unless you have a terrible setup.

Also Leonardo: That's amazing work. I kinda wanted to add that to the main plugin but I wanted to finish the light effect first. Been toying around with a fade in / out effect.
__________________
Mecha the Slag is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 12-10-2010 , 10:50   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #22

Quote:
Originally Posted by Mecha the Slag View Post
... Also Leonardo: That's amazing work. ...
no, that's easy work with amazing result
ps: don't forget about known bugs.
__________________

Last edited by Leonardo; 12-10-2010 at 11:13.
Leonardo is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 12-10-2010 , 12:44   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #23

Quote:
Originally Posted by FaTony View Post
Well my fps dropped from 200 to 40
200 fps is pointless. Most displays, especially LCDs, are incapable of displaying more then 60fps.
naris is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 12-10-2010 , 12:49   Re: Flare Light lol
Reply With Quote #24

Quote:
Originally Posted by Leonardo View Post
Nothing to say.
I noticed an error in the logs that repeats fairly often:
Code:
L 12/10/2010 - 00:28:08: [SM] Native "GetEntPropEnt" reported: Property "m_hOwnerEntity" not found (entity 34/env_lightglow)
L 12/10/2010 - 00:28:08: [SM] Displaying call stack trace for plugin "other/TF2_Flare_Light.smx":
L 12/10/2010 - 00:28:08: [SM]   [0]  Line 66, TF2_Flare_Light.sp::Timer_EntitySpawned()
So, I change both the TF2_Flare_Light and TF2_Ignite_Lite plugins to uses references to save and track entities. I also added a check of the entity limits to improve stability when the amount of free entities drops too low.
Attached Files
File Type: sp Get Plugin or Get Source (TF2_Flare_Light.sp - 284 views - 5.9 KB)
File Type: sp Get Plugin or Get Source (TF2_Ignite_Light.sp - 305 views - 6.9 KB)
naris is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 12-10-2010 , 13:19   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #25

fixed in all three my plugins.
__________________
Leonardo is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 12-10-2010 , 13:23   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #26

Quote:
Originally Posted by Leonardo View Post
how many amazing things we can do now
There really is no need to check if the plugin has created any entities in OnPluginStart() sicne it has not had the opportunity to do so yet, so this code is not needed:
PHP Code:
public OnPluginStart()
{
    for(new 
iEntity = (MaxClients+1); iEntity MAX_ENTITIESiEntity++)
        if(
g_iArrow[iEntity] != -1)
        {
            new 
iLightEntity g_iArrow[iEntity];
            if(
IsLightEntity(iLightEntity))
                
RemoveEdict(iLightEntity);
            
g_iArrow[iEntity] = -1;
        }

Same thing for OnMapStart(), which has the same code in TF2_Flare_Light.sp, but not in the newer plugins. It's also not really needed to check if the value is -1 before assigning it to -1, as it won't really improve performance, but that is a minor quibble.

Last edited by naris; 12-10-2010 at 13:27.
naris is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-10-2010 , 14:26   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #27

Quote:
Originally Posted by naris View Post
200 fps is pointless. Most displays, especially LCDs, are incapable of displaying more then 60fps.
And I'm running CRT at 85 Hz.

Also:
Quote:
Dynamic lighting is calculated at runtime, which makes it expensive to render.
http://developer.valvesoftware.com/wiki/Lighting
__________________
FaTony is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 12-10-2010 , 14:30   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #28

Quote:
Originally Posted by FaTony View Post
And I'm running CRT at 85 Hz.
200 fps is still pointless, as is anything over 85 fps, for your setup...
naris is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 12-10-2010 , 14:34   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #29

Quote:
Originally Posted by Leonardo View Post
fixed in all three my plugins.
Actually, you need to to call EntIndexToEntRef() to get the reference to fix the problem. Your updated plugins still have this error:
Code:
L 12/10/2010 - 04:03:43: [SM] Native "GetEntPropEnt" reported: Property "m_hOwnerEntity" not found (entity 34/env_lightglow)
L 12/10/2010 - 04:03:43: [SM] Displaying call stack trace for plugin "other/TF2_Flare_Light.smx":
L 12/10/2010 - 04:03:43: [SM]   [0]  Line 66, TF2_Flare_Light.sp::Timer_EntitySpawned()
So This:
PHP Code:
public OnEntityCreated(iEntity, const String:sClassName[])
{
                
CreateTimer(0.05Timer_EntitySpawnediEntity);
}

public 
Action:Timer_EntitySpawned(Handle:hTimerany:iEntity)
{
    
iEntity EntRefToEntIndex(iEntity);

Needs to be like This:
PHP Code:
public OnEntityCreated(iEntity, const String:sClassName[])
{
                
CreateTimer(0.05Timer_EntitySpawnedEntIndexToEntRef(iEntity));

naris is offline
Matheus28
Senior Member
Join Date: Aug 2009
Old 12-10-2010 , 14:47   Re: [TF2] Pyro Flamethrower Light Emittion
Reply With Quote #30

Quote:
Originally Posted by naris View Post
200 fps is still pointless, as is anything over 85 fps, for your setup...
Implying every player in the server has an excellent computer
Matheus28 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode