NewObjects specification

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification

Post by wallyweb »

eis_os wrote: TTDPatch should successfully handle 400 active objects, you can see 100 Classes...
(255 entries per Class is a gui limit and can't changed, currently TTDPatch seems to support only 100 entries)

You can't have more then 256 objects per grf (no extended byte support there),
400 objects per grf would be the hard limit anyway, as we can only handle 400 textids per local GRF.

Sum up:
400 active objects in all newgrfs
only 100 classes
only 100 entries
not more then 256 grfs for TTDPatch.

Note: Every sprite counts, you will hit the sprite count earlier then the newobjects implicit id limit.
This is what I have been referring to:
Action0 in wiki wrote:In total, each game can only have 255 object IDs for all active grf files.
Is this wrong? Or did I misunderstand it?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NewObjects specification

Post by planetmaker »

michael blunck wrote:
planetmaker wrote:The specifications of NewObjects? are available since OpenTTD r20670 in TTDP since r2340
In the actual context, this is nonsense, because the newobjects feature in TTDPatch is already available since <r1300, though not in the current form.
Exactly. The current format as described there is available only since the versions I mentioned.

I edited the wiki AFTER you complained in that very posting (which you obviously edited) that the current format present there is kinda bogus and missing ALL version information. As such it is now more correct than before.

So please add the TTDP version information for the old specs, also describing all changes ever made to it, if you want that. As you've been complaining that information on that is missing as well as writing long articles on what objects could potentially provide for the game, you might have put some energy into getting the right information into that document instead.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification

Post by wallyweb »

Lakie's latest TTDPatch nightly, r2340/2341, got Action 0 working properly. Thank you Lakie. :bow:
Rubidium wrote:I copied the sprite that distinguished between graphics and callback in the purchase "chain", so I copied the comment as well. In any case the sprite 61 is part of normal "chain" and it picks out callback 159 (the start/stop animation callback), which in sprite 60 tells to start the animation (returning of FE). As I'm not good in NFO it's probably a nasty hack, but it works for me. Without those two sprites to actually start the animation there is no animation.
I am glad to report that your "hack" is no longer a "hack". I needed to include it under the Patch as well. :bow:
Rubidium wrote:Furthermore I'd like to ask you a small favour. Could you add

Code: Select all

    1 * 16	 14 "C" "INFO" "B" "PALS" \w1 "W" 00 00
before your action 8. That way you'll tell OpenTTD that it uses the Windows palette and I don't have to press "toggle palette" (as I'm using the original DOS graphics).
and
planetmaker wrote:If you draw always using the windoze palette, then it will be helpful to always include that, yes, as it ensures that automatically the correct palette will be chosen; it will make your newgrf incompatible with earlier TTDP versions (EDIT correct conclusion:) which will disable the GRF, if an action14 is found.
This prompted a thought ... Several TTDPatch players use the DOS version. Should something similar be included for the OTTD player who may be using one of those DOS versions as well? Also, I found it did not affect my using it with the most recent TTDPatch nightlies. Any idea as to which version was the last one where it disabled the grf?

Thank you one and all. Amazing work indeed! 8)
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: NewObjects specification

Post by FooBar »

In case of the DOS version you can include the following instead:

Code: Select all

1 * 16    14 "C" "INFO" "B" "PALS" \w1 "D" 00 00
Last version that disabled the grf was r2333
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification

Post by wallyweb »

FooBar wrote:...
Foobar has been added to the "one and all" Thank you list. :D
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: NewObjects specification

Post by Lakie »

wallyweb wrote:
Rubidium wrote:I copied the sprite that distinguished between graphics and callback in the purchase "chain", so I copied the comment as well. In any case the sprite 61 is part of normal "chain" and it picks out callback 159 (the start/stop animation callback), which in sprite 60 tells to start the animation (returning of FE). As I'm not good in NFO it's probably a nasty hack, but it works for me. Without those two sprites to actually start the animation there is no animation.
I am glad to report that your "hack" is no longer a "hack". I needed to include it under the Patch as well. :bow:
This unlikely as the majority of the new object animation system has not yet been committed, and is in internal testing. As such none of object animation triggers or callbacks are currently in TTDPatch nightlies.

As I mentioned earlier, the current behaviour my code uses, is that an object will start life with all its tiles on the animation system and the grf can choose to remove tiles from it.
Rubidium wrote:
Lakie wrote:Currently my code adds all tiles of an object (with the animation flag) to the animation system, and then calls the trigger for construction.
Interesting... seems like industry tiles and houses behave that way. I modelled this part after stations though. I'd be fine with it either way, so what's the concensus here about that?
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: NewObjects specification

Post by FooBar »

wallyweb wrote:Foobar has been added to the "one and all" Thank you list. :D
No, thank you! I like lists, I actually have a few of my own for all different kinds of purposes. But I especially lists where I'm on :] Well, only the good ones, not the bad ones :mrgreen:
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification

Post by wallyweb »

Lakie wrote:This unlikely as the majority of the new object animation system has not yet been committed, and is in internal testing. As such none of object animation triggers or callbacks are currently in TTDPatch nightlies.
Oh nooo. :cry:
With a hurricane scheduled for tomorrow and a holiday on Monday, I guess I shall be very very bored until Tuesday. :roll:
Oh well, you're still on my "one and all" Thank you list. :D
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: NewObjects specification

Post by eis_os »

Note: TTDPatch supports 400 active objects... but you can only define 255 in objects in grf.
http://svn.ttdpatch.net/trac/browser/tr ... ev=2341#L1

If I remember well, I changed the id framework later to support more, but wiki objects didn't get updated. Again, you will surely hit the sprite limit earlier when you add animations then the id limit... since r1989 08/22/08 21:32:31. It's a simple compile time constant, it's possible to change the 400 to a higher value.

-edit-
As requested by Michael, the wiki may be changed to only describe the revised specs, but mention that TTDPatch used to support an older now deprecated support since r????

Nitpickers Corner:
While I really think it's great that OTTD Devs try to sync the specs, mentioning TTDPatch later in a TTDPatch wiki and even use "TTDP" I really dislike. Could you please stop that...
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: NewObjects specification

Post by Lakie »

Well, in my testing of the various variables, I often ended up using(/abusing) cb157 as a way to check conditions (using some of the 40+x and 60+x vars).
So I was wondering if the callback return from cb157 should be adjusted to allow a textid (D4xx only) return for a custom "Cannot build object here..." reason, (by having a bit set in the return value).

Although, it might be needed to split cb157 from cb149, to prevent confusion in that case...

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: NewObjects specification

Post by frosch »

Lakie wrote:So I was wondering if the callback return from cb157 should be adjusted to allow a textid (D4xx only) return for a custom "Cannot build object here..." reason, (by having a bit set in the return value).
In that case I would suggest to do it like cb 28 (http://wiki.ttdpatch.net/tiki-index.php ... ibility_28_ ), i.e. 0x400 for allowing construction.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

NewObjects specification - Class Labels

Post by wallyweb »

As there seems to be no further comment regarding Object Class Labels, I assume that the "Recommendations" are acceptable, (minus the "TEST" label as suggested by eis_os), I would like to update the wiki in the next day or two. I will consider this post as a last call for proposals and suggestions and if none are forthcoming, I will update the wiki on Friday.

EDIT - 17-09-2010 - Done
Last edited by wallyweb on 17 Sep 2010 14:34, edited 1 time in total.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

NewObjects specification - Irregular Layout

Post by wallyweb »

I am working on an object where an irregular layout, as is currently available with industry tiles, would be very useful. Furthermore, I can think of several other situations where this might be useful. Essentially, what I am thinking about is the ability to build a road or track (or anything else one can dream of) in between two sections of the same object. George's coal mines and Pickabird's forests would be good examples of this.
What are your collective thoughts on this?
By the way, would this be similar to Variational Action 2 Variables for Industry Tiles - Relative position (43) ?
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: NewObjects specification

Post by michael blunck »

eis_os wrote: Note: TTDPatch supports 400 active objects... but you can only define 255 in objects in [the same?] grf.
So the documentation is alright?
Get object type at offset (60)
Returns the same values as industry var60.
which in turn reads:
00xxh if the tile is an industry tile and was defined in the current GRF with ID xx.
Or needs the doc being changed?

regards
Michael
Image
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: NewObjects specification

Post by SwissFan91 »

Would some of the ideas posted here be possible to create with newobjects? A cable car type thing whereby the pylons and the stations itself were just objects placed in the scenario?
Total Alpine Replacement Set: Industry, Town, Objects
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: NewObjects specification

Post by michael blunck »

jake.grimshaw wrote:Would some of the ideas posted here be possible to create with newobjects? [...]
Similarly complicated as implementing it as an industry. In any way, you´d have to implement synchronised animation cycles for each tile to get the illusion of an overall animation.

regards
Michael
Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification

Post by wallyweb »

jake.grimshaw wrote:Would some of the ideas posted here be possible to create with newobjects? A cable car type thing whereby the pylons and the stations itself were just objects placed in the scenario?
michael blunck wrote:Similarly complicated as implementing it as an industry. In any way, you´d have to implement synchronised animation cycles for each tile to get the illusion of an overall animation.
If it's just pylons and stations, then it would be a very simple task. However, if you want the chairs or cable cars moving, then that's where Michael's thoughts apply.
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: NewObjects specification

Post by SwissFan91 »

I think due to the scale of the game (a mountainside could only be 4/5 '\' squares), a lift without cable cars/chairs wouldn't look too out of place. Or, it could be done with just static chairs/cable cars.

But at least it shows it is possible. Is this synchronised animation cycle idea impossible ? Or just extremely difficult to implement?
Total Alpine Replacement Set: Industry, Town, Objects
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification

Post by wallyweb »

jake.grimshaw wrote:Is this synchronised animation cycle idea impossible ?
No
Or just extremely difficult to implement?
Yes ... well ... It depends on the quantity of frames.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NewObjects specification - Build on coasts

Post by wallyweb »

From my releases thread:
slaca wrote:In openttd i can't build lighthouse next to the water like in your second post, except i plant a tree first :) (maybe openttd's 'bug')
[/quote]

What I have observed:

Action0, property 10 ...
- bit 3: "Allow construction of the object on water" unset
- bit 5: "Do not display foundations if on a slope" unset

Effect: When building an object on a coast (sloped tile with shoreline) ...
- In TTDPatch, the object gets a foundation.
- In OpenTTD, the message is "Can't build on water".
- In OpenTTD, planting a tree on the coast tile allows an object to be built with foundations on that tile.
- In TTDPatch, a player can't plant trees on coasts.

The TTDPatch implementation would be the most desirable.
Is the OTTD implementation a bug? Is it particular to newobjects only?
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 11 guests