Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Jul 23, 2018 3:49 pm

All times are UTC




Post new topic  Reply to topic  [ 117 posts ]  Go to page Previous 1 2 3 4 5 6
Author Message
PostPosted: Wed Jan 21, 2009 12:33 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
congratulations :)

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Wed Jan 21, 2009 12:49 pm 
Offline
Engineer
Engineer

Joined: Sat Jan 10, 2009 7:20 am
Posts: 126
Location: Paris, france
A logical enhancement, appreciate it (though I won't be able to use it 'til the cargodest build hit r15190, I guess) :D


Top
   
PostPosted: Wed Jan 21, 2009 3:12 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Very nice and congratulations.
See the photo of a game that I made in ttdPatch long time ago hope it gives you ideas.
See little water plane landing on top of the mountain. :wink:
Attachment:
File comment: Mountain with waterplane
mountainEdge.png
mountainEdge.png [ 262.67 KiB | Viewed 3393 times ]

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
PostPosted: Thu Jan 22, 2009 2:46 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 23, 2005 12:09 am
Posts: 3138
Congratulations.
I was surprised it hit trunk so quickly, but it deserved it.
:D

_________________
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.


Top
   
PostPosted: Thu Jan 22, 2009 11:10 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Mar 08, 2004 12:39 am
Posts: 98
Location: Good ol' Portugal
Awesome! Amazing work guys! :bow: :bow: :bow:

_________________
That's CP 1564, a Montreal Locomotives Works built locomotive


Top
   
PostPosted: Fri Jan 23, 2009 5:51 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4676
Location: Lost in Music
Great patch, thanks.

For those who are trying freeform map edges in the latest nightly, go to advanced settings, and then in the 'construction' menu node, 'Enable terraforming the tiles at the map borders'.

cheers,

Andy

_________________
FIRS Industry Replacement Set (Released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (Finished)
Squid Ate FISH (ships) (Released) | CHIPS Has Improved Players' Stations (Finished)
Iron Horse (trains, released) | Termite (tracks for Iron Horse, released) | Busy Bee (game script, released)

Road Hog (road vehicles, released)


Top
   
PostPosted: Fri Jan 23, 2009 8:13 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 12, 2004 12:37 am
Posts: 1393
Location: United Kingdom of Great Britain and Northern Ireland
It'll certainly help heightmaps - having spain surrounded by water on all sides is a little... unrealisitic.


Top
   
PostPosted: Sun Feb 01, 2009 1:07 pm 
Offline
Engineer
Engineer
User avatar

Joined: Tue May 17, 2005 11:25 pm
Posts: 111
While this works fine for me when generating a new map, it only works properly on two edges of the map when loading a heightmap (specifically the bottom two eges don't have any sea, but they still slope down to zero height). I'm running r15297. Note I can raise the edges back up manually, so I suppose it's a problem with the heightmap loading rather than the new feature itself.

Please don't shoot me if this is a known issue but I couldn't see anything form skimming the last couple of pages from this thread.

I very much like this new feature though! :)

_________________
My OpenTTD heightmaps


Top
   
PostPosted: Mon Feb 09, 2009 2:24 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Jul 17, 2007 1:36 am
Posts: 1244
Skype: moonray_zdo
Location: Teh matrix, duh.
push through to 6.4! :D

_________________
Formerly known as Sapphire United.

Learn Openttd
Learn Planetary Annihilation
Learn Orbit
Whose poo?


Top
   
PostPosted: Mon Feb 09, 2009 10:20 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Sapphire united wrote:
push through to 6.4! :D


uhm... huh?

What exactly do you want?

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Tue Feb 10, 2009 3:35 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Tue Apr 05, 2005 1:48 am
Posts: 1507
Location: Deep down the deepest blue
Sapphire united wrote:
push through to 6.4! :D

Poor you... You still fail to understand how it works :(

a) It would not be 6.4, it would be 0.6.4
b) if 0.6.4 would eventually come out, it will be bug fixes ONLY.
c) I can positively point out that there will be no 0.6.4, since there will be a 0.7.0. One day.

_________________
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones


Top
   
PostPosted: Tue Mar 10, 2009 7:57 pm 
Offline
Director
Director

Joined: Tue Jul 17, 2007 5:56 pm
Posts: 608
Hello,

I am just adjusting the more heightlevels patch to the freeform map edges patch. What makes me trouble are slopes at the map edges.

Example: Consider a 256x256 map. z(x,y) is the height at position (x,y). Let z(154,255)=22, z(155,255)=22, z(156,255)=21. So (155,255) has slope NE. If you scroll southeast, you have to paint the black area properly in order to avoid glitches resulting from areas of the map still being displayed where now black area has to be painted.

My idea to deal with this is assigning points outside the map a height as well, based on the heights at the map edges. Then, I can paint black tiles with the correct slope there. For example, for the tiles mentioned above (y now is any number > 255), z(154,y)=22, z(155,y)=22, z(156,y)=21. This way, any tile southeast of the map at y position 155 would be a Slope NE. Same for the areas northeast, northwest and southwest of the map. I wrote an alternative TileHeightOutsideMap function as follows:

Code:
static inline uint TileHeightOutsideMap(int x, int y) 
{
  if (x < 1) {
   if (y < 1) {
     return TileHeight(TileXY(1, 1));
   } else if (y < (int)MapMaxY()) {
     return TileHeight(TileXY(1, y));
   } else {
     return TileHeight(TileXY(1, (int)MapMaxY()));
   }
  } else if (x < (int)MapMaxX()) {
   if (y < 1) {
     return TileHeight(TileXY(x, 1));
   } else if (y < (int)MapMaxY()) {
     return TileHeight(TileXY(x, y));
   } else {
     return TileHeight(TileXY(x, (int)MapMaxY()));
   }
  } else {
   if (y < 1) {
     return TileHeight(TileXY((int)MapMaxX(), 1));
   } else if (y < (int)MapMaxY()) {
     return TileHeight(TileXY((int)MapMaxX(), y));
   } else {
     return TileHeight(TileXY((int)MapMaxX(), (int)MapMaxY()));
   }
  }
}


Based on this concept of heights outside map, I can rewrite the painting code in viewport.cpp for tiles outside map as follows:

Code:
            } else {
               // We are outside the map => paint black
               tile_info.tile = 0;
               tile_info.tileh = GetTileSlopeOutsideMap(tile_info.x, tile_info.y, &tile_info.z);
               tile_type = MP_VOID;
            }


I am pretty sure that this works, except for one problem. The drawing procedure for the black tile called some lines later unfortunately ignores the slope and paints the tile like if it is flat. See attached screenshot for what I mean.

I think, what we would need here, are just black images for the slopes NE, SW, NW, SE (and/or make the painting code paint them :D ). What I unfortunately not know is how to implement them. If I get it right, the solution originally implemented in the freeform map edges patch for the problem I described above is the following code:

Code:
         } else {
            if (!_settings_game.construction.freeform_edges || (TileX(tile) != 0 && TileY(tile) != 0)) {
               if (x_cur == ((int)MapMaxX() - 1) * TILE_SIZE || y_cur == ((int)MapMaxY() - 1) * TILE_SIZE) {
                  uint maxh = max<uint>(TileHeight(tile), 1);
                  for (uint h = 0; h < maxh; h++) {
                     DrawGroundSpriteAt(SPR_SHADOW_CELL, PAL_NONE, ti.x, ti.y, h * TILE_HEIGHT);
                  }
               }

               ti.tile = tile;
               ti.tileh = GetTileSlope(tile, &ti.z);
               tt = GetTileType(tile);
            }
          }


So you simply paint: For each tile in the black area, one black tile per height level of that tile. I don't think that painting that many images is resonable with more height levels.

So: Can anyone help solving the problem I described above?
Attachment:
File comment: Glitches at the map edge.
Unbenannt, 16. Nov 1962.png [78.3 KiB]
Downloaded 75 times


Top
   
PostPosted: Tue Mar 10, 2009 8:03 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
ic111 wrote:
So you simply paint: For each tile in the black area, one black tile per height level of that tile. I don't think that painting that many images is resonable with more height levels.

Have you already tried if this works? It would by far be the simplest solution.

Quote:
So: Can anyone help solving the problem I described above?
Unfortunatly I don't think I can, the code to fix this in the freeform map edges patch was written by SmatZ.


Top
   
PostPosted: Wed Mar 11, 2009 5:12 am 
Offline
Director
Director

Joined: Tue Jul 17, 2007 5:56 pm
Posts: 608
First thanks for your answer, although you couldn't give me the informations I need.

Well, I mainly meant resonable in terms of efficiency. If I get it right, the freeform edges algorithm would paint <heightlevel> images for each black tile?

And as I already have implemented an adapted algorithm (more things had to be changed for the more heightlevels patch, e.g. the selection of the to-be-updated tiles), I think providing / painting images for sloped tiles (they are basically what I am missing so far) would be easier and better.

I will have a closer look on how I can do this soon.


Top
   
PostPosted: Wed Mar 11, 2009 7:29 am 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
ic111 wrote:
First thanks for your answer, although you couldn't give me the informations I need.

Well, I mainly meant resonable in terms of efficiency. If I get it right, the freeform edges algorithm would paint <heightlevel> images for each black tile?
I thought it only does that for the tiles at the south edge, so only for tiles with coordinates (MaxX, ?) and (?, MaxY). If that's true, it isn't a problem at all to do that for some more heightlevels.


Top
   
PostPosted: Tue Feb 13, 2018 12:47 am 
Offline
Engineer
Engineer

Joined: Wed Dec 06, 2017 6:45 pm
Posts: 3
Hi everyone!
I’m building a new map to play on, and the first time I use the feature to build to the edges. But one thing bothers me: the black background. I really get depressed when I’m in the edge areas. Could there be a feature to select another background color like in my screenshot? I find it much more friendly there. (There was a NewGRF which made everything to water, but it’s not working anymore.)
Regards. GojkoG


Attachments:
Background-Color.png [335.57 KiB]
Not downloaded yet
Top
   
PostPosted: Tue Feb 13, 2018 2:45 am 
Online
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7043
the way the edge is drawn was changed when more heightlevels was introduced, so the existing newgrfs don't work anymore. it is not anymore a special black sprite drawn as a tile, but the grass/dirt sprite with an all-black recolour map

but it should be possible to make a newgrf again, which just replaces this recolour map.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 117 posts ]  Go to page Previous 1 2 3 4 5 6

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.