Hyper.nl Unreal Services Forum Index Hyper.nl Unreal Services
The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

simulated functions and ROLE

 
Post new topic   Reply to topic    Hyper.nl Unreal Services Forum Index -> Projects
View previous topic :: View next topic  
Author Message
srbassalot



Joined: 16 Sep 2004
Posts: 229
Location: Earth

PostPosted: Tue Mar 03, 2009 1:19 pm    Post subject: simulated functions and ROLE Reply with quote

Hey guys, quick question...
Ran into an issue where I coded a mod and tested it in the single player environment and it worked fine but it didn't in the server environment...After some research it looks like a function that is declared as a "simulated function" needs to have it's Remote_Role declared? I am more than confused on this, I read all the info I can find on it but can't make sense of it.
I have declared the "Remote_Role" as SimulatedProxy but that doesn't seem to help and I know I'm missing something here....Any ideas on this?
I know it's kinda of a broad issue but any input would help..

Thanks,
Bass
Back to top
View user's profile Send private message
mental-HunteR



Joined: 05 May 2006
Posts: 363
Location: The Netherlands

PostPosted: Wed Mar 04, 2009 12:43 pm    Post subject: Reply with quote

Depends if the base of "thing" (The class you got the script from) you've created has set some things in advanced, like BNetTemporary or something. If you still don't know what i mean pm me the mod and ill fix it if i can.
_________________
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
srbassalot



Joined: 16 Sep 2004
Posts: 229
Location: Earth

PostPosted: Wed Mar 04, 2009 1:42 pm    Post subject: Reply with quote

Mental...yes bNetTemporary is true because it is projectile class based..


While I'm thinking of it let me add.....I have been testing in a "Lan server configuration" does anyone know if there will be differences in behavior in a dedicated server configuration?
I ask because Of code like >>>>>
Super.PostBeginPlay();
if ( Level.NetMode != NM_DedicatedServer )

Does that include a Lan server?

Thanks a lot guys, I really appreciate the input..
BTW I'm testing on my Lan because it's easier to be sure everything is running fine before releasing into the wild :-)

Bass
Back to top
View user's profile Send private message
mental-HunteR



Joined: 05 May 2006
Posts: 363
Location: The Netherlands

PostPosted: Wed Mar 04, 2009 10:09 pm    Post subject: Reply with quote

and how are you running your sever?? via a shortcut or something?

or just you start your by going to unreal goto multiplayer and clickm on start server so that if you leave the game, the server closes?
_________________
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Bleeder91



Joined: 28 Sep 2006
Posts: 265

PostPosted: Wed Mar 04, 2009 11:06 pm    Post subject: Reply with quote

lets see what we have here, levelinfo script..:
Code:

var enum ENetMode
{
   NM_Standalone,        // Standalone game.
   NM_DedicatedServer,   // Dedicated server, no local client.
   NM_ListenServer,      // Listen server.
   NM_Client             // Client only, no local server.
} NetMode;

i guess that Standalone would be a LAN server? my english is going downwards ;(
_________________
Unreallity - Wrath of the Skaarj is still developing! Check out the new refreshing website!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
srbassalot



Joined: 16 Sep 2004
Posts: 229
Location: Earth

PostPosted: Thu Mar 05, 2009 11:07 am    Post subject: Reply with quote

Bleeder91 wrote:
lets see what we have here, levelinfo script..:
Code:

var enum ENetMode
{
   NM_Standalone,        // Standalone game.
   NM_DedicatedServer,   // Dedicated server, no local client.
   NM_ListenServer,      // Listen server.
   NM_Client             // Client only, no local server.
} NetMode;

i guess that Standalone would be a LAN server? my english is going downwards ;(


I had a MAJOR brain-malfunction from too much reading about UScript I think..LOL
OK I got it straight, it had been so long since I set it up for my Lan I forgot what was involved...the only difference is a Lan server uses ports 7775 and 7776 only, you still use -server just like a normal dedicated server.
Actually Bleeder "NM_Standalone" is for "Single Player Mode"

I think I almost have my problems fixed with my "ROLE" issues as well..

Mental, I start the server with a .bat file..

Thanks guys :-)
Bass
Back to top
View user's profile Send private message
Bleeder91



Joined: 28 Sep 2006
Posts: 265

PostPosted: Thu Mar 05, 2009 6:42 pm    Post subject: Reply with quote

goodies, another word learned in english :3
_________________
Unreallity - Wrath of the Skaarj is still developing! Check out the new refreshing website!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
srbassalot



Joined: 16 Sep 2004
Posts: 229
Location: Earth

PostPosted: Thu Mar 05, 2009 7:47 pm    Post subject: Reply with quote

LOL
If you ask me the "NM" is TOTALLY misleading...how can there be a NetMode if it is StandAlone?????? AKA Single Player Game or Bot Match.
That is not a question BTW :-P

Cheers,
Bass
Back to top
View user's profile Send private message
.:..:



Joined: 30 Nov 2004
Posts: 11
Location: Finland

PostPosted: Wed Mar 11, 2009 11:55 pm    Post subject: Reply with quote

"Simulated" keyword in front of a function means the function is allowed to be executed on Client side (this only touches with replicated actors from server to client, not ones spawn on client).
Code:
var enum ENetMode
{
   NM_Standalone,        // Standalone game.
   NM_DedicatedServer,   // Dedicated server, no local client.
   NM_ListenServer,      // Listen server.
   NM_Client             // Client only, no local server.
} NetMode;

That can be checked through Level.NetMode.
In simple they mean:
StandAlone - We are currently playing in an offline game.
DedicatedServer - We are currently running on a dedicated server.
ListenServer - We are currently hosting listen server (non-dedicated server, meaning you play yourself in the server with 0 ping).
Client - We are currently a client in a server.

Depending on WHERE you check it, it may give you different results (like if its a code that may be executed on client it may be NM_Client while on server its NM_DedicatedServer). This allows you to filter i.e: special effects from being uselessly spawned on server.

Lets say we have a projectile code:
Code:

<- Make it simulated to allow client call PostBeginPlay (meaning this actor was just spawned).
simulated function PostBeginPlay()
{
   local Effects E;

   if( Level.NetMode!=NM_Client ) <- We dont want client to assign Velocity as its already being replicated from server to client.
      Velocity = vector(Rotation)*Speed; <- Transform Rotation into vector component (X,Y and Z) and multiply it by projectile Speed.
   if( Level.NetMode!=NM_DedicatedServer ) <- Do not execute this following code on DedicatedServer (because there are no-one around on dedicated servers to see these effects).
   {
      E = Spawn(Class'SilentBallExplosion');
      if( E!=None )
         E.RemoteRole = ROLE_None; <- Assign remoterole to ROLE_None, so that ListenServer wont replicate this actor to a client.
   }
}


As for RemoteRole's (most common ones):
ROLE_None - Do not replicate this actor AT ALL.
ROLE_SimulatedProxy - Replicate this actor as simulated (meaning all physic codes and functions are allowed to be called on client).
ROLE_DumpProxy - As the name says, dump everything to client and let client handle no physics itself (this is the WORST solution).

And, bNetTemporary - Replicate actor only ONCE (does not continuously get updates from server), then let client handle rest of the actor (INCLUDING destroying it).

Net codes are in fact really simple, just learn the difference between Server side and Client side!
Server side: the server's copy of the game running.
Client side: when you join a server you have different copy of game running.
And never expect that everything is being sent over from Server to Client (as this would obviously hog up too much bandwith).

..hope this helps any.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Bleeder91



Joined: 28 Sep 2006
Posts: 265

PostPosted: Thu Mar 12, 2009 8:21 pm    Post subject: Reply with quote

hey dots
_________________
Unreallity - Wrath of the Skaarj is still developing! Check out the new refreshing website!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
srbassalot



Joined: 16 Sep 2004
Posts: 229
Location: Earth

PostPosted: Fri Mar 13, 2009 6:53 pm    Post subject: Reply with quote

Hell ya it does!!
Thanks for taking the time to explain it Dots, I appreciate it :-)

Bass
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Hyper.nl Unreal Services Forum Index -> Projects All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group