I think RF's Way Better,But...>>>

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

I think RF's Way Better,But...>>>

Post by metal_head »

I don't want this to look like that I'm saying that RF is not good or something,RF is a lot better than Entidad-3D,but there's something I would like to show you.
I made a video showing some things(how they are in RF and in E3D).
I really need an answer if they can be done like in E3D. The video is only about collision and movement.In Entidad I used the game Solid Quest and in RF,My game,which is in developement for 9 months now.

Please take a look of the video and tell me if theese things I showed can be fixed.If you have any problems with downloading or with the file format,let me know.
http://www.mediafire.com/?gezzymbzd1n

And again,just because the video is called RF vs E3D doesn't mean that I'm comparing RF with entidad.If I liked entidad more I would have made my game with it.:D
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: I think RF's Way Better,But...>>>

Post by Danimita92 »

Well... Entidad is crap. That's all I've got to say. Most of the RF-spanish community left entidad because of all the great stuff RF could do.

Walking - I saw no difference. In fact, the animations in RF made it a little more realistic.

Going down - I didn't see much of a difference, either. In RF you can chose if the ramps are like a slide or if you can stop in the middle of it.

Ceiling - Use a scripted player instead of a normal player, I guess. Or add more gravity to the player.

Wall - I know, it's a bug with the player. Use a scripted player to fix it, I think.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: I think RF's Way Better,But...>>>

Post by metal_head »

I'm not good at scripting and I don't think I will be able to make a scritped player.
For the walking,the difference is that when you press W(for walking) in RF the player starts waliking at the speed of walinking and when you release the button the player stops immediately.In entidad,when you press W the player's speed of waliking starts to increase untill player reaches full speed and when you release the walking button player's speed starts to decrease till it reaches 0.
For going down a steep road,in RF player starts falling and the speed decreases.in E3D I don't know about falling,but the speed of walking remains the same.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: I think RF's Way Better,But...>>>

Post by paradoxnj »

Entidad3D is built from the Genesis demo GTest which was developed by Eclipse Entertainment. GTest was to be a shell for a commercial game called "Rayne Havoc". The project was scrapped and Genesis was released to the public. RF was written from scratch using various code snippets from the community.

All that stuff can easily be fixed. With the exception of the walking, all of your issues are related to the way RF handles collision. The "walking down" is caused by the way RF handles gravity.
Many Bothans died to bring you this signature....
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: I think RF's Way Better,But...>>>

Post by QuestOfDreams »

paradoxnj wrote:All that stuff can easily be fixed.
Then please tell me where the RF code is wrong.
The "walking down" is caused by the way RF handles gravity.
Just increase the gravity or decrease the player's speed and there won't be any jumping when going downwards

PS: You could have at least used the same levels and player models to compare RF and Entidad3D and see if your problems occur in both programs. The way you did it the video doesn't provide much useable information. :roll:
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: I think RF's Way Better,But...>>>

Post by paradoxnj »

Never said RF was wrong. ;) I just know how GTest works and know that RF movement is based upon ProjectX/Z code. Movement is definitely not as smooth as GTest.

I know that GTest has keeps a list of moves based on your input.

Code: Select all

#define CLIENT_MAX_MOVE_STACK	256

typedef struct Client_Move
{
	float			Time;
	float			Delta;
	float			ForwardSpeed;
	float			Pitch;
	float			Yaw;
	geVec3d			Pos;
	uint16			ButtonBits;
	uint16			CurrentWeapon;

	struct Client_Move	*Next;
} Client_Move;
There is a global stack for moves because GTest is built for multiplayer. I believe that GTest's movement is so smooth because it actually uses physics calculations for the final move calculations. The following function is what GTest uses for PlayerPhysics.

Code: Select all

//=====================================================================================
//	PlayerPhysics
//=====================================================================================
geBoolean PlayerPhysics(GenVSI *VSI, 
						void *PlayerData, 
						float GroundFriction, 
						float AirFriction, 
						float LiquidFriction, 
						float Gravity,
						float BounceScale, 
						geBoolean AllowBounce, 
						float Time)
{
	float	Speed;
	GPlayer	*Player;

	Player = (GPlayer*)PlayerData;

#ifndef FLY_MODE
	Player->LastGoodPos = Player->XForm.Translation;

	// Add gravity
	switch (Player->State)
	{
		case PSTATE_InLava:
		case PSTATE_InWater:
			Player->Velocity.Y -= PLAYER_GRAVITY*Time*0.05f;
			break;

		default:
			Player->Velocity.Y -= PLAYER_GRAVITY*Time;
			break;
	}

	CheckVelocity(VSI, Player, BounceScale, AllowBounce, Time);

	SqueezeVector(&Player->Velocity, 0.2f);
	geVec3d_AddScaled(&Player->XForm.Translation, &Player->Velocity, Time, &Player->XForm.Translation);

	CheckPlayer(VSI, Player);
#else		// Fly through walls
	Player->State = PSTATE_InAir;
	SqueezeVector(&Player->Velocity, 0.2f);
	geVec3d_AddScaled(&Player->XForm.Translation, &Player->Velocity, Time, &Player->XForm.Translation);
#endif
	
	Speed = geVec3d_Length(&Player->Velocity);

	// Apply friction
	if (Speed > 0.001)
	{
		float	NewSpeed;

		if (Player->State == PSTATE_Normal || Player->State == PSTATE_DeadOnGround)
			NewSpeed = Speed - Time*Speed*PLAYER_GROUND_FRICTION;
		else if (Player->State == PSTATE_InAir || Player->State == PSTATE_Dead)
			NewSpeed = Speed - Time*Speed*PLAYER_AIR_FRICTION;
		else if (PlayerLiquid(Player))
			NewSpeed = Speed - Time*Speed*PLAYER_LIQUID_FRICTION;

		if (NewSpeed < 0.0f)
			NewSpeed = 0.0f;

		NewSpeed /= Speed;

		// Apply movement friction
		geVec3d_Scale(&Player->Velocity, NewSpeed, &Player->Velocity);
	}
	
	UpdatePlayerContents(VSI, Player, Time);

	return GE_TRUE;
}
I think if you get a move stack going and make this function fit into RF, you'll fix the issues that metal_head is describing.

Also...check out Client_Control() in GMain.c line 848 to see how it processes moves from the stack.
Many Bothans died to bring you this signature....
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: I think RF's Way Better,But...>>>

Post by metal_head »

Thanks for the replies guys! Sorry that I didn't make the same levels,but I didn't have enough time.I was thinking about the gen1car script. Thw car increases it's speed by an amount untill it reaches full speed,so if something like that can be made in RF it would be very good.I think that smooth moving will be a very nice and dynamic addition to RF :)
Voltare
Posts: 263
Joined: Tue Jul 05, 2005 10:36 am

Re: I think RF's Way Better,But...>>>

Post by Voltare »

I've noticed a whole ton of code that's not used by rf.....it's almost a complete different engine compared to "vanilla" genesis3d or gtest.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: I think RF's Way Better,But...>>>

Post by paradoxnj »

Ok...I looked throught the RF code and now think I know where to make the change. It seems like you need to change the way gravity is handled by the actor manager. You have to add a velocity vector and control movement that way.
Many Bothans died to bring you this signature....
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: I think RF's Way Better,But...>>>

Post by metal_head »

Well,I'm not very familiar with all this stuff.I want to become a programmer one day,because that is very interesting to me.Before I discover RF I was making web pages,but that's very different from the programming languages RF uses,so I won't be able to do this yet (sadly:( ).What's wore,is that now I'm on a holiday :d and I have iternet onlyu on dinner because the restaurant has a Wi-Fi source,so I won't be able to eaven take a look on it.
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Re: I think RF's Way Better,But...>>>

Post by Masta_J »

if you want to increase the speed of your actor gradually, why not use the attribute system. Just create an attribute which dictates the speed of your player, and while you hold the walk key, you set your attribute to modify every half a second or so.

Eg:

Code: Select all

  

if(IsKeyDown(K_WALK))
{
 ANIM=StringCopy(WALKANIM);
 ANC=2;
 SPEED=Integer(GetAttribute("speed","Player")/1.5)
 }

 if(IsKeyDown(K_WALK))
 {
  if(run_time < time)
   {
    if(random(1,10)>7)
     {
      ModifyAttribute("speed",1,"Player");
      run_time = time + 0.5;
     }
  }
This will increase your pawn's speed by one unit per half a second.
A good warrior knows his limits, but a great warrior finds his way around them.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: I think RF's Way Better,But...>>>

Post by metal_head »

Wow,I didn't think of using an atribute,but I don't really know how I'm going to do this.If the attribute is,let's say 100,will the max seed of the player be 100 too?
I don't really get the script either,I'm new in scripting and have a long way to go to learn simkin,I have programed in HTML,Javascript,CSS (the web languages),but never in something like simkin.
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Re: I think RF's Way Better,But...>>>

Post by Masta_J »

In order to set the attribute, go into your install folder, then open up "Player.ini", and simply add the attribute in there. For using a speed attribute, you don't want the lowest amount of your attribute to be 0, because then your player won't move at all unless his/her attribute is increased. The best way to define your speed attribute looks a little something like this:

Code: Select all

[speed]
initial=20
low=20
high=100
This will ensure that your attribute won't decrease below 20, which will therefore be your players starting speed. 100 will be the max speed that your player will eventually run at. In terms of the code, to explain it to you would be quite a lengthy process. I would suggest that you play around with the GenericPlayer example script. Thats how i learnt the basics of coding. You can add this segment of code to that script under the RunPlayer[() order.
This portion of code is already in the RunPlayer[() order and is the command which tells your pawn to walk forward. All I have changed is hilighted in red.

Code: Select all

if(IsKeyDown(K_FOR))
{
ANIM=StringCopy(WALKANIM); ///Predifined animation for walking.
ANC=2;
[color=#FF0000]SPEED=Integer(GetAttribute("speed","Player")/1.5)[/color]
}
Basically I have added the GetAttribute command to the SPEED=Integer command. GetAttribute returns the amount of the specified attribute (in this case, "speed"), therefore telling the pawn that his speed is whatever the attribute "speed" is.
You will need to add the second portion of code:

Code: Select all

if(IsKeyDown(K_FOR))
{
  if(run_time < time)
   {
    if(random(1,10)>7)
     {
      ModifyAttribute("speed",1,"Player");
      run_time = time + [color=#FF0000]0.5[/color];
     }
  }
}
Directly under the first portion. Basically what this does is modify the attribute "speed" by 1 unit every 0.5 seconds that you've been holding down the walk button. You can increase/decrease the amount of time it takes to pick up speed by changing the numeric highlighted in red.

I forgot to add this in my previous response, but you will also need to add this under the first two portions of code:

Code: Select all

if(IsKeyDown(K_FOR)=false)
{
ModifyAttribute("speed",-100,"Player");
}
This will return your speed back to normal once you release the forward key.

Hope this helps with your learning. Once you gain an understanding of coding, RF is pretty much limitless!
A good warrior knows his limits, but a great warrior finds his way around them.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: I think RF's Way Better,But...>>>

Post by metal_head »

Thanks,now almost evrything got clear.I can't get it to work sadly.

Code: Select all

WALKANIM     [Run]

Spawn[()
{
Lowlevel("Run");
}]
Run[()
{
if(IsKeyDown(15))
{
ANIM=StringCopy(WALKANIM); ///Predifined animation for walking.
ANC=2;
[color=#FF0000]SPEED=Integer(GetAttribute("speed","Player")/1.5)[/color]
}

if(IsKeyDown(15))
{
  if(run_time < time)
   {
    if(random(1,10)>7)
     {
      ModifyAttribute("speed",1,"Player");
      run_time = time + [color=#FF0000]0.5[/color];
     }
  }
}

if(IsKeyDown(15)=false)
{
ModifyAttribute("speed",-100,"Player");
}
}]
I put a pawn in the level and set it to hold the script,but nothing changed.Maybe I'm doing something wrong.
Also I want to ask about that command:

Code: Select all

ANIM=StringCopy(WALKANIM); 
That's the command which tells the player to do an animation when the 15 key if((IsKeyDown(15)) is pressed,right?,but I haven't seen that before,I tough that the command for animation is

Code: Select all

Animate(WALKANIM);
never mind,why should in the script be a command for animation,isn't the script supposed do be only about the player's speed.
Thanks a lot for helping me Masta J :) only if you can help me figure this out I'll be very very gratefull
Post Reply