GodDamn I knew I would have forgotten 1 dllX Abstract X wrote:Missing lua51.dll.
http://rapidshare.com/files/412570094/lua.zip
Moderator: Coders of Rage
GodDamn I knew I would have forgotten 1 dllX Abstract X wrote:Missing lua51.dll.
X Abstract X wrote:Okay, it ran.
Mario walks around smoothly, didn't notice bad framerate at all.
When you scroll the map, it's supposed to be jittery because it moves by a full tile each time, right?
So, it ran good for me.
X Abstract X wrote:Oh yes, he runs at about half the speed when he's in the tiled area. I'm not so sure it's a rendering issue though. How does your main loop look and how are you capping the logic framerate?
Code: Select all
if ( SDL_GetTicks() - CurrentTick > 1000 ) {
if ( CurrentFrame > MaxFPS ) {
SDL_Delay( ( ( 1000 / MaxFPS ) - (SDL_GetTicks() - CurrentTick ) ) ); // Delay the nessacary
CurrentFrame = 0;
}
}
Code: Select all
void Map::Render() {
if ( Key[SDLK_a] ) {
Camera::GetInstance()->SetX( Camera::GetInstance()->GetX() - 0.3f );
}
if ( Key[SDLK_d] ) {
Camera::GetInstance()->SetX( Camera::GetInstance()->GetX() + 0.3f );
}
if ( Key[SDLK_w] ) {
Camera::GetInstance()->SetY( Camera::GetInstance()->GetY() - 0.3f );
}
if ( Key[SDLK_s] ) {
Camera::GetInstance()->SetY( Camera::GetInstance()->GetY() + 0.3f );
}
glBindTexture(GL_TEXTURE_2D,Texture);
glEnable( GL_TEXTURE_2D );
for ( float x = Camera::GetInstance()->GetX() + 16;x < Camera::GetInstance()->GetX() + Camera::GetInstance()->GetWidth();x += 32 ) {
for ( float y = Camera::GetInstance()->GetY() + 16;y < Camera::GetInstance()->GetY() + Camera::GetInstance()->GetHeight();y += 32 ) {
for ( int LAYER = 0;LAYER < 2;LAYER++ ) {
if ( x >= MapW * 32 || x < 0 || y >= MapH * 32 || y <= 0 ) {
continue;
}
if ( Tile[LAYER][(int)x / 32][(int)y / 32] < 0 ) {
continue;
}
for ( int i = 0; i < 16;i++ ) {
if ( ( Tile[LAYER][(int)x / 32][(int)y / 32] - (i * 16) ) < 16 ) {
CropX = ( Tile[LAYER][(int)x / 32][(int)y / 32] - (i * 16) ) * 32;
CropY = i * 32;
glPushMatrix();
glColor3f(1,1,1);
glTranslatef(x - Camera::GetInstance()->GetX(),y - Camera::GetInstance()->GetY(),0);
glBegin( GL_QUADS );
glTexCoord2f(CropX / 512,CropY / 512); glVertex2f(-32 / 2,-32 / 2);
glTexCoord2f( ( CropX + 32 ) / 512,CropY / 512 ); glVertex2f(32 / 2,-32 / 2);
glTexCoord2f( (CropX + 32 ) / 512, ( CropY + 32 ) / 512); glVertex2f(32 / 2,32 / 2);
glTexCoord2f(CropX / 512, ( CropY + 32 ) / 512); glVertex2f(-32 / 2,32 / 2);
glEnd();
glPopMatrix();
break;
}
}
}
}
}
}
Lol sorry about that, I wonder why it would slow down if you're CPU was a only at 12%.......Maybe its just my shitty PC and I'm not capping the framerate correctly...I'm confused I've been trying to firgure this out for days nowX Abstract X wrote:My CPU was at 12%. I didn't look at that code yet, I'll edit this in a bit.
I keep having to end the task to quit, is there an exit key? lol
I think 12% might be deceiving. My CPU is quad core, hyperthreaded, and 1/8 of 100% is 12.5%. As far as I know, applications will use as much CPU as they can get, an entire core if possible.N64vSNES wrote:Lol sorry about that, I wonder why it would slow down if you're CPU was a only at 12%.......Maybe its just my shitty PC and I'm not capping the framerate correctly...I'm confused I've been trying to firgure this out for days nowX Abstract X wrote:My CPU was at 12%. I didn't look at that code yet, I'll edit this in a bit.
I keep having to end the task to quit, is there an exit key? lol
CurrentTick is the time that has alapsedX Abstract X wrote:What is CurrentTick?
Time elapsed since the start of program? That would translate to:N64vSNES wrote:CurrentTick is the time that has alapsedX Abstract X wrote:What is CurrentTick?
Code: Select all
if (0 > 1000) {
if (CurrentFrame > MaxFPS) {
SDL_Delay(1000 / MaxFPS);
CurrentFrame = 0;
}
}
It's still screwed. As far as I can tell, you didn't supply an OpenGL dll so it's been using the one in my win32 folder.N64vSNES wrote:http://rapidshare.com/files/412705189/newbuild.zip
Ok so here is the new, I realised that my frame rate was fucked and was capping it wrong So try it know and also see if the is any diffrence when you use another openGL dll ( I doubt it'll make a diffrence but its worth a try )
Well I've fixed it, its not exactly glut speed but its a hell of a lot faster, I gave it a newer openGL DLL and it runs with maps rendering at 30-40% CPU at 60 FPS however before it was at 50% (dual core) at about 30-40 FPS when maps were renderingX Abstract X wrote:It's still screwed. As far as I can tell, you didn't supply an OpenGL dll so it's been using the one in my win32 folder.N64vSNES wrote:http://rapidshare.com/files/412705189/newbuild.zip
Ok so here is the new, I realised that my frame rate was fucked and was capping it wrong So try it know and also see if the is any diffrence when you use another openGL dll ( I doubt it'll make a diffrence but its worth a try )
For me, it takes 7 seconds for mario to cross in the tiled area, 4.5 seconds to cross in the empty area. That is definitely not normal, even if the game renders at 20 FPS you probably want the simulation to run at a constant speed. If that bothers you, you could check out http://gafferongames.com/game-physics/f ... -timestep/ and work on decoupling the simulation speed from the rendering speed.N64vSNES wrote:Well I've fixed it, its not exactly glut speed but its a hell of a lot faster, I gave it a newer openGL DLL and it runs with maps rendering at 30-40% CPU at 60 FPS however before it was at 50% (dual core) at about 30-40 FPS when maps were renderingX Abstract X wrote:It's still screwed. As far as I can tell, you didn't supply an OpenGL dll so it's been using the one in my win32 folder.N64vSNES wrote:http://rapidshare.com/files/412705189/newbuild.zip
Ok so here is the new, I realised that my frame rate was fucked and was capping it wrong So try it know and also see if the is any diffrence when you use another openGL dll ( I doubt it'll make a diffrence but its worth a try )