Skip to main content
GameDev.net gamedev.net
🔒 Locked

FPS

Started by NickyP101 Mar 17, 2005 at 12:18 AM 5 replies 850+ views
Original Post
NickyP101
NickyP101
Currently my multiplayer, 2d top down view, tile based scroller, shooter game is running at 20fps. Now i really hvnt made a game before, this is my first, lol been working on it for about 3 weeks now. Im just wondering if 20fps is well below the acceptable standard? Im running the game in a 800 by 800 window. No i realise u prob need more information, but can u give me an arrprox answer? Lyk if it is obviously a horrible fps lol If it is ill start the debugging beofre i go further in the game :) Thx in advance, Nick
nihilisticod
nihilisticod
2d top down tile based at 20fps at 800x800. Sounds like something is amiss.

Are you writing in in VB, using windows GDI, on an old computer, or runnign a lot of other applications in the background? If you havnt met any of these conditions then you are hopefully drawing a LOT on the screen. Try runnign it fullscreen and see if that help at all.

Although 20 fps is detectable, but even first person shooters are quite playable at that rate. If you think you wouldnt be irritated playing it at that rate then its more than likely fine.
NickyP101
NickyP101
Im using java, yes i have programs running in the background, map isnt really thats big, map is about 1600, 1600.
nihilisticod
nihilisticod
I am not at all familiar with how graphics are done in java. DO you use an api or is there some native graphics methods or what? I've never used it. I suspect that java is the first problem since it runs on top of the virtual machine. That will slow things down to start. I guess I dont know enough about java graphics to answer.
jbadams
jbadams
Just a few things to keep in mind:

-Using Java will slow things down a little bit. It's an excellent language, and it's improved vastly in terms of speed in recent years, but it can still have some issues with rendering anything graphics intensive. This does not mean you should use another language, it's just something to keep in mind - for now I'd advise staying with Java, as you seem to be learning well (I've been following a few of your threads [wink]).

-Running in windowed mode will be a little slower than running in fullscreen. Again, this is not neccesarily to say that you shouldn't run in a window, as there are many reasons in favour of doing so, but just another thing to be aware of.

-Are you using hardware accelleration (ie. something like the JOGL library to use a 3d card), or are all the calculations performed in software? Hardware will obviously run faster, but don't worry about it yet if you're using software calculations and aren't ready to move onto this yet.

-The last thing to check are your algorithms and data structures (how you're storing the game's information). Changes in these will often make the biggest difference in terms of performance, but I can't really offer any specific suggestions on this without seeing appropriate parts of your code.


Now, all that aside, 20fps is pretty good for your first effort - chances are your coding is still somewhat inefficient, but just by getting something on screen you've gotten further than many people. [wink] Does the game look good like that? If it looks ok, then just keep working. Even if it's noticable, you should probably still keep working. Get everything working, finish up the game, and then try to optimise it - otherwise you may rewrite some code to be faster, and end up replacing it to add a new feature anyway.

Now, for your homework, I want you to find out what a 'profiler' is. [wink]

Hope that's of some help. [smile]
- Jason Astle-Adams
NickyP101
NickyP101
Haha thanks for ur input :) I have been programming for lyk 3 years, im 16. Im actually running my program through JProbe right now as we talk lol. And yeah i can garentee that my algoriths are inefficient. Hell lol i even know what is causing performance issues, im drawing the whole map to a buffered image, then croping the image and drawing it to the buffered strat lol, inefficient yes, but i have reasons for doing it that way instead of just drawing the imediate tiles to the first buffered image lol.

Ill keep in touch, thanks again :) Nick, haha im addicted to programming, is programming a good thing to follow onto after i finnish high skool, lyk should i do a software engineering?

NickyP101
NickyP101
Without Cropping i get FPS at 25, haha ive been having problems getting my problem across with this cropping etc. I just cant get this problem around my head :( Ill try think of a nice way to write it before i post it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.