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

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Do you use ECS with TTDP?

I use ECS under TTDP
5
3%
I use ECS under TTDP and OTTD
6
4%
I use ECS under OTTD
158
93%
 
Total votes: 169

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by DaleStan »

George wrote:
DaleStan wrote:Okay... So that's *completely* not going to work.
The textref stack is filled for all accepted cargos before the line is drawn.
We have skip words in stack command for strings
That's "discard", not "skip". Once discarded, they can't be recovered. The arguments for each additional string must, therefore, come after the string that requires the arguments, and before the string for the next cargo.
George wrote:Because currently we expect only 3 strings to use stack, I think we can take it this way unless we get an easy way to have different stacks for every string.
Yes, but those three strings require six stack bytes (Yes, six.) each, before any additional arguments. That's 18 bytes (of 24) for three cargo strings. This leaves (! I got it wrong.) 6 bytes -- 2 bytes per cargo (on average, of course) for any additional arguments. With 2 cargos, you'd have 12 bytes, 6 per cargo. With 1 you'd have 18.
This is enough space to provide the stockpile sizes for three incoming cargos, and oodles of spare space when you have fewer cargos.

The production side is much less restricted. Although it only has 22 bytes total space, it also only has up to two cargos, and only requires four bytes per cargo, not six. (So 7 each for two and 18 for one.)
George wrote:
DaleStan wrote:Would "Place the number of additional bytes required in (the low byte of) register 100h. The bytes will be copied starting from the low byte of register 101h." work?
Sorry, a bit confused with description. If a string for cargo 1 needs words 1, 2, 3 in stack, and a string for cargo 2 needs words 4, 5, 6, than what should go to registers?
For the first cargo, 100h would contain 6, 101h would contain words 1 and 2 (1 in the low word, 2 in the high) and 102h would contain word 3 in its low word.
For the second cargo the same, except that 101h and 102h contain words 4/5 and 6.
Of course, this would only fit if you didn't have a third cargo.

I would have preferred to put the count in the callback return, instead of in 100h, but I don't see how I can manage that while maintaining backwards compatibility.

For the code you gave me, the relevant sprite would become (note that I changed the width; sign extension is either correct or not an issue here.)

Code: Select all

 -1 * 32 02 0A DE 85
  		 1A 20 \w2 \2sto
  		 1A 20 \wx100 \2rst
  		 00 20 FF FF \2sto
  		 1A 00 \wx101
  		 01 DE 80 00 00 00 00 DE 80
George wrote:I'd prefer 10 words per all the strings, than 1 per string, so 1 string could use 5 wprds in stack, while the could not use it.
You can allot the stack space however you like, provided you remember that each cargo type requires six (or four) bytes, and you only have 24 (or 22) total.

EDIT: Actually, those limits only apply for industries without production callbacks, and in the fund-industry window. When there's a production callback, the limits are lower: unused cargo slots require 2 bytes there, not zero.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Altern8or
Engineer
Engineer
Posts: 37
Joined: 25 Sep 2005 00:44
Location: Aberdeen, Scotland

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by Altern8or »

George wrote:
Altern8or wrote:I am using your wonderful ECS cargoes scheme along with DBSetXL (and ECS patch), I have noticed that a couple of textile plants have appeared in the game recently but neither of the connected stations will accept the required supplies of cargo.
I have loaded your GRF in r1803 and built a new one. It started accepting the cargo after 3 months of life as intended.
I have to download and test r1825 now.
-Edit-
Same with r1285. How old is your industry?
Just for interest, if you don't mind me asking George, what set-up were you using with my saved file in terms of your GRF setup and config please?
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

Altern8or wrote:
George wrote:
Altern8or wrote:I am using your wonderful ECS cargoes scheme along with DBSetXL (and ECS patch), I have noticed that a couple of textile plants have appeared in the game recently but neither of the connected stations will accept the required supplies of cargo.
I have loaded your GRF in r1803 and built a new one. It started accepting the cargo after 3 months of life as intended.
I have to download and test r1825 now.
-Edit-
Same with r1285. How old is your industry?
Just for interest, if you don't mind me asking George, what set-up were you using with my saved file in terms of your GRF setup and config please?
I used my configs
Attachments
ttdpatch.cfg
(41.97 KiB) Downloaded 89 times
newgrfw.cfg
(1.4 KiB) Downloaded 100 times
Image Image Image Image
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

DaleStan wrote:That's "discard", not "skip". Once discarded, they can't be recovered. The arguments for each additional string must, therefore, come after the string that requires the arguments, and before the string for the next cargo.
For the code you gave me, the relevant sprite would become (note that I changed the width; sign extension is either correct or not an issue here.)

Code: Select all

 -1 * 32 02 0A DE 85
  		 1A 20 \w2 \2sto
  		 1A 20 \wx100 \2rst
  		 00 20 FF FF \2sto
  		 1A 00 \wx101
  		 01 DE 80 00 00 00 00 DE 80
EDIT: Actually, those limits only apply for industries without production callbacks, and in the fund-industry window. When there's a production callback, the limits are lower: unused cargo slots require 2 bytes there, not zero.
Hope to test a new version :roll:
Image Image Image Image
Altern8or
Engineer
Engineer
Posts: 37
Joined: 25 Sep 2005 00:44
Location: Aberdeen, Scotland

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by Altern8or »

Thanks George, I'll try comparing configs and grf just in case a rogue setting or file is causing it, will be a few days before I can report back as I am back at work, but will let you know the outcome. Thanks it is much appreciated, Robert.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by DaleStan »

George wrote:Hope to test a new version
Unfortunately, that's going to take a while.

I forgot (or failed to notice) that the industry details window also requires 2 bytes per cargo for the amounts, bringing things to a nice round 8 bytes per cargo, 24 bytes total.

There seem to be another 8 bytes hiding out, but finding them could be an issue.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

ECS Wood vector is beta 4 now. Please check :roll:
Image Image Image Image
fjb
Engineer
Engineer
Posts: 86
Joined: 08 Oct 2007 11:20

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by fjb »

Hi,

it is still in the Beta 3 section of the download page.

I will try it in my next game. The other Beta 4 versions are working much better with OpenTTD than the older versions.
Regards
Frank
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

DaleStan wrote:
George wrote:Hope to test a new version
Unfortunately, that's going to take a while.
I forgot (or failed to notice) that the industry details window also requires 2 bytes per cargo for the amounts, bringing things to a nice round 8 bytes per cargo, 24 bytes total.
There seem to be another 8 bytes hiding out, but finding them could be an issue.
Dale, how does it go?
Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by DaleStan »

I think I found those 8 bytes, but that commit seems to have somehow broken text loading on Vista and/or 64-bit processors. It's completely beyond me how something like that could happen, but happen it apparently did. Until that gets fixed, I'm reluctant to add more.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by wallyweb »

George wrote:ECS Wood vector is beta 4 now. Please check :roll:
I noticed you updated the Agricultural Vector today, but it is still marked as beta 3. Is this correct? Or should it be beta 4?
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

wallyweb wrote:
George wrote:ECS Wood vector is beta 4 now. Please check :roll:
I noticed you updated the Agricultural Vector today, but it is still marked as beta 3. Is this correct? Or should it be beta 4?
ECS Agricultural vector is beta 4 now. Please check :roll:
Image Image Image Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by wallyweb »

George wrote:
wallyweb wrote: ...
ECS Agricultural vector is beta 4 now. Please check :roll:
Looking good. 5 done, 5 to go. :D
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

wallyweb wrote:
George wrote:
wallyweb wrote: ...
ECS Agricultural vector is beta 4 now. Please check :roll:
Looking good. 5 done, 5 to go. :D
That is not my plan :roll: I plan to improve first 5 vectors first. And only then to do the rest.
Wally, time came to fix the wiki :roll: You, lazy boy X( , did not update it yet (but promised :rolleyes: ). I want you to do the factory page TODAY! :mrgreen:
Image Image Image Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by wallyweb »

George wrote:Wally, time came to fix the wiki :roll: You, lazy boy X( , did not update it yet (but promised :rolleyes: ). I want you to do the factory page TODAY! :mrgreen:
Sorry George. I have something else I must attend to first ... some testing I promised for somebody else ... but I will be using your ECS vectors. 8) Hopefully I'll be done by Wednesday. When I run the tests I'll pay close attention to the Factory. :mrgreen:
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

I've finished beta 4 for 5 most complete vectors. Now I want to collect ideas to move them to beta 5. Suggestions are welcome.
These are ideas that I have now:
1) closure in town zone 4 for every industry, in zone 3 for any heavy industry
2) must cargoes do not decrease production when primary are available
3) increase production event goes before decrease production event
4) protection age depends on map size (the formula is required)
5) a parameter to disable storage size
6) a parameter to increase mine capacity to the highest value (applied only when industry starts production, do not affect industry later)
Image Image Image Image
broodje
Director
Director
Posts: 617
Joined: 13 Jul 2003 12:47
Location: Alphen aan den Rijn
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by broodje »

in my opinion the zoning of industry does no justice to real life situations. In the Netherlands all (except 1) coal mines lied close, or even in towns. Kerkrade for example enclosed 2 mines and Heerlen had 4 mines in the middle of the town.
In my opinion the same goes for the factories. It is only of recent years that heavy industry isn't located in the middle of towns any more. (the textile industire in Leiden had big factories in the middle of town, Amsterdam and Rotterdam had huge harbours in the middle of town before the war (Amsterdam even till into the 70ish).
So in my opinion, for Beta 5 it would be nice to see the zoning gone for most industry types, at least till the 70ish. (more examples of heavy industries in towns could be Liverpool, Manchester and other northern English towns.)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by wallyweb »

George wrote:I've finished beta 4 for 5 most complete vectors. Now I want to collect ideas to move them to beta 5. Suggestions are welcome.
What remains to be done to the Chemicals Vector and the Construction Vector to move them from alpha 1 into beta 4?
1) closure in town zone 4 for every industry, in zone 3 for any heavy industry
Ok, but it must be easy to rebuild these industries in acceptable zones after closure in zones 3 and 4 or it will defeat the intent of the game which is not industry management but is transportation of cargoes. A workable system would be those industries close only after the same industry is built in an acceptable zone.
2) must cargoes do not decrease production when primary are available
Do you mean "Most industries do not decrease production when primary cargoes are available."? If yes, then this sounds good.
3) increase production event goes before decrease production event
4) protection age depends on map size (the formula is required)
5) a parameter to disable storage size
6) a parameter to increase mine capacity to the highest value (applied only when industry starts production, do not affect industry later)
These sound interesting.

How about "A mine or well will not close as long as there are 'in-ground' reserves, but production levels will decrease as the 'in-ground' reserves approach 0, where 'in-ground' reserves are whatever the mine or well has NOT yet produced."?
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

wallyweb wrote:
George wrote:I've finished beta 4 for 5 most complete vectors. Now I want to collect ideas to move them to beta 5. Suggestions are welcome.
What remains to be done to the Chemicals Vector and the Construction Vector to move them from alpha 1 into beta 4?
I think this part of the ECS should be reviewed. I'm not satisfied with it now. I do not want to spend time on the code that would be dropped down because the schema changed.
wallyweb wrote:
1) closure in town zone 4 for every industry, in zone 3 for any heavy industry
Ok, but it must be easy to rebuild these industries in acceptable zones after closure in zones 3 and 4 or it will defeat the intent of the game which is not industry management but is transportation of cargoes. A workable system would be those industries close only after the same industry is built in an acceptable zone.
There is no way to control the location of a new industry. So, suggestion is removed.
wallyweb wrote:
2) must cargoes do not decrease production when primary are available
Do you mean "Most industries do not decrease production when primary cargoes are available."? If yes, then this sounds good.
I mean if you stop to deliver dyes to printing works for example, the industry would not decrease production level, but will process 4 times less paper and produce 5 times less goods.
wallyweb wrote:How about "A mine or well will not close as long as there are 'in-ground' reserves, but production levels will decrease as the 'in-ground' reserves approach 0, where 'in-ground' reserves are whatever the mine or well has NOT yet produced."?
ok.
7) a parameter that disables mine closure unless it is exhausted.
8 ) these parameters would be ignored on hard game settings.
Image Image Image Image
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: ECS implementation by George: ECS vectors. Beta 4 11/01/2008

Post by George »

I'd like also discuss location conditions ( http://wiki.ttdpatch.net/tiki-index.php ... Conditions )
let us have a look
1) town class
In towns, in town zone X, far from towns, anywhere
2) water class
in sea, near, far, anywhere
3) land class 1
in desert, not in desert, in forest, anywhere
4) other industry
min distance, max, anywhere
5) land class 2
flat land, terraformed land

unused
6) population
7) snow line

What conditions should we add? What conditions should we remove? What should we change?

* most of conditions are disabled in map editor, except land classes. Let me know if they are not.
Image Image Image Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 6 guests