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 »

Timeflyer wrote:can't load this grf with Stable 1.5.3
That's correct. New Map Features (NMF) provides three additional bridge slots which are not available in OTTD stable or nightly. Carbon Bridge is in slot 16 (0F). OTTD Stable only goes to 13 (0C).
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Cirdan my VC++ is complaining about get_radius_max

if (dx < this->w / 2) dx = this->w - 1 - dx;


5>d:\development\ottd\cirdan_2\src\map\tilearea.h(108) : warning C4018: '<' : signed/unsigned mismatch
5>d:\development\ottd\cirdan_2\src\map\tilearea.h(112) : warning C4018: '<' : signed/unsigned mismatch
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

I am aware of this warning, and you can safely ignore it. Apparently MSVC considers it a "signed/unsigned mismatch" that you compare an unsigned int and a uint16.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

Sorry to bother you guys with something like this, but oddly enough I can't get the current version to compile on MinGW. It really hates

Code: Select all

void ScriptInstance::RegisterAPI()
{
	/* We don't use squirrel_helper here, as we want to register
	 * to the global scope and not to a class. */
	this->AddMethod ("min", &squirrel_op <min <SQInteger> >, 3, ".ii");
	this->AddMethod ("max", &squirrel_op <max <SQInteger> >, 3, ".ii");

	sqstd_register_mathlib (this->GetVM());
}
this part. "min<SQInteger" is not a valid template argument for type 'SQInteger ... because function 'T min(T, T) ... has no external linkage"

Trunk compiles fine, but then the concerning part here is different, so no huge surprise.
I'm just kinda confused, since obviously it compiles fine for others. dunno if it's something with my MinGW setup or something. And obviously the error itself is completely beyond me. :?
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

It looks a lot like this bug. What compiler version are you using?

The function right above the one you quoted should start with

Code: Select all

template <SQInteger op (SQInteger, SQInteger)>
static SQInteger squirrel_op (HSQUIRRELVM vm)
Can you try removing "static" and recompiling?
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

Removing static made no difference, but gcc was still at 4.8.1. I've updated that to 4.9.3-1 now, and it compiled just fine. Darn. It's always the obvious thing; didn't even think it might be that :(

Thanks ;)

€: as "reward" I'll mention a glitch(feature? ^^) during map generation; if towns aren't allowed to build roads we get 1-road tile towns only. Trunk still generates town normally, they just don't build any afterwards. Dunno if this is intended, but personally I think the trunk way makes a bit more sense.
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Glad to be of help.
Pyoro wrote:during map generation; if towns aren't allowed to build roads we get 1-road tile towns only. Trunk still generates town normally, they just don't build any afterwards. Dunno if this is intended, but personally I think the trunk way makes a bit more sense.
Thanks for reporting this—it seems that I accidentally broke it about a year ago (!). The attached patch should fix it; I will push it to the repo soon-ish. In the meanwhile, as a workaround, you can allow towns to build roads in the initial settings and then disallow it as soon as the game starts.
Attachments
town-roads.diff
(467 Bytes) Downloaded 96 times
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Will you include the bridges over station as well Cirdan?
Using the patch since a few weeks now and had no crash or odd behaviours
so far.
Cheers
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

Paths works perfectly, so I found another bug for you ;) - I get CTDs when using that "pop up virtual keyboard" thing, or more precisely when pressing "Ok" on it. It ie can be used to change the random seed at map generation or the NewGRF filter or renaming stations/vehicles/etc. No idea what its proper name is.

I usually never use this so it's not something particularly important (as with the town roads there are solutions around it). But CTDs admittedly aren't nice and it can happen ingame accidentally, so players might loose progress. ^^;
To double-check I also tried wallyweb's latest compiled version, and it behaves the same. I also have an old one from Okctober 2014 around, and it doesn't happen there, so maybe it's not _quite_ as old as the other one ;)
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Pyoro wrote:Paths works perfectly, so I found another bug for you ;) - I get CTDs when using that "pop up virtual keyboard" thing, or more precisely when pressing "Ok" on it. It ie can be used to change the random seed at map generation or the NewGRF filter or renaming stations/vehicles/etc. No idea what its proper name is.
Right, I'm seeing crashes as well—I hope that this is the same bug.
Pyoro wrote:I usually never use this so it's not something particularly important (as with the town roads there are solutions around it). But CTDs admittedly aren't nice and it can happen ingame accidentally, so players might loose progress. ^^;
Agreed. A crash is a bug, period. Reliable programs do not crash.
Pyoro wrote:To double-check I also tried wallyweb's latest compiled version, and it behaves the same. I also have an old one from Okctober 2014 around, and it doesn't happen there, so maybe it's not _quite_ as old as the other one ;)
No, this one is from mid-January. I just never tested the on-screen keyboard.

The attached patch should fix it (it does for me). Thanks for reporting!
TrueSatan wrote:Will you include the bridges over station as well Cirdan?
Using the patch since a few weeks now and had no crash or odd behaviours
Thanks for the feedback. I am currently doing some more bridge-related development, so this may have to wait a little while until everything settles down. I hope to have a clearer picture in a week or two.
Attachments
osk-fix.diff
(295 Bytes) Downloaded 87 times
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

cirdan wrote:The attached patch should fix it (it does for me). Thanks for reporting!
It also does for me ;) Thanks for fixing this.

Unfortunately this time I didn't find anything else to fix, how disappointing ;)
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Here is the newest Ubunut 14.04 64bit version of cirdans patch.
No bridge of stations patch applied yet.
Linking and all reported bugs are fixed, thanks for the fast update on source cirdan :)

And added as well JGR's tracerestriction branch.
Attachments
openttd-custom-ga066c950-UNIX.tar.xz
Version: ga066c950
Ubuntu 14.04
(4.63 MiB) Downloaded 85 times
openttd-custom-g0c1cc91f-tracerestrict-cirdan-UNIX.tar.xz
Version: g0c1cc91f-tracerestrict-cirdan
Ubuntu 14.04
(4.65 MiB) Downloaded 85 times
Last edited by TrueSatan on 12 Jun 2016 20:16, edited 3 times in total.
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

I have just pushed an update to the repository. Here is a summary of user-visible changes:
  • The load type of an order will now not reset itself to "no loading" if you set the unload type to "transfer" but the order has a refit.
  • Autorenew now works with servicing disabled. The autorenew setting is now honoured even if you play with no breakdowns and servicing disabled—vehicles getting old will try to visit a depot to renew themselves.
  • Improved handling of station refits for trains. Previously, when a train was told to autorefit at a station, each wagon would decide which cargo to refit to among those theoretically possible, but if refitting later failed (because refitting to that cargo is only possible in depots, for instance), it would give up and stay with its old cargo type. Now, if this happens, the wagon will keep trying to refit to other possible cargoes until one succeeds (or there are no more cargoes to try).
  • The Polish town name generator has been fixed (I broke it two years ago :-().
  • Fixed a bug that prevented towns from building roads on creation (during world generation or in the scenario editor) if town road building was disabled in the settings; thanks to Pyoro for reporting.
  • Fixed a crash when using the on-screen keyboard; thanks to Pyoro for reporting.
  • The maximum number of different bridge types has been increased to 16; you will need a NewGRF that provides extra bridges to actually have that many.
  • Fixed a bug that prevented towns from ever considering the silicon tubular bridge when choosing a bridge.
  • NewGRFs can now define a sprite to be used in the selection window when building a bridge; this is done with property 14 in the Action0 for the bridge. As a consequence, replacements for suspension, cantilever and tubular bridge types are no longer tied to the same sprite within each group. Combined with the new bridge type limit, you can now have up to 16 really different bridge types, and not just 7 plus 6 variations on some of them.
  • Docks, road stops and (default) rail stations and waypoints can now have bridges built over them. For road stops, the bridge has to be 2 levels higher than the station ground; for rail stations, the bridge has to be 4 levels higher than the track on roofed tiles and 2 levels higher on station building tiles; for rail waypoints, the bridge has to be 3 levels higher than the track. These limits are there to avoid graphical glitches; this is also the reason why custom rail stations are excluded, as there is not an easy way to determine if a bridge over a particular station tile will glitch. If you do not mind seeing your trains drive through walls, roofs, pillars, cranes or otherwise defy the laws of physics, apply the attached patch before compiling to lift all restrictions on bridge building over rail stations and waypoints.
As always, feedback and bug reports are welcome.

Many thanks to wallyweb for his suggestions regarding bridges and for helping me understand the NewGRF side of bridges.
TrueSatan wrote:Here is the newest Ubunut 14.04 64bit version of cirdans patch.
No bridge of stations patch applied yet.


COmpiling failed on Ubuntu 14.04 64bit
Hey, wait for a proper announcement first! ;-) Thanks for the bug report, it should already be fixed. I don't currently have access to a 64-bit system for testing, so I can't catch mistakes like this one.
Attachments
free-bridges.diff
(3.24 KiB) Downloaded 194 times
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Sorry was to fast today. And no problem I can provide some bug reports hehe.
Oh I see the bridge over stations is in now :) Hurray now I have to wait
for the tracerestriction branch from JGR to test my save.

Thanks again for the newest additions.
Btw even the AI uses the new feature. That AI really buillded a bridge over
my station. grrrr... lol
Cheers
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Strange on one of my older savegames every single train went to the depot.
I have no breakdowns and therefore no auto checkup in depot. So there are
no orders on for example vacuum trains/to expensive) to go to the depot
after their lifespan exceeded.
Result was that i lost 675,000,000 euros because everything was replaced with new trains lol

Very odd behaviour. And only happened for all of my trains. I have still road vehicles with
age over 500 years hehe

I just watched my game and after they were nearly all replaced because they were rather old, it seems
now it works normally again.

Could ruin you if you are low on cash though...

Not sure if i can reproduce it with a vanilla game.
Cheers
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post by JGR »

The latest cirdan revision (5896789d77) does not build on my system (Ubuntu 16.04 amd64, gcc 5.3.1) due to:

Code: Select all

/home/jgr/openttd/trunk5/src/gfx_layout.cpp:87:14: error: ‘const void* ICUFont::getFontTable(LETag) const’ marked ‘override’, but does not override
  const void *getFontTable (LETag tableTag) const OVERRIDE
              ^
I see that there have been quite a lot of font/ICU related changes in the last month.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

This must be caused by having a different libicu version, as LEFontInstance in mine does have two overloaded virtual getFontTable methods. Can you try removing 'OVERRIDE' from the end of that line and report back?
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post by JGR »

cirdan wrote:This must be caused by having a different libicu version, as LEFontInstance in mine does have two overloaded virtual getFontTable methods. Can you try removing 'OVERRIDE' from the end of that line and report back?
It seems to build OK with the override removed.
For reference the version of libicu is 55.1-7.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

JGR wrote:It seems to build OK with the override removed.
Thank you, fix pushed.
JGR wrote:For reference the version of libicu is 55.1-7.
The version of libicu in my testing box is 52.1-8, so something must have changed between them.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

Bug Report - Crash when trying to Add or Remove items in the NewGRF Settings window, both in the splash screen and in game.
Happens on 32bit Windows, both with and without the freebridge patch.
EDIT: More specifically, it happens when I try to click to highlght a GRF to be added or removed.
Attachments
crash.zip
(3.15 KiB) Downloaded 91 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests