Did you know? Every one of these messages is hand-typed live, just for you.

GameType in *.ini [Solved] Replication help need [PLZ]

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 10 Apr 2011, 16:38

I'm trying to define a multiplayer game in Unreal but I can't find proper int settings.
I want to be able to choose a RaceDM game in Unreal 'Start New Multiplayer Game' which is in Race package under DeathMatchGame class.

I can choose tons of 'em there but I can't figure out how to add any.

Code: Select all

[Public]
Object=(Name=Race.RaceGame,Class=Class,MetaClass=UnrealShare.SinglePlayer,Description="WPAB;RacePlayer")
Object=(Name=Race.RaceDM,Class=Class,MetaClass=UnrealShare.DeathMatchGame,Description="WPAB;RacePlayer")

Works only for singleplayer.

Any clues?

<.<
>.>
o.-

Raven?
Last edited by Z-enzyme on 10 Apr 2011, 22:30, edited 1 time in total.

User avatar integration
Skaarj Berserker Skaarj Berserker
Posts: 445
Joined: 01 Sep 2010, 12:37

Subject: Re: Multiplayer Game Type in .int file - Unreal 227g

Post Posted: 10 Apr 2011, 17:57

I took a look at UnrealShare.int and UnrealI.int. I would say, you have to use Engine.GameInfo as MetaClass in the second case. There are also Preferences entries, but I don't think they are important.

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: Multiplayer Game Type in .int file - Unreal 227g

Post Posted: 10 Apr 2011, 19:18

Oh.... OH! It works!

Thanks a bunch!

Prepare for a video then :D

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: Multiplayer Game Type in .int file - Unreal 227g

Post Posted: 10 Apr 2011, 22:28

Still, I'm having some troubles with replication so if there's anyone who could help me out I'd be glad.

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 10 Apr 2011, 22:51

What problems exactly?
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 01:03

Ok, I've got this hovercraft script there, and the problem is that it doesn't replicate one HitWall function right.

Code: Select all

function HitWall (vector HitNormal, actor Wall)
{
   local effects S;
   local rotator F;

   if(OldVel != vect(0,0,0))
      OldVel = Velocity;

   if(wall.isa('LevelInfo') || wall.isa('StaticMeshActor') )
   {
      WallVel = HitNormal*Throttle*0.1;;
      Throttle*=0.75;
      spawn(class'chip',Owner, '', Location-(HitNormal*( 32+frand()*8) ));
      s = spawn(class'SmallSpark2',Owner, '', Location-(HitNormal*( 32+frand()*8) ));
      s.drawscale = 2;
      f.yaw = 65535*frand();
      s.setrotation(F);
   }
}

The "s" effect is spawned but the "Throttle*=0.75;" doesn't happen. I've replicated Throttle but that doesn't do much.

Code: Select all

   reliable if ( Role==ROLE_Authority )
      BSearchActor, Dist, DistZ, Speed, DefFloat, Throttle;

That's all I've done to make it happen in game, and this is what already was there in PlayerWalking function (which I redid)

Code: Select all

      if ( Role < ROLE_Authority ) // then save this move and replicate it
         ReplicateMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
      else
         ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);

The Throttle is added in PlayerMove state.

And there's one more glitch with Rotation.Roll but that's not that serious and it needs a closer look at the script itself.

[Edith]

LOL I just fixed it by adding

Code: Select all

Simulated Function SlowDown()
{
   Throttle*=0.75;
}

I don't get it :<

User avatar salsaSkaarj
Gilded Claw Gilded Claw
Posts: 1862
Joined: 21 Apr 2009, 21:54
Location: on the prowl

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 11:51

Qtit wrote:[Edith]

LOL I just fixed it by adding

Code: Select all

Simulated Function SlowDown()
{
   Throttle*=0.75;
}

I don't get it :<


I probably don't know enough of UScript but the * after Throttle seems strange to me. Isn't the * the multiplying operation?, in which case I would expect Throttle = Throttle*0.75.
Damn, why don't I just look into an UScript manual - I'm starting to get intersted into the coding aspect in Unreal.

User avatar TheIronKnuckle
Gilded Claw Gilded Claw
Posts: 1967
Joined: 12 Nov 2007, 07:21
Location: Riding my bicycle from the highest hill in Sydney to these forums

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 14:44

In most (If not all) C-like languages

Code: Select all

x *= y;

is shorthand for

Code: Select all

x = x * y;

You can do this with all the standard math operators.

Code: Select all

x += y
x -= y
x *= y
x /= y

I wonder if you can do

Code: Select all

x %= y

I should try some time.
ImageIgnorance is knowing anything
And only idiots know everything

diamond
Skaarj Berserker Skaarj Berserker
Posts: 366
Joined: 13 Nov 2007, 10:51
Location: ROFLand
Contact:

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 15:56

AFAIK you can even do:

x <<= y;
x >>= y;
Image
UBerserker wrote:Architecture doesn't need to detailed, it just needs to be right.

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 18:41

Lol I know that x *= y; is x = x * y;

The question is, why the same line x *= y; doesn't work online in HitWall() function (which is replicated by the Actor class) and does work in SomeGodDamnSimulatedFunction() which I replicate now and s=Spawn(someshit) works always anywhere.
It's all about replication now.
Last edited by Z-enzyme on 11 Apr 2011, 19:38, edited 1 time in total.

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 19:37

There's more Replication issues.

Rotation part in PlayerWalking state PlayerMove function:

Code: Select all

   GetAxes(Rotation,X,Y,Z);

   SurfaceRot = HitNormal*x;

   MyRot = rotation;
   MyRotation.Yaw += aTurn*0.015 * ShipHandling;
   MyRotation.Yaw *= 0.95;
   MyRot += MyRotation;
   SurfaceRotation.pitch = (SurfaceRot.X * -16384) + (SurfaceRot.Y * -16384);
   if(Dist < 3*DistZ)
      MyRot.pitch += (0.0001*(400-Dist)) * (SurfaceRotation.pitch - rotation.pitch);
   MyRot.roll += (MyRotation.yaw * 0.00065* Throttle-2*ShipHandling);
   UpdatePawnRotation(MyRot);

   if ( Role < ROLE_Authority ) // then save this move and replicate it
      ReplicateMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
   else
      ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);


Video:
https://www.youtube.com/watch?v=WUbmd73s5xw

Part 1 - Server move (no glitch)
Part 2 - Client move (Rotation.Roll jumps)

Dunno why. I can send a full code to anyone who knows how to fix that.

User avatar salsaSkaarj
Gilded Claw Gilded Claw
Posts: 1862
Joined: 21 Apr 2009, 21:54
Location: on the prowl

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 21:06

TheIronKnuckle wrote:In most (If not all) C-like languages

Code: Select all

x *= y;

is shorthand for

Code: Select all

x = x * y;

Thanks, that's perfectly clear now.
So Uscript is C-like? pity for me, I'm not familiar with C (only VB, php and a bit of Python - and javascript when I have to :cry: and a bit of Java when it can't be avoided). Seems like I'll have to learn some new vocab and grammar to understand these scripts properly.

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 11 Apr 2011, 23:16

Lol I'm not familiar with ANY programming language... Except UScript :P

User avatar TheIronKnuckle
Gilded Claw Gilded Claw
Posts: 1967
Joined: 12 Nov 2007, 07:21
Location: Riding my bicycle from the highest hill in Sydney to these forums

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 12 Apr 2011, 00:43

salsaSkaarj wrote:
TheIronKnuckle wrote:In most (If not all) C-like languages

Code: Select all

x *= y;

is shorthand for

Code: Select all

x = x * y;

Thanks, that's perfectly clear now.
So Uscript is C-like? pity for me, I'm not familiar with C (only VB, php and a bit of Python - and javascript when I have to :cry: and a bit of Java when it can't be avoided). Seems like I'll have to learn some new vocab and grammar to understand these scripts properly.


Pretty much anything with curly braces and semicolons is C-like :P That includes Java and javascript, and IIRC PHP as well

diamond wrote:AFAIK you can even do:

x <<= y;
x >>= y;


That's crazy. I'm good with pointers, memory allocation, hacking the stack and the heap and that sort of super low level stuff, but I've never touched the bitwise operators; they take low to the lowest level. I suppose that's the next thing on the education agenda for me :P (I can't see the practical use these days though, maybe for EXTREME code opimisation)

Qtit wrote:Lol I'm not familiar with ANY programming language... Except UScript :P


Far out, I respect you sir! :lol: If there was one language I wish I knew fluently, it would have to be Uscript. The reward for writing the code is so much greater than it is writing something in C or VB imo, because you are being creative and the amount of enjoyment you get out of the end result reflects that.
Same principle applies to mapping. Mapping is a lot like 3D modelling. The thing is, when you finish a 3D model you can sit back, rotate it, zoom in on it, and go "damn fine". But that's all it's good for: looking at. Whereas when you make a map, the end result is something which you can walk around in, murder skaarj in, and truely immerse yourself in.

Mapping > Modelling
UnrealScript > Everything else


edit:

while we're off-topic, I recently discovered the ternary operator. It makes me bouncy. Turning if statements into if expressions makes for suprisingly elegant, even if terse, code. Need to check if Uscript has it.
ImageIgnorance is knowing anything
And only idiots know everything

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject: Re: GameType in *.ini [Solved] Replication help need [PLZ]

Post Posted: 12 Apr 2011, 16:25

And... Going back to the topic. What's wrong with my client steering? Replication or buggy code?

Next

Who is online

Users browsing this forum: No registered users and 38 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited