I am trying to make a java version of the very cool and addictive game Transport Tycoon (Deluxe)But I am having trouble with the graphics as i dont get a high fpsso I look for ppl who want to help with me with the graphics engine bcz mine isnt so performant

If you would like to help you can post it here or send me a private message

Wow! I liked TT very much. I was addicted to it. What are you comparing your code with when you say your graphics engine isn't so performant? Are you using Java2D, or some openGL bindings? I have really little time nowdays, but maybe I could help with some issues.cheers!

Wow! I liked TT very much. I was addicted to it. What are you comparing your code with when you say your graphics engine isn't so performant? Are you using Java2D, or some openGL bindings? I have really little time nowdays, but maybe I could help with some issues.cheers!

I am using full-screen exclusive awt mode at the moment but with that comes i have to redraw my whole screen each frame. It can contain 1000 tiles ( at 1024*768) so this takes so much timethe game is beginning to run really slow and get only 30 fps orso.

I run the test.jar and I think Java2D is capable of rendering many more sprites per frame.There are some important points to note however, so for example to make them hardware accelerated by Java. Many of these notes have been discuessed in the forum's 2D threads. I'm pretty sure some Java2D experts read so please: comment. :-) Thanks.Kevin's currently moving, so we'll have to wait for his comments. Still his (?) FAQ is nice and helpful IMO: http://wiki.java.net/bin/view/Games/FAQ#2D_Rendering

Just in case the correct way to use Java2D doesn't bring the performance you need then I'd go the OpenGL route. However, I can't imagine you'd need the direct metal OpenGL way to do a isometric simulation.

P.S. Chris Sawyer rules. Together with D. Braben one of the - if not the - brightest minds in the entire video gaming industry. Man, he wrote the entire Rollercoaster Tycoon in Assembler. A real Scottish braveheart. :-)

I run the test.jar and I think Java2D is capable of rendering many more sprites per frame.There are some important points to note however, so for example to make them hardware accelerated by Java. Many of these notes have been discuessed in the forum's 2D threads. I'm pretty sure some Java2D experts read so please: comment. :-) Thanks.Kevin's currently moving, so we'll have to wait for his comments. Still his (?) FAQ is nice and helpful IMO: http://wiki.java.net/bin/view/Games/FAQ#2D_Rendering

Just in case the correct way to use Java2D doesn't bring the performance you need then I'd go the OpenGL route. However, I can't imagine you'd need the direct metal OpenGL way to do a isometric simulation.

P.S. Chris Sawyer rules. Together with D. Braben one of the - if not the - brightest minds in the entire video gaming industry. Man, he wrote the entire Rollercoaster Tycoon in Assembler. A real Scottish braveheart. :-)

I have made some small apps with jogl before so i should try and do that then?

For what is worth the following code is used to make a tile texture i did in xith3d (maybe then you why its complety different output):

@ Chris Sawyer rules. Together with D. Braben one of the - if not the - brightest minds in the entire video gaming industry. Man, he wrote the entire Rollercoaster Tycoon in Assembler. A real Scottish braveheart. :-)

TT was completely written in assembler, dont know about rt but it is true he roels

I've tested the newer benchmarks and still think it's somewhat slow, but well, I'm no Java2D expert.From what I've seen from Kevin's and other's Java2D examplesI think it should go much faster. Could any Java2D expert please comment?

My own hobby 2d project (a parallax side scroller) is being done in OpenGL (JOGL) with an 1:1 orthogonal view (so no scaling of the bitmap textures) but just because the game's main task (> 75%) is to move textures around on the screen and the whole point is smoothly moving tons of large sprites. :-)

This won't be the case for your Tycoon game, where just a small amount of the game's performance goes into drawing the graphics (25% maybe?).So I wouldn't worry too much about graphics speed. Because by the time you finish the other parts of your game in Java you'll have evaluated a fast and neat way to plot them in Java2D. And... of course it's a good idea to encapsulate your internal graphics system so that you can always decide to change the final plotting class(es) of the sprites.

Had a look at the source to the first example, and have to say you are doing some things in very peculiar ways.

Your fps counting for starters is totally crazy, and inaccurate.

Creation of your images is odd too (Transparency class)why not just load the images with ImageIO, and copy them to a BufferedImage [managed] returned from GraphicsConfiguration.createCompatibleImage.You shouldn't need to use Toolkit.createImage(ImageProducer) *ever*.

your VolatileImages class is also fundamentally flawed, and quite useless.

now for something different...TTD is indeed awesome! My friends and me play OpenTTD almost every evening on the Internet. So I find the idea to port it Java pretty cool and I would be happy to help you concerning the GUI, which makes a pretty big part of TTD. I could provide the in-game window frames, Widgets like tables, text fields, buttons etc.

However, OpenTTD is constantly enhanced and the OpenTTD-Guys drop builds like I change my shorts. Which is why I would like to ask on which version of OpenTTD you rely. And how do you intend to keep up with the enhancements? Or do you just fork from an old version?

now for something different...TTD is indeed awesome! My friends and me play OpenTTD almost every evening on the Internet. So I find the idea to port it Java pretty cool and I would be happy to help you concerning the GUI, which makes a pretty big part of TTD. I could provide the in-game window frames, Widgets like tables, text fields, buttons etc.

However, OpenTTD is constantly enhanced and the OpenTTD-Guys drop builds like I change my shorts. Which is why I would like to ask on which version of OpenTTD you rely. And how do you intend to keep up with the enhancements? Or do you just fork from an old version?

Johannes

My intentention is to base the game (GUI and graphics) part on the original TTD and then enhance the gameplay with some features of other sim games which i find more interesting and should have been in TTD as well like bridge and tunnelbuilding.

Had a look at the source to the first example, and have to say you are doing some things in very peculiar ways.

Your fps counting for starters is totally crazy, and inaccurate.

Creation of your images is odd too (Transparency class)why not just load the images with ImageIO, and copy them to a BufferedImage [managed] returned from GraphicsConfiguration.createCompatibleImage.You shouldn't need to use Toolkit.createImage(ImageProducer) *ever*.

your VolatileImages class is also fundamentally flawed, and quite useless.

why would my fps counting be inaccurate? I just calculate the time neede to draw a frame so that should be accurate

the reason why i dont use imageio is because just slows down my game sooo much using toolkit is much beter and has the same output

my volatileimages class is idd useless but there are some other classe useless but i just included them because i might them later

I started writing a TTD clone in java a couple of years ago, but got distracted before I'd written much.. All I did was load the the TTD graphics and levels in and display the landscape.

Still, if you're interested I can dig out my code and send it to you, there might be something useful in there..

that would be very kind of you for the moment i am a bit stuck with all the menus because i need to draw them myself and catch all the button events and so i am looking for a a way to still use the awt components so i dont have to all that myself

I've tested the newer benchmarks and still think it's somewhat slow, but well, I'm no Java2D expert.From what I've seen from Kevin's and other's Java2D examplesI think it should go much faster. Could any Java2D expert please comment?

My own hobby 2d project (a parallax side scroller) is being done in OpenGL (JOGL) with an 1:1 orthogonal view (so no scaling of the bitmap textures) but just because the game's main task (> 75%) is to move textures around on the screen and the whole point is smoothly moving tons of large sprites. :-)

Yup, same here. I started using Java2d, and I found it wasn't quite that smooth in operation, so I switched to JOGL which has worked out much better. Although, I did also want to put large alpha blended textures into the game once the gameplay was sorted so j2d wasn't really an option for the rethought goals anyway.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org