I cannot be sure if this issue is well known or not (for me was annoying for a long time).
Many maps had "Storm-Coming" like stuff and being pretty well designed but Playing them on servers is a mess as long as DistanceLightning do sucks at net stuff in original.
To mention several titles (list is longer): DM-Traitorsgate.unr, DM-Wheel.unr, DM-WZ5-Revolution.unr, DM-WZ2-AdDominus.unr, DM-Waterplace.unr, MH-[SP]ColdSteel.unr, DOM-Storm.unr, DM-UnderGround.unr, etc.
Net Stuff is doable in MyLevel directly or using brute-force VIA game-type (my case) or an evil mutator able to ruin crap out even if is set to bNoDelete (default).
Here I'm introducing a mutator supposed to solve this stuff for a better On-Line playable Level. For sure if other needs are encountered, source-code is there for analyzing/adds/changes/removals/etc.
Long name (umm...) "Lightning Tweaker" - shortly called "LightningTw".
Technical explanations goes bellow if are needed by coders (even if I'm not a coder I'll try to point out how works this stuff).
Document included contains setup explanations.
DistanceLightning tweaking
- sektor2111
- Godlike
- Posts: 6424
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
- sektor2111
- Godlike
- Posts: 6424
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: DistanceLightning tweaking
Bump, speaking about Lights we can debate some... sort of lamps which looks stupid as dead bodies making light around. In client we can toy a bit as long as client is able to SEE things, server doesn't care how these things look. Update + ScreenShots examples.
Reduced size sample:
___
Edit:
Sample Number 2 - perhaps more relevant
[attachment=4]LightningTw_2.zip[/attachment]
Reduced size sample:
[attachment=3]Original.png[/attachment]
Original ^___
[attachment=2]With_Mutator.png[/attachment]
Using this Mutator ^Edit:
Sample Number 2 - perhaps more relevant
[attachment=1]Original_02.png[/attachment]
VS[attachment=0]With_Mutator02.png[/attachment]
- Attachments
-
- LightningTw_2.zip
- (1.62 MiB) Downloaded 110 times
Last edited by sektor2111 on Sun Mar 27, 2016 10:02 am, edited 2 times in total.
- papercoffee
- Godlike
- Posts: 10466
- Joined: Wed Jul 15, 2009 11:36 am
- Personal rank: coffee addicted !!!
- Location: Cologne, the city with the big cathedral.
- Contact:
Re: DistanceLightning tweaking
Just a note: you can optimize the code by skipping never true conditions. Instead of
this one skips other tests if one condition is successful:
Code: Select all
if (Other.Class == Class 'Lamp1')
[..]
if (Other.Class == Class 'Lamp4')
[..]
Code: Select all
if (Other.Class == Class 'Lamp1')
[..]
else if (Other.Class == Class 'Lamp4')
[..]
"If Origin not in center it be not in center." --Buggie
- sektor2111
- Godlike
- Posts: 6424
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: DistanceLightning tweaking
It works in any environment, including OFF-Line for those lamps. Aside, DistanceLightning is a fix for servers, because Net Code is trash for that class - and it was used in mapping... anyone playing such DM/CTF/MH/etc. maps OFF-Line doesn't need this mutator 100%... it looks functional for those lamps. DistanceLighning is fully operational OFF-Line and it doesn't really need a fix, for Lamps things are tweaked.papercoffee wrote:Dude this is neat ...So, this is a server only mutator?
I'm appreciating observations but... I'm not concerned about server's performance. Those codes belongs to client, you don't have to believe me, just add logs and see where are executed. Be my guest to use/improve them as you want if you like this lightning deal.Barbie wrote:Just a note: you can optimize the code by skipping never true conditions
- sektor2111
- Godlike
- Posts: 6424
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: DistanceLightning tweaking
Because we seems to hunt some speed let's see LightNotify different done:
Is this faster enough right now ?
Code: Select all
ForEach Allactors(class'actor',other)
{
switch(Other.Class)
{
case Class 'DistanceLightning':
...
break;
case Class 'Lamp1':
...
break;
case Class 'Lamp4':
...
break;
case Class 'Lantern':
...
break;
case Class 'Lantern2':
...
break;
case Class 'TubeLight':
...
break;
case Class 'TubeLight2':
...
break;
}
}
Re: DistanceLightning tweaking
I have another approach to have this nice lamp glowing on clients: On client login, spawn an Actor there that checks and switches on the glowing of lamps. The disadvantage is that you need control over the client's login - I use it in a GameInfo's child; maybe it works also in Mutators ModifyClient(), I didn't test that.
and
Code: Select all
event PostLogin(playerpawn NewPlayer) {
[...]
if (spawn(class'MakeLanternsGlow', NewPlayer) == None)
warn("class'MakeLanternsGlow' could not be spawned on" @ NewPlayer);
}
Code: Select all
class MakeLanternsGlow expands Actor;
simulated function PostBeginPlay() {
local Decoration deco;
super.PostBeginPlay();
//log(self $ ".PostBeginPlay DEBUG: function entered, Level.NetMode=" $ GetEnum(enum'ENetMode', Level.NetMode));
if (Level.NetMode != NM_DedicatedServer)
{
foreach AllActors(class 'Decoration', deco)
if (Lantern(deco) != None || Lantern2(deco) != None || Lamp4(deco) != None)
if (deco.LightRadius > 0 && deco.LightBrightNess > 0)
if (deco.AmbientGlow == 0)
deco.AmbientGlow = 254;
Destroy();
}
}
defaultproperties {
bHidden=true
CollisionRadius=0
CollisionHeight=0
}
"If Origin not in center it be not in center." --Buggie
- sektor2111
- Godlike
- Posts: 6424
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: DistanceLightning tweaking
Client login doesn't really need a hook, exist a simple method to gain new player, yes there are always multiple solutions for the same thing. See topic with "Player On-Line" by Loathsome. Similar code has been already used. Not sure if is faster because involves server participation.