News:

SimuTranslator
Make Simutrans speak your language.

Curves

Started by ij, February 06, 2009, 09:38:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fabio

this rather sounds like starting back all the paks from the scratch...

prissi

The problem is that simutrans has easily 1000 different images. Unfourtunately that amount of textures is handled badly on high end grafik systems still (There was a more in-depth discussion on this in OpenTTD, including an OpenGL driver which worke worse than the current.)

Ashley

Quote from: isidoro on February 21, 2009, 06:32:16 PM
Thinking about the effort you are making, a reflexion came to my mind.  Why not pass the graphics engine to OpenGL without modifying the underlying ST tile model.  A lot of pak makers surely have Blender 3D models of buildings and vehicles.  For those vehicles whose 3D models aren't available, the graphics engine can put the flat image.  For the others, the 3D rendering.  Once a full 3D pak is available, the viewpoint can be freed or even you could "ride a vehicle"...

The Simutrans tile-based system would be needlessly restrictive for a 3D game, you'd want to develop something entirely new in that case, with freeform tracks. I've played around with OpenGL before, and while I probably could do all of this in 3D I quite like the look you get in a 2D sprite based game, that's why I'm developing one :)

Technically though, you'd use the same system, with 3D vectors rather than 2D ones and use the generated bezier curve to draw procedurally generated track graphics in 3D. All of the math is basically the same. You'd also need a fairly trivial set of functions that would split a curve (since track switches would always need to occur at the end of a curve section).

This is the way that, for example, Sid Meier's Railroads! does track drawing, although the system in that game is annoyingly restrictive (e.g. two tracks cannot cross each other without joining). And the complete lack of any kind of decent signalling and the crap routing makes that game pretty fail tbh.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

ij

I'm hardly worried about rotating vehicles online (ie., while drawing). It's pretty standard even in games that ran on 386 times and now we have a lot more cpu horsepower. In general there won't be that many vehicles in curves at the same time I hope. On screen I mean, obviously we don't care to do that for vehicles that are in off-screen curves.

whoami

#39
Quote from: ij on March 07, 2009, 07:50:35 PM
I'm hardly worried about rotating vehicles online (ie., while drawing).
The thing to worry about is: for certain things, a lot of ST needs to be redone from scratch, and because that is so much effort, that task will have to justify itself by adding even more features, making it even harder (2nd version effect). For example, if going to any kind of 3D, the current tile images will be too limiting, so the vehicles and buildings should all be done again. If the tiles on the map are to be abandoned, goods routing, pathfinding and waybuilding need to be implemented again, in a much more general way.

Dwachs

Quote from: ij on March 07, 2009, 07:50:35 PM
I'm hardly worried about rotating vehicles online (ie., while drawing).

It would be possible to allow for more views of vehicles (16 or 24 views for curves, several more for up/down hill). But who will draw them?

It would be very interesting to see whether it is possible to automatically construct the missing views from the now available views (8 per vehicle). That is, to reconstruct 3d information from the existing views and render some more views. Ofcourse they will be rough approximations but they can be improved by pixel artists.
Parsley, sage, rosemary, and maggikraut.

prissi

There are even wuite a number of vehicles with only four views ...

And there was a patch for vehicles on slopes. But then all vehicles on slopes has to be redrawn. Given the fact that even many vehicles on diagonals are not of the correct length in almost every set ...

ij

Quote from: whoami on March 07, 2009, 08:06:02 PM
The thing to worry about is: for certain things, a lot of ST needs to be redone from scratch, and because that is so much effort, that task will have to justify itself by adding even more features, making it even harder (2nd version effect). For example, if going to any kind of 3D, the current tile images will be too limiting, so the vehicles and buildings should all be done again. If the tiles on the map are to be abandoned, goods routing, pathfinding and waybuilding need to be implemented again, in a much more general way.

I disagree on most of the points... I guess you didn't get what I was saying... Those tile based things can certainly be rotated by any angle by simutrans while it needs to draw a vehicle. How beautiful the end result will look like is something that hasn't been tested yet but such sprite rotation has been used for ages. I'm certainly not talking about drawing more or redoing them like people are whole the time suggesting :-).

My idea about curves is not something presented by Timothy (or 3d people) which abandons the current tile based model (either replaces or abandons it completely). Each curve in my thoughts is still in the end quite much tile based, the curve goes from a tile to the adjacent one at a time (the only violation is actually the case where it goes exactly through a tile edge crossing but I currently ignore that corner case, I haven't done the math if that'll happen with some radius or not). Thus, routing and pathfinding can be fully tile-based like now.

As listed in the beginning of this thread, the building of curves is still an open problem. Ie., how it should be integrated gui.

The first thing on my todo list is getting the closer diagonal tracks to work since I'll needing that anyway to do close enough curves. I'll open a new thread on that one once I get something concrete.

whoami

Quote from: ij on March 07, 2009, 10:26:26 PM
I disagree on most of the points... I guess you didn't get what I was saying...
Maybe I subconsciously used the debate method of "take the opponent's point so far that it becomes a point against himself". :P

QuoteThose tile based things can certainly be rotated by any angle by simutrans while it needs to draw a vehicle. How beautiful the end result will look like is something that hasn't been tested yet but such sprite rotation has been used for ages.
Hmm, I am quite sure that the low resolution (especially pak sizes <=64) prohibits that, unless you have a method of telling the algorithm which pixel to move/morph into which other one - but I would be glad to be proven wrong. (For certain vehicles, a single pixel, or single line of them, can be important for the whole impression.)

isidoro

Other games with multiple-tile curves has side-effects too.  For instance, signal placing.  In those programs, a 4x4 curve can only have signals at the exits.

kierongreen

Sprite rotation is fine for a 2d game, however simutrans is 2.5d so you can't use the same techniques.

ij

@isidoro: signal placement was also among the problems listed in the first mail :-).

@kierongreen: doh. Good point, I haven't thought that before. It certainly is a problem with 4 views only vehicles and even with 8 views there's one jumpy change when the tail dis/reappears (plus some variance in the visible length of the vehicle)... :-( I'll probably experiment with some vehicle to see how bad it will look like if I just skew it by changing one of the axis vectors instead of both as would be done with plain simple 2d sprites. I'm not sure the end result will be any worse than what we already have when the vehicle jumps from view to another (the 45deg angle).

@whoami: lines usually do not vanish, small one pixel detail vanish or are made less obvious from time to time but I doubt that appearance of a vehicle is so much depending on a single pixel really and the ones that vanish are angle dependant.