Patch - More companies (240)

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
milek7
Engineer
Engineer
Posts: 12
Joined: 18 Jul 2016 08:04

Patch - More companies (240)

Post by milek7 »

Raises maximum companies limit to 240.

Caveat:
- there is only 16 colors, after exhausting that pool companies are assigned random colors

Patch based on 1.6.1

Changelog:
v4:
- no more stupid warnings in MSVC
- scrollbar in companies league window
- different alignment of companies buttons in linkgraph and ai gui
- possibility of entering 3 digits in multiplayer server create window
v3:
- bugfix in loading unpatched savegames
v2:
- bugfixes
v1:
- initial version
Attachments
more_companies_v4.patch.zip
patch file (apply on 1.6.1)
(25.46 KiB) Downloaded 151 times
openttd-more_companies_v4-win32.exe.zip
windows binary 32-bit (built with MSVC2015)
(5.38 MiB) Downloaded 96 times
openttd-more_companies_v4-win64.exe.zip
windows binary 64-bit (built with MSVC2015)
(5.92 MiB) Downloaded 113 times
Last edited by milek7 on 03 Oct 2016 17:09, edited 1 time in total.
Timmaexx
Transport Coordinator
Transport Coordinator
Posts: 301
Joined: 03 Jan 2009 17:55

Re: Patch - More companies (240)

Post by Timmaexx »

I haven't used it yet, so unluckily I cannot give constructive feedback.

What is your experience with the patch? Have you ever tried to match with 239 AIs? This sounds very funny... well maybe more crazy. Have you tried it out online with more than hundred players?

I am really looking forward to your answer with more information on the experience with the patch!
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Patch - More companies (240)

Post by Leanden »

If you are going to the effort of increasing the number of players to 240, why not roll out a full 256 colours for CC ;)
Image
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Patch - More companies (240)

Post by NekoMaster »

Leanden wrote:If you are going to the effort of increasing the number of players to 240, why not roll out a full 256 colours for CC ;)
Pretty sure there arent enough colors in the OPenTTD pallet for that :P
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: Patch - More companies (240)

Post by SimYouLater »

NekoMaster wrote:
Leanden wrote:If you are going to the effort of increasing the number of players to 240, why not roll out a full 256 colours for CC ;)
Pretty sure there arent enough colors in the OPenTTD pallet for that :P
No no no. You're looking at it wrong. Each company has either two colors or the same color twice. All that you have to do is allow the same primary company color if the secondary color is different than all other companies with that primary color. 16 primary colors times 16 secondary colors equals 256 combinations, more than enough for this patch.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Patch - More companies (240)

Post by NekoMaster »

SimYouLater wrote:
NekoMaster wrote:
Leanden wrote:If you are going to the effort of increasing the number of players to 240, why not roll out a full 256 colours for CC ;)
Pretty sure there arent enough colors in the OPenTTD pallet for that :P
No no no. You're looking at it wrong. Each company has either two colors or the same color twice. All that you have to do is allow the same primary company color if the secondary color is different than all other companies with that primary color. 16 primary colors times 16 secondary colors equals 256 combinations, more than enough for this patch.
AHh, well I thought Leanden ment using 256 new colors (perhaps every shade of color in the TTD DOS pallet)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Patch - More companies (240)

Post by JGR »

Leanden wrote:If you are going to the effort of increasing the number of players to 240, why not roll out a full 256 colours for CC ;)
Most likely because some slots need to be reserved for town ownership, water, unowned tiles, and any future non-company owners.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Patch - More companies (240)

Post by Leanden »

No sorry i didnt mean a full pallet, i just meant a full catalogue of CC combinations :)
Image
milek7
Engineer
Engineer
Posts: 12
Joined: 18 Jul 2016 08:04

Re: Patch - More companies (240)

Post by milek7 »

Timmaexx wrote:I haven't used it yet, so unluckily I cannot give constructive feedback.

What is your experience with the patch? Have you ever tried to match with 239 AIs? This sounds very funny... well maybe more crazy. Have you tried it out online with more than hundred players?

I am really looking forward to your answer with more information on the experience with the patch!
Thanks for interest.
I tested it only with 40 AIs running for 20 years: http://i.imgur.com/S2L5mzz.png
I didn't try it online. Typically on my server (vanilla) there was only 2-3 players, and probably with patched game this would be even less. Though I can run it if it there's interest.
JGR wrote:Most likely because some slots need to be reserved for town ownership, water, unowned tiles, and any future non-company owners.
Yes, I reserved place for 16 special entities though only 7 is currently used (OWNER_TOWN, OWNER_NONE, OWNER_WATER, OWNER_DEITY, INVALID_OWNER, COMPANY_INACTIVE_CLIENT, COMPANY_NEW_COMPANY)
SimYouLater wrote:No no no. You're looking at it wrong. Each company has either two colors or the same color twice. All that you have to do is allow the same primary company color if the secondary color is different than all other companies with that primary color. 16 primary colors times 16 secondary colors equals 256 combinations, more than enough for this patch.
Good idea, I will try to do this in free time.
EDIT: No, this doesn't have any adventages over repeating primary colors, because secondary color isn't shown in company window, and livery schemes for vehicles can be set to any, even same as other company colors.
Last edited by milek7 on 02 Oct 2016 09:14, edited 1 time in total.
User avatar
openbu.org
Engineer
Engineer
Posts: 74
Joined: 14 Nov 2014 07:40
Location: USA
Contact:

[Solved]Re: Patch - More companies (240)

Post by openbu.org »

Hi, Patch - More companies (240) is wonderful.
But......
Could not open c:/Users/Ade/Desktop/161/media/extra_grf/2ccmap.nfo
Ade@DESKTOP-1GN814B ~
$ cd C:/Users/Ade/Desktop/161

Ade@DESKTOP-1GN814B /c/Users/Ade/Desktop/161
$ ./configure
checking awk... awk
detecting OS... MINGW
checking build system type... mingw32
checking host system type... mingw32
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++
checking host c++... g++
checking host windres... windres
checking host strip... strip
checking builtin depend... yes
checking makedepend... disabled
detecting cpu-type... 32 bits
detecting SSE... found
checking static... yes
checking unicode... yes
using debug level... no
using desync debug level... no
using link time optimization... no
checking OSX sysroot... not OSX, skipping
checking allegro... not found
checking sdl... not found
checking COCOA... not OSX, skipping
checking GDI video driver... found
checking dedicated... not selected
checking console application... disabled (only used when forced)
checking network... found
checking squirrel... found
checking translator... no
checking assert... disabled
checking zlib... found
checking liblzma... found
checking lzo2... found
checking libxdg-basedir... not found
checking libpng... found
checking freetype2... found
checking libfontconfig... WIN32, skipping
checking icu-lx... not found
checking icu-i18n... not found
checking psp-config... not PSP, skipping
checking libtimidity... not found
checking direct-music... not found
checking sort... sort
checking endianness... AUTO
suppress language errors... no
checking stripping... strip -s
checking distcc... no (only used when forced)
checking ccache... no (only used when forced)
checking grfcodec... found
checking nforenum... found
checking OSX application bundle... not OSX, skipping
checking revision... svn detection
checking iconv... not OSX, skipping
personal home directory... OpenTTD
shared data directory... none
installation directory... /
icon theme directory... none
manual page directory... none
menu item directory... none
using CFLAGS_BUILD... -Wall -Wno-multichar -Wsign-compare -Wundef -Wwrite-strings -Wpointer-arith -W -Wno-unused-parameter -Wredundant-decls -Wformat=2 -Wformat-security -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Winit-self -fno-strict-aliasing -Wcast-qual -fno-strict-overflow -Wnon-virtual-dtor -Wno-free-nonheap-object -DMINGW -D_FORTIFY_SOURCE=2 -O1 -DNDEBUG
using CXXFLAGS_BUILD... -std=gnu++0x -Wno-narrowing
using LDFLAGS_BUILD... -static-libgcc -static-libstdc++
using CFLAGS... -O2 -fomit-frame-pointer -Wall -Wno-multichar -Wsign-compare -Wundef -Wwrite-strings -Wpointer-arith -W -Wno-unused-parameter -Wredundant-decls -Wformat=2 -Wformat-security -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Winit-self -fno-strict-aliasing -Wcast-qual -fno-strict-overflow -Wnon-virtual-dtor -Wno-free-nonheap-object -DMINGW -D_FORTIFY_SOURCE=2 -DWITH_SSE -mno-ms-bitfields -DWIN -DWITH_ZLIB -IC:/MinGW/include -DWITH_LZMA -IC:/MinGW/include -DLZMA_API_STATIC -DWITH_LZO -Ic:/Users/Ade/Desktop/161/src/3rdparty/squirrel/include -DWITH_PNG -IC:/MinGW/include/libpng15 -DWITH_FREETYPE -IC:/MinGW/include/freetype2 -IC:/MinGW/include -DUNICODE -D_UNICODE -DENABLE_NETWORK -DNDEBUG -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\"OpenTTD\\" -DGLOBAL_DATA_DIR=\\"/usr/local/share/games/openttd\\"
using CXXFLAGS... -std=gnu++0x -Wno-narrowing
using LDFLAGS... -lstdc++ -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -limm32 -LC:/MinGW/lib -lz -LC:/MinGW/lib -llzma /usr/local/lib/liblzo2.a -LC:/MinGW/lib -lpng15 -lz -LC:/MinGW/lib -lfreetype -lz -Wl,--subsystem,windows -static
Generating Makefile...
Generating lang/Makefile...
Generating setting/Makefile...
Generating grf/Makefile...
Generating objs/Makefile...

Ade@DESKTOP-1GN814B /c/Users/Ade/Desktop/161
$ make
make[1]: Entering directory `/c/Users/Ade/Desktop/161/objs/lang'
[LANG] Compiling and Linking endian_check.exe
[LANG] Testing endianness for host
[LANG] Compiling core/alloc_func.cpp
[LANG] Compiling string.cpp
[LANG] Compiling strgen/strgen_base.cpp
[LANG] Compiling strgen/strgen.cpp
[LANG] Compiling getoptdata.cpp
[LANG] Compiling and Linking strgen.exe
[LANG] Generating table/strings.h
[LANG] Compiling language afrikaans
[LANG] Compiling language arabic_egypt
[LANG] Compiling language basque
[LANG] Compiling language belarusian
[LANG] Compiling language brazilian_portuguese
[LANG] Compiling language bulgarian
[LANG] Compiling language catalan
[LANG] Compiling language croatian
[LANG] Compiling language czech
[LANG] Compiling language danish
[LANG] Compiling language dutch
[LANG] Compiling language english
[LANG] Compiling language english_AU
[LANG] Compiling language english_US
[LANG] Compiling language esperanto
[LANG] Compiling language estonian
[LANG] Compiling language faroese
[LANG] Compiling language finnish
[LANG] Compiling language french
[LANG] Compiling language gaelic
[LANG] Compiling language galician
[LANG] Compiling language german
[LANG] Compiling language greek
[LANG] Compiling language hebrew
[LANG] Compiling language hungarian
[LANG] Compiling language icelandic
[LANG] Compiling language indonesian
[LANG] Compiling language irish
[LANG] Compiling language italian
[LANG] Compiling language japanese
[LANG] Compiling language korean
[LANG] Compiling language latin
[LANG] Compiling language latvian
[LANG] Compiling language lithuanian
[LANG] Compiling language luxembourgish
[LANG] Compiling language malay
[LANG] Compiling language norwegian_bokmal
[LANG] Compiling language norwegian_nynorsk
[LANG] Compiling language polish
[LANG] Compiling language portuguese
[LANG] Compiling language romanian
[LANG] Compiling language russian
[LANG] Compiling language serbian
[LANG] Compiling language simplified_chinese
[LANG] Compiling language slovak
[LANG] Compiling language slovenian
[LANG] Compiling language spanish
[LANG] Compiling language spanish_MX
[LANG] Compiling language swedish
[LANG] Compiling language tamil
[LANG] Compiling language thai
[LANG] Compiling language traditional_chinese
[LANG] Compiling language turkish
[LANG] Compiling language ukrainian
[LANG] Compiling language vietnamese
[LANG] Compiling language welsh
make[1]: Leaving directory `/c/Users/Ade/Desktop/161/objs/lang'
make[1]: Entering directory `/c/Users/Ade/Desktop/161/objs/setting'
[SETTING] Compiling and Linking endian_check.exe
[SETTING] Testing endianness for host
[SETTING] Compiling core/alloc_func.cpp
[SETTING] Compiling string.cpp
[SETTING] Compiling ini_load.cpp
[SETTING] Compiling settingsgen/settingsgen.cpp
[SETTING] Compiling getoptdata.cpp
[SETTING] Compiling and Linking settings_gen.exe
[SETTING] Generating table/settings.h
make[1]: Leaving directory `/c/Users/Ade/Desktop/161/objs/setting'
make[1]: Entering directory `/c/Users/Ade/Desktop/161/objs/extra_grf'
[BASESET] Assembling openttd.nfo
Could not open c:/Users/Ade/Desktop/161/media/extra_grf/2ccmap.nfo
make[1]: *** [c:/Users/Ade/Desktop/161/bin/baseset/openttd.grf] Error 255
make[1]: Leaving directory `/c/Users/Ade/Desktop/161/objs/extra_grf'
make: *** [all] Error 1

solved.Copy C:\Users\Ade\Videos\OpenBU.org\OpenTTD.org-SDK-2016.10.02\Development of OpenTTD\openttd-1.6.1-source\openttd-1.6.1\media to the folder.

Testing Server:http://www.openttd.org/en/server/96261
Deactivated
Engineer
Engineer
Posts: 40
Joined: 21 Nov 2015 01:25

Re: Patch - More companies (240)

Post by Deactivated »

milek7 wrote:
SimYouLater wrote:No no no. You're looking at it wrong. Each company has either two colors or the same color twice. All that you have to do is allow the same primary company color if the secondary color is different than all other companies with that primary color. 16 primary colors times 16 secondary colors equals 256 combinations, more than enough for this patch.
EDIT: No, this doesn't have any advantages over repeating primary colors, because secondary color isn't shown in company window, and livery schemes for vehicles can be set to any, even same as other company colors.
You could just make each company color oval-thing contain 2 colors - 1st primary color on the left half and 2nd primary color on the right. You also got to get someone to draw the sprites (I think, or is it by using hex color codes etc.?)
Another method is to just use 240 colors. But the problem comes with assigning names to the color (i.e. Cyan, Magenta) and being able to tell the difference between all of them.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Patch - More companies (240)

Post by NekoMaster »

Deactivated wrote:
milek7 wrote:
SimYouLater wrote:No no no. You're looking at it wrong. Each company has either two colors or the same color twice. All that you have to do is allow the same primary company color if the secondary color is different than all other companies with that primary color. 16 primary colors times 16 secondary colors equals 256 combinations, more than enough for this patch.
EDIT: No, this doesn't have any advantages over repeating primary colors, because secondary color isn't shown in company window, and livery schemes for vehicles can be set to any, even same as other company colors.
You could just make each company color oval-thing contain 2 colors - 1st primary color on the left half and 2nd primary color on the right. You also got to get someone to draw the sprites (I think, or is it by using hex color codes etc.?)
Another method is to just use 240 colors. But the problem comes with assigning names to the color (i.e. Cyan, Magenta) and being able to tell the difference between all of them.
Problem is that the 8-bit pallet of OpenTTD doesnt have 240 colors to use for company colors, it only has so many sets of colors that can be used (eg, shades of brown, red, yellow, grey, etc)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests