Short _map* guide, please...

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
follow
Engineer
Engineer
Posts: 55
Joined: 20 Jul 2004 02:43
Location: Warsaw, Poland
Contact:

Short _map* guide, please...

Post by follow »

Recently I started to look/read/change OpenTTD code, and have some problems decoding what
bits means what in all _map arrays.

Here is what I have guessed so far:

If tile is rail (how to determine?):

Code: Select all

_map5    (X _ _ _ _ _ _ _) - rail has signals
_map5    (_ _ _ X X X X X) - rail track orientation
_map2    (X X X X _ _ _ _) - signals status (?)
_map3_lo (X X X X _ _ _ _) - signals configuration
_map3_lo (_ _ _ _ X X X X) - track type
_map3_hi (_ _ _ _ _ X X X) - presignals configuration
For roads there is:

Code: Select all

_map3_lo (X X X X X X X X) - owner
_map5    (_ _ _ _ _ X X X) - road direction/orientation
Land:

Code: Select all

_map_type_and_height (_ _ _ _ X X X X) - land height (or rather height of one of the corners of tile?)
_map_type_and_height (X X X X _ _ _ _) - land (tile) type
Of course X is important bit of whole byte.


I would be thankful if somebody can confirm this, and compleate missing parts.
Thanks!

PS.
Specific questions:
* (ti.map5 & 0xF8) == 0xC0)
* (ti.map5 & 0xF8) == 0xE0)
* (_map5[tile]&0xF0) == 0x10
* ti.tileh & 0x10
* how to check what i sunder the bridge
User avatar
Celestar
Director
Director
Posts: 574
Joined: 02 Jul 2004 10:56
Contact:

Post by Celestar »

There's a docs/landscape.html file right? I suggest you read it. Plus: The entire map array will be thrown away in one of the next versions anyway and be replaced by something more sane and flexible.

Celestar
matthijs
Engineer
Engineer
Posts: 76
Joined: 25 Jun 2004 15:20
Location: Enschede, Netherlands
Contact:

Post by matthijs »

Ah crap, there is a landscape.html file? I've been trying to figure out some of that stuff by hand, stupid me... ;-)
follow
Engineer
Engineer
Posts: 55
Joined: 20 Jul 2004 02:43
Location: Warsaw, Poland
Contact:

Post by follow »

Me too...

Thanks Celestar :)
msalters
Engineer
Engineer
Posts: 34
Joined: 16 Jun 2004 19:21

Post by msalters »

It's very useful. The one thing that keeps confusing me is the relation between the 4 directions (0 = NE, 1 = SE?) and the 6 railtracks. (0=NE->SW, 1=NW-SE, 2-4 are corners?)
follow
Engineer
Engineer
Posts: 55
Joined: 20 Jul 2004 02:43
Location: Warsaw, Poland
Contact:

Post by follow »

BTW.

Is there any open discussion on the new map format?
List of features, is it more 'dynamic'?

It would be great if you can share ideas, and maybe discuss enhancements, before
everything is finished...

Eventually I may voulnteer helping with development of this.

Thanks,
Jan

Just a few sugestions I have in mind:
- sharing tiles by diferent types of tracks (because why not)
- option for future additions like underground station (I vote for this in the feature!)
- option for future addition like arbitrary crossings, N-S, E-W highways, N-E bridges,
not straight bridges, not flat bridges (conecting different levels)
- more steep landscape
- option for traffic light on anything (bridges, under bridges (even if currently ther would
be GUI problem), maybe on the ends of station platform, may underground)

I know that sounds too much universal and mote of these features will be never added, but maybe at least some space can be saved for eventual future additions...

Or maybe you already take all of these into consideration. But it's just why I would like
to be able to discuss/read about it.
:)
follow
Engineer
Engineer
Posts: 55
Joined: 20 Jul 2004 02:43
Location: Warsaw, Poland
Contact:

Post by follow »

In short words:

It would be greate if with new map format following answer is not longer valid:

It is not possible map will not allow for this.
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

follow wrote:BTW.

Is there any open discussion on the new map format?
List of features, is it more 'dynamic'?

It would be great if you can share ideas, and maybe discuss enhancements, before
everything is finished...

Eventually I may voulnteer helping with development of this.

Thanks,
Jan

Just a few sugestions I have in mind:
- sharing tiles by diferent types of tracks (because why not)
- option for future additions like underground station (I vote for this in the feature!)
- option for future addition like arbitrary crossings, N-S, E-W highways, N-E bridges,
not straight bridges, not flat bridges (conecting different levels)
- more steep landscape
- option for traffic light on anything (bridges, under bridges (even if currently ther would
be GUI problem), maybe on the ends of station platform, may underground)

I know that sounds too much universal and mote of these features will be never added, but maybe at least some space can be saved for eventual future additions...

Or maybe you already take all of these into consideration. But it's just why I would like
to be able to discuss/read about it.
:)
you forgot some others improvements
- subterranean vision (like tubes and water conducts in sim city), so you can manage underground lines like normal tracks
- curve tunnels
- different types of curves
- more realistic slopes
and so on
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

matthijs wrote:Ah crap, there is a landscape.html file? I've been trying to figure out some of that stuff by hand, stupid me... ;-)
well, it was a good joke never the less :lol:
As a general rule, chech the docs in doc folder. Somebody spend time to write it to save time for other people
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 19 guests