The International Simutrans Forum

Community => Community Discussion => Randomness Lounge => Topic started by: Ashley on June 17, 2009, 04:49:30 PM

Title: pyTile - My pet project
Post by: Ashley 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 (http://forum.simutrans.com/index.php?topic=1459.msg15708#msg15708). See what you think, the demo is here:

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

Both of these require the download of Python 2.6 (http://python.org/download/) and Pygame 1.8.1 (http://pygame.org/download.shtml).

Maybe some of these ideas will inspire the developers of Simutrans.
Title: Re: My pet project
Post by: sojo on June 17, 2009, 05:23:39 PM
This tracks are very nice. Mayby it will be in simutrans a funciton for this, someday.
Title: Re: My pet project
Post by: VS on June 17, 2009, 06:18:47 PM
I get the impression that you have some surprises hidden up your sleeves :)
Title: Re: My pet project
Post by: Ashley on June 20, 2009, 09:39:16 AM
Moved to general discussion.
Title: Re: My pet project
Post by: VS 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.
Title: Re: My pet project
Post by: Ashley 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.

(http://entropy.me.uk/pytile/pytile_sc.png) (http://entropy.me.uk/pytile/pytile_sc.png)

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).

(http://entropy.me.uk/pytile/random_test.png) (http://entropy.me.uk/pytile/random_test.png)

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.
Title: Re: My pet project
Post by: Combuijs on September 08, 2009, 02:27:21 PM
Looks lovely!
Title: Re: My pet project
Post by: Fabio on September 08, 2009, 02:40:03 PM
congrats!!!
Could this code be integrated in ST? it would be lovely!!!
Title: Re: My pet project
Post by: Ashley 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 (http://archive.forum.simutrans.com/topic/02168.0/index.html)
Title: Re: My pet project
Post by: Fabio on September 09, 2009, 07:05:20 AM
Quote from: Timothy on September 08, 2009, 11:53:48 PM
Edit: And of course, I've always wanted to make this screenshot a reality :)

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

;D

I wish to see it in the future... Thank you for your testing!!!
Title: Re: pyTile - My pet project
Post by: Ashley 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"
Title: Re: pyTile - My pet project
Post by: Maragil on September 22, 2009, 04:02:04 PM
*dancing*

Fun!
Title: Re: pyTile - My pet project
Post by: VS on September 22, 2009, 04:06:16 PM
Your svn says:
svn: Can't open file '/var/svn/timothy/db/current': Permission denied
Title: Re: pyTile - My pet project
Post by: Ashley on September 22, 2009, 07:31:33 PM
Odd, try it now?
Title: Re: pyTile - My pet project
Post by: VS on September 22, 2009, 08:48:58 PM
Thanks, works like a charm.
Title: Re: pyTile - My pet project
Post by: Ashley on September 23, 2009, 07:07:42 PM
Do let me know what you think of the program :)