QuoteMy idea was much simpler: to prevent the city from automatically building and renovating under bridges, elevated roads and similar structures, and to leave the rest up to the player.Since there are bridges over entire valleys with villages, I think a general ban is not nice, and height related is better.
Quoteheight_clearance = min(0, (pak_size/2 - ymin) / height_step))Height zero is exactly at half height. Image coordinates are from top left. The smaller ymin, the more height needed. Hence the minus sign. Starting deeper than half height needs no clearance, and then one more per height_step. I agree that zero does not make sense, one should better calculate:
say the word and I will work to your formula rather than invent my own.You prepared already a lot of the needed work. So maybe just go on? I am very busy this week at work, I fear, lots of text to write, which drains me and do not leave enough for programming.Quote from: danivenk on Yesterday at 11:22:30 AMif a different player real or AI could technically cut off growth by just building an elevated way or bridge next to a city.Every railway and also all fences do this.
Quote from: makie on Yesterday at 09:44:09 AMMy concern is the city itself, which simply and stupid builds anywhere as it expands—including underneath elevated highways.I get that, but even then that means if a different player real or AI could technically cut off growth by just building an elevated way or bridge next to a city. I'm just posing possible concerns with completely disallowing it. Hence why I myself am not sure if such a quick fix is the right option. That is why I think that either prissi's idea of introducing height into the objects or a way of estimating the height of a building based on how many tiles it covers in the drawing phase is the best option.
What the player does is a different matter. To restrict the player in a single-player game, it makes only sense if it is absolutely necessary to avoid program crash, I think.
clip_h = rw/2 + (pak_height_conversion_factor * rw / 8);
max_height = max(max_height, (area.h - area.y) / clip_h);
if (max_height == 0) { /* display without clipping */ }clip_h is 96 for pak128 and 40 for pak64. One height level on screen is:tile_raster_scale_y(TILE_HEIGHT_STEP, rw)That is 16 pixels in both paksets.height_clearance = min(0, (pak_size/2 - ymin) / height_step)This is always less than or equal to 0 as written. Did you mean max?Quote from: danivenk on Yesterday at 09:32:46 AMNot sure if completely disallowing the build/renovating buildings under bridges is really desirable... That would mean that if the player does not have access to the public player they can't add buildings underneath the bridges/elevated ways.My concern is the city itself, which simply and stupid builds anywhere as it expands—including underneath elevated highways.
Quote from: prissi on Yesterday at 02:30:02 AMSo my idea would be:
Introduce a new parameter for buildings in dat files: "height_clearance"