OgreRails = A railroad implementation demo

Discuss a Transport Tycoon-like game being programmed by forum users.

Moderator: Transport Empire Moderators

ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

OgreRails = A railroad implementation demo

Post by ohlidalp »

Hello everybody who ever wander into these forums in a hope that there's something going on. Well, it is now. I'm back 8)

I've decided to work on the most fun and most rewarding part of this project - trains! More specifically, I'm writing a complete railroad track + vehicles implementation: rails, trains, stations, semaphores, pathfinding and such. My goal is to create a complete working prototype which can be incorporated into TE. Currently, it's exists as a separate application which I made as my own sandbox. I've called it OgreRails and hosted it on GitHub: https://github.com/An00biS/OgreRails.

Currently, the program can do the following:
* define arbitrary logical (invisible) track on the game map.
* follow these tracks and compute point coordinates
* visualize the track by placing 3D models of rails in the space
* define logical vehicles and consists which follow tracks and span over a certain length
* visualize the vehicles

And here is the roadmap of things to follow:
0.1 Working rails and trains (DONE!)
0.2 Direct single-track construction GUI
0.3 Train GUI windows, train reversing, train lifting and placing functionality (LOMO-like)
0.4 Train construction, modification and removal GUI
0.5 Rail crossings
0.6 Rail waypoints and pathfinding
0.7 Rail signals
0.8 High track
0.9 High track bridge graphics
1.0 Final touches

Finally, here are the things which NOT to expect from his tech. demo: terrain. The ground is represented by one flat 3D plane and that's how it's going to remain. Uzurpator is working on the terrain and my code is completely terrain-independent (on the engine level), so we can put it together anytime later (when Uzu's code starts working, anyway :P ).

Allright, I've said enough, now check out the v0.1 alpha version. It shows you two pre-built tracks and 5 trains riding it. All you can do so far is to move and zoom the camera, but I'm sure you'll enjoy it anyway :) .
__________

== DOWNLOAD ==
The executable is in the 'bin' folder, in case you were lost.
Known bugs: It crashes on exit (segfault) :( Well, it's alpha, what did you expect... :D
__________

Please download and try running it, I need to know if it works at all, and if it does, then what you think. I tested it on my Windows7 64 bit and Fedora15 64bit (HPNX6310 notebook, 4GB RAM, intel 945 integrated graphics)
And while you download, you can admire these screenshots :D :
screenshot_1.png
screenshot_1.png (830.79 KiB) Viewed 32179 times
screenshot_4.png
screenshot_4.png (886.53 KiB) Viewed 32179 times
screenshot_2.png
screenshot_2.png (823.96 KiB) Viewed 32179 times
BTW in case anybody was wondering where I got those awesome graphics, well, they're mine :] Actually I made them over a year ago, and now I'm finally making use of them. I made them deliberately low-poly and low-res-textured because they are meant for testing, not for beauty. And I'm not any great artist anyway.

Enjoy and let me know how very very much you like it :D .

Cheers
~ An00biS

EDIT: Title, .exe info.
EDIT2: Oops, the download link is broken, why didn't anybody tell me :oops: ?
EDIT3: Added direct download link (the previous was still broken :oops: )
Last edited by ohlidalp on 31 Aug 2011 23:27, edited 3 times in total.
Rigs of Rods maintainer.
User avatar
Spacek531
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 06 Sep 2010 16:44
Location: close to 45.665,-122.649

Re: SURPRISE!!! A railroad implementation prototype.

Post by Spacek531 »

That looks really cool!

I know you said you would not implement terrain, but it would be awesome if you did.
Help for Windows 7
RELEASED: Amtrak Cascades
Give me train ideas, they and their babies just might turn into a mod.

emergency pony link

By the way, ponies.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: SURPRISE!!! A railroad implementation prototype.

Post by ohlidalp »

Spacek531 wrote:That looks really cool!
I know you said you would not implement terrain, but it would be awesome if you did.
Thanks!
Sure, terrain would be great, but rather than implementing one I'd like to merge with this one. Why should I do everything myself? :wink: Actually, maybe I'll won't have to implement terrain because the terrain coder will implement me :D
Rigs of Rods maintainer.
User avatar
Spacek531
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 06 Sep 2010 16:44
Location: close to 45.665,-122.649

Re: SURPRISE!!! A railroad implementation prototype.

Post by Spacek531 »

That sounds like a good plan, if it uses the same language as yours!

I am really excited about this. Perhaps a 3D Locomotion?
Help for Windows 7
RELEASED: Amtrak Cascades
Give me train ideas, they and their babies just might turn into a mod.

emergency pony link

By the way, ponies.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: SURPRISE!!! A railroad implementation prototype.

Post by ohlidalp »

Spacek531 wrote:...Perhaps a 3D Locomotion?
Well, the idea in my mind is kind of like Locomotion, but with many things done differently. I have some new ideas here, but it's too early to post them - they might change and someone may post a better suggestions. I'm not going to design it all by myself :))

EDIT: Btw, did you download and try running it? I'm waiting eagerly for reports about this.
Rigs of Rods maintainer.
User avatar
Spacek531
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 06 Sep 2010 16:44
Location: close to 45.665,-122.649

Re: OgreRails = A railroad implementation demo

Post by Spacek531 »

Well, I go to download it, and there is no file named Bin. That means no exe.
Help for Windows 7
RELEASED: Amtrak Cascades
Give me train ideas, they and their babies just might turn into a mod.

emergency pony link

By the way, ponies.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: OgreRails = A railroad implementation demo

Post by uzurpator »

Like the guy above said. I can download the sources, not quite so with the binary.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

uzurpator wrote:...I can download the sources, not quite so with the binary.
:oops: Sorry, my bad.

Well, I just discovered that http://www.github.com is a proud linux site - If you upload a file with badly set user permissions, the file is kept with bad user permissions. In this case, it meant "nobody is allowed to read it".

The Github download is fixed now, and here's also a direct download link:
http://ogrerails.an00bis.net/downloads/ ... -win32.zip

Enjoy.
Rigs of Rods maintainer.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: OgreRails = A railroad implementation demo

Post by uzurpator »

1. Frame rate is OK - on Core 2 Quad 6600 @ 3ghz and radeon 6850.
2. Batch count is catastrophically bad. THere are over 800 batches in the full zoom - that is a batch count for the whole scene, not just an alpha. Where does it come from?
3. Try to not use the ExampleApplication framework.
4. Likewise - avoid using std::auto_ptr. THat thing is evil and depreciated in newest c++ standard. Use boost::shared_ptr or, if an object is often passed around, use boost::intrusive_ptr

However - looks nice :D
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

Thanx for the feedback.
uzurpator wrote:2. Batch count is catastrophically bad.
I didn't pay any attention to this, I admit. I guess that's because the Loco model uses about 15 materials - every piece has it's own texture image. Or because the straight track consists of tens of separate meshes. I'll look into it.
uzurpator wrote:3. Try to not use the ExampleApplication framework.
I admit, the "Example" in it's name gives it sorta lame look - but otherwise, there's nothing bad about it, it's just another library which handles some arbitrary work for me and it does it well. I'll slowly eliminate it when it becomes insufficient or unnecessary, but right now, removing it would'n be any progress.
uzurpator wrote:4. Likewise - avoid using std::auto_ptr. THat thing is evil and depreciated in newest c++ standard. Use boost::shared_ptr or, if an object is often passed around, use boost::intrusive_ptr
std::auto_ptr is not evil in the same way that a chainsaw is not evil.
I admit, there is some controversy about auto_ptr. I'll study boost's pointers and see what I can use. Shared_ptr would work, but it's logically incorrect because I allways use auto_ptrs where the ownership is, there is no shared ownership and no passing auto_ptrs by value.
uzurpator wrote:However - looks nice :D
I' so very very glad to hear this :] :] :]
Rigs of Rods maintainer.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: OgreRails = A railroad implementation demo

Post by uzurpator »

From what I see you use 4, when we disregard the ExampleApp batches.
You sould build trackage as a StaticGeometry, that is a great batch saving method.

auto_ptr - once again. Avoid like plague. This thing works in a way that you cannot guarantee.

first link
http://anki3d.org/stl-auto_ptr-a-bad-idea/

If you need something with sole ownership - use boost::unique_ptr or boost::scoped_ptr.
If you need something passed around with a pointer - use boost::intrusive_ptr
otherwise use boost::shared_ptr

Anyhow - auto_ptr will be depreciated in next c++ standard, so using it is bad anyways
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

> uzurpator : Allright.

Tomorrow I'm leaving for a week's biking trip to Romania, so don't expect any updates in that period. But I'll get to it right after I return.

I'll be back 8)
Rigs of Rods maintainer.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

BUMP with a screenshot.
Screenshot with example CEGUI window and visual map cursor.
Screenshot with example CEGUI window and visual map cursor.
ogrerails-alpha-gui.jpeg (120.57 KiB) Viewed 31546 times
Current task: GUI and track construction

The progress is slower than I'd wish for it to be, I thought version 0.2 would be done by now, but now I'm happy that I at least coded something. So far, I've been doing mostly uninteresting internal stuff: I've ditched Ogre's ExampleFramework and, following Uzurpator's advice, replaced std::auto_ptr with boost::shared_ptr (I tried other options, but this was the simplest). On the 'visible' side, I incorporated CEGUI (credit) and added code which finds cursor position on the map (credit) and visualizes the snap-point where track can be built (it's the yellow-crossed purple puddle in the screenshot :wink: - yeah, It looks terrible, I don't know what I was thinking when I was drawing it :mrgreen: ).

So, I've got all I need to start with the construction - but not today. :P

Cheers.
Rigs of Rods maintainer.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

There is something going on with the track building system :wink:
Attachments
screenshot_lomo_building_gui.jpeg
screenshot_lomo_building_gui.jpeg (134.45 KiB) Viewed 31393 times
Rigs of Rods maintainer.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: OgreRails = A railroad implementation demo

Post by uzurpator »

This is pretty nifty :)
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
vinaximus
Traffic Manager
Traffic Manager
Posts: 135
Joined: 23 Sep 2004 12:10
Location: Nepal, Kathmandu

Re: OgreRails = A railroad implementation demo

Post by vinaximus »

I downloaded and ran it. Quite nice. Plz go for it.
Good day building rails
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

I've been working on the railroad... :D
Building works, deletion not yet :-D
Building works, deletion not yet :-D
railroad-construction.jpeg (109.97 KiB) Viewed 31158 times
Uzurpator: thanx!
vinaximus: the train keeps rollin... :)
Rigs of Rods maintainer.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: OgreRails = A railroad implementation demo

Post by uzurpator »

Nice :)

One question. I am going to have some free time soon, so I want to continue my branch of the development. However. I have implemented some MyGUI in my branch. How entangled are you in CeGUI?
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
ohlidalp
Engineer
Engineer
Posts: 98
Joined: 27 Aug 2007 18:46
Location: mapy.cz/?query=rajhrad
Contact:

Re: OgreRails = A railroad implementation demo

Post by ohlidalp »

Uzurpator: Glad you like it.

The GUI in OgreRails is temporary, just something to control the demo. Right now, I don't know exactly what features it's going to have so I can't design a complete GUI. When time comes, I'll rewrite the whole layout into a final state.

I like the idea of using MyGUI, it's a great-looking lib, though I've never used it. I've used CeGUI because it was easy to start with, but in the future, I'd like to use something else.
Rigs of Rods maintainer.
dogcat1984
Engineer
Engineer
Posts: 1
Joined: 01 Nov 2011 14:53

Re: OgreRails = A railroad implementation demo

Post by dogcat1984 »

:lol: I am very glad this project continues. I just can't wait to play the completed version.
Post Reply

Return to “General Transport Empire Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests