For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

player possition based skyboxes

Unreal Unreal and more Unreal
Post Reply
User avatar
hell
OldUnreal Member
Posts: 7
Joined: Sun Jul 29, 2007 2:24 pm

player possition based skyboxes

Post by hell »

hey was wonderin if it was possible to code in unreal for one of the versions a slightly more advanced skyzoneinfo system. by that i mean move the skyzone camera in a relative direction of the players movement. if anyone play's valve source games you will see in maps with skyboxes the suroundings move slightly when going through a map. this would be really great and make maps more realistic like.
User avatar
PRIMEVAL
OldUnreal Member
Posts: 854
Joined: Mon Apr 24, 2006 10:45 pm

Re: player possition based skyboxes

Post by PRIMEVAL »

Kinda reminds me of the DOOM games. But I'm not seeing how that would be realistic since I would assume the mountains in the distance would remain stationary... :-?
Image
User avatar
hell
OldUnreal Member
Posts: 7
Joined: Sun Jul 29, 2007 2:24 pm

Re: player possition based skyboxes

Post by hell »

well say you had a mountain pass and you walked from one end to the other the one end would be different that the other cos of the gradual change
User avatar
PRIMEVAL
OldUnreal Member
Posts: 854
Joined: Mon Apr 24, 2006 10:45 pm

Re: player possition based skyboxes

Post by PRIMEVAL »

Ah, ok, that makes sense. But would we notice while we're busy blowing up Skaarj, Brutes, and Titans? :P But yeah, thinking about it that is a neat idea. I wouldn't know how it would be done, though.
Image
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: player possition based skyboxes

Post by Chaos13 »

The thing is called "Parallax Skybox" actually...
Skydev = Chaos13 = Dimension4
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: player possition based skyboxes

Post by GreatEmerald »

ZoneInfo attached to a mover? But then it doesn't follow the player.
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: player possition based skyboxes

Post by Raven »

Here's code (changed U2 ParallaxSkyZoneInfo). Didn't test it in game, but it compiles fine.

Code: Select all

class ParallaxSkyZoneInfo extends SkyZoneInfo;

var() float RelativeMoveScale;
var Pawn Player;
var vector LastPlayerLocation;

//------------------------------------------------------------------------------
simulated function Tick( float DeltaTime )
{
      local Pawn iPawn;

      Super.Tick( DeltaTime );

      if( Player == None )
      {
            for( iPawn = Level.PawnList; iPawn != None; iPawn = iPawn.NextPawn )
                  if( PlayerPawn(iPawn) != None && PlayerPawn(iPawn).Player != None )
                        Player = PlayerPawn(iPawn);
            if( Player != None )
                  LastPlayerLocation = Player.Location;
      }
      else
      {
            SetLocation( Location + (Player.Location - LastPlayerLocation) * RelativeMoveScale );
            LastPlayerLocation = Player.Location;
      }
}

defaultproperties
{
      RelativeMoveScale=0.100000
      bStatic=False
}
Image
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: player possition based skyboxes

Post by Chaos13 »

I dont like this code, because its only for SinglePlayer games and obviously wont work in network games.
Skydev = Chaos13 = Dimension4
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: player possition based skyboxes

Post by GreatEmerald »

The function is at least simulated :P
Pravin

Re: player possition based skyboxes

Post by Pravin »

That code could easily work online, by checking the role of the playerpawn being examined before setting the local player var..

Code: Select all

            for( iPawn = Level.PawnList; iPawn != None; iPawn = iPawn.NextPawn )
                  if( PlayerPawn(iPawn) != None && PlayerPawn(iPawn).Player != None && (iPawn.Role=Role_AutonomousProxy||Level.NetMode==NM_StandAlone))
                        Player = PlayerPawn(iPawn);
            if( Player != None )
                  LastPlayerLocation = Player.Location;
That would cover the case of a client - role is autonomous, or a singleplayer game - netmode is standalone. There should probably be prevention of the zone moving out of world bounds and such. This code seems to be largely for example purposes, but would be a great base.
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: player possition based skyboxes

Post by Chaos13 »

You sure simulated function that is not owned by playerpawn will be executed? Also it would be very good to make axis restrictions, warping and "infinite length surface" for perfect parallax :P All is easy to do ofc (think of setowner)
Last edited by Chaos13 on Mon Aug 18, 2008 1:26 am, edited 1 time in total.
Skydev = Chaos13 = Dimension4
Post Reply

Return to “Unreal General Forum”