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

griffin71
Traffic Manager
Traffic Manager
Posts: 142
Joined: 31 Mar 2007 13:11
Location: Amsterdam

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by griffin71 »

George wrote:
griffin71 wrote:OK, so here's a new savegame meeting the conditions outline above.
Here again, a Cement works (Scabbot Bay) is closing, despite an apropriate deliverance of sand.
Conditions are not met
1) parameter is 0, so standard difficulty conditions are used
2) protect if level > 04h, good service ( 9E + A0 > 1024), v40 + v41 + v42 > 1024, younger than 5(2) years
2.1) level = min (min (R1, 4 + min ( R2 , R3 + 8 )) , 128)
R1 = v40 / (9 * max (year - 1920; 5) + 20) * base1=8 / 100)
so, you do not provide enough limestone to have required level
2.2) amount of cargo transported - is not applied because this amount of cargo was not produced
2.3) amount of cargo waiting. I see about 300 in you save game, so, that is not enough
2.4) age - above 5.
so, there are no conditions to protect your industry - it will be closed.

but as soon I change parameter to 8, the industry becomes protected (2.3 applies, because 300 tons is more than 1 ton) and the industry does not close

So, I see the expected behaviour.
Aha. Thanks for analysing it. Now, a few questions come to my mind:
1. Where can I find these details (so I need not bother you with things known)? And, what do they mean?
Is your protection level defined somewhere?, and the meaning of your parameters R1, v40, etc.? Or it that only inside the NewGRF?
George wrote:
1. Industries state 'Closure: no' in case there is no closure threat, or 'Closure: in nn months', in case there is.
It would require one more string. I do not see much profit here. I've added it to todo list with the lowest priority.
2. Secondary industries state which cargo they need (in sensible amounts) to prevent closure. E.g. 'Minimal monthly demand: sand (250 tonnes) or lime (150 tonnes)' (arbitrary amounts used) Such a statement is very helpful for the player :)
I've added it to todo list with the lowest priority.
Thanks for adding these to the todo list :) Seeing how complicated the decision taking for remaining of the industry really is, I fear that as long as it's not translated back to a few exported quantities, AIs really won't keep ECS industries running for too long, save for a few lucky shots.
This raises some thoughts, as a good computer opponent is a wannahave for single players. The behaviour of the cement industry (realistic as it is), is different from the behaviour of the construction industry (judging from experience), to which apparently only supply of bricks is enough to keep it running. As this difference in behaviour cannot be read in the industry description, this leads to confusion for the player (frustration for the les patient). If AI programmers would create an AI for this geat industry set, this information should be exported to the AI in one way or another as well. It seems sensible (to me, at least) that the suggested display of minimal cargo requirement is then also made available through a function call to the AIs.

I'm providing my thoughts here because I much like the industry set, but the points mentioned still can/should be improved upon. Thanks a lot for your responses and patience so far!
A game worth playing is a game worth modding :-)
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 5 25/10/2008

Post by George »

griffin71 wrote:
George wrote:Conditions are not met
1) parameter is 0, so standard difficulty conditions are used
2) protect if level > 04h, good service ( 9E + A0 > 1024), v40 + v41 + v42 > 1024, younger than 5(2) years
2.1) level = min (min (R1, 4 + min ( R2 , R3 + 8 )) , 128)
R1 = v40 / (9 * max (year - 1920; 5) + 20) * base1=8 / 100)
so, you do not provide enough limestone to have required level
2.2) amount of cargo transported - is not applied because this amount of cargo was not produced
2.3) amount of cargo waiting. I see about 300 in you save game, so, that is not enough
2.4) age - above 5.
so, there are no conditions to protect your industry - it will be closed.
but as soon I change parameter to 8, the industry becomes protected (2.3 applies, because 300 tons is more than 1 ton) and the industry does not close
So, I see the expected behaviour.
Aha. Thanks for analysing it. Now, a few questions come to my mind:
1. Where can I find these details (so I need not bother you with things known)? And, what do they mean?
Is your protection level defined somewhere?, and the meaning of your parameters R1, v40, etc.? Or it that only inside the NewGRF?
This is written in GRF. Someday it would be copied to wiki. If someone would help me and write wiki now, I'm ready to explain him how to read and understand all this code in GRF, so he would have the required information to write the wiki
griffin71 wrote:
George wrote:
1. Industries state 'Closure: no' in case there is no closure threat, or 'Closure: in nn months', in case there is.
It would require one more string. I do not see much profit here. I've added it to todo list with the lowest priority.
2. Secondary industries state which cargo they need (in sensible amounts) to prevent closure. E.g. 'Minimal monthly demand: sand (250 tonnes) or lime (150 tonnes)' (arbitrary amounts used) Such a statement is very helpful for the player :)
I've added it to todo list with the lowest priority.
Thanks for adding these to the todo list :) Seeing how complicated the decision taking for remaining of the industry really is, I fear that as long as it's not translated back to a few exported quantities, AIs really won't keep ECS industries running for too long, save for a few lucky shots.
well, it would be nice to have a flag for AI to define the primary and the supporting materials. It would also be nice if the AI would not provide more service to the industry if it does not accept so much cargo.
Image Image Image Image
griffin71
Traffic Manager
Traffic Manager
Posts: 142
Joined: 31 Mar 2007 13:11
Location: Amsterdam

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by griffin71 »

George wrote:(...)This is written in GRF. Someday it would be copied to wiki. If someone would help me and write wiki now, I'm ready to explain him how to read and understand all this code in GRF, so he would have the required information to write the wiki (...)
You mentioned it before, and it looks like a good learning excercise to me. I'm unfamiliar with NewGRFs and GRF editing, but reading the wiki about it, it's merely much information, rather than complex information.
It seems a bit pointless to discuss all this on the forum, so why don't you PM me on how I can make a start writing the wiki?
George wrote:(...)well, it would be nice to have a flag for AI to define the primary and the supporting materials. It would also be nice if the AI would not provide more service to the industry if it does not accept so much cargo.
I suppose making this information accessible to the AI is part of the trunk?
A game worth playing is a game worth modding :-)
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 5 25/10/2008

Post by George »

griffin71 wrote:
George wrote:(...)well, it would be nice to have a flag for AI to define the primary and the supporting materials. It would also be nice if the AI would not provide more service to the industry if it does not accept so much cargo.
I suppose making this information accessible to the AI is part of the trunk?
No, it is only my wish
Image Image Image Image
User avatar
SAC
Tycoon
Tycoon
Posts: 1521
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by SAC »

Hi all... :))

I need some assistance trying to figure out what problem I have with my TTDP game. I have recently gone back to the map editor to prepare for some new graphics to be tested, and have decided to load the entire ECS collection. For some odd reasons this seems impossible. While I can load ECS Town, Basic and Machinery without any problems, as soon as I add Wood, Construction, Agriculture or Chemical they all complain about a conflict with both Machinery, Basic and Town. Removing Town, Basic and Machinery doesn't help as the other ECS.grf's starts complaining about ”GRF conflict with existing definitions” (resource -10 at sprite 1,622)"...

Is there possibly a setting in my TTDXC, (configurator), that causes these issues to arise, or something else? I'd be grateful for any help... :))

Edit to add;

Oh, and I should probably add that these issues doesn't change even if I remove all other .grf's except the ECS's...
Simuscape - Chose Your Destination;
Simuscape | Visual Studio | INFRA Diary

INFRA Downloads - Chose Your Destination;
Simuscape | INFRA - A World of its own
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by michael blunck »

Try loading the ECS grfs in rising order, ID-wise:

Town vector 4D656F91
Basic vector 4D656F92
Machinery vector 4D656F94
Wood vector 4D656F95
Construction vector 4D656F96
Agricultural vector 4D656F97
Chemicals vector 4D656F9C

And remove "Paper on temperate" (PAPERW.GRF), it´s incompatibel with ECS.

Other than that, there are still a bunch of other suspicious grfs ... 8)

regards
Michael
Image
User avatar
SAC
Tycoon
Tycoon
Posts: 1521
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by SAC »

Thanks Michael, yes, there really are some suspicious .grf's out there... :mrgreen:

Anyways, your suggestion didn't help at all! While I still can load Town, Basic and Machinery, the other ones simply won't load without producing an error as described in my previous post! Didn't know about the Paper On Temperate though, but removing it doesn't make any difference either! ?(

I really don't understand this...

The only thing I do notice is that all my ECS-files have the ID; 4D656FFF, according to the info provided in the TTDX Configurator! Is that an issue? The ECS-files are ALL downloaded from George's site yesterday! ?(
Simuscape - Chose Your Destination;
Simuscape | Visual Studio | INFRA Diary

INFRA Downloads - Chose Your Destination;
Simuscape | INFRA - A World of its own
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by wallyweb »

SAC wrote:I have recently gone back to the map editor to prepare for some new graphics to be tested, and have decided to load the entire ECS collection.
While I still can load Town, Basic and Machinery, the other ones simply won't load without producing an error as described in my previous post!
TTDPatch Manual wrote:When you use the newhouses or newindustries switches, TTDPatch remembers all house/industry types that have ever been enabled in your game, even if they're not available right now.
Hi SAC,
Try this sign cheat: cht:PurgeIndustries
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by michael blunck »

wallyweb wrote: Hi SAC,
Try this sign cheat: cht:PurgeIndustries
Again? :P
SAC wrote: Well, just to let all of you know that I've managed to install all of the ECS vectors in my currently running game, a game that has been running for quite some years now - and I'm not speaking game years here...

And the solution; the "Cht: PurgeIndustries"! Thanks for pointing me to this one. I had no idea industry ID's - or houses for that matter - could still occupy an ID-list even after being removed from the newgrf.list! So again, a BIG thank you to all that has helped me with this, and especially Wally!
http://www.tt-forums.net/viewtopic.php? ... 8d#p747269
regards
Michael
Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by wallyweb »

michael blunck wrote:
wallyweb wrote: Hi SAC,
Try this sign cheat: cht:PurgeIndustries
Again? :P
Sat Nov 29, 2008 7:23 pm :shock:
GENIUS! German ingenuity strikes again! His brain surgeon implanted him with a Rolodex! :bow:
:lol:
History is so darned repetitive. :roll:
Thanks. :wink:
User avatar
SAC
Tycoon
Tycoon
Posts: 1521
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by SAC »

:oops:

I've been away from this game for awhile... what else can I say... Totally forgot about this one.. :mrgreen:

And of course it worked - again... :))

Thank you Michael and Wally...
Simuscape - Chose Your Destination;
Simuscape | Visual Studio | INFRA Diary

INFRA Downloads - Chose Your Destination;
Simuscape | INFRA - A World of its own
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by wallyweb »

SAC wrote:Thank you Michael and Wally...
The bill is in the mail ... You owe us two grf's. :mrgreen:
User avatar
SAC
Tycoon
Tycoon
Posts: 1521
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by SAC »

wallyweb wrote:
SAC wrote:Thank you Michael and Wally...
The bill is in the mail ... You owe us two grf's. :mrgreen:
:mrgreen:

I didn't expect anything less...
Simuscape - Chose Your Destination;
Simuscape | Visual Studio | INFRA Diary

INFRA Downloads - Chose Your Destination;
Simuscape | INFRA - A World of its own
User avatar
PaulC
Director
Director
Posts: 616
Joined: 31 Jul 2006 12:40
Location: Lancs, England
Contact:

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by PaulC »

I've downloaded ECSHousew.grf (beta 5, 13 December 2009), but some of the buildings aren't displaying properly:
SCR4.png
SCR4.png (61.01 KiB) Viewed 3034 times
I'm using TTDP 2.6 r2303, and yes, I'm certain I don't have the dos grf by mistake. Any ideas? ?(
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 5 25/10/2008

Post by George »

PaulC wrote:I've downloaded ECSHousew.grf (beta 5, 13 December 2009), but some of the buildings aren't displaying properly:
I'm using TTDP 2.6 r2303, and yes, I'm certain I don't have the dos grf by mistake. Any ideas? ?(
Unfortunately, I do not know. This problem happens in TTDP and does not in OTTD. And I can't understand why. May be DaleStan can suggest something?
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 5 25/10/2008

Post by wallyweb »

George wrote:This problem happens in TTDP and does not in OTTD. And I can't understand why. May be DaleStan can suggest something?
I wonder if there is any relationship between this issue and a PM discussion I had with DaleStan about an issue concerning "multitile sprites only possible with action 2 extended coding". The symptoms are different, but I notice that the affected buildings in PaulC's screenshot seem to be multitile.
User avatar
PaulC
Director
Director
Posts: 616
Joined: 31 Jul 2006 12:40
Location: Lancs, England
Contact:

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by PaulC »

wallyweb wrote:...but I notice that the affected buildings in PaulC's screenshot seem to be multitile.
Although you can't see them in the screenie I posted above, the two-tile petrol stations don't have this problem.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by DaleStan »

My first suspicion is a scribbled recolor sprite. Are you quite certain that your recolor sprites are where you think they are, that they are being referenced correctly, and that they aren't being replaced by other recolor sprites later?
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 5 25/10/2008

Post by George »

DaleStan wrote:My first suspicion is a scribbled recolor sprite. Are you quite certain that your recolor sprites are where you think they are, that they are being referenced correctly, and that they aren't being replaced by other recolor sprites later?
But why do they look correct in OTTD then? If the recolour sprite is wrong, it should be wrong both in OTTD and TTDP, shouldn't it?
Image Image Image Image
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: ECS implementation by George: ECS vectors. Beta 5 25/10/2008

Post by frosch »

The problem is the result of callback 1E.
George's GRF returns 0xC7yx for the 2CC map for colours x and y, while 0xC0yx would be correct.
OTTD only uses the lower 8 bits and masks the rest, while TTDP uses all 13 bits.
The origin of 0xC7yx is most likely the wrong example in the specs.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 10 guests