Sign in to follow this  

[java] Isometric engine - fps.

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently working on a graphical mud in Java, with an isometric graphics engine. I used an old isometric engine I wrote for another game that performed badly. Now that I'm using Swing I get much higher framerate, since it's hardware accelerated - I don't think I'm even gonna bother messing with volatile images manually. At the moment I'm working on the map editor (The days of manually writing map text files and then compiling them into binary format are over :)) I would be happy if someone would try it out and report back what framerate they're getting, including the size of the isometric panel and their system specs. DownLoad

Share this post


Link to post
Share on other sites
Exception in thread "main" java.io.FileNotFoundException: editor.prp (Nie mo┐na odnalečŠ okreťlonego pliku)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at mapeditor.Editor.main(Editor.java:66)

"Nie mo┐na odnalečŠ okreťlonego pliku" part means "file could not be found"

Share this post


Link to post
Share on other sites
i got fps=22-30 and size=(671,550)
system : duron 800/ 256 mb/ radeon 8500/ win xp

when i pressed 'full' it escaped with following error:
Exception occurred during event dispatching:
java.lang.NoSuchMethodError
at mapeditor.SideBar.actionPerformed(SideBar.java:47)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
n Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

Share this post


Link to post
Share on other sites
It runs perfectly on my system.
I get ~90-200 FPS (it's quite jumpy) in windowed mode, and 39-45 FPS in fullscreen mode (same framerate when maximizing the window as when "Full" is clicked).

But why, oh why, do you make your game in Java?! It's way too slow for decent game development. Well, that's my experince anyway.

Good luck with your game! :)

My system specifications:
Athlon XP 2500+ (really a ~1866MHz)
1024 MB Duel Ram
128 MB Radeon 9500

Windows XP Professional w/Service Pack 1
DirectX 9.0b

EDIT: I should probably mention that I have "Java 2 SDK 1.4 Enterprise Edition" installed.

Share this post


Link to post
Share on other sites
Thanks.
Yeah it's jumpy because when you press "fps" for the framerate test you basically turn off the timing. I suppose I'll have to get some work done experimenting with decoupling model update rate and framerate.

In the game the isometric panel will only be part of the user interface that'll also feature a chat and control panel. If I can get 60 fps in the finished game I don't see how it's "way too slow for decent game development" :)

Anyway, if I ever finish this game by then computers and graphics cards will be a lot faster than they are today *eg*.

Share this post


Link to post
Share on other sites
I must say, I give Java a lot more credit now than I used to. I'm working on a highly complex GUI for a job related project and I was so impressed with the ease of UI development that I decided to build my 3D world designer / level editor in Java using JOGL. So far it is definantly been working out great!

Good job using Java. I think it should at least be an avenue worth exploring nowadays.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You might want to take a look at Mappy (and clones) - there are quite a few good isometric map editors already around for free, one of which might do everything you want already. This is a VERY common thing for people to do!

Re: java / speed, only morons who don't check facts and people who are too lazy to learn a new language properly before making an opinion believe it to be too slow for games. If you believe java is too slow, I suggest you shutup or troll elsewhere, because you only make yourself look stupid. If you want to start learning how to make java run fast, take a look at the games and tech on http://grexengine.com/sections/externalgames and the forums on http://javagaming.org.

Share this post


Link to post
Share on other sites
kinda jumpy 70-80 in window and 40-50 in full screen? using Althon 1400 256 ram 64mb ati something can't remember now. But i a running quite a bi of junk in the back as well

Share this post


Link to post
Share on other sites
Hey Anonymous Poster

I'm sorry if I've made myself appear as a "moron" and "look stupid".
I have roughly a years worth of experince with Java 1.4.1 and 1.4.2 from 2002-2003, and found it to be a very nice language to work with, but suffering from too many downsides - among those also issues concerning speed and performance.
That is just my experince, and optimizations and taking advantage of 3rd party technoligies may give a considerable performance improvement.

I find this quote on http://grexengine.com/sections/externalgames/java-content.html:
"Since around 2002, Java on average is less than 5% slower than the best C++ code. For most applications (including games) java is within 1% of the speed of C++ code; many of the improvements of the last few years have concentrated on making up the performance gap, so that now - finally! - Java is a realistic practical alternative even in games development - where RAW SPEED is usually the most important factor."
I don't know where they've got their infomation from (there is no sources), but it sounds too good to be true.
Nearly the speed of C++, one of the fastest high-level programming languages availiable? Then how come almost all commercial games being developed in C and C++, when no (to my knowledge at least) commercial games have been developed in Java? That is, disregarding games for cell phones, palm pilots and the like.

I just find it hard to believe that Java should be *this* fast. My experince with Java tells me the completely opposit. In fact, the Java game I started 10 minuttes ago has been hanging ever since it managed to finish loading.

I'm no expert in Java, so don't flame me for arguing on behaf of me previous experinces with Java.

That's just my 2 cents.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Sion_
Hey Anonymous Poster

I'm sorry if I've made myself appear as a "moron" and "look stupid".


Sorry - that was intended as a general comment, not aimed specifically at you. But...if you do spout off about the quality of something you don't understand, then I would be inclined to apply such epithets to you. Shrug. A little knowledge is enough to make oneself look stupid...hence wise people with little knowledge know to question, rather than state, their opinions.

Quote:

I have roughly a years worth of experince with Java 1.4.1 and 1.4.2 from 2002-2003, and found it to be a very nice language to work with, but suffering from too many downsides - among those also issues concerning speed and performance.


If you start threads on particular problems you faced, you may get some illuminating answers. However, this is a very bad place to do that, since there are few java programemrs here. The forums at javagaming.org (which is run by Sun!) are a much better place for help.

The fact of the matter is that if you design + code properly you should have no problems with performance except in exceptional circumstances. As far as I am aware, bugs have been filed with Sun against all such cases - and if you find a new one, you should file a bug and it will get fixed in around 2-12 months.

Quote:

I find this quote on http://grexengine.com/sections/externalgames/java-content.html:
"...Java on average is less than 5% slower...


It's optimistic, but it is largely true.

Quote:

I don't know where they've got their infomation from (there is no sources), but it sounds too good to be true.
Nearly the speed of C++, one of the fastest high-level programming languages availiable?


C++ is not inherently all that fast. C++ is inherently pretty damn slow; it's mostly the quality of the C++ -> assembler compilers that makes C++ programmers produce fast programs. C++ is decades old, whereas Java has only just had it's tenth birthday; it took java compilers quite a lot of years to achieve similar efficiency as C++ compilers. This was complicated by the fact that they were also building more complex runtime-compilers as well as plain old offline compilers.

FYI, go and buy some back-issues of game-devleoper magazine from around 10 years ago. You will discover that the hot topic of the day was "Is it possible to write fast games in C++? We all know that C++ is MUCH slower than C...or is it?". It took *years* before programmers + compilers managed to make C++ run fast compared to C. Funny. These days most C++ advocates apparently have had a collective amnesia and forgotten what a bad reputation C++ used to have for performance. Or...maybe it's just that they are too young to have been around then, and don't check their facts before spouting off? Shrug.

Quote:

Then how come almost all commercial games being developed in C and C++, when no (to my knowledge at least) commercial games have been developed in Java? That is, disregarding games for cell phones, palm pilots and the like.


Easy: when has technical excellence been the driving aim of commercial companies? Why is one of the worst quality OS's (windows) the creator of the richest man in the world?

...Because technical superiority does not equate to commercial success. In a market where 95% of the best programmers have 10+ years C++ development experience and 0-1 years java experience, does it make commercial sense for a studio to use java? No, not really.

This is certainly changing. Now that java programmers outnumber C++ programmers in the main IT industry, we're getting to the stage where companies can actually hire java programmers and have a good choice of good programmers, instead of struggling to find enough coders of *any* quality. But, like the adoption of C++, it's a slow process.

Quote:

I'm no expert in Java, so don't flame me for arguing on behaf of me previous experinces with Java.


A misunderstanding, as I said - I didn't mean to direct that comment directly at you. However...I still think you would be better off instead of saying "X is very slow in my experience" saying "I never worked out how to make X go fast".

Both statements mean the same thing. However, the first implies that you believe java is always slow, and implies you have some evidence of this (which, if you're inexperienced, must be expert opinions, because it would be stupid to trust your own opinion if you know very little!). The second implies that you are still hoping that someone will help you learn how to improve the speed.

IMHO, the second is likely to attract offers of help, and also can't make you look stupid: you've professed no opinion, yet have conveyed the same raw information.

Share this post


Link to post
Share on other sites
@happybara: You went and downloaded Java 1.4 just for me ? :)
Yeah the hardware acceleration introduced by 1.4 really does a nice job when it comes to blitting.
Still the framerate is lower than even C++ with GDI, one important reason for this is that Graphics.drawImage() is asynchronous, which is great for event-driven GUI applications if you don't want hanging buttons but bad news for game developers. Of course this is of no concern to people using Jogl etc.

But anyway, I'm happy with the framerate people are getting.

Why am I coding games in Java?

1. I know Java a helluva lot better than C/C++, and if I had to worry about memory allocation, dangling pointers etc. I would never get anything done - I'm not an army *eg*.

2. I'm aiming for Java Web Start. That's really a great way to play games. I wish it was as easy to find and install the Java plugin as it is to install Flash plugins.
But perhaps there is hope. Now that MS no longer distributes their sucky 1.1 "Java" VM perhaps people will get REAL Java instead :)

Share this post


Link to post
Share on other sites
Yeah that's my site, I originally created the isometric engine for the ArenaBots game, which I was creating as a project at the university for the compiler course. I don't know if I'll be working on that project again any time soon. I'll probably port to Swing if I do.
My goal now is to create a graphical mud.

Share this post


Link to post
Share on other sites

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this