Curved tracks
Moderator: OpenTTD Developers
Curved tracks
As you may, or may not know, I've been trying to do a work-around to get curved railway tracks (It's a really dirty solution by using overlapping tiles).
Anyway, I've been doing a lot of programming in other languages lately and I realise that it must be possible to write an algoritm that solves the problem instead. Something like:
Of course, this will estimately require 3-4 times more sprites, but it shouldn't be too hard to write an algoritm like this, right?
Secondly, I want to make longer engines using a different method. Previously, the engines were either long and stiff or simply divided into two sprites. I wonder if it's possible to create a NewGRF using 2-3 sprites, where the one in the middle overlaps the first and the last:
Of course, this will look a bit weird in motion, but I think it may turn out better than the usual methods.
Anyway, I've been doing a lot of programming in other languages lately and I realise that it must be possible to write an algoritm that solves the problem instead. Something like:
Of course, this will estimately require 3-4 times more sprites, but it shouldn't be too hard to write an algoritm like this, right?
Secondly, I want to make longer engines using a different method. Previously, the engines were either long and stiff or simply divided into two sprites. I wonder if it's possible to create a NewGRF using 2-3 sprites, where the one in the middle overlaps the first and the last:
Of course, this will look a bit weird in motion, but I think it may turn out better than the usual methods.
Re: Curved tracks
Using the adjacent track bits for selecting sprites isn't hard, but I think you underestimate the needed sprites "a bit" If you want to provide a full set of sprites (i.e. not including only curves but all junctions as well), even the single straight diagonal X track is already needed in 49 variants. And that's only a single track.Bad_Brett wrote:Of course, this will estimately require 3-4 times more sprites, but it shouldn't be too hard to write an algoritm like this, right?
-- Michael Lutz
Re: Curved tracks
Only 49? It thought it would be 81, considering each track ending would have three different designs (3^4). Though much of this just would be copy-paste, it doesn't seem to be an optimal solution. I was thinking of using overlays.Michi_cc wrote:Using the adjacent track bits for selecting sprites isn't hard, but I think you underestimate the needed sprites "a bit" If you want to provide a full set of sprites (i.e. not including only curves but all junctions as well), even the single straight diagonal X track is already needed in 49 variants. And that's only a single track.Bad_Brett wrote:Of course, this will estimately require 3-4 times more sprites, but it shouldn't be too hard to write an algoritm like this, right?
-- Michael Lutz
Actually, the current game works pretty much like this already:
If I recall correctly, a track can be placed in six different ways. Each track has two endings. Each ending needs three sprites. This would equal 6*2*3 = 36 new sprites. If you exlude sharp turns, it would only require 2*2*3 + 4*2*2 = 28 new sprites. Of course, the elevated sprites would require 6 sprites each (=24 additional sprites).
Graphically, this would lead to endless possibilities. And if a certain curve doens't exist, the game simply ignores the algorithm, so existing tile sets could still look as they do today.
I know this would be a big project, but it would drastically increase the moddability.
Re: Curved tracks
i have previously drawn up a design-document which decisions a newgrf would have to make, assuming each half-rail gets drawn individually. from there it's "just" a combinatorial explosion to draw the combined rail bits. openttd would only have to provide VarAction2 variables for the adjacent track bits, everything else could be done in NewGRF.
the combination of the sprites can be done in the Makefile for the GRF (i think OpenGFX+ does that for wagon+cargo sprites), not much copy-pasting needed.
my current solution is to just offer more turning states:
https://dev.openttdcoop.org/attachments ... t_1922.png
each of the 4 TTD-direction gets two intermediate turning views, one for turning left and one for turning right. you can add some visual turning state of the wheel bogies, if you find you have enough pixels.
the combination of the sprites can be done in the Makefile for the GRF (i think OpenGFX+ does that for wagon+cargo sprites), not much copy-pasting needed.
this has two problems, first is, at TTD-Scale, a turning bogey would be really hard to see, and second, if two vehicles overlap, you have no chance of defining which vehicle will be drawn first, so you will get graphical glitches which you cannot solve.Bad_Brett wrote:Secondly, I want to make longer engines using a different method. Previously, the engines were either long and stiff or simply divided into two sprites. I wonder if it's possible to create a NewGRF using 2-3 sprites, where the one in the middle overlaps the first and the last:
Of course, this will look a bit weird in motion, but I think it may turn out better than the usual methods.
my current solution is to just offer more turning states:
https://dev.openttdcoop.org/attachments ... t_1922.png
each of the 4 TTD-direction gets two intermediate turning views, one for turning left and one for turning right. you can add some visual turning state of the wheel bogies, if you find you have enough pixels.
Re: Curved tracks
Why do we need curved tracks? It would completely change the feel of OpenTTD and it would no longer be a clone of TTD. If you want better/more realistic graphics then play Cities in Motion, Locomotion or other.Bad_Brett wrote:As you may, or may not know, I've been trying to do a work-around to get curved railway tracks (It's a really dirty solution by using overlapping tiles).
Re: Curved tracks
You can argue against any development that way. If you want to play ttd you should play ttd, not OpenTTD...
Re: Curved tracks
Obviously you can, but such a major change in the graphics of including 'proper' curves changes the 'feel' of the game. At the moment, even with all of the features added since TTO anybody can still see that it is essentially the same game, whereas with the inclusion of curvy tracks etc., the look of the game is changed dramatically (for little gameplay value).broodje wrote:You can argue against any development that way. If you want to play ttd you should play ttd, not OpenTTD...
Re: Curved tracks
I think this can be implemented in a way that it's optional. If it ever gets implemented.
I see the benefit of this for 32bpp extra zoom sprites. It just looks better without changing gameplay in any way. For 8bpp sprites it's probably not worth the effort, unless someone somehow invents 8bpp extra zoom sprites
I see the benefit of this for 32bpp extra zoom sprites. It just looks better without changing gameplay in any way. For 8bpp sprites it's probably not worth the effort, unless someone somehow invents 8bpp extra zoom sprites
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Curved tracks
If we get extra zoom sprites, we should get it for 8bpp and 32bpp alike.FooBar wrote:unless someone somehow invents 8bpp extra zoom sprites
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Curved tracks
Woooaaah! I know I requested this some time ago, so I had stopped hoping. This changes everything. Can you imagine this solution + extra zoom levels + curved tracks? It would look incredible! I'm amazed.Eddi wrote:i have previously drawn up a design-document
my current solution is to just offer more turning states:
I really don't get this. The reason I spend countless hours working on my OpenTTD mod is because I love the game. I have no interest in Locomotion. I'm not trying to change the core game. I'm just trying to be creative.Class 165 wrote: Why do we need curved tracks? It would completely change the feel of OpenTTD and it would no longer be a clone of TTD. If you want better/more realistic graphics then play Cities in Motion, Locomotion or other.
Re: Curved tracks
There's a lot of things that OpenTTD now does which has completely changed the "feel" of TTD, and for the better. If this can continue that trend of making the game better, then I am for it. You're seriously going to gripe about trains making a curved 45-degree turn instead of a sharp 45-degree turn? I suppose you also argue about whether or not engines should display animated smoke or which way the sun shines on a particular set of vehicles?Class 165 wrote:Why do we need curved tracks? It would completely change the feel of OpenTTD and it would no longer be a clone of TTD. If you want better/more realistic graphics then play Cities in Motion, Locomotion or other.Bad_Brett wrote:As you may, or may not know, I've been trying to do a work-around to get curved railway tracks (It's a really dirty solution by using overlapping tiles).
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Re: Curved tracks
Yeah, sure... http://fuzzle.org/~petern/ottd/8bpp-ez.pngFooBar wrote:I see the benefit of this for 32bpp extra zoom sprites. It just looks better without changing gameplay in any way. For 8bpp sprites it's probably not worth the effort, unless someone somehow invents 8bpp extra zoom sprites
He's like, some kind of OpenTTD developer.
Re: Curved tracks
Yeah, something like that
Re: Curved tracks
The "better" is debatable...kamnet wrote:There's a lot of things that OpenTTD now does which has completely changed the "feel" of TTD, and for the better.
In my opinion, the better way is improving OTTD performance and making it more playable (new means of transportation, largest maps, thousands vehicles on the map, hundreds NewGRFs to choice...).
The graphics in OTTD will be allways simplified and schematic, unless the game will be converted to using full 3D engine. But it would be no longer a clone of TTD... The semi-solutions, like 32bpp blitter, EZ and curved tracks only decreases OTTD performance, but don't add interesting new features, increased OTTD playability.
Last edited by TadeuszD on 13 Jan 2012 12:03, edited 1 time in total.
Re: Curved tracks
But it might increase enjoy-ability - which is not a worthless goal...
- SwissFan91
- Tycoon
- Posts: 2395
- Joined: 08 Feb 2009 18:36
- Location: Alberta, Canada
Re: Curved tracks
I'd say go for it, Bad_Brett. People can complain about it changing OTTD until the cows come home, but I'm fairly confident that they won't be forced into using these curves. Yes, the screenshot in the first post looks nothing like OTTD, but I'm sure once you play it with the GUI and start sending trains around, you'll realise the amount of work done and the real potential of OTTD.
I'm sure nobody is suggesting make curved tracks a permanent fixture. It sounds a bit like saying, 4 or 5 years ago, 'Oh I don't like the idea of being able to build canals, it takes away from the feel of TTD'.
I'm sure nobody is suggesting make curved tracks a permanent fixture. It sounds a bit like saying, 4 or 5 years ago, 'Oh I don't like the idea of being able to build canals, it takes away from the feel of TTD'.
Re: Curved tracks
kamnet wrote:There's a lot of things that OpenTTD now does which has completely changed the "feel" of TTD, and for the better. If this can continue that trend of making the game better, then I am for it. You're seriously going to gripe about trains making a curved 45-degree turn instead of a sharp 45-degree turn? I suppose you also argue about whether or not engines should display animated smoke or which way the sun shines on a particular set of vehicles?
Things such as canals, trams, path signals, one way signals and smoke etc. are nice features which look nice and/or make the gameplay better, and also are still in the style of TTO - when you look at them you can say that they are from a TT based game, whereas things such as curved tracks and suchlike do not look or feel like they are part of any TT game, and so would make OTTD something else (which may of course be better in other people's opinions).SwissFan91 wrote:I'd say go for it, Bad_Brett. People can complain about it changing OTTD until the cows come home, but I'm fairly confident that they won't be forced into using these curves. Yes, the screenshot in the first post looks nothing like OTTD, but I'm sure once you play it with the GUI and start sending trains around, you'll realise the amount of work done and the real potential of OTTD.
I'm sure nobody is suggesting make curved tracks a permanent fixture. It sounds a bit like saying, 4 or 5 years ago, 'Oh I don't like the idea of being able to build canals, it takes away from the feel of TTD'.
I would just like to clarify my position on this - in my opinion a curved track feature wouldn't fit with OpenTTD as the graphics of OTTD just aren't in that style. This doesn't mean that I am against the development of such a feature - obviously the game is open source and if someone, as does Bad_Brett, feels that curved tracks would make the game better and more enjoyable then its great . Its good that people are so creative and modify the game so much as without such people we wouldn't have OTTD (or TTDP) here today. I didn't mean to come across as grumpy , I guess the saying that if you don't have anything good to say then don't say anything is quite appropriate for me here.
Re: Curved tracks
I guess we better change the tram tracks then to not have curves...
-
- Engineer
- Posts: 52
- Joined: 08 Mar 2004 21:14
- Location: Sunderland UK
Re: Curved tracks
I guess you never played Transport Tycoon on the Playstation.TadeuszD wrote:kamnet wrote: The graphics in OTTD will be allways simplified and schematic, unless the game will be converted to using full 3D engine. But it would be no longer a clone of TTD...
Re: Curved tracks
I was thinking about something different, than simple transformation 2D sprites to 3D objects.Spaz O Mataz wrote:I guess you never played Transport Tycoon on the Playstation.
Who is online
Users browsing this forum: No registered users and 21 guests