Page 1 of 94

ECS vectors v1.1.2 (by George) 19/06/2011

Posted: 05 Feb 2007 07:06
by George
ECS vectors v1.1.2 realized

You can download it here
http://george.zernebok.net/newgrf/downloads.html#decs
or here http://bananas.openttd.org/en/newgrf/
Documentation is here
http://www.tt-wiki.net/wiki/ECS

-- old post --
According to the last discussions, the following decisions were done

1) production is divided by 4. For some industries it was done by reducing the number of production callbacks (by checking AA mod 4). It causes higher productions (1.5 times higher) periodically.
2) production with no supply would exist.
3) industry in service would be protected from close-down with 0.20% chance
4) vectors would stay separated.

-- old post --

There was a delay in my work for TTD, but now I'm back and would like to pick up ECS discussions again.
The best point for discussion is the GRF files - so, I reworked 3 GRFs and now they are available for download for beta-testing (r1380 required).

Major changes
I did some work on compatibility and it was increased a lot, now the ECS vectors are fast compatible with most other industry sets. For better compatibility these sets need to be improved too. The town vector now supports 2 parameters (that can have 0 or 1 value). First parameter set to 0 disables default industries and cargos (that means all other GRFs should be below it in newgrf.cfg). Second parameter set to 0 disables changing snowline.

TODO
To complete translations, to add snowed versions, animations, some minor reworking and improving of a behaviour

Main question
Before working on all the other vectors, I’d like to make some decisions on these ones.
1) Are Production amounts Ok or should all the values be divided by 2 or 3?
7 Asiastars with 8 wagons (without speed limits) transporting livestock from animal farm to tinning factory on a distance of 20 squares at high production level – isn’t it too much? Or only processing industries should be affected?
2) Should output without raw materials exist?
As it was discussed before, the owner of the industry should have some activity even if you do not serve this industry. It leads to the problem with AI, that makes a route for transporting this small amounts of cargo, sometimes with 2 trains, and loses money because it is not profitable.
3) Should industry in service be protected from closedown?
Now they have a chance reduced to 3% from 6% (0.20% in total) every month for industry on very low production level. Also, the last one on the map and very young industries are protected. Is it Ok, too much (they should never closedown) or too little (a chance should be about 6% as it was before)
4) Should all the cargos and industries be united in one GRF or not? My tests shows, that 4 vectors in one game is too much, but what do you think?

Posted: 05 Feb 2007 09:24
by Scautura
My opinion may not hold much water, being a relative newbie and all, but here goes with my opinions:

1) I no longer play with the original trains as I find them too boring, but maybe there's a way to detect "default" and "GRF" trains, so you can divide by 2 when then original trains are in use. Then again, you need to use the modified trucks/wagons for ECS to work properly with the default trains, so maybe this won't work.
2) Maybe a parameter? If playing with the AI, have no activity, but if playing on your own then have limited activity, as it is now. I know for one, I don't bother with the industries with limited activity, until I can get materials to them.
3) I think you've probably got this just about right, but it does get annoying with multiple chains. That said, you already said that more than 4 chains is bad in the next point.
4) I (personally) think everything should be in one GRF, but again add a parameter (bit parameter) to allow activating only those vectors that you want to, along with suggested ideas (i.e. It would be a bad idea to deactivate the Town vector, but add wood, coal, agriculture using this "ECS.grf 42" for example). I always found it awkward trying to get the ECS grfs in the right order for them to work properly.

To be absolutely honest, I've been playing with the UKRS industry set, and to me it feels very well done. Obviously, the last version of ECS I played was a little rough and (probably?) came out prior to the UKRSI, and felt very hard to work with, but I was trying to play with all the vectors at once (oops). I'll try again with just 3 or 4 and see how that feels, I'll probably get a better idea.

Scautura

Posted: 05 Feb 2007 12:10
by George
Scautura wrote:3) I think you've probably got this just about right, but it does get annoying with multiple chains. That said, you already said that more than 4 chains is bad in the next point.
Now I suppose only 3 of them should be used for testing (town, wood and agricultural)
Scautura wrote:4) I (personally) think everything should be in one GRF, but again add a parameter (bit parameter) to allow activating only those vectors that you want to, along with suggested ideas (i.e. It would be a bad idea to deactivate the Town vector, but add wood, coal, agriculture using this "ECS.grf 42" for example). I always found it awkward trying to get the ECS grfs in the right order for them to work properly.
That is impossible, unless the parameter of the grf is stored inside the savegame. Because if you save game with one parameter, and load with the other, the result will be unpredictable. While the list of active GRFs is stored in the save. So, if all the GRFs are represented in the newgrf.cfg, the patch would select the required grfs to activate.

Posted: 05 Feb 2007 13:53
by Csaboka
I can't answer 1) and 3) because I haven't played much with your GRFs (just for debugging).

2) I think the minimum production should stay. If the AI is a problem, we could add a new callback that lets you prevent the AI from connecting two industries. It would be called both for the source and the destination industries, and the AI wouldn't do anything if either of the two returns a negative result. You could also use this to prevent the AI from delivering an optional cargo if a required cargo isn't delivered yet. Plus, you could prevent the AI from using steel mills altogether, since it won't handle them correctly (it would try to deliver either coal or iron ore, but not both).

4) I think the GRFs should stay separate. First of all, George is right about the parameters not being saved, this would cause a lot of headache. Another reason is convenience - I think it's more convenient to turn the vectors on and off in-game before starting a new game. With parameters, you would need to close and restart TTDPatch every time you want to use another vector combination. If you don't play with ECS usually, all you need to do is putting an exclamation mark after each ECS GRF in your CFG. This way, they are disabled by default and you need to turn them on manually before starting a new game.

Posted: 05 Feb 2007 14:03
by George
Csaboka wrote:2) I think the minimum production should stay. If the AI is a problem, we could add a new callback that lets you prevent the AI from connecting two industries. It would be called both for the source and the destination industries, and the AI wouldn't do anything if either of the two returns a negative result. You could also use this to prevent the AI from delivering an optional cargo if a required cargo isn't delivered yet. Plus, you could prevent the AI from using steel mills altogether, since it won't handle them correctly (it would try to deliver either coal or iron ore, but not both).
Would it be possible to learn AI to deliver both coal and iron ore to one steel mill? to balance the amount of iron ore and coal being delivered?

Posted: 05 Feb 2007 14:06
by George
And one more question - is documentation is enough or should it be changed or expanded? It yes - feel free to modify the wiki page for ECS. Currently I've put only one industry on wiki. If it will not be changed for a while, I'll put all the other industries. When all of them would be fixed on wiki, I'll copy them back to my site.

Posted: 05 Feb 2007 14:07
by Csaboka
I think you're expecting too much from the AI. I haven't studied how it works in depth, but it just seems to be picking connectable industries at random, and if some conditions are met, it tries to connect them. Even if you could force it to build a coal route to a steel mill after the iron ore route is finished, I'm sure it couldn't balance the amounts. It just builds a route then forgets about it, except for replacing old engines.

[edit] Oh, and it removes routes that aren't profitable for a long time, but I think that's all.

Posted: 05 Feb 2007 15:18
by George
Csaboka wrote:I think you're expecting too much from the AI. I haven't studied how it works in depth, but it just seems to be picking connectable industries at random, and if some conditions are met, it tries to connect them. Even if you could force it to build a coal route to a steel mill after the iron ore route is finished, I'm sure it couldn't balance the amounts. It just builds a route then forgets about it, except for replacing old engines.
[edit] Oh, and it removes routes that aren't profitable for a long time, but I think that's all.
Well, it would be nice if we could force him to connect some industries in some conditions. It would be nice to control removing too.
And would it be possible to AI to choose different platform sizes and consists lengths? To make stations and consists larger, not only update engines? To add or remove a number of vehicles on the route?

Posted: 05 Feb 2007 15:28
by PikkaBird
The AI seems to be a bit funny about newcargos in general at the moment. Sometimes it will build a route, but no wagons, and there doesn't seem to be much rhyme or reason to it.

Personally, I would love an AI route construction callback, if only to stop the current situation where the AI always builds three or four spaghetti-routes between the same two industries; a callback which could test whether an industry was already served might help to limit this.

Posted: 05 Feb 2007 15:39
by Csaboka
PikkaBird wrote:The AI seems to be a bit funny about newcargos in general at the moment. Sometimes it will build a route, but no wagons, and there doesn't seem to be much rhyme or reason to it.
The AI doesn't know which wagons to use for the new cargoes - you need to tell it via callback 18. If you don't use callback 18, the AI will be stuck because it can't buy wagons for the train it's planning to build.
PikkaBird wrote:Personally, I would love an AI route construction callback, if only to stop the current situation where the AI always builds three or four spaghetti-routes between the same two industries; a callback which could test whether an industry was already served might help to limit this.
I don't think the callback will be hard to add. I just didn't realize how useful it may be. I always play without the AI, so I won't do much to improve it unless someone else asks me to :)

Posted: 05 Feb 2007 15:39
by wallyweb
Hey George! Welcome home! :wink: Glad to see you are back. :D

Before I comment in too much detail, I have downloaded the three updates and I will play with them a bit.

I for one like to use all the vectors. I build my scenarios with 90 industries with the challenge being to build and manage a very complicated transportation system.

The main documentation I would like to see is the order in which the grf's should appear in the newgrf configuration file. Also, a question ... are there not some vectors that require products from another vector?

Posted: 05 Feb 2007 16:01
by michael blunck
> are there not some vectors that require products from another vector?

In a well-constructed industry set every vector should be self-contained and I think this is the case with George´s implementation.

regards
Michael

Posted: 05 Feb 2007 16:09
by PikkaBird
Csaboka wrote:The AI doesn't know which wagons to use for the new cargoes - you need to tell it via callback 18. If you don't use callback 18, the AI will be stuck because it can't buy wagons for the train it's planning to build.
Give me some credit. :P The AI in UKRS does have a callback 18, and uses the same wagons for every cargo except passengers, mail and valuables.

Posted: 05 Feb 2007 18:38
by Csaboka
George wrote:Well, it would be nice if we could force him to connect some industries in some conditions. It would be nice to control removing too.
And would it be possible to AI to choose different platform sizes and consists lengths? To make stations and consists larger, not only update engines? To add or remove a number of vehicles on the route?
Someone who understood all the AI code may be able to do all that, but not me... But then, that certain someone would be better off rewriting the whole AI subsystem instead. The interface between the AI and the rest of TTD seems to be clear, and the new code doesn't have to be in ASM, it can be in C or even in C++.
PikkaBird wrote:Give me some credit. The AI in UKRS does have a callback 18, and uses the same wagons for every cargo except passengers, mail and valuables.
Oh, I'm sorry :oops: It must be a bug, then, the only question is whose code it's in. It can be in my code, your NFO, or some problem left in TTD by Chris Sawyer...

Posted: 05 Feb 2007 19:23
by George
wallyweb wrote:Hey George! Welcome home! :wink: Glad to see you are back. :D
thank you
wallyweb wrote:Before I comment in too much detail, I have downloaded the three updates and I will play with them a bit.
I for one like to use all the vectors. I build my scenarios with 90 industries with the challenge being to build and manage a very complicated transportation system.
if you have 90 industries of 37 types, than you have only 2.4 industries of the type. Not much :)
wallyweb wrote:The main documentation I would like to see is the order in which the grf's should appear in the newgrf configuration file.
I hope it can be any, except town vector should be the first
wallyweb wrote:Also, a question ... are there not some vectors that require products from another vector?
Every vector can work alone. Then it's satisfied with its' own cargos. If more vectors are available, it starts to use some other cargos too.
Michael Blunck wrote:In a well-constructed industry set every vector should be self-contained and I think this is the case with George’s implementation.
That's right, every vector can live alone with one exception - towns :) the final industries are designed to support towns with cargo (goods, food and so on). If you do not have a place for final cargo, then I do not know what to do. :roll:

Michael. I'd like to ask you - when would the newcargos set be updated? The last version I found does not support ECS correctly (fish, beer, food make conflict).

Posted: 05 Feb 2007 22:00
by wallyweb
George wrote:
wallyweb wrote:Before I comment in too much detail, I have downloaded the three updates and I will play with them a bit.
I for one like to use all the vectors. I build my scenarios with 90 industries with the challenge being to build and manage a very complicated transportation system.
if you have 90 industries of 37 types, than you have only 2.4 industries of the type. Not much :)
And that is very challenging :wink:
George wrote:
wallyweb wrote:The main documentation I would like to see is the order in which the grf's should appear in the newgrf configuration file.
I hope it can be any, except town vector should be the first
Also one of the Basic vectors (depending upon climate) must be loaded. Is this correct?
George wrote:
wallyweb wrote:Also, a question ... are there not some vectors that require products from another vector?
Every vector can work alone. Then it's satisfied with its' own cargos. If more vectors are available, it starts to use some other cargos too.
Michael Blunck wrote:In a well-constructed industry set every vector should be self-contained and I think this is the case with George’s implementation.
That's right, every vector can live alone with one exception - towns :) the final industries are designed to support towns with cargo (goods, food and so on). If you do not have a place for final cargo, then I do not know what to do. :roll:
The Chemical plant in the Chemical vector produces dyes which as far as I can see can only be sold to the Printing Works in the Wood vector or the Textilera (Textile plant?) in the Agriculture vector.

George, I realize that you are still working on these however I noticed that unless all vectors are loaded there are some very interesting toyland industries appearing in the industry window. Also, unless all vectors are loaded, the Printing Works accepts only steel and the Copper Mine produces iron. With all vectors loaded everything seems to be fine.

Posted: 06 Feb 2007 07:11
by George
wallyweb wrote:
George wrote:if you have 90 industries of 37 types, than you have only 2.4 industries of the type. Not much :)
And that is very challenging :wink:
You'd have not enough raw materials :?
wallyweb wrote:Also one of the Basic vectors (depending upon climate) must be loaded. Is this correct?
No. You can run even single town vector (running single wood vector would leave default industries).
wallyweb wrote:The Chemical plant in the Chemical vector produces dyes which as far as I can see can only be sold to the Printing Works in the Wood vector or the Textilera (Textile plant?) in the Agriculture vector.
and in machinery vector too. I plan to add a dyes shop in chemicals vector if no other vector is loaded. Deys is a special cargo :)
wallyweb wrote:George, I realize that you are still working on these however I noticed that unless all vectors are loaded there are some very interesting toyland industries appearing in the industry window.
That should not happen in newly created games (if they exists than there is a bug somewhere). As Csaboka wrote, it is impossible to apply industry sets in the existing games.
wallyweb wrote:Also, unless all vectors are loaded, the Printing Works accepts only steel
try reset industries cheat. Let me know if it does not help
wallyweb wrote:and the Copper Mine produces iron. With all vectors loaded everything seems to be fine.
Give me more info about it, please.

Posted: 06 Feb 2007 22:01
by wallyweb
George wrote:
wallyweb wrote:
George wrote:if you have 90 industries of 37 types, than you have only 2.4 industries of the type. Not much :)
And that is very challenging :wink:
You'd have not enough raw materials :?
90 - 37 = 53 left for extra resources. Not a lot so it is very challenging.
George wrote:
wallyweb wrote:Also one of the Basic vectors (depending upon climate) must be loaded. Is this correct?
No. You can run even single town vector (running single wood vector would leave default industries).
Ok. I tried this. See below.
George wrote:
wallyweb wrote:The Chemical plant in the Chemical vector produces dyes which as far as I can see can only be sold to the Printing Works in the Wood vector or the Textilera (Textile plant?) in the Agriculture vector.
and in machinery vector too. I plan to add a dyes shop in chemicals vector if no other vector is loaded. Deys is a special cargo :)
Sounds like a good idea.
George wrote:
wallyweb wrote:George, I realize that you are still working on these however I noticed that unless all vectors are loaded there are some very interesting toyland industries appearing in the industry window.
That should not happen in newly created games (if they exists than there is a bug somewhere). As Csaboka wrote, it is impossible to apply industry sets in the existing games.
See my comment below.
George wrote:
wallyweb wrote:Also, unless all vectors are loaded, the Printing Works accepts only steel
try reset industries cheat. Let me know if it does not help
See my comment below.
George wrote:
wallyweb wrote:and the Copper Mine produces iron. With all vectors loaded everything seems to be fine.
Give me more info about it, please.
See my comment below.

1. Using the latest nightly patch with the attached ttdpatchw.cfg.
2. See the attached ecstestgrf.cfg ... this is my newgrf configuration file for this test.
3. I made 17 screen shots. Rather than post them all, I put them into a zip file for you.

I did not do a game so there is no old save game to do a cheat reset.
Rather, I started a scenario and looked at the industry selection window which shows the "accepts" and "produces" for each industry listed. I assume that these would remain the same if the industries were actually built.
The screen shots should tell the story for you. Let me know if you need anything else.

Posted: 06 Feb 2007 22:13
by George
wallyweb wrote:1. Using the latest nightly patch with the attached ttdpatchw.cfg.
// (TTDPatch 2.6 alpha 0 r1286 (Windows))
I wrote it should be at leas 1380, but strange that the grf allowed you to run it :?

Posted: 06 Feb 2007 22:19
by wallyweb
George wrote:
wallyweb wrote:1. Using the latest nightly patch with the attached ttdpatchw.cfg.
// (TTDPatch 2.6 alpha 0 r1286 (Windows))
I wrote it should be at leas 1380, but strange that the grf allowed you to run it :?
I knew you would notice that. :wink: I am running last night's nightly. I have not updated the configuration file because there have been no new switches added since then, at least none that I am aware of.