ID Limit - Question

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

Zoom
Engineer
Engineer
Posts: 69
Joined: 24 May 2003 04:14
Location: Minsk, Belarus
Contact:

ID Limit - Question

Post by Zoom »

Is it possible to make more than 35 locomotives for my set? (I'd like to convert unused ID's from toyland for locos from my set and I know there is an action that sorts vehicles properly).
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

To amend to this question - what are the actual IDs of all the vehicles in the game? Is there some nice list that summarizes this? I've tried searching, but to no avail.
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

You can convert as many of the IDs as you want to trains in any particular climate, but you can only modify train IDs. Toyland IDs can be converted as you want to, as long as you convert Toyland trains.

Have a look here for all the vehicle IDs, but there are two small problems if you want to use them to make new graphics.
1. New graphics IDs are in hex so you'll need to convert them
2. New graphics IDs start at 0 for each type of vehicle.
If you feel up to it, run TTDAlter and count from the top, starting at 0, and that'll tell you all the vehicle IDs.
broodje
Director
Director
Posts: 615
Joined: 13 Jul 2003 12:47
Location: Alphen aan den Rijn
Contact:

Post by broodje »

or do like I did and ask owen for a list , I posted it here: http://home.tiscali.nl/broodje/TTD_veh-ids.txt

hapy moddig :D
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

Make sure you start counting at the first off it's set (if using broodje list).

Or
ID Road vehicle -116
ID Ship -204
ID Planes -215

and make sure you make hex values :!:
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

Broodje, your link doesn't work.

As I look through the list I am struck by a sudden observation:

All the traincars are listed separately, for all the climates. But you don't use more than one set of them, and you could really have the maglev and monorail share the same carriages as everything else, just giving them livery overrides as required.

So, of the 116 slots, you'd use maybe 20 for traincars, thus allowing you to have 90 or so locos! Really?

But there must be a catch, since MB said 36 is the maximum limit.

Can someone explain this?
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Hmm, even if it was possible, can you imagine the chaos if there were 90 engines available? That would mean a new one would appear almost every year (if we made ones for future as well). I find that the 36 that are in the DB Set are already almost overwhelming.

Still it would be interesting to figure out what's the deal with this.

Cheers,
minime
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

Well, the Japan set already has shared slots, and I'm sure we could come up with at least 10 visually-distinctive new trains, if not 20. I dunno if you'd want 90, but I could see 50 anyway. Particularly when you consider that it is possible for trains to be released from 1920 through 2040, which is 120 years. In the Japanset for instance, you have several different usages, all of which need to be supported:
-EMUs
-DMUs
-Electric passenger locos
-Electric freight locos
-Diesel passenger locos
-Diesel freight locos
-HSR (Shinkansen)
And we haven't even touched maglev or monorail, both of which Japan has.

In the American set, there are at least 6 more visually distintive diesel locos, and probably as many more each of steam and electric, which I didn't add because they didn't seem necessary. But if we knew we had plenty of slots I might just go ahead and add them.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

This is interesting :?
A while ago (in fact here), I did some experiments with changing wagons to engines and when I clicked on the newly-created engine TTD crashed.
However, due to a miscalculation of IDs, I accidentally put one of the new US set trains into the wagon ID range a few days ago. However, it worked perfectly this time (with alpha 15a)! I've just tested it again now and it worked again, so maybe that was an unintentional bug in the patch that is now fixed. If so, which is what it seems like, as krtaylor says, we can now have loads of engines! :D

P.S. Let's add some more engines to the US set now! :wink:
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

OK. I guess we will take this as Holy Writ. Announcements will be made in all relevant forums.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Hmm, this could possibly be tested just by reusing the sprites from one loco and making multiple copies of it with different IDs. I'll give it a shot and see what I can get.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
ChrisCF
Transport Empire Developer
Transport Empire Developer
Posts: 3608
Joined: 26 Dec 2002 16:39
Location: Over there --->

Post by ChrisCF »

Surely it would be possible to replace other objects, e.g. to create an entire set encompassing rail, road, air and sea, using fewer different aircraft designs (and redesigning the post-2000 ones which look a bit pants), a more rationalised ship scheme, and making use of any slots this frees up for more rolling stock, and some extra locos.

In fact, would it be possible to generate a set which contains nothing but 200+ different types of locos and rolling stock, or only ships, etc.?
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

No. That's also why there are still so few ships.

It is not possible to interchange the slots from different TYPES of vehicles. Maglevs, monorails, locos, carriages, they are all trains, with parameters that specify exactly what they are, which can be changed. But they're still all trains; they're not ships or planes.

Each type of vehicle has its own array (I think) with the parameters that pertain to that type. We can mix around with the parameters, and change graphics, but we can't change from one type to another.

The trains are particularly useful because each different climate has its own set of locos, and many of its own carriages. So we can use all of those slots in one environment since we don't have to worry about populating the other environments (you can only play one at a time).

The aircraft are mostly all the same throughout the different environments, which is bad, but there were a great many of them in the first place so there's still enough slots to play with.

The trucks have plenty of slots too because Chris Sawyer did it with a different truck for each cargo; we can just have one "generic" platform truck and you refit it for the cargo you want, thus effectively letting us have 10x more trucks than he had.

But there never were that many ships, and all the environments had the same ones (except for Toyland, but it only had 2 I think). By making the ships refittable and using the Toyland slots, MB squeezed a few more ships out of the mix, but he is currently using all the slots there are and there is no way to get more. Josef is still working on it but it doesn't look promising. You never know though, he might trip over the key some time and we'll be all set.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
ChrisCF
Transport Empire Developer
Transport Empire Developer
Posts: 3608
Joined: 26 Dec 2002 16:39
Location: Over there --->

Post by ChrisCF »

My understanding was that each vehicle in the list had its entry with the relevant properties, including one which specified what type of vehicle it was, a property whose value could be changed.
Bugzilla available for use - PM for details.
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

Apparently that understanding is mistaken, because otherwise it would have been changed long ago and we would have given some of the excess train slots to the ships. The reason they aren't interchangeable is because each of the different types have different parameters associated with them. Of course some are always there (top speed, HP, year of introduction) but then some are specific to the type (planes: helicopter Y/N?; trains: steam, diesel, electric, monorail, maglev; etc.) The way the arrays are set up in memory to hold these things cause problems. You can change the values in the memory spaces easily enough, that's what you're basically doing when you make a new set - just defining the trains differently, and putting different values in the slots already prepared for them. But making the vehicles into different types would require a whole new set of slots, and that's a problem.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

krtaylor wrote:and you could really have the maglev and monorail share the same carriages as everything else, just giving them livery overrides as required.
No, you can't. They have to be different. You need each car three times if you want to support all three train types. And if you don't, it gets really, really tricky because of all the possible combinations of unimaglev 0, 1, 2, 3 and elrails on/off.
User avatar
Lilman424
Tycoon
Tycoon
Posts: 2743
Joined: 20 Oct 2002 14:55
Location: Georgia
Contact:

Post by Lilman424 »

straight from the IRC channel:

Code: Select all

(08:58:24)(08:58:27)(08:58:36) <patchman> well, it's implied
(08:58:57) <patchman> 0-115 are trains, 116-204 are rvs, 205-214 are ships and 215-255 are aircraft
(08:59:07) <Metalcore424> but why is it unchangeable
(08:59:08) <Metalcore424> ?
(08:59:17) <patchman> because each of them has their own fixed size arrays
(08:59:36) <Metalcore424> If you changed it, how many other things would it break?
(08:59:53) <chirho> Is there also the lack of something in that data which relates directly to the type?
(09:01:21) <patchman> it doesn't relate it, but if it's a rail vehicle, the rail arrays are accessed by the ID, and if it's an RV, the RV arrays are accessed with an index of (ID-116), and so on
(09:01:28) <patchman> it's implied in hundreds of places, and can't be changed
(09:01:41) <patchman> believe, this would've been the first thing I'd have changed for the ships, if it was possible
(09:02:05) <Metalcore424> even with my limited knowledge of programming (albeit no assembly) that makes no sense....
(09:03:29) <Metalcore424> enlighten me how it makes sense...
(09:04:26) <chirho> In the block of data describing a rail vehicle, there's nothing in there which says "I'm a rail vehicle".
(09:04:31) <patchman> no
(09:04:40) <chirho> Instead, when it wants a rail vehicle, it looks for the ID.
(09:04:41) <patchman> it's hardcoded in hundreds of places
(09:05:06) <Metalcore424> ah
(09:05:08) <Metalcore424> I see
(09:05:08) <chirho> When it wants a road vehicle, it identifies which ID it's after by +116
(09:05:12) <Metalcore424> no way to change that?
(09:05:23) <Metalcore424> without TTU...
Metalcore's me, chirho is ChrisCF.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction. - Albert Einstein
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

Patchman wrote:
krtaylor wrote:and you could really have the maglev and monorail share the same carriages as everything else, just giving them livery overrides as required.
No, you can't. They have to be different. You need each car three times if you want to support all three train types. And if you don't, it gets really, really tricky because of all the possible combinations of unimaglev 0, 1, 2, 3 and elrails on/off.
Whoa, hang on, this is confusing. By the way, the IRC quote isn't relevant to my point, because that's talking about interchanging ships, RVs, planes and trains between them. That's not what I'm talking about here, I'm talking, simply, about using some of the slots occupied by carriages, for train locos.

At the very least you could get a few by using the carriage slots from Toyland (who carries fizzy-drinks anyway?) and whatever other climate you're not intending your set to be used in.

But as far as having to have three sets of traincars for the three different types of track, how can that be? The Cargoset provides traincars that are perfectly interchangeable between, at least, the first two (normal and electrified rail.) Surely all the Cargoset vehicles are not entered in there twice?? My assumption is that you globally changed to code somewhere to make it such that normal trains can also run on electrified tracks, and thus, that all the traincars are "normal" traincars, and there's no such thing as a traincar for the electrified tracks. So that frees up another batch of them.

I suppose maybe you'd have to have separate carriages in their own slots for the unified maglev/monorail, but that's not such a big deal since we only offer mail, passengers, and valuables carriages on the maglev, you don't have to have the whole dozen. So that saves a bunch more slots. I'm still not clear on why you can't just offer the same carriages all round, isn't it a bitmask that sets on which tracks each vehicle is allowed to operate? But even in a worst-case scenario as I see it, you can use it this way:

116 total slots for trains
-3 slots for maglev carriages
-20 (or so) slots for other carriages for normal & electrified
leaves 90 or so slots that can be used for engines, divided between normal, electrified, and maglev as desired.

Is this wrong? If so, where?
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

I think you have to envisage all the different patch settings:
(FYI, electric trains are not determined by setting them to use the second track type; it's dependent upon a setting that already existed about whether trains are steam, diesel or electric.)

Elrails on, unifiedmaglev 1 (the usual setting): you need railway carriages and maglev carriages.
Elrails on, unifiedmaglev 2: you need railway carriages and maglev carriages.
Elrails off, unifiedmaglev 3: you need railway, monorail and maglev carriages.
(All other possible settings come down to these three in the end.)
Therefore, if you want to have a monorail when both settings are off, you will need all three types of wagons. If you want to have a maglev locomotive when both settings are off, then you need two types of wagons. If you don't want any monorails or maglevs ever, then obviously you only need railway wagons.

So, basically, I believe you are right, krtaylor.
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Here are some problems because I already thought about changeing ships:

Each vehicle type values are stored in different places in TTD.
Not each vehicle type uses the same stuff in arrays. (incompatiblities)

So even if you change some bit, you break the others -> mostly impossible because a lot work...
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image
Post Reply

Return to “Graphics Development”

Who is online

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