Page 21 of 25

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.21

Posted: 09 Jul 2010 01:05
by Morloth
Michiel wrote:Congrats! I hope it'll stand the test of time. Those stations look really cool! Don't mind if I have a look at how that's done ;) ChooChoo is supposed to be about making things look good, after all :)

Good luck on your new projects!
Congrats to you as well with the implementation of NewGRF stations :).
Lord Aro wrote:is it me, or have you got your AI version numbers in a muddle?
shouldn't this be v2.1.0 or something because you've added a minor feature?
i mean it's (mostly) not a bug fix is it?
Yes.... :oops: You're right to point out that I haven't been very consistent. But with the end of NoCAB development for the foreseeable future I've decided to put the version number to 2.1.0 ;).
NekoMaster wrote:
Kogut wrote:So it may be nice to say WHY it crashes.
If you look at some of my earlier crash posts, its a "HasNext" not found
Thanks, this has been fixed now :).
planetmaker wrote:
Morloth wrote: P.S. This will be the last update for quite a while. I'm going to focus on some other projects at the moment so only if bugs pop up I'll take a look. But for the moment this is the last version of NoCAB for the near future. Thanks for all your feedback!
Thanks for all your frequent updates. I'll find it sad, when this great NoAI should not see the maintenance level it did so far and which can be considered outstanding :-) I hope you'll return to it with the same passion after a well - deserved break :-) Yes, sometimes one has to do different things in order to keep the joy :-)
Very true :). Just want to focus on some other games rather than transportation sims, but I'll be bank for sure. Have some good ideas where to take NoCAB next. But if bugs arrive I'll be on standby ;).

New version: NoCAB 2.1.0
* Fixed buffer overflow problem. If NoCAB earned more than 2^31 of cash (happens more often that one would think :P) the overflow causes money earned beyond that to be treated as negative. The API makes sure the maximum number returned is 2^31 - 1, but because I also add the money NoCAB can loan this pushes it over the edge.
* Deleted all references to 'HasNext' to avoid any problems with future versions of OpenTTD.
* Better demolishing behaviour when an industry is closed.
* NoCAB now actually builds trees, although a bug causes NoCAB to plant entire rain forests around cities ;).

That's it folks, enjoy the new release, I'm off on a sabbatical :).
- Bram

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.0

Posted: 09 Jul 2010 03:24
by NekoMaster
Thank you very much! It actually works now! Now I can play with my favorite NoAI in nightlies :3 *goes of to play on his patched version of openttd*

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.0

Posted: 09 Jul 2010 08:18
by Lord Aro
A huge well done and congratulations is in order
Your regular uprates will be missed
We will grudgingly wait for your return
(naturally, the next release of AIAI will thrash it solidly) :roll:

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.0

Posted: 26 Jul 2010 14:00
by fanioz
I'm not sure, is this has been reported or not

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.0

Posted: 26 Jul 2010 21:00
by Morloth
fanioz wrote:I'm not sure, is this has been reported or not
No it wasn't, thanks! :)

Fixed in the latest version, changelog:
- Fixed a bug in the routine for building depots for ship connections. In the case of a bidirectional connection if no suitable place could be found for the other depot the array with all possible connections would be over read resulting in a crash (thx fanioz!).
- More flexible when choosing spots in a town.
- Pathfinder for ships more greedy.
- Subsum returns reports now in the order of utility score (most important first!).

Bram

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.1

Posted: 26 Jul 2010 21:22
by NekoMaster
Im finding that when I play with no Cab, it only plays with like, thousands of buses or trucks (usually 30 per connection over very long distances) even though it has the option of using trains, planes, and ships

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.1

Posted: 27 Jul 2010 07:39
by Morloth
NekoMaster wrote:Im finding that when I play with no Cab, it only plays with like, thousands of buses or trucks (usually 30 per connection over very long distances) even though it has the option of using trains, planes, and ships
There is actually a couple reasons for that behaviour. First of all you need to know that NoCAB plans ahead and build up a database of possible connections. However, I only allow it to calculate connections it should be able to build given the maximum loan or bank balance (whichever is higher). In the beginning of the game this will mean that it will be limited to mainly airlines and trucks / buses. So when the loan is raised to a point that rail connections become available as well it is very possible that it already stored 100 connections using trucks / buses. If the rail connections it plans are better than the variant using trucks / buses it will be replaced so this should fix this issue. However, usually a that point it will be making so much money and the pathfinder for rail connections will simply not be able to prevent all of the 100 truck / bus connections to be build before it has a chance of updating them.

Secondly, which ties in with the issue above, the pathfinder for rails are slower due to their nature than the pathfinder for road vehicles and airoplanes. So NoCAB will be able to calculate more truck / bus routes than train routes and given that money at some point is no longer an issue it will build more of the former.

It is true that this behaviour should be changed and it is currently planned for the next release. The plan is to allow NoCAB to upgrade its connections, for example if we first have connection from a coal mine to a power plant using trucks to transport the coal, we might find that it is actually a better idea to replace this connection with one using a train and have it transport the cargo to a power station further away gaining more money that way. This should fix this issue you're describing. But at the moment there is little you can do to change this behaviour I'm afraid :/.

Hope this helps,
Bram

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 02 Oct 2010 12:08
by Lord Aro
apologies about bumping this thread while you're on your holiday :lol: , but i think i've found a bug:

When the AI is set to rail only (and i suppose it would happen at another time as well) the rail station building always returns a ERR_PRECONDITION_FAILED

see pic:
nocab bug.png
nocab bug.png (62.88 KiB) Viewed 2337 times
also, station placing of docks needs a bit of work:
the AI placed the dock just out of range of the factory, and it also took it years to get rid of the station:

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 11 Oct 2010 10:47
by Morloth
Lord Aro wrote:apologies about bumping this thread while you're on your holiday :lol: , but i think i've found a bug:

When the AI is set to rail only (and i suppose it would happen at another time as well) the rail station building always returns a ERR_PRECONDITION_FAILED

see pic:
nocab bug.png
also, station placing of docks needs a bit of work:
the AI placed the dock just out of range of the factory, and it also took it years to get rid of the station:
Thanks for the report :). I'll have a look next month to see if I can fix this issues.

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 10:07
by Morloth
New version 2.1.2 released. After reading the results of a small test by Samu I went on to discover why NoCAB did so bad. As it turned out there has been a change in the code of building NewGRF stations 4 months ago which broke that part of NoCAB, so it wasn't able to build train connections for that long! :evil:

Here is the fix! Enjoy :).
Bram

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 19:10
by Samu

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 19:35
by Brumi
I also had a crash using NoCAB 2.1.2 on OpenTTD 1.0.4, it seems to be the same problem as Samu's:

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 21:23
by Zuu

Code: Select all

[url=http://www.openttd.org]Some text[/url]
=> Some text

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 21:35
by Samu

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 21:39
by Samu
Some text
Some text

http://cid-23b29f3de45f6f1f.office.live ... 201953.png

The forum hates me.

<iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:320px;height:179px;padding:0;background-color:#fcfcfc;" src="http://cid-23b29f3de45f6f1f.office.live ... "></iframe>

http://cid-23b29f3de45f6f1f.office.live ... =455874334

Some text

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 21:42
by Yexo
The ^ in the url makes it fail.

Edit: more like the ].

Edit2: this works:

Code: Select all

[url=http://cid-23b29f3de45f6f1f.office.live.com/self.aspx/.Public/Sem%20nome,%209%20Out%201953.png]Some text[/url]
Some text

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 09 Nov 2010 21:56
by Samu
Microsucks sucks.

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 10 Nov 2010 04:01
by Morloth
Thanks for the bug report, but it seems my fix only works for the nightlies. As AIIndustry::INDUSTRYTYPE_* in only included in there. I'm going to assume that 1.0.5 will include these change so when that version is released NoCAB should work as expected. The only way I can "fix" NoCAB for the current version is by disabling the NewGRF stations and then enable it when 1.0.5 comes around. So I keep NoCAB as it is and hopefully 1.0.5 will come around quick enough.

Bram

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 20 Nov 2010 22:19
by Zuu
I assume you refer to AIIndustryType::INDUSTRYTYPE_*. Those are only part of the nightly API docs - not the 1.0.x API docs. Thus they are not available in the 1.0 API version. Sometimes if you develop on a nightly build you can by accident access 1.1/trunk API functions/features even if you have told OpenTTD that you want the 1.0 API.

This is probably because OpenTTD provides backward compatibility using the compatibility nut files that ship with OpenTTD. These act as a bridge between the new API and the old API so that an AI written for an old API still work (given that it tells OpenTTD which compatibility layer to load). However it doesn't seem that these compatibility layers hide the new features which is probably what have happened it your case.

Be sure to use the 1.0.x API docs http://noai.openttd.org/api/1.0.5/ to not accidentally use new features by mistake.

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1

Posted: 21 Nov 2010 16:00
by Mac_
Same error, on 1.0.5
:-(