The International Simutrans Forum

 

Author Topic: pyTile - My pet project  (Read 4039 times)

0 Members and 1 Guest are viewing this topic.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
pyTile - My pet project
« on: June 17, 2009, 04:49:30 PM »
I thought I'd show off a little project I've been playing with. I like Simutrans a lot, and I am very interested in learning what it takes to put together a game like this. I've been working recently on a few little technical demos to improve my programming ability and to try and bring to life ideas I've had for ways to solve problems (some of which may be inspirational for the Simutrans project).

The first is an isometric graphics engine. I've called this pyTile (following the standard naming convention when dealing with Python). I'm working on releasing a much improved version soon, but you can see an older version here:

http://www.pygame.org/project/871/

The second which I have been playing with most recently is a demonstration of a system for track building which I've been thinking about for a long time. Again, this is quite embryonic at present but I think this represents the best and most flexible way to integrate realistic looking track (and road, eventually) into a square-grid/tile based game. It gives you smooth curves, nice looking points (switches) and even double track. I've posted a much earlier version of this before in a discussion about Curves. See what you think, the demo is here:

http://pygame.org/project/1160/

Both of these require the download of Python 2.6 and Pygame 1.8.1.

Maybe some of these ideas will inspire the developers of Simutrans.
« Last Edit: September 15, 2009, 09:37:11 PM by Timothy »

Offline sojo

  • Devotees (Inactive)
  • *
  • Posts: 851
  • Maintainer pak96.comic
    • German home of Simutrans
Re: My pet project
« Reply #1 on: June 17, 2009, 05:23:39 PM »
This tracks are very nice. Mayby it will be in simutrans a funciton for this, someday.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: My pet project
« Reply #2 on: June 17, 2009, 06:18:47 PM »
I get the impression that you have some surprises hidden up your sleeves :)

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: My pet project
« Reply #3 on: June 20, 2009, 09:39:16 AM »
Moved to general discussion.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: My pet project
« Reply #4 on: June 20, 2009, 09:50:02 AM »
I wanted to ask - what are for these four points around corners? It seems impossible to connect tracks to them.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: My pet project
« Reply #5 on: September 08, 2009, 02:02:17 PM »
An update, since I've had time to work on this recently.

(Please click on the images to view the full size ones, the forum resizes them and the resized versions don't look that great)

The bezier tracks are merged into the game engine, they look pretty good (though they need some tweaking to look as good as hand-drawn track graphics). They look a lot better in higher resolution (e.g. pak128 scale). I may try rendering some static tile-based graphics for Simutrans using this method for pak128/64.



I've also written a perlin noise generator to produce random terrain (much like the one Simutrans uses). I'm going to use this to procedurally generate textures as well (e.g. for grass and other ground terrain types).



Finally I'm going to be providing a public read-only interface to the SVN on my server, to make it easy to check out development versions. This will cover the source code for TileCutter as well.

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: My pet project
« Reply #6 on: September 08, 2009, 02:27:21 PM »
Looks lovely!

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: My pet project
« Reply #7 on: September 08, 2009, 02:40:03 PM »
congrats!!!
Could this code be integrated in ST? it would be lovely!!!

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: My pet project
« Reply #8 on: September 08, 2009, 11:53:48 PM »
I am sure the same system could be implemented in Simutrans, yes, but the development effort would almost certainly be extremely high... If anyone wants to examine the source code and try to port the system to Simutrans they are welcome, it should be finished soon enough.

I started this project with the intent of exploring concepts which would be very difficult to integrate into Simutrans, to provide live demos of what is possible. Hopefully they will inspire someone to do the same for Simutrans :)

Edit: And of course, I've always wanted to make this screenshot a reality :)

http://archive.forum.simutrans.com/topic/02168.0/index.html

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: My pet project
« Reply #9 on: September 09, 2009, 07:05:20 AM »
Edit: And of course, I've always wanted to make this screenshot a reality :)

http://archive.forum.simutrans.com/topic/02168.0/index.html

;D

I wish to see it in the future... Thank you for your testing!!!

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: pyTile - My pet project
« Reply #10 on: September 15, 2009, 09:38:23 PM »
I've posted a reasonably playable version (still in development) which shows off the flexibility of the track building. Take a look:

http://www.pygame.org/project/871/?release_id=2229

"svn co svn://entropy.me.uk/timothy/pytile/tags/0.1.2"

Offline Maragil

  • *
  • Posts: 249
Re: pyTile - My pet project
« Reply #11 on: September 22, 2009, 04:02:04 PM »
*dancing*

Fun!

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: pyTile - My pet project
« Reply #12 on: September 22, 2009, 04:06:16 PM »
Your svn says:
svn: Can't open file '/var/svn/timothy/db/current': Permission denied

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: pyTile - My pet project
« Reply #13 on: September 22, 2009, 07:31:33 PM »
Odd, try it now?

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: pyTile - My pet project
« Reply #14 on: September 22, 2009, 08:48:58 PM »
Thanks, works like a charm.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: pyTile - My pet project
« Reply #15 on: September 23, 2009, 07:07:42 PM »
Do let me know what you think of the program :)