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
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Small patch to keep track of the ordering of the docks in the harbour. See foto.
Image
Attachments
dock numbers_26124.patch
(3.8 KiB) Downloaded 139 times
dn.png
dn.png (152.06 KiB) Viewed 946 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:Small patch to keep track of the ordering of the docks in the harbour.
First I successfully applied your Organise_ship_docking patch.
Then I applied your dock numbers_26124.patch and got this:
MinGW wrote:sh: dock: No such file or directory
and then I figured it out ... MinGW read the space in your patch name as a new line or some such.
Bad bad MinGW does not like spaces in it's lunch.
Adding an underscore worked: dock_numbers_26124.patch
MinGW is happy now.
:mrgreen:
Make is acookin' and lunch will be up within 30 minutes or so.

A Win32 binary lunch is ready:
DockNumberTest_Win32.7z
The recipe ...
(5.74 MiB) Downloaded 145 times
and a sampling from our kitchen:
Lunch by the numbers ...
Lunch by the numbers ...
Dock Number Test.png (66.35 KiB) Viewed 4541 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

Here is the binary with JGR's tracerestrict-cidan, Hackalitlebit's docks by the numbers and notafrog's favourite free bridge:
OpenTTD-NMF_JGR-g5f20fe4eM-tracerestrict-cirdan-HAv2plus1-Win32.7z
Code by numbers
(5.76 MiB) Downloaded 146 times
and some "what-you-see-is-what-you-get":
Paint by numbers
Paint by numbers
Docking_By_The_Numbers.png (170.6 KiB) Viewed 4533 times
Enjoy,
:D
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Waiting bouy ready!

Wally it is better to apply the 4 patches again.(zipfile below)
I hope you don't have problems with savegames.(I didn't)
Docks (yes the ones with 2 tiles) can only be used for loading and unloading.
Dockbuoy's can be transformed into a waiting buoy or for loading unloading.
You need to click on the label and press ctrl.
By doing so you will roll trough all possible states.

Code: Select all

color codes :
green-green   : Ready to receive for loading unloading.
red-green     : Reserved for loading unloading.
green-yellow  : Ready to receive for waiting.
red-yellow    : Reserved for waiting.
See below foto.
wb.png
wb.png (18.7 KiB) Viewed 4461 times
Patches included in zipfile.
Note that instead of using bool var (reserved) now a flag (dockstatus) is used!!
docks.png
docks.png (25.92 KiB) Viewed 4461 times
Attachments
bouy.zip
(7.9 KiB) Downloaded 149 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:Waiting bouy ready!
Can you make the coloured dots larger? On my system they are quite difficult to discern even at maximum zoom
Patches included in zipfile.
I applied them in the following order:
26350 then 26351 then 26352 then 26353
Is this ok? Your png image suggests a reverse order.

Here is the Windows 32 bit binary:
OpenTTD-NMF-g30353e06M-HALB-4_Win32.7z
Just the 4 patches, nothing else.
(5.74 MiB) Downloaded 134 times
NOTE: My MinGW had a hiccup on the first chunk of the first patch (26350), however it seems that MinGW retried and it was ok. The subsequent 3 patches went without issue. So, please run this binary to make sure that nothing broke.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

wallyweb wrote:Can you make the coloured dots larger? On my system they are quite difficult to discern even at maximum zoom
When you open /Cirdan-clone/src/lang/english.txt you can find the following lines

Code: Select all

STR_VIEWPORT_DOCK_GREEN                                         :{GREEN}..{BLACK}{NUM}
STR_VIEWPORT_DOCK_RED                                           :{RED}..{BLACK}{NUM}
STR_VIEWPORT_DOCK_GREEN_YELLOW                                  :{GREEN}.{YELLOW}.{BLACK}{NUM}
STR_VIEWPORT_DOCK_RED_YELLOW                                    :{RED}.{YELLOW}.{BLACK}{NUM}
Just change the dots to another character.
Like * or º or :
I now used

Code: Select all

STR_VIEWPORT_DOCK_GREEN                                         :{GREEN}::{BLACK}{NUM}
STR_VIEWPORT_DOCK_RED                                           :{RED}::{BLACK}{NUM}
STR_VIEWPORT_DOCK_GREEN_YELLOW                                  :{GREEN}:{YELLOW}:{BLACK}{NUM}
STR_VIEWPORT_DOCK_RED_YELLOW                                    :{RED}:{YELLOW}:{BLACK}{NUM}
That looks like this
dubblepoint.png
dubblepoint.png (62.08 KiB) Viewed 4422 times
It is for testing only.
Also change your company collor for more contrast.
wallyweb wrote:I applied them in the following order:
26350 then 26351 then 26352 then 26353
Correct. Uh... I didn't think about it, but that is how I see it on my screen.
wallyweb wrote:NOTE: My MinGW had a hiccup
Hmmm I'll check it out here.
Hold on.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

wallyweb wrote: NOTE: My MinGW had a hiccup
:oops:

Its time to start branching.
Clean patch below

apply in reversed order.
2.png
2.png (26.4 KiB) Viewed 4413 times
Tested 2x and compiled 2x :mrgreen:
Attachments
buoys2.zip
(7.91 KiB) Downloaded 136 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:
wallyweb wrote:Can you make the coloured dots larger? On my system they are quite difficult to discern even at maximum zoom
Just change the dots to another character.
Aha! I will experiment with an assortment of characters.
Also change your company collor for more contrast.
This is a little more difficult. Players select a company colour for a reason. My own preference is orange because it shows up well for me. Another player may prefer red or white for a similar reason, or for any reason they deem to be valid.
wallyweb wrote:NOTE: My MinGW had a hiccup
Hmmm I'll check it out here.
Hold on.
/me pauses productivity.
Clean patch below
Back with a fresh binary in about an hour, 8)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

MinGW says ...

Code: Select all

$ patch -p1 < Cirdan-clone_26346.patch
patching file src/pathfinder/opf/opf_ship.cpp
patching file src/pathfinder/yapf/yapf_ship.cpp
Hunk #1 FAILED at 48.
Hunk #2 succeeded at 104 (offset -3 lines).
Hunk #3 succeeded at 230 (offset -3 lines).
1 out of 3 hunks FAILED -- saving rejects to file src/pathfinder/yapf/yapf_ship.
cpp.rej
patching file src/saveload/afterload.cpp
patching file src/saveload/saveload.cpp
patching file src/saveload/station_sl.cpp
patching file src/ship_cmd.cpp
patching file src/station_base.h
Hunk #3 succeeded at 537 (offset 27 lines).
patching file src/vehicle.cpp
Here are the yapf_ship files:
yapf.7z
(4.96 KiB) Downloaded 141 times
/me pauses productivity
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Did you update your branche from cirdan?
His last commit is:
Fix old map array tunnel head conversion 7 days ago.
here

I checked your reject.
But that should be easy
open file yapf_ship.cpp
and replace lines (somewere near line 50)

Code: Select all

-		, m_dest_tile    (depot ? INVALID_TILE :
-				ship->current_order.IsType (OT_GOTO_STATION) ?
-					m_dest_station->GetClosestTile (ship->tile, m_dest_station->dock_area) :
-				ship->dest_tile)

with

Code: Select all

		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
And I made clean clone of cirdan and the patch applies without problems
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

HackaLittleBit wrote:Did you update your branche from cirdan?
His last commit is:
Fix old map array tunnel head conversion 7 days ago.
I tried but I couldn't get Git clone to point to his testing branch.
I checked your reject.
But that should be easy
I'll apply your fix and see what happens.

Now, how do I get Git to clone from his testing branch?

Hmm ... So now we will have

Code: Select all

-		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
+		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
:?:
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

wallyweb wrote:Now, how do I get Git to clone from his testing branch?
I pull from here
git://repo.or.cz/openttd/fttd.git
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

HackaLittleBit wrote:I pull from here
git://repo.or.cz/openttd/fttd.git
So did I and that got me the regular repo. Now I just got brilliance and determined that the branch name is testing and I put that into Git clone's branch field and that worked. 8)

I'm compiling a clean test branch now, and when that is done I will compile another with your patches. Look for results in about an hour or two. :mrgreen:
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

You know, for a long time I refused to buy a new computer.
I used many years ago system 36 and system 1 IBM
We had 60 terminals on 750 kb of memory.
Yeahhhhh.
So I was happy with my eee pc + 2 MB of memory. (massive machine) windows xp
My son grew up and started to laugh at me.
Anyway after much arguing he managed to take me to the shop.
He showed me a machine with 4000k screen Nvidia board etc etc. quadcore etc etc etc.
I tell you, he was right
The difference is incredible.
I compile openttd in less than a minute. Instead of 15.
4000k screen is like reading a book.
Don't be a grumpy old man, spend the money! :mrgreen:

Regards
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:I have just resurrected my testing branch with an update that fixes a crash when loading games with the old map array (reported by HackaLittleBit). If everything goes well and no other bugs appear, I will merge this branch to my master branch in a few days.
Having finally figured out how to pull from cirdan's testing branch, here is the bare and naked, unmodified Windows 32bit binary:
NMF-g1938333b-testing-Win32.7z
Once tested and verified to be without a crash, this will be replaced by a formal push from cirdan
(5.72 MiB) Downloaded 154 times
Moving on to HackalitleBit's patches, MinGW now gives me:

Code: Select all

$ patch -p1 < Cirdan-clone_26346.patch
patching file src/pathfinder/opf/opf_ship.cpp
patching file src/pathfinder/yapf/yapf_ship.cpp
patch: **** malformed patch at line 40: @@ -107,7 +104,7 @@
Are you sure about that yapf_ship.cpp mod you suggested?
HackaLittleBit wrote:Don't be a grumpy old man, spend the money! :mrgreen:
About five years ago I spent close to $2000 on a brand new HP lappy, the big one with a big screen, triple core performance and Windows 7. Yeahhhhh.
Sometime last year, when it was well out of warranty, it smoked its on-board graphic chip. Result: One motherboard reduced to scrap!
So I resurrected my reliable old Dell single core XP box and muddled along until I had the $150 I needed for a used A-Open dual core XP box which is where I am and remain until I can raise $500 for something with more cores and with absolutely NO Windows 10.
It could be worse. I could always go back to my still running IBM P/S 1 with Windows 3.1 :P
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Wally see below patch

I manually edited it.
Don't apply the patch just look at the differences.
Change manually this line (51)

Code: Select all

		, m_dest_tile    (depot ? INVALID_TILE : ship->current_order.IsType(OT_GOTO_STATION) ? m_dest_station->GetClosestTile(ship->tile, STATION_DOCK) : ship->dest_tile)
Into

Code: Select all

		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
I applied my patches and indeed it is the only problem I encountered.

I all depends on which branch is active.
Attachments
temp_26346.patch
(2.13 KiB) Downloaded 129 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

I only have a plain text editor (NoteTab Light) so I do not see the line numbers.
HackaLittleBit wrote:Wally see below patch

I manually edited it.
Don't apply the patch just look at the differences.
Change manually this line (51)

Code: Select all

		, m_dest_tile    (depot ? INVALID_TILE : ship->current_order.IsType(OT_GOTO_STATION) ? m_dest_station->GetClosestTile(ship->tile, STATION_DOCK) : ship->dest_tile)
This is the closest line that I have and it is different from the one that you have:

Code: Select all

-		, m_dest_tile    (depot ? INVALID_TILE :
-				ship->current_order.IsType (OT_GOTO_STATION) ?
-					m_dest_station->GetClosestTile (ship->tile, m_dest_station->dock_area) :
-				ship->dest_tile)
It is followed by this line:

Code: Select all

+		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
so if I make your suggested change, I will have:

Code: Select all

-		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
+		, m_dest_tile    (depot ? INVALID_TILE : ship->dest_tile)
Wouldn't it be easier to just send me your revised patch rather than I make the changes by hand?
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

wallyweb wrote:Wouldn't it be easier to just send me your revised patch rather than I make the changes by hand?
:roll:
Anyway
Here is a pic of the harbour of Singapore.
Image

This is the reality there.
singapore.png
singapore.png (309.15 KiB) Viewed 4284 times
And below the 4 patches that you need.

They go above the commit from cirdan of 5 months ago.
Changeset: 25986 (65a280a61037) Make BreakIndustryChainLink an ordinary function …
wallyweb wrote:I only have a plain text editor (NoteTab Light) so I do not see the line numbers
I am on linux now and never going back.
On windows one of the best tools for editing is NOTEPAD++
With this you can read c++ and patches and lots more.
EDIT
I see now that Kdevelop has a version for windows!!!
Here you can download it.
I know that more devellopers here use this IDE
I really like it, highly recomended.

I do not know how to set up things for windows.
Here are the instructions
Attachments
singapore2.png
singapore2.png (310.19 KiB) Viewed 946 times
organised_harbor_movement.zip
(7.84 KiB) Downloaded 136 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:This is the reality there.
So when are you going to make a scenario of the real thing? :lol:
And below the 4 patches that you need.
:bow:
They go above the commit from cirdan of 5 months ago.
Ok ... We're done with cirdan's test push then ...
I am on linux now and never going back.
I was on Linux, many distros, many times ... Red Hat, Mandrake, and whatever the latest one is ... I forget the name ... I may go back when I get a better PC, but for now I'm not messing with partitions etc.
On windows one of the best tools for editing is NOTEPAD++
With this you can read c++ and patches and lots more.
Actually I can do all that with NoteTab Light. I'm just too busy lazy to poke around the app.
I see now that Kdevelop has a version for windows!!!
Here you can download it.
I know that more devellopers here use this IDE
I really like it, highly recomended.
I'll look into it, but it would probably just sit there taking up space.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

OK ... Here we go ... :D

Windows 32bit cirdan's push with HackalittleBit's mod:
OpenTTD-NMF-g30353e06M-HALB-4a_Win32.7z
Exactly the way HackalittleBit wrote it
(5.74 MiB) Downloaded 123 times
Windows 32bit JGR's tracerestrict-cirdan with HackalittleBit's mod and cirdan's free-bridge diff and a little mod of my own: 8)
OpenTTD-NMF_JGR-g5f20fe4eM-tracerestrict-cirdan-FBHAv4a-Win32.7z
With my own mod added
(5.76 MiB) Downloaded 136 times
A little screenshot showing my mod:
A thousand words worth of picture
A thousand words worth of picture
dockTest.png (94.37 KiB) Viewed 4235 times
An observation: If a second ship joins the waiting ship, the waiting buoy's symbols change to reservation available.

All in all, this is really neat. 8)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 13 guests