George's new cargos [aborted] Use ECS instead

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

Post Reply

How should the building look it transperent mode

as the ground part with the above part in grey (default behaviour)
14
21%
there should be a text with cargo name over the ground part (English only)
15
22%
there should be an icon of the cargo over the ground part
38
56%
other (specify please)
1
1%
 
Total votes: 68

User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

OK, I've fixed the errors, the correct file is attached.
The problems were:
- The prop. 09 problem I mentioned before
- I forgot to mention, but additional tiles must have prop 13 as zero, otherwise TTD may try to build the tile as a stand-alone building
- The statue used ID 01, which was already taken by the E part of the hotel, this caused some problems.

I don't know if this is intentional, but one of the hotel tiles accepts cargo 12, which isn't defined. I haven't changed that.
George wrote:Have a look at one more screenshot. The hotel affects additional tiles nearby. The roads and TREES are changed! That's why it had snow tree crash. Now it made tropic tree (but no crash)
Of course it alters nearby tiles. After all, it thinks those tiles are a part of a 2x2 building, so the other parts are on the nearby tiles. If they aren't there, it writes some data to the landscape anyway, causing pseudo-random changes.

[Your suggestions]

I've added them to my todo list, I may work on them sometime later (which may not be soon). I've got so many requests and suggestions lately that I simply can't work on all of them soon.
George wrote:may be it is a reason of the crash, because I check callback 17 for every tile?
No. Altough callback 17 is never called for additional tiles (if they're coded properly), enabling it isn't an error, and it shouldn't cause problems.
Attachments
newcargospetroltouristsw_fixed.rar
Fixed GRF
(11.95 KiB) Downloaded 208 times
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:OK, I've fixed the errors, the correct file is attached.
Well, the last found bug is not really the last (I found a typo in the south part ;) )
Csaboka wrote:The problems were:
- The prop. 09 problem I mentioned before
- I forgot to mention, but additional tiles must have prop 13 as zero, otherwise TTD may try to build the tile as a stand-alone building
I knew that error in the nfo file :)
Csaboka wrote:I don't know if this is intentional, but one of the hotel tiles accepts cargo 12, which isn't defined. I haven't changed that.
It was intended to be beer. But it should be 0d, not 12
Csaboka wrote:[Your suggestions]I've added them to my todo list, I may work on them sometime later (which may not be soon). I've got so many requests and suggestions lately that I simply can't work on all of them soon.
Ok
Csaboka wrote:
George wrote:may be it is a reason of the crash, because I check callback 17 for every tile?
No. Altough callback 17 is never called for additional tiles (if they're coded properly), enabling it isn't an error, and it shouldn't cause problems.
So I can skip the allowing of building for not north tiles?

One more question (I've asked before but can't understand yet). Can I specify N liveries for the building and allow only N this building on map, how can I make that every view will be represented only once on the map? Random view does not give this result.
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

George wrote:So I can skip the allowing of building for not north tiles?
Yes, it won't ever be used
George wrote:One more question (I've asked before but can't understand yet). Can I specify N liveries for the building
Yes. You can use callback 1E (set bit 4 of property 14 to enable it), and select the color mapping via a random action 2. For this to work, you need to enable color mapping in the normal action 2, but have 0 as the mapping. I used this a lot while coding TTRS2, I can show an example building if it's still not clear.
George wrote: and allow only N this building on map,
In callback 17, check bits 8..15 of var 44, and disallow if there are too many already.
George wrote: how can I make that every view will be represented only once on the map? Random view does not give this result.
You can't do that. TTD doesn't know how a building looks like, except while drawing it, so you can count types only, not variations. If you really need this, you can have every variation as a separate type, then limit each to 1 per map. If it's not that important (like the cathedrals in TTRS2), just try living with it.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:
George wrote:One more question (I've asked before but can't understand yet). Can I specify N liveries for the building
Yes. You can use callback 1E (set bit 4 of property 14 to enable it), and select the color mapping via a random action 2. For this to work, you need to enable color mapping in the normal action 2, but have 0 as the mapping. I used this a lot while coding TTRS2, I can show an example building if it's still not clear.
George wrote:and allow only N this building on map,
In callback 17, check bits 8..15 of var 44, and disallow if there are too many already.
George wrote: how can I make that every view will be represented only once on the map? Random view does not give this result.
You can't do that. TTD doesn't know how a building looks like, except while drawing it, so you can count types only, not variations. If you really need this, you can have every variation as a separate type, then limit each to 1 per map. If it's not that important (like the cathedrals in TTRS2), just try living with it.
It was one question, not three. I already use first two possibilities, but the question was to make them unique. I understand, that I can code them as different buildings, but I read somewhere that there are 256 building types limit per save. That's why I wanted to make them as different views, not as different building. I want to make a general classes 1x1 hotel, 2x1 hotel, 1x2 hotel, 2x2 hotel and make different views for them. But I do not want to have same views on the map.
BTW, about different cathedrals views. Are they different buildings or different views of one building? If they are the second, there can be 2 same cathedrals on the map, isn't it?
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

George wrote:It was one question, not three. I already use first two possibilities, but the question was to make them unique. I understand, that I can code them as different buildings, but I read somewhere that there are 256 building types limit per save. That's why I wanted to make them as different views, not as different building. I want to make a general classes 1x1 hotel, 2x1 hotel, 1x2 hotel, 2x2 hotel and make different views for them. But I do not want to have same views on the map.
And as I said, it isn't possible. You either make them different buildings or allow the same variation to appear more than once.
George wrote:BTW, about different cathedrals views. Are they different buildings or different views of one building? If they are the second, there can be 2 same cathedrals on the map, isn't it?
They're different views of one building, and yes, there can be two of them that look the same. Since there are 12 variations and only 3 is allowed on the map, this is unlikely to happen, though.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:...
(Suggestion) How hard would it be to implement a var that returns random value?
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

George wrote:(Suggestion) How hard would it be to implement a var that returns random value?
It would be easy, but why would you need such a variable? Random action 2s already give you a random value to decide on.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:
George wrote:(Suggestion) How hard would it be to implement a var that returns random value?
It would be easy, but why would you need such a variable? Random action 2s already give you a random value to decide on.
Beacuse it works with a degree of two. checking such variable would allow, for example, the 1/3 easily
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

It sounds like you need a new version of random action 2's, not a new variational variable. I. e. you don't want it to change each time you read it, only when certain triggers are met.

I think it would be easy to create a new version of random action 2 where the number of variations doesn't need to be power of 2.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:It sounds like you need a new version of random action 2's, not a new variational variable. I. e. you don't want it to change each time you read it, only when certain triggers are met.
I think it would be easy to create a new version of random action 2 where the number of variations doesn't need to be power of 2.
That would be handy.
But I had one idea, that requires a var - different probability. I can specify the probability of the appearance of the building equal to FF, but checking this var and using callback 17 I could make it smaller if there is one building build, more small when two and so on.
Image Image Image Image
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

New cargos alpha 1

Post by George »

Status:
alpha 1 of new cargos. It is much safer to use it now. The only thing that is currently wrong is the tourists source. They a produced by banks. It would be changed in the future.
Dos: http://ttd.cernun.net/download/NCPT.RAR
Win: http://ttd.cernun.net/download/NewCargo ... ristsw.rar
Attachments
SCR32.png
SCR32.png (30.87 KiB) Viewed 3244 times
Last edited by George on 12 Aug 2005 03:59, edited 1 time in total.
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

George: I've added your idea to my to-do list.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

After a second thought, a global variable that returns random numbers is not feasible, it would be a huge risk of desyncing multiplayer games.

In multiplayer, the random seed must be in sync on the machines participating, which means they must call the Random function only if all other machines do so. Since some callbacks and the drawing itself isn't synchronized between machines (the drawing only happens if you're looking at the vehicle/station/whatever), you wouldn't be allowed to use the random var. there. The risk would be high that some GRF coder gets it wrong and uses the random var. somewhere it shouldn't be used. The bug would only be noticeable in multiplayer games, a situation GRF coders don't test at all.

What I could easily do (and is safe to do) would be giving a random value to your GRF in var. 18 before calling callback 17. Callback 17 is synchronized between machines, so generating an extra random number there wouldn't break things.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Perhaps an easier way would be to give access to the random action 2 random variable through a var.action 2.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

Patchman: In general it may be, but not for callback 17. That one is called before the house is built, so there's no random values stored yet.

OTOH, a variational action 2 with direct access to the random value wouldn't substitute for a more flexible random action 2, since it doesn't have triggers.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:After a second thought, a global variable that returns random numbers is not feasible, it would be a huge risk of desyncing multiplayer games.
What I could easily do (and is safe to do) would be giving a random value to your GRF in var. 18 before calling callback 17. Callback 17 is synchronized between machines, so generating an extra random number there wouldn't break things.
Ok. So I could make a building with decreasing probability of appearance depending on amount of this building in the town
Image Image Image Image
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

I forgot to post the modern petrol station. What do you think about it?
Image
Image Image Image Image
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

would it be possible to have one that suits Andrex US road set ?
what are you looking at? it's a signature!
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

George wrote:I forgot to post the modern petrol station. What do you think about it?
Image
Doesn't look like a petrol station to me :?
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Purno wrote:
George wrote:I forgot to post the modern petrol station. What do you think about it?
Image
Doesn't look like a petrol station to me :?
For me too. But what has to be changed?
SHADOW-XIII wrote:would it be possible to have one that suits Andrex US road set ?
Why not.
Last edited by George on 16 Aug 2005 14:56, edited 1 time in total.
Image Image Image Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 12 guests