freerails

I read the site quite regularly but don’t post that much. I thought I’d post link to the project I’ve been working on, since recently it’s started to take shape.

It’s an open source game inspired by the old game railroad tycoon.

It is beginning to get playable; although at this stage one could still say it’s a poor parody of the original :wink:

I’ve used swing and active rendering and it runs in full-screen and windowed mode.

and the sf page…
http://sourceforge.net/projects/freerails/

Here’s the screen shot:

You can download the latest version from:
http://sourceforge.net/project/showfiles.php?group_id=9495&release_id=178073

If anyone has tried it, I would be interested to know what frame rates you got.

Luke

I love railroad tycoon and your screenshots look quite nice. I’ve just been a bit busy this week. I’ll definitely check it out this weekend.

Are those original graphics? :smiley:

[quote]Are those original graphics?
[/quote]
They’re based on graphics from freeciv (released under GPL).

I have yet to figure out the game, but it looks quite nice :slight_smile:
I got 30-40 fps.

Nice game!

I got 9 FPS on Win XP/Athlon XP 2000+ (1,6Ghz)/GeForce256 SDR.

After building a track, two stations and a trains it dropped to 4.

Even the rates are not very good I think you are doing a good job. It is always a pleasure to see remakes of classical computer games (especially good old Amiga games!) on the Java plattform.

A nice, strategy games is my favorite genre of games. I get around 25fps on a 2.0ghz athlon, gf4, 512mb ram.

I’ve released an updated version:
http://sourceforge.net/project/showfiles.php?group_id=9495&release_id=182959

New features:
Better train schedule dialogue box.
You can start several client windows (the first step to becoming multiplayer).
Option to run in fullscreen and select the display mode.

I’m still not sure what’s causing the poor performance on some machines.

I tested the new version and its frame rate did not change in windowed mode. In fullscreen mode I have now around 11 FPS.
strange: after letting the game a few minutes alone the rate dropped to 1 frame per second.

Its a riddle to me why my system performs so bad. Do you know the JADE library? (http://jade.pautrot.com)

It is meant for fast 2d games and may be an option to you. It is written in pure java and performs very well. The only drawback: its documentation and tutorials are written in french :smiley:

How do you paint the map? Do you repaint the whole map, or only the part that is visible? I think that’s the first point i would look at. Or you could look at http://j2da.sf.net and rip the OpenGL part out of it :slight_smile:

Troggan

Ps: This is documented in English :wink:

Only the exposed part is painted and the background is painted to a buffer, which is then drawn to the screen. I’m getting ~70FPS at 1024*768 * 16bit on a P4 1.6Ghz in windowed mode. I might look at an alternative to java2d at some stage, but I’d rather concentrate on playability first.

I released on updated version of jfreerails today. You can download it here:
http://sourceforge.net/project/showfiles.php?group_id=9495&package_id=24205

There have been lots of changes since the last version I posted a link to here. Notably, multiplayer support.

I would be interested to hear any suggestions – particularly on how usability and playability could be improved.

Luke

Here are a couple of screen shots from the latest version. Its getting more playable although the slickness could be improved :wink:

http://freerails.sourceforge.net/screenshots/buenos_aires.PNG

http://freerails.sourceforge.net/screenshots/add_wagon.PNG

Assuming it’s at all playable yet, why don’t you make a webstart version, and then submit it here:

http://grexengine.com/sections/externalgames/

Thanks for the suggestion - I’ve emailed the details.

The webstart link is:
http://freerails.sourceforge.net/jfreerails.jnlp

I only spent about 5 minutes playing with it, and I’m pretty tired at the moment, so take this with a pinch of salt… I think you ought to be aiming for 0 fps most of the time, unless there are animations on screen: you have a game that doesn’t need to repaint the screen a lot of the time! Even with animations, only the animation needs painting, so you should expect fps = 0 unless the mouse moves over the main panel, and even then you should get whatever speed j2d is blitting your cached buffer at (very fast) assuming no complex computations going on in the background.

On my 1ghz machine I’m getting 19 fps if I leave the window at normal size. If i maximize it (1400x1050) then FPS drops to 9 - this is with nothing happneing on screen! In that situation, you shouldn’t be re-rendering at all; just wait until something changes. The big drop suggests that it’s being limited by your rendering rather than game logic.

One thing you might want to try is not using a gigantic scroll pane for the main window; there are things in swing to optimize such huge scrollpanes, but IIRC they are quite tricky to get right. You ould try replacing it with a fixed-size window (just for testing), with buttons that scroll one square left/right/up/down you might find an interesting difference in performance - in which case, you know you aren’t using the scrollpane “properly” for your gigantic area, and you can keep fine-tuning it until you get the same speed when using the scrollpane.

PS it looks good already, looking forward to more updates :slight_smile:

Thanks for the suggestions.

I’ve posted and updated version.

The website is
http://sourceforge.net/projects/freerails/

and the webstart
http://freerails.sourceforge.net/jfreerails.jnlp

I’ve made a few small performance and game play changes. Adding

to the webstart script made the biggest difference!

I have updated the game I am working on, freerails. There have been many changes since I last posted a link here. The one I am most pleased with is the new track build system that uses A* pathfinding.

Webstart, ~1MB
http://freerails.sourceforge.net/jfreerails.jnlp

Website
http://freerails.sourceforge.net/

Hope you guys like it. Any comments greatly appreciated.

Luke

if you’re clicking and dragging in the main pane, how bout letting that scroll the screen if your mouse moves past the edge? Like, I knew a city was down and right off the screen, so I clicked from the city I could see and I wanted to drag the track down to it, but it wouldn’t let me because the screen didn’t scroll as I was dragging the track down.