New map features

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
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

JGR wrote:
wallyweb wrote:[Reserved for JGR's tracerestrict push]
I've done the merge, but haven't done any non-trivial testing.
:bow:
The binaries are here. :D
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

Love the station-on-slopes things. That often bugged me, depending the rotation, especially when placing non-track tiles where it really didn't make any sense that they needed to be placed like this or that ^^

Thanks for keeping up the good work :)
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

I would usually compile before sleeping but I have seen that JGR
updated the tracerestriction branch :)
Thanks for that JGR :bow:

So here is the Ubuntu 14.04 64 bit version.
Only did a rough testing but starting my save game.

Game runs and save loads.
No crashes so far.

So good job both of you.

Cheers
Attachments
openttd-custom-g5f20fe4e-tracerestrict-cirdan-UNIX.tar.xz
Ubuntu 14.04 LTS 64bit
Version: g5f20fe4e-tracerestrict
(4.66 MiB) Downloaded 88 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

TrueSatan wrote:Do I have to enable the drag and drop feature? Because with my rather "old" save game, its not working with thebew station from Michael Blunk. I can drag and drop but over the dimensions and get an error cannot build station here. He fixed the layout mostly to the length of7 and usually to two platforms.
This new feature only affects station building with drag and drop. The difference now is that, if the station layout only allows a single choice for either the number of tracks or the platform length of the station, then the highlight area is locked in that particular direction and dragging is only possible along the other axis. Dragging behaviour is unchanged if there are several possible sizes along a direction, in which case you can still select an area that the station layout does not allow (and get an error). I did consider doing something with this case as well (restricting selection to allowed sizes), but it turned out to be a lot of work and gave it up.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

cirdan wrote:
TrueSatan wrote:Do I have to enable the drag and drop feature? Because with my rather "old" save game, its not working with thebew station from Michael Blunk. I can drag and drop but over the dimensions and get an error cannot build station here. He fixed the layout mostly to the length of7 and usually to two platforms.
This new feature only affects station building with drag and drop. The difference now is that, if the station layout only allows a single choice for either the number of tracks or the platform length of the station, then the highlight area is locked in that particular direction and dragging is only possible along the other axis. Dragging behaviour is unchanged if there are several possible sizes along a direction, in which case you can still select an area that the station layout does not allow (and get an error). I did consider doing something with this case as well (restricting selection to allowed sizes), but it turned out to be a lot of work and gave it up.
Thanks for the explanation and I understand that the other feature would be a lot of work.

Cheers
notafrog
Engineer
Engineer
Posts: 14
Joined: 13 May 2014 17:43

Re: New map features

Post by notafrog »

Hi Cirdan

I've been building bridges over stations ever since you introduced the feature and I love it.
I've just updated to g30353e06. Prior to that I was running g7573dfd9.

I've looked in the messages but haven't seen any reference to this problem: I can now only build bridges over the default OpenTTD station.
For every other station platform in my NewGRF sets, I get the "Must demolish railway station first" message.

Is this supposed to have changed?
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

WARNING: highly experimental!!!
Tiny patch to make ships wait on different docks.
The patch is far from ready so beware.
Be carefull with deleting stuff.
Just for the weekend to have a look. ;-)

To make more than one dock you need to press the ctrl key and attach the new dock to an existing one.

Included is savegame to show you what I pretend.

TODO:
Position ships according to dock position.
Better integration in pathfinder.
Lots of testing.

Suggestions about code improvements are highly welcome.(damn that pathfinder is complicated :-()

Happy weekend!

P.S. I do not want any credit for this micro thingy. All credit goes to Cirdan. Awesome!
Attachments
Cirdan-clone_26118_seperate docking.patch
(4.25 KiB) Downloaded 79 times
cird.sav.zip
(14.57 KiB) Downloaded 72 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

HackaLittleBit wrote:... patch ...
Observations:
1. I applied the patch to cirdan's current push.
OpenTTD-NMF-HALB-g30353e06M-Win32.7z
(5.74 MiB) Downloaded 77 times
2. I built three docks on one station.
3. I built a navigation buoy nearest to the first dock.
4. I built a ship with orders to go to the docks via the buoy and wait for a full load.
5. I cloned three more ships (same orders)
6. I launched ship 1, 2 and 3. Each went to an empty dock.
7. I launched ship 4. It joined ship 1 at the first dock.

Suggestion: Have ships moor (wait) at the buoy for an empty dock.
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: New map features

Post by acs121 »

And if there's no buoy ? Or if the buoy is very far from the dock ?
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

acs121 wrote:And if there's no buoy ? Or if the buoy is very far from the dock ?
It is up to the player to build the buoy were most appropriate.
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: New map features

Post by acs121 »

Not everyone puts buoys. Example : i have a friend which uses hydrofoils and hovercraft in bays or lakes in cities. He never puts buoys.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

acs121 wrote:Not everyone puts buoys. Example : i have a friend which uses hydrofoils and hovercraft in bays or lakes in cities. He never puts buoys.
That's his choice. If Hackalittlebit is able to code as I am suggesting, and your friend does not want to take advantage of it, that does not affect the other players. If you have another suggestion, then let us see it. You might have a better idea. 8)
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: New map features

Post by acs121 »

One idea is that the ship, be there a buoy or not, will stand 3 tiles away from the docks until a dock is free. If the ship has in the orders a buoy from 3 to 10 tiles away from the docks, then it will stand near it.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

acs121 wrote:Not everyone puts buoys. Example : i have a friend which uses hydrofoils and hovercraft in bays or lakes in cities. He never puts buoys.
I think that if player does not put buoy at regular intervals ship should be able to crash with each other or with coast.
Let say max distance between buoys 15 tiles.
This would relieve the pathfinder!
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

notafrog wrote:I've been building bridges over stations ever since you introduced the feature and I love it.
I've just updated to g30353e06. Prior to that I was running g7573dfd9.

I've looked in the messages but haven't seen any reference to this problem: I can now only build bridges over the default OpenTTD station.
For every other station platform in my NewGRF sets, I get the "Must demolish railway station first" message.

Is this supposed to have changed?
The code did not change as such. My master branch only ever allowed bridges over the standard stations, but at some time I did post this patch that would lift this restriction and allow bridges also over custom stations. Perhaps you were playing with a version that had this patch applied? The patch should still apply cleanly, but ping me if it does not.
HackaLittleBit wrote:WARNING: highly experimental!!!
Tiny patch to make ships wait on different docks.
The patch is far from ready so beware.
Be carefull with deleting stuff.
Just for the weekend to have a look. ;-)
HackaLittleBit wrote:Suggestions about code improvements are highly welcome.(damn that pathfinder is complicated :-()
I see a problem with your approach: it seems that ships choose a docking tile when switching to a new order, which may be long before they reach their destination station. Is this right?
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

HackaLittleBit wrote:I see a problem with your approach: it seems that ships choose a docking tile when switching to a new order, which may be long before they reach their destination station. Is this right?
In theory this can be, when player play's without buoys, the moment ship aims for next stopping place.
So yes that is correct.

Keep in mind that this approach is one of the possibilities.
Other variants could be reserve the "loading tile".(more complicated however)
Maybe make check only when close (+/- 8 tiles) before docking.

It is however a magnitude better as what is was.
The player has to make sure enough docking places are available.(for example)
The "dockbuoy" could be used as waiting place if available.(other variant)
You can make it as complex as you want.
I am a bit against this because you can have a zillion different layouts of the harbour.
Aaannd... it is a game, it does not have to perfect.(things never get done like that)

Before I forget, canal tiles on level 0 could be used to guide ships through the harbour.(lower cost, but a lot of programming in pathfinder I think)
See foto
tile2.png
tile2.png (5.86 KiB) Viewed 3019 times
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Hey thanks hackalittlebit for the patch :)

I will just post the Ubuntu 16.04 jgr tracerestriction version, because of the
highly experimental stage.

I used it on a save from a rather advanced (year 2815) game
I played on tracerestrition.
I added a few docks to some passenger lines and wow it works.
Not using bouys at any kind, besides the bouy icons for the docks
if you place them on the water tiles.

Looks promising :)
Hope to see more of this patch, guess it will be more fun
to play with boots soon.

Edit: ah i c the problem now as well, the docks don't have a flag or something if they
are occupied. guess they need something like that for the pathfinder (I am using YAPF on ships)
So as described in some of the above posts, the speedboots overtakes a slower ship
occupies the docks, no problem there, but the slower ships has decided to early
to take the same spot just arrives l8er, so you have the same behaviour as without the patch.


Cheers
Attachments
openttd-custom-g5f20fe4eM-tracerestrict-cirdan-UNIX.tar.xz
Version: g5f20fe4eM-separate-docks
Ubunut 16.04 64bit
(4.66 MiB) Downloaded 70 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

Good work TrueSatan. 8)

Here's a thought. Is the station coverage accessible? If it is, then ships might be made unable to reserve a dock until they enter the coverage area.

Another thought. Is there a default movement for a ship when all docks are full? Something like "Go around and try again"? Or perhaps "Pause movement until a free dock is detected."?

The logic might look something like this:
1. Ship enters next order
2. YAPF plots best route to that station
3. Ship enters station coverage grid
4. YAPF pauses ship
4. YAPF checks each dock for availability.
5. None found. Pause continues.
6. YAPF detects free dock.
7. YAPF reserves free dock.
7. YAPF stops pause.
8. Ship moves to reserved dock.
Note that a reserved dock would have the same effect as an occupied dock.
The only bug that I can see is what if two (or more) ships enter the coverage area at the same time? Which ship gets priority? Or does YAPF poll each ship in a sequence?
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

TrueSatan wrote:Not using bouys at any kind, besides the bouy icons for the docks
"Keelhauling" that is what they should do with people that don't use buoys.

wallyweb

Cirdan has dockbuoys that I think not many people know.
Those could be used to let ships wait until free slot is available.
Maybe Cirdan even made them for that purpose.
You don't need to change the pathfinder for that.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

HackaLittleBit wrote:wallyweb

Cirdan has dockbuoys that I think not many people know.
Those could be used to let ships wait until free slot is available.
Maybe Cirdan even made them for that purpose.
You don't need to change the pathfinder for that.
Aye! I've been using the docking buoys for a while, especially for offshore unloading of crude to an oil refinery, as they do here on the Bay of Fundy to the Irving Oil Refinery. I considered using it but then thought that it would simply be considered one of the multiple docks as it is now. Would you be able to use it without giving up its dock properties?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests