Page 1 of 2

Halftile foundations (in trunk since r11321)

Posted: 03 Oct 2007 17:24
by frosch
Good evening.

Some of you were already unpatiently waiting for it, but now it is released. The patch features:
1) The halftile foundations: Build two horizontal/vertical tracks on (steep) slopes.
2) Acerbus' anti-zig-zag foundations.
Both can be seen in
halftileintroduction.png
Screenshot
(117.34 KiB) Downloaded 755 times

Before you can start playing, you will have to know some things:
Most foundations hide something behind them. More intresting is: If you click on the overlapping areas, the mouse click will be associated to the hidden tile. This is also the behaviour of trunk, but there it is not that noticeable.
But here it is more critical. See the following situation (right hand side):
steep slope
steep slope
SteepSlopeS.png (3.51 KiB) Viewed 7959 times
The lower part of the steep slope is completely hidden by the foundation. Where do you now have to click to build track there?
Remember - the hidden part will always be preferred. So imagine there would be no foundation and click where the lower part of the slope must be. Note that the (auto-)rail highlight will also be hidden.
OTOH in the same situation: If you now want to build signals on the upper track, you will have to click near the lower border of the foundation. The clickable area is relative small.
And even more; in the left hand side situation: If you have two tracks on such a steep slope and want to build signals on one of the track, both click areas are on the upper foundation. If you click on the lower part of the foundation you will already get the next track behind it.
Okay a bit tricky, but I hope if you try it, you will figure it out.
Second you will notice, that only some pixels of the track on the lower part are visible. But with fences you will discover if there is track:
With fences
With fences
FencesHelp.png (4.12 KiB) Viewed 7940 times

Now, how to install this:
1) Below (in the next post) you will find a zip with two graphic files: "halffndw.grf" and "halfselw.grf". Copy them into your "data" directory, where the original graphics are.
2) Second you will find the patch file. Read the sticky topics "Howto apply a patch" and "BuildOTTD" on how to apply it.


Savegame compatibility:
If you load a savegame from trunk, all foundations will switch to the new one. The halftiles near the coast will get flooded in the first seconds after load.
I did not increase the savegame version. By that all future versions of the patch will be compatible to this version. If you load a savegame from this patch in trunk, it will quietly do that. Previously flooded halftiles near the coast will convert back to grass. However, if you have built a track combination that is not valid in trunk (i.e. two tracks on slopes), it will fail. That means trunk will still load the savegame but will crash somewhen in between (e.g. when the invalid track combination should be drawn in a viewport, when a vehicle (even plain) will go over it, ...). However, if you remove all critical tracks, you can savely load the savegames from trunk.


If you do not like the new foundation graphics, you can load your own with an Action5 (see http://wiki.ttdpatch.net/tiki-index.php?page=Action5).
In the next post is an example grf: tmpfndw "Temperate foundations in all climates".
I extended Action5 Type 6 with a 90 sprites version. The 16 new sprites are appended at the end, so the grf is compatible with TTDP without any version checks. See "tmpfndw.grf" below for a example.


Now - enjoy it!

Re: Halftile foundations :)

Posted: 03 Oct 2007 17:26
by frosch
new version. The graphics slightly changed, so you also have to download the graphics again.

Further there is now a example how to use ActionA and Action5 to replace the foundation graphics. tempfndw.grf changes the foundations of all climates to those of the temperate climate. You may want to use this grf, if you are playing with a industry grf, that changes the foundations :)

Re: Halftile foundations :)

Posted: 03 Oct 2007 17:31
by DaleStan
frosch wrote:2) Use 16 sprites, if you want to only load the new foundations. (see halffndw.grf for the order, though it contains the sprites for all climates)
NAK. Action 5 loads one set of contiguous sprites. You may use it to load any number of sprites into this one set, but you may not use multiple action 5s to load multiple parts of one set. If you need non-contiguous loading, then you need multiple action 5 types.

Re: Halftile foundations :)

Posted: 03 Oct 2007 22:26
by athanasios
I hope it will make it into the trunk soon. It is a must. Good luck.

Re: Halftile foundations :)

Posted: 04 Oct 2007 10:09
by frosch
DaleStan wrote:Action 5 loads one set of contiguous sprites. You may use it to load any number of sprites into this one set, but you may not use multiple action 5s to load multiple parts of one set. If you need non-contiguous loading, then you need multiple action 5 types.
Err, I forgot a point in the first post, so I clarified the NewGrf extentions.
I somehow expected problems with method 3), but now there are problems with 2). :) I just took a look at the TTDP Action5 handler and agree that the current method won't work.

However as long as noone wants to replace the graphics, I am not in the mood to spend any work on this issues.

Re: Halftile foundations :)

Posted: 04 Oct 2007 18:00
by Acerbus
Wow, thanks to Frosch, I seem to have my very own anti zig-zag patch :D How many people can say that?

Will build and test right now!

EDIT: I seem to have found a bug:
Sinwood Transport, 28. märts 1920.PNG
Sinwood Transport, 28. märts 1920.PNG (31.86 KiB) Viewed 7559 times
As you can see, the autorail button seems to be a bit off. This apparently only happens with the Canadian Trainset, though.

Re: Halftile foundations :)

Posted: 04 Oct 2007 20:16
by Bilbo
Great idea!

Well, as for the trunk acceptance, often it can help to split the patch into several parts (one containing some code cleanup, another just improved graphics - Acerbus's antizigzag, and last patch containing the foundations itself). Once the smaller patches are already in, the last part is then smaller, easier to review or maintain, etc ...

So, if it is possible to split patch into some logical parts ... you can try it to have chance of accepting the patch sooner.

Re: Halftile foundations :)

Posted: 04 Oct 2007 23:27
by DaleStan
frosch wrote:
DaleStan wrote:Action 5 loads one set of contiguous sprites. You may use it to load any number of sprites into this one set, but you may not use multiple action 5s to load multiple parts of one set. If you need non-contiguous loading, then you need multiple action 5 types.
I somehow expected problems with method 3),
3 is not an issue. There are many places where TTDPatch says, in essence:

Code: Select all

if (num_FOO_sprites > BAR)
    sprite = base_FOO_sprites + BAR;
else
    sprite = TTD_PROVIDED_SPRITE;
// do something with sprite
This is especially the case with type 04 (signals), for which any of 48, 112, or 240 is documented as valid, and type 07 (GUI) which has been growing new sprites one and two at a time for some time now.

Re: Halftile foundations :)

Posted: 05 Oct 2007 00:55
by Roujin
very nice :) if only different tracktypes were allowed on one tile, we could build a nice trace for monorail/maglev :lol:

ok, we can, but not in curves with the new halftiles. only if it were the same track type :P

Re: Halftile foundations :)

Posted: 05 Oct 2007 08:45
by frosch
Acerbus wrote:I seem to have found a bug:
Ok, the cause for this is: You have loaded a grf, that replaces the autorail icon. The new foundation sprites are inserted in a lower sprite number range, so all following spritenumbers got incremented by 16. A clean solution would be to finally create an Action5 for OTTD specific GUI icons (well actually perhaps there is already one, I am not sure).
DaleStan wrote:This is especially the case with type 04 (signals), for which any of 48, 112, or 240 is documented as valid, and type 07 (GUI) which has been growing new sprites one and two at a time for some time now.
Method 3) is different. The new sprites are not appended at the end, but interleaved.

I guess it will result in adding a new Action5 type.

Re: Halftile foundations :)

Posted: 05 Oct 2007 16:35
by DaleStan
Or just appending the new sprites to the end instead.

Re: Halftile foundations :)

Posted: 20 Oct 2007 22:55
by Digitalfox
r11319 -Add: halftile- and anti-zig-zag-foundations. Patch by frosch.
In trunk thanks to rubidium and frosch :D

Re: Halftile foundations :)

Posted: 20 Oct 2007 23:31
by Roujin
hooray for frosch :D :D

another great contribution by you :) *bow*

Re: Halftile foundations :)

Posted: 21 Oct 2007 00:05
by athanasios
I can't wait till tomorrow for the nightly! :D

Re: Halftile foundations :)

Posted: 21 Oct 2007 06:55
by Acerbus
Hooray for Frosch! I ain't gonna wait for the nightly, I'm gonna BOTTD myself a brand new build just to check it out!

Re: Halftile foundations :)

Posted: 21 Oct 2007 09:34
by Wolf01
great :D
thank you frosh and rubidium (and why not to Acerbus?)

Re: Halftile foundations :)

Posted: 21 Oct 2007 11:06
by Acerbus
Wolf01 wrote:and why not to Acerbus?
Why me? ?(

Re: Halftile foundations :)

Posted: 21 Oct 2007 11:15
by Wolf01
frosch wrote: 2) Acerbus' anti-zig-zag foundations.
maybe this?

Re: Halftile foundations :)

Posted: 21 Oct 2007 13:07
by Acerbus
Wolf01 wrote:
frosch wrote: 2) Acerbus' anti-zig-zag foundations.
maybe this?
To tell you the truth, I've always been confused as to why Frosch chose to name the patch after me. I somehow never got around to asking, though :s

Not that I have anything against it though :lol:

Re: Halftile foundations :)

Posted: 21 Oct 2007 13:23
by Roujin
that would be because of this post by you: http://www.tt-forums.net/viewtopic.php? ... t=#p617983

and his reaction:
Nice idea. I also did not like the zig-zag at the end, but I did not knew a way to remove it without drawing even more foundation-sprites. Thank you for pointing me on this way. I will definitely implement that.