Jump to content

Recommended Posts

Posted

Hey guys, it's me again

I just found a really strange and hard bug. I positioned an entity at 0,0,4100 and then it went crazy ...

Here's my code and a video:

int main(int argc, char** argv)
{
Initialize();

//Create a graphics context
SetAppTitle("Dustin's Solar System");
Graphics(600,800,0,60,1);	

//Create a world
if (!CreateWorld()) {
	MessageBoxA(0,"Error","Failed to create world.",0);
	goto exitapp;
}
CreateFramework();

//Setup the camera
cam=GetLayerCamera(GetFrameworkLayer(0));
PositionEntity(cam,Vec3(1,0,0));
CameraRange(cam,0.0001f,10000);

TEntity Mercury = LoadModel("abstract::Mercury.gmf");
PositionEntity(Mercury,Vec3(4100,0,0));

int move=0;
int strafe=0;

while(!AppTerminate()) {

if(MouseDown(1)){
   if(!camrotmode){
       camrotmode=true;
	mmx = MouseX();
	mmy = MouseY();
       MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
   }
}else if(camrotmode){
 camrotmode=false;
 MoveMouse(mmx,mmy);
}

if (KeyDown(KEY_L)){
Hud::ShowPlanetInformation();
}

if(camrotmode){
MouseMovement::Update();
RotateEntity(cam,camrotation);
}
if (!MouseDown(1)){
ShowMouse();
}

move=KeyDown(KEY_W)-KeyDown(KEY_S);
strafe= KeyDown(KEY_D)-KeyDown(KEY_A);
if (KeyDown(KEY_LSHIFT)){
	move *= 10;
	strafe *= 10;
}
if (KeyDown(KEY_SPACE)){
	move *= 50;
	strafe *= 50;
}
MoveEntity(cam,Vec3(strafe/1.0*AppSpeed(),0,move/1.0*AppSpeed()));

UpdateFramework();
RenderFramework();

Flip(0);
}
exitapp:
return Terminate();
}

And here the video:

 

Need fast help pls, it's a project for school which has to be finished in 1 and a half week -.-

Thanks

Dustin

Posted

Thank you for that quick answer =)

Unfortunately that doesn't work. But it has to be something in my code, cause in the editor there is no such problem...

The best is that it happens with and without lights ...

SetWorldSize(Vec3(100000.0f,100000.0f,100000.0f));

 

//EDIT

I put the model in the editor, no problems. I loaded that scene in code and i got the same bug as before. I must be missing something that the editor has ...

Posted

No problems here :)

 

World size: 50000

Camera Range: 6000 (if that matters...maybe??)

 

A model at Vec3(6000.0F) looks exactly the same as Vec3(3000.0F), no matter

if there is a light or not...

 

Have you tried it with a smaller model? Mine are max 20 units across.

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Posted

Works fine with gamelib also. Gamelib does a few billion things to get the Editor scene loaded right, so I'm not going to guess what it could be :)

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

That's where you need intelligent game design. You can't just throw all arbitrary ideas into a game and expect that they work. About 90% of every game is faked, but faked so well that people don't notice it.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

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.

×
×
  • Create New...