Fan does not rotate online

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
Barbie
Godlike
Posts: 1722
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Fan does not rotate online

Post by Barbie » Mon Jul 15, 2019 2:02 am

In a map I have the decoration Fan2 and set its RotationRate.Roll to 100053. If I run the map locally, the fan rotates fine. But if I run the map on the server, the clients don't see it rotating. What's wrong there?
Attachments
FanTest.unr.7z
(7.92 KiB) Downloaded 8 times
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
PrinceOfFunky
Godlike
Posts: 1077
Joined: Mon Aug 31, 2015 10:31 pm

Re: Fan does not rotate online

Post by PrinceOfFunky » Mon Jul 15, 2019 3:18 am

Barbie wrote:In a map I have the decoration Fan2 and set its RotationRate.Roll to 100053. If I run the map locally, the fan rotates fine. But if I run the map on the server, the clients don't see it rotating. What's wrong there?
I can't check it now but I think CTF-Niven has a fix to make fans working online.
"Your stuff is known to be buggy and unfinished/not properly tested"

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Fan does not rotate online

Post by sektor2111 » Mon Jul 15, 2019 5:46 am

Here can be time to get over replication - which has problems here, or reinforcing it - and spawn a child FAN ONLY in client VIA script letting client to be authoritative. Definitely there is a bit of fine tuning at properties for making it to work ON-Line. Second solution would be to assist said fan with other actor causing a variable rotation and changing properties dynamically for triggering replication to work even later not only at Map-Start. I did this with flags in MH-MinasTirith giving them a different fluttering frequency without to edit map and using original actors.

Sektor's Settings might be tested:
FAN2 >
- NetPriority = 4
- NetUpdateFrequency = 10
- bstasis = FALSE - allow animations with any matter
- bAlwaysRelevant - because frequency is adjusted above
Else
- NetUpdateFrequency 100 but...
- RemoteRole = ROLE_DumbProxy
- still NetPriority = 4
then testing if setting up bNoDelete would help.

Number 2: There is a version of FACE in forum which I uploaded where those asteroids in SkyBox are not only visible ON-Line but they are rotating as well - look at their setup.

Edit: I forgot a detail
If that rotation whatever 100053 causes replication problems and engine sets it to 0, you will want to switch to non-replication method dealing in client directly else nothing will rotate if value is nullified.
Edit2:As expected
Replication is doing sucks at that rotation rate so we might have another solution - operational On-Line - rotating fast and smoother.
[attachment=0]DM-FanTest_1.zip[/attachment]
Hit me with 5 stars :lol2: .
Attachments
DM-FanTest_1.zip
Changed that %K and %O because don't make any sense... and map went smaller at once with MyLevel stuff added...
(9.98 KiB) Downloaded 11 times

User avatar
Deepu
Skilled
Posts: 181
Joined: Mon Nov 11, 2013 7:56 am
Personal rank: Average
Location: India
Contact:

Re: Fan does not rotate online

Post by Deepu » Mon Jul 15, 2019 6:44 pm

:twisted: :twisted: :twisted: :twisted: :twisted: adjust with this star :P

Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Re: Fan does not rotate online

Post by Red_Fist » Wed Jul 17, 2019 7:24 am

When playing SP maps, oldskool, I never noticed they didn't work.

The other SP (Mr Prophet) was an air vent that they used zone gravity and you had to avoid the fans or get sliced to death I played them on loaths server several times.
Binary Space Partitioning

User avatar
Barbie
Godlike
Posts: 1722
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Fan does not rotate online

Post by Barbie » Thu Jul 18, 2019 2:57 pm

I tried some more variants: the fan is rotating online, when
* the sucking zone in front of it is removed
* another fan is put into the map.
Very strange, and I cannot see any correlation.

Thanks for your answers so far. I didn't check other examples with working fans or other decorations - they do not help answering the question, why this special setup does not work.
Red_Fist wrote:The other SP (Mr Prophet) was an air vent that they used zone gravity and you had to avoid the fans or get sliced to death
Exactly the same happens here.
sektor2111 wrote:If that rotation whatever 100053 causes replication problems and engine sets it to 0,
Nice approach, but that is not the reason (replication problems=only bits 9 to 16 of the rotator components are transferred).
sektor2111 wrote:
DM-FanTest_1.zip
(For the reader who didn't inspect this solution: at map loading a fan is spawned if the machine is not a dedicated server. So the fan only exists on clients.) Thanks for this - while it is not an answer to my question, it seems to be the way to get a rotating fan. And it even raises some interesting questions:
1) You are using a sub class of SpawnNotify to spawn a fan.
code of FanNotify
Show

Code: Select all

class FanNotify expands SpawnNotify;

event PrebeginPlay()
{}

simulated function PostbeginPlay()
{
	Super.PostbeginPlay();
	if (Level.NetMode == NM_DedicatedServer)
		return;
	DoMyFan();
}

simulated final function DoMyFan()
{
	Spawn(class'AFan2',,,vect(14594,-2944,-3168));
}
Isn't a sub class of a usual Actor like Keypoint enough to do this work? I mean, your FanNotify is called on every spawned Actor, and this useless processing should be avoided.

2) The declaration of SpawnNotify tells:

Code: Select all

class SpawnNotify expands Actor native;

var class<Actor> ActorClass;
where ActorClass looks like a filter for the notifications: the SpawnNotification() function is only called for actors of that class and its subclasses. But where can I set this in UnrealEd?
sektor2111 wrote:Changed that %K and %O because don't make any sense
(These variables were used in a SpecialEvent's DamageString: "%o was hacked. %k")
How can you realize a death message like "PLAYERNAME was hacked" where PLAYERNAME is replaced with player's name then? See also Wiki.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Fan does not rotate online

Post by sektor2111 » Thu Jul 18, 2019 5:55 pm

@Barbie
- Log what happens. If it would get called a lot you could have a bunch of Fans which I'm not sure if it happens. A SpawnNotifier always helped me better than a common actor and here is not used "event Actor SpawnNotification(Actor other)" and then I must ask: Where is the load ? Else for preventing a supposed overload can be used a bool for controlling this task, a log in postbeginPlay can show how it works or more logs.
Barbie wrote:How can you realize a death message like "PLAYERNAME was hacked" where PLAYERNAME is replaced with player's name then?
I did not see anything than K and O with no meaning because some mappers are going too creative without to know the meaning of those things. Those things are for a Killer and an Other during a valid kill not killed by map - already was under discussion such a situation (in a 300k map). If you want a Name you need a new actor, another SpecialEvent type hunting EventInstigator and then GetHumanName() of this Instigator even assigning dynamically that DamageString by capturing Instigator's name. %K and %O are just assumptions, you have to connect them with gameinfo properly. I dare to say that these are NOT FOR mappers.
Some natives are for that:

Code: Select all

//
// Deathmessage parsing.
//
void AGameInfo::execParseKillMessage( FFrame& Stack, RESULT_DECL )
{
	guard(AGameInfo::execParseKillMessage);
	P_GET_STR(KillerName);
	P_GET_STR(VictimName);
	P_GET_STR(WeaponName);
	P_GET_STR(KillMessage);
	P_FINISH;

	FString Message, Temp;
	INT Offset;

	Temp = KillMessage;

	Offset = Temp.InStr(TEXT("%k"));
	if (Offset != -1)
	{
		Message = Temp.Left(Offset);
		Message += KillerName;
		Message += Temp.Right(Temp.Len() - Offset - 2);
	}
	Temp = Message;

	Offset = Temp.InStr(TEXT("%o"));
	if (Offset != -1)
	{
		Message = Temp.Left(Offset);
		Message += VictimName;
		Message += Temp.Right(Temp.Len() - Offset - 2);
	}
	Temp = Message;

	Offset = Temp.InStr(TEXT("%w"));
	if (Offset != -1)
	{
		Message = Temp.Left(Offset);
		Message += WeaponName;
		Message += Temp.Right(Temp.Len() - Offset - 2);
	}

	*(FString*)Result = Message;

	unguardexec;
}
We do need a Killer and an Other and a Weapon for Killer, else it doesn't make any sense...

If you don't like client deal you can keep trying to replicate that 100053 and let me know what you get. All I did here was with using Editor and nothing else like a Notepad. Try Actor class if Notifier is not your favorite.
Barbie wrote: the SpawnNotification() function is only called for actors of that class and its subclasses. But where can I set this in UnrealEd?
Perhaps is easy with EditActor command - or using another Engine having

Code: Select all

var() class<Actor> ActorClass;
My current Engine package has a lot of variables open for editing preventing me to have headaches not to mention those "constants" turned into variables - just for any compilation fun - How do you think that I did patch plugins modifying Movers/Doors ? Because some DecidedByEpic constants are not that constants as they think - it's their goofing restricting coders, I was playing with them with no issues...

Even if I have a builder generating an entire decoration script writing non static classes during a blink, I did not do anything outside of Editor - that one is for patch files where I spawn "static" things - if you get what I mean. I did Afan then I saved a copy for being in Mylevel, I wrote notifier, I moved fan into spot, I captured spawning script with builder - copy paste compile done, adjusting a bit net properties Saving map with AFan for reference moved away (has no RemoteRole - it doesn't need it), neither the "run-time" one, and then I tested various rotations, including 200000. It was working like a kitchen blender.

As average toward CPU load, here I think server is relaxed because it won't replicate/rotate any FAN to/for player(s) because each player is taking care about his own FAN by itself.

User avatar
Barbie
Godlike
Posts: 1722
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Fan does not rotate online

Post by Barbie » Fri Jul 19, 2019 10:30 pm

sektor2111 wrote:If it would get called a lot you could have a bunch of Fans
That's not what I meant - of course PostBeginPlay(), where in you spawn a Fan, is executed only once for every SpawnNotify (PostBeginPlay() should be executed only once for every Actor, not only SpawnNotifies;).

Let me tell how I guess that SpawnNotifiers work: They are organized in single linked list (like Inventory or the Mutator chain), and the start anchor is Level.SpawnNotify. A SpawnNotify manages adding and removing from this list itself in the events PostBeginPlay() respectively Destroyed().
For every spawned Actor the engine runs through this list and checks if the spawned Actor is of the same class or a subclass of the given ActorClass from that current SpawnNotify. If so, the function SpawnNotification() of the current SpawnNotify is called and the just spawned Actor is passed to it. With the default settings the function just returns the given Actor (line 54 is the source code).

You may now argue that you did not implement the function SpawnNotification() - nevertheless the code is executed in the parent class. Also the single linked list has one element more than needed.
sektor2111 wrote:then I must ask: Where is the load ?
Just above. Well, reducing this does not save the world nor makes the world climate better or your machine significant faster, but I may ask: Why code executing for nothing? You can have the same results by using a "normal" Actor without having more writing work and having less CPU code.
sektor2111 wrote:%K and %O are just assumptions, you have to connect them with gameinfo properly.
I have checked the corresponding GameInfo class very properly and seriously (MonsterHunt in this case) and found that %k and %o are handled there. :lol:
BTW: your native C++ code cannot be from UT: If you leave out that "%k" in UT, the message is not processed at all.
sektor2111 wrote:I dare to say that these are NOT FOR mappers.
If the map is designed for a certain GameInfo class your argument is brushed away.
sektor2111 wrote:We do need a Killer and an Other and a Weapon for Killer, else it doesn't make any sense...
The code you posted works if none, one, two or three arguments are given. It just substitutes the variables with the corresponding names and mapper can produce a senseful message.

sektor2111 wrote:
Barbie wrote:But where can I set this [the ActorClass] in UnrealEd?
Perhaps is easy with EditActor command - or using another Engine having

Code: Select all

var() class<Actor> ActorClass;
So I guess the Epic developers have forgotten the brackets... It is definitely a variable that has to set by mappers in UnrealEd.
sektor2111 wrote:it's their [Epic developers] goofing restricting coders
Yes, I also know coders who set functions as final for no reason. :loool:
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Fan does not rotate online

Post by sektor2111 » Sat Jul 20, 2019 10:12 am

I also know myself using final functions for things which are not supposed to be updated by subclassing but Conformed and/or used OFF-Line and preventing some processing of seeking functions as explained by Higor.
MapGarbage by example is a tool which I'm updating by direct replacement instead of writing child builders... And I don't see where is the damage in using final functions. Epic were doing this is some monster-firing case and I did my own classes in NsMonster using... Another final instead of calling their function, and NO, I did not have any problem with EPIC's final trashes from Skaarj Pawns because my Notepad++ is capable to do string replacements in less than one second...

As for SpawnNotify list let me know how long is this list ? Why my server has no problems here, why some PrecipitationGenerator was doing sucks by using Actor and working Properly by using a SpawnNotifier and the rest of things addressing "Other Side" ? Of course I did some checks using logs, using a slow machine and running server and client in the same weak machine. While I could not see lags or breaks, I would like to know how long is this List which you find damaging and how many times is called in server running maps INSIDE Engine boundaries. Like I said, IF you do have a notifier problem USE Actor, simple as that.
Barbie wrote: and seriously (MonsterHunt in this case) and found that %k and %o are handled there. :lol:
BTW: your native C++ code cannot be from UT: If you leave out that "%k" in UT, the message is not processed at all.
I cannot recall where some Crap aka Map was spreading %K and %O looking too stupid for my server because it was used in a Zone Setup not a "Shooting-Kill" and I'm not bother to recall that trash, as for code is from UTv400 - see source-code posted in forum and this native is nominated in "GameInfo"... and nope it doesn't work everywhere See also some (if I well recall) CTF-300k-W00tious or such how does that death message looks like - a garbage, perhaps mapper is happy to laugh in a trash-can.

Code: Select all

		if ( (DamageType == 'SpecialDamage') && (SpecialDamageString != "") )
		{
			BroadcastMessage( ParseKillMessage(
					Killer.PlayerReplicationInfo.PlayerName,
					Other.PlayerReplicationInfo.PlayerName,
					Killer.Weapon.ItemName,
					SpecialDamageString
					),
				false, 'DeathMessage');
			bSpecialDamage = True;
		}
Explain me clearly if a Zone is killing you where is Killer, Other and Weapon... and NOPE this in MonsterHunt means Accessed None which I changed in my versions... if I well recall the last Accessed None which I fixed in killed function was exactly in such a case in one of testing sessions with Kelly... If a Zone has SpecialDamage (a brain-fart) and some crapped up string used, you will be interested to find Killer and his Weapon - let me know what you see...
I can manage to do such killer actors using NAMES properly instead of a native mess never done for Zones and writing... final functions.

Brackets problem ? Yes, they added brackets where things can be badly screwed up (TimeDilation is not for mappers, for sake, EPIC...) and NOT adding brackets where they should be used... a bunch of places. I'm trying to imagine what would be Bot Pathing knowledge if NavigationPoint class would have more data VISIBLE to mapper-user and stopping that hiding mess because it's not helpful at all.
Now you know what I mean with Editing/Modding version of UT ? Using some stock done for making things VISIBLE and not a blind editing based on guessing - for me they really screwed up things here. Using such files has been done since OldSkool coding, I did not reinvent warm water or the wheel.

Posting summary: I do have a FAN working On-Line... and even more than a FAN.

User avatar
Gustavo6046
Inhuman
Posts: 821
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Finite
Contact:

Re: Fan does not rotate online

Post by Gustavo6046 » Sat Jul 20, 2019 1:41 pm

sektor2111 wrote:Replication is doing sucks
Uhm, I'm not a fan of that... *wind stops*

Post Reply