New Map Rewrite effort

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

User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

New Map Rewrite effort

Post by belugas »

As some of you may have heard, there is a new effort on "New Map" subject, called tfc_newmap.

We, the tfc_newmap developers, are now proud to present to you the fruits of our work.
The main goal pursued is to remove _all_ direct accesses to the current map array.
Other, though less major, goals are to increase the readability of
the code in the parts where it accesses the map,
prepare the ground for the structure devs wrote for the old rewrite and so on.

Currently we have almost identified all direct accesses and written a
wrapper for them. The next step, which we are currently starting, is to
generalize the newly created accessors to a 'global' map API. Meanwhile we
are trying to remove all indirect map accesses via the TileInfo struct. This
struct hides the API by creating an extra, unnecesary layer.

The progress of the work can be followed via:
http://wiki.openttd.org/index.php/MapRewriteProgress

We try to keep our version of OpenTTD as close as possible to the trunk of
OpenTTD. This means that the tfc_newmap OpenTTD should be able to load
savegames from the trunk OpenTTD and vice versa. When that is not the case,
it will be considered a bug. So this means that we need you to test our efforts anyway
that you can, on newtwork as well as standalone. Do not expect anything new visually,
nor new feature nor anything else.

The most recent version of our effort can be fetched (via SVN) from:
svn://svn.libgpmi.org/openttd/branch/tfc_newmap
or browsed at Our own private TRAC system, graciously provided by TrueLight!

Nightlies are available below, for those OS:
Linux ,Mac OS x and Windows

Rubidium, glx, egladil and me would like to thanks :
Truelight for his kind help and advices
Darkvater, peter1138, tron for their advices and support
Igor2Code (as now known on IRC) for inspiration ;)
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
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

I'm glad you're making so good progress on it, TFC team.

Belugas, that's great you've announced it here, this way much more people will know about your wonderful job.

Also I'm happy to see developer's nicks in "Greets" section - If devs got involved in a patch, the patch gets involved in OpenTTD :D
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

:shock: wow!
the last time I saw this wikipage (witch was 3 days ago) it was just for a few percent done if I'm not wrong.

Amazing, just amazing!
Keep it up! :wink:
dmh_mac
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 25 Apr 2005 18:18

Post by dmh_mac »

Wow this is great!
User avatar
paijm021
Engineer
Engineer
Posts: 84
Joined: 14 Apr 2004 20:32
Location: Netherlands
Contact:

Post by paijm021 »

Will this ultimately lead to things like diagonal tracks under bridges and signals in tunnels?

Anyway superb effort!
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

We greatly appreciate those nice comments of yours :)

What is the future looking? Bright, in our dreams!

Once everything is the way we want them to be, we will start the real work : implementing the scheme devs wrote in the old map rewrite effort.

That would ultimately allow us to do things like:
undersea tunnels
turning tunnels
undergroung stations
lights on tunnels-bridges
diagonal tracks underbridge
multiple layered bridges
diagonal bridges and tunnels (but that would require graphics ;) )
cliffs
And so much more...
In fact, the imagination is going wild :D
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
DeletedUser21
Tycoon
Tycoon
Posts: 11501
Joined: 20 Sep 2004 22:45

Post by DeletedUser21 »

Hmm... It is turning to go a little bit like Locomotion bridges and stuff only then with the TTD graphics and far better gameplay! :P
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

Great work!!!
When it is finished ..it will make the game much better.


*fingers crossed to see it in the trunk when it is done*
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
Archonix
Chief Executive
Chief Executive
Posts: 733
Joined: 01 May 2003 17:29
Location: Manchester, UK
Contact:

Post by Archonix »

/me imagines multi-level diagonal bridges criss-crossing all over the map...

Yeah baby. :D
Brignell’s law of consensus: At times of high scientific controversy, the consensus is always wrong.
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

I am SO glad progress is still being made on this project. I'm so maxed out on time right now it's depressing. I'd rather be working on OTTD full time. :)

I'd offer help, but again, no time. :(
-Buggi
Programmer and TTD fan...
CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Post by CobraA1 »

Great :). Keep at it, I love it already.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
jungle
Engineer
Engineer
Posts: 76
Joined: 17 Dec 2004 23:40
Location: UK

Post by jungle »

This is a huge job, well done for having another try... hopefully the last attempt provided some experience of what can go wrong and this time it can all go a bit more smoothly.

If it means OTTD has to cut down on new features for a while it is still well worth it - the possibilities once the new map is up and running are enormous. There's a lot of newly drawn graphics already waiting in the wings for a map capable of using it.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

jungle wrote:If it means OTTD has to cut down on new features for a while it is still well worth it
Luckily, we are not official devs, which means they keep on doing their great job, while we keep on our side :). So no cut doen of anything.
And, today, it is a great one, since we removed the last direct map accesses. So Step one in finished.
The fun only begins :)
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
User avatar
Thalass
Traffic Manager
Traffic Manager
Posts: 200
Joined: 02 Jul 2004 13:29
Location: Ontario, Canada

Post by Thalass »

One thing I've noticed, when a train goes uphill or downhill, instead of sliding up or down the slope the train and it's carriges act as if each tile is flat, and when it reaches the next tile it jumps. Like it's going up or down stairs.


works fine other than that, though. :)
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

sounds like the slope retrieval functions isn't working yet :)
User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

Great job guys!!! It's really nice that you managed to take this project to the end!!!
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!
kasper_vk
Engineer
Engineer
Posts: 8
Joined: 02 Sep 2004 13:04
Location: The Netherlands

Stop all terrain-related development in main code-stream?

Post by kasper_vk »

I've had this thought for al long time, but I never noticed anyone else saying the same thing, so here it is:

Development of all map-related changes, patches and new features should be ceased until the / a new map structure has been fully developed & merged with the main source-stream.

Why?
- every addition to or change of the current structure wil have to be retested & re-implemented when the / a new map structure is merged with the main source stream
- every addition to or change of the current structure might further slow down the develoment of a new map structure, if the developers aim at staying (close to) compatible with the main-stream
- asuming the new stucture is well designed & implemented, any new feature will take less effort to implement on the new structure than on the old, so why bother building new features on the current/old structure?

The motivation behind this is simple: there's a large amount of suggestions from the OTTD userbase regarding map-related features / changes (pbs, signals on bridges, diagonal tunnels&bridges, underground stations, multi-tile depots... etc!). And it seems that lately more & more people create patches to achieve some of these map-related goals, but al these changes are made on the existing map-structure.
IMHO if this continues, it will become increasingly difficult & time-consuming to even switch to a new structure.

Investing this time in the development of the new structure seems to me a far better way to go (on the long run!). Trying to only achieve results on short term will eventually kill any project.

Anyone who shares this opinion?
Do the OpenTTD developers have a vision of the way to go towards a new map structure?
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

In my patches (those which I'm currently working on) I try to avoid direct references to the map array. However, sometimes they aren't avoidable. So should I wait until the code* is rewritten? The answer is no. But I do agree that if you write some code, you should certainly think how you would change it if the new map structure would be integrated in the trunk. I mean, where you use direct references, you should add comment lines about what they do**, so you can easily change them when you should.



* i.e., the new map structure
**And probably mark them in some way, so you can find them just by ctrl-F-ing (or something like that).
egladil
OpenTTD Developer
OpenTTD Developer
Posts: 188
Joined: 07 Nov 2005 17:10
Location: Sweden

Post by egladil »

kasper_vk: Could you please explain what you mean by map-related patches? Do you mean things like this project, or things like my yellow signals patch, or both?
User avatar
AlienDNA
Engineer
Engineer
Posts: 97
Joined: 12 Apr 2004 08:53
Location: Leiden, Netherlands

Post by AlienDNA »

There is just one thing I wonder about. As I am reading this, I remember devs working on a new map array as well. Is this effort running on its own, or is this THE map rewrite everyone was already waiting for.

Because I wouldn't like the main branch splitting up in one with the tfc map array, and one with the main map array. Because then it would be better to spend all one's effort on a single branch, then to make 2 seperate ones...
"I'm gonna rip his leg off and kick him with it!", Sanjuro, Shogo-MAD
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 2 guests