Jump to content

Terrain/camera problem


Raul
 Share

Recommended Posts

I made a RAW file with L3DT and imported in the Editor.

 

I put some trees and a few rocks and wanted to try in my "game". The problem is that my camera is stick to my feet. (see the pic) THis is happening only when I use terrains made by importing RAW files from L3DT.

i5 2.7Ghz, GTS 450, 8GB Ram, Win7 x64; Win8 x64

rvlgames.com - my games

RVL Games Facebook Page, YouTube Channel

 

Blitzmax :)

Link to comment
Share on other sites

Are you using a controller ?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Is there anymore information you can share? I just imported an L3DT raw fine ..

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

I do not know what else to say. There are no problems using the FPSShooter lua scrip in the editor. But when loading in my program...

 

Now I made a terrain from scratch in the editor and is running good. :)

 

No one had a similar problem until now?

i5 2.7Ghz, GTS 450, 8GB Ram, Win7 x64; Win8 x64

rvlgames.com - my games

RVL Games Facebook Page, YouTube Channel

 

Blitzmax :)

Link to comment
Share on other sites

Does the controller fall ?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Well I can only make guess's as all I have to go on is a picture and that you are using a controller.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Also here is the code for the "player":

 

It's nothing special. :)

 

CreatePlayer + UpdatePlayer:

void cPlayer::CreatePlayer()
{
//controller
PlayerController=CreateController(1.8,0.45,0.3,46);
EntityType(PlayerController,1);
SetBodyMass(PlayerController,100);
}

void cPlayer::UpdatePlayer()
{
//rotation
gx = GraphicsWidth()/2;
gy = GraphicsHeight()/2;
dx = Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed());
dy = Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed());
MoveMouse(gx,gy);
CameraPitch = CameraPitch + dy;
CameraYaw = CameraYaw - dx;
CameraPitch=Clamp(CameraPitch,-89,89);
PlayerRotation.X  = CameraPitch;
PlayerRotation.Y  = CameraYaw;

//movement
PlayerMove=KeyDown(KEY_W)-KeyDown(KEY_S);
PlayerStrafe=KeyDown(KEY_D)-KeyDown(KEY_A);

if (KeyDown(KEY_LSHIFT)||KeyDown(KEY_RSHIFT)) {
	if (!ControllerAirborne(PlayerController)) {
		PlayerMove*=2.0;
		PlayerStrafe*=2.0;
	}
}

float PlayerJump=0.0;
if (KeyHit(KEY_SPACE)) {
	if (!ControllerAirborne(PlayerController)) {
		PlayerJump=6.0;
	}
}

//controller input
UpdateController(PlayerController,PlayerRotation.Y,PlayerMove*3,PlayerStrafe*3,PlayerJump,500);

PlayerPosition=EntityPosition(PlayerController);
PlayerHeadPosition=PlayerPosition;

PlayerHeadPosition.Y =PlayerPosition.Y + 1.8;


double walkadd=AppSpeed()*Length(GetBodyVelocity(PlayerController));
walktimer+=walkadd;
PlayerHeadPosition.Y=Curve(1.0-0.4*sin(walktimer/500.0),PlayerHeadPosition.Y,16);
}

void cPlayer::SetPlayerPosition(TVec3 NewPlayerPosition)
{
MoveEntity(PlayerController,NewPlayerPosition);
}

 

Main Loop:

	myPlayer.UpdatePlayer();
       RotateEntity(frameworkCam,myPlayer.PlayerRotation);
PositionEntity(frameworkCam,myPlayer.PlayerHeadPosition);

i5 2.7Ghz, GTS 450, 8GB Ram, Win7 x64; Win8 x64

rvlgames.com - my games

RVL Games Facebook Page, YouTube Channel

 

Blitzmax :)

Link to comment
Share on other sites

Here there are the map files.

The engine version I use is 2.31

 

 

Well your map worked fine for me in the editor and my FPS project app (Blitzmax):

 

post-12-12721857386531_thumb.jpg

 

Looking at your code now.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

also try using drawtext to show you what value PlayerHeadPosition.Y is when you run your program.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

DrawTextW, as referenced in the error message, is actually the Win32 function DrawText which is probably why it's complaining about the arguments. The compiler is not recognising the parameter set and chosing the right function.

 

Just of the top of my head try something like:

 

char text[255];
sprintf(text,"Player head height is: %.2f",myPlayer.PlayerHeadPosition.Y);
DrawText(10,10,text);

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Well quickly looking at your code the problem(s) seem to be here:

 

       double walkadd=AppSpeed()*Length(GetBodyVelocity(PlayerController));
      walktimer+=walkadd;        
      PlayerHeadPosition.Y=Curve(1.0-0.4*sin(walktimer/500.0),PlayerHeadPosition.Y,16);

 

GetBodyVelocity is a Vec3 .. so what will length return here? I thought that was for the length of a str? doesnt curve smooth the transition between two positions? here it seems you are smoothing between 1.0-0.4×sin(walktimer/500.0) and PlayerHeadPosition.Y,16 what happens if you comment out the head bobbing routine? I assume thats what it is?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...