View previous topic :: View next topic |
Author |
Message |
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Tue Mar 03, 2009 1:19 pm Post subject: simulated functions and ROLE |
|
|
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 |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Wed Mar 04, 2009 12:43 pm Post subject: |
|
|
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 |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Wed Mar 04, 2009 1:42 pm Post subject: |
|
|
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 |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Wed Mar 04, 2009 10:09 pm Post subject: |
|
|
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 |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Wed Mar 04, 2009 11:06 pm Post subject: |
|
|
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 |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Mar 05, 2009 11:07 am Post subject: |
|
|
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 |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Mar 05, 2009 7:47 pm Post subject: |
|
|
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 |
|
|
.:..:
Joined: 30 Nov 2004 Posts: 11 Location: Finland
|
Posted: Wed Mar 11, 2009 11:55 pm Post subject: |
|
|
"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 |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Fri Mar 13, 2009 6:53 pm Post subject: |
|
|
Hell ya it does!!
Thanks for taking the time to explain it Dots, I appreciate it :-)
Bass |
|
Back to top |
|
|
|