Smooth Movement?

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

RandomDever
Chaos Rift Regular
Chaos Rift Regular
Posts: 198
Joined: Thu Mar 26, 2009 8:42 pm
Current Project: My Engine
Programming Language of Choice: C++

Re: Smooth Movement?

Post by RandomDever »

@lalacomun I would absolutely LOVE to be using OpenGL BUT I couldn't figure that out when I tried it before.
And that was back when I had time to mess around with it.
And by the way bumping up the frame rate help ALOT so thank you SO much.
Now I can finally resume development. :mrgreen:
Again thank you.
User avatar
lalacomun
VS Setup Wizard
VS Setup Wizard
Posts: 114
Joined: Wed Dec 28, 2011 10:18 pm
Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
Programming Language of Choice: C++
Location: Argentina
Contact:

Re: Smooth Movement?

Post by lalacomun »

Really glad i could help You :) anything else You need just ask,ill be glad to answer ;)
Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
Posts: 307
Joined: Sun Mar 13, 2011 7:57 pm
Current Project: 2D RPG & NES Platformer
Favorite Gaming Platforms: NES,SNES,N64,Genesis,Dreamcast,PC,Xbox360
Programming Language of Choice: C/++
Location: Canada

Re: Smooth Movement?

Post by Light-Dark »

k1net1k wrote:You need to narrow down your engine to the point where you can eliminate things causing it.
Start by removing textures, remove all characters, remove lighting, remove AI, slow down the game loop, use more debugging, etc. Keep going until you find the thing causing it, then drill down into that
Trufax, that is what i do for debugging mem leaks and crashes.
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step
Image
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Smooth Movement?

Post by avansc »

Light-Dark wrote:
k1net1k wrote:You need to narrow down your engine to the point where you can eliminate things causing it.
Start by removing textures, remove all characters, remove lighting, remove AI, slow down the game loop, use more debugging, etc. Keep going until you find the thing causing it, then drill down into that
Trufax, that is what i do for debugging mem leaks and crashes.
That is one option, and may work for small programs, and may even be the best option for beginners.

However, there are a few problems with this approach.

1. This does not scale.
2. This does not tell you what the root cause is.

I suggest you use the IDE's debugger, and step through the program, look at why is crashing. This will teach you better habits, it will also make you a better programer. (it will also prepare you for a job as a programmer, if you choose to end up there, since debugging ends up being the vast majority of the work in a products lifecycle)

PS: I would even suggest to use windbg/gdb or whatever, and learn to use that. It has by far the biggest learning curve, but will teach you the most.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
RandomDever
Chaos Rift Regular
Chaos Rift Regular
Posts: 198
Joined: Thu Mar 26, 2009 8:42 pm
Current Project: My Engine
Programming Language of Choice: C++

Re: Smooth Movement?

Post by RandomDever »

Well besides running my game at 100 fps, is there an easy way to implement OpenGL into my 'engine' so I don't have to do that for future projects?
User avatar
lalacomun
VS Setup Wizard
VS Setup Wizard
Posts: 114
Joined: Wed Dec 28, 2011 10:18 pm
Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
Programming Language of Choice: C++
Location: Argentina
Contact:

Re: Smooth Movement?

Post by lalacomun »

RandomDever wrote:Well besides running my game at 100 fps, is there an easy way to implement OpenGL into my 'engine' so I don't have to do that for future projects?
i think you could load an OpenGL Texture from your SDL Surfaces, here:

http://content.gpwiki.org/index.php/SDL ... ith_OpenGL

But remember you will not be able to draw an openGL Texture with SDL_BlitSurface function :(
hope it helped ;)
Image
RandomDever
Chaos Rift Regular
Chaos Rift Regular
Posts: 198
Joined: Thu Mar 26, 2009 8:42 pm
Current Project: My Engine
Programming Language of Choice: C++

Re: Smooth Movement?

Post by RandomDever »

Well that's a start but is there like an all-inclusive beginner's guide for people retooling from SDL to OpenGL because I have attempted this before and OpenGL does not like text rendering.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Smooth Movement?

Post by dandymcgee »

RandomDever wrote:Well that's a start but is there like an all-inclusive beginner's guide for people retooling from SDL to OpenGL because I have attempted this before and OpenGL does not like text rendering.
I think you can use SDL_ttf to generate a texture then render it with OpenGL, but usually you just use a bitmap font. I remember text in OpenGL being a pain as well.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
lalacomun
VS Setup Wizard
VS Setup Wizard
Posts: 114
Joined: Wed Dec 28, 2011 10:18 pm
Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
Programming Language of Choice: C++
Location: Argentina
Contact:

Re: Smooth Movement?

Post by lalacomun »

here you go:

http://www.sdltutorials.com/sdl-opengl-tutorial-basics

i havent read it all but it seems complete ;)
Image
User avatar
lalacomun
VS Setup Wizard
VS Setup Wizard
Posts: 114
Joined: Wed Dec 28, 2011 10:18 pm
Favorite Gaming Platforms: psx, nintendo ds, gameboy advance, xbox 360, ps2
Programming Language of Choice: C++
Location: Argentina
Contact:

Re: Smooth Movement?

Post by lalacomun »

well as regarding to text rendering it may be a pain in the ass :oops: but here some tuts on text
rendering with OpenGL:

http://www.opentk.com/doc/graphics/how- ... ing-opengl
http://en.wikibooks.org/wiki/OpenGL_Pro ... ndering_01

hope it helped ;)
Image
RandomDever
Chaos Rift Regular
Chaos Rift Regular
Posts: 198
Joined: Thu Mar 26, 2009 8:42 pm
Current Project: My Engine
Programming Language of Choice: C++

Re: Smooth Movement?

Post by RandomDever »

Indeed it did. Thank you.
BTW do you have any good articles on level design theory?

Edit: Specifically 2d platform level design theory.
Post Reply