Planeset and OpenTTD

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

User avatar
459
Transport Coordinator
Transport Coordinator
Posts: 330
Joined: 18 May 2004 13:37
Location: Finland

Planeset and OpenTTD

Post by 459 »

I'd like to see our Planeset working well enough with OpenTTD sometime. I'm bored using the normal planes ;) Currently the airplanes in set seem to work somehow but helicopters (even the basic ones) are more or less broken. You have my permission to do anything with files mentioned below to get the set working.

There are two packages. First is the Planeset - 459 Remix (can be found by following the first link) which doesn't have any advanced GRF features so there's much less to fix. I suggest that if you are trying to make something work this is the set to start. Under the second link is the current Planeset which has more advanced features. I don't suggest touching it before the 459 remix works fine. Both packages also include reference NFO/PCX for troubleshooting/reverse-engineering etc.

http://www.tt-forums.net/viewtopic.php? ... start=1040
http://www.tt-forums.net/viewtopic.php? ... start=1360
Planeset has been officially released!
Get it here. Help us to draw liveries for all planes!
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

I was planning on getting used to the newgrf code anyway. So I might give it a shot to make your planeset working. :D Are you using any callbacks in the set, those are not implemented at all yet.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
459
Transport Coordinator
Transport Coordinator
Posts: 330
Joined: 18 May 2004 13:37
Location: Finland

Post by 459 »

The 459 Remix doesn't have callbacks as far as I remember - try to get it working first instead of the development version. The development version uses some callbacks for some helicopters (airships).
Planeset has been officially released!
Get it here. Help us to draw liveries for all planes!
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

459 wrote:The development version uses some callbacks
Um... no it doesn't.

What it does use is constructs like:

Code: Select all

498 * 10	 03 03 01 01 01 FF 03 00 01 00
499 * 7 	 03 03 81 01 00 04 00
The second action 3 sets the rotor sprites.
(A similar construct appears at sprites 481-2)
Last edited by DaleStan on 26 Jan 2005 17:33, edited 1 time in total.
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
459
Transport Coordinator
Transport Coordinator
Posts: 330
Joined: 18 May 2004 13:37
Location: Finland

Post by 459 »

OK, maybe the talks of using callbacks to adjust cargo capacity&type properties and running costs have confused me.

Anyway, the Remix is still more basic in behaviour.
Planeset has been officially released!
Get it here. Help us to draw liveries for all planes!
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

OK, choppers are working correctly now. They don't take off on the runway any more. :) What other things aren't working yet? Note that there seems to be a problem with planeset savegames right now. Occasionaly it doesn't the game crashes while saving. I haven't found the cause of that problem yet.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

With the 24/Jan/2005 nightly build (r1641), and v0.3.6:

OTTD does not draw the zeppelins correctly. It draws nothing at all in the purchase window, and a zeppelin with a rotor on top in the aircraft details window, as well as in the main map.
Compare OpenTTD's version of the Graf with TTDPatch's version.

If I start a game in 1940 with only the PlaneSet loaded, I get an assertion failure on the expression "totpix > 0", line 1441 of ./gfx.c. when clicking the "New Aircraft" button in the hangar of a small airport. If ignored, the graphics go wonky, and OTTD dies. (0.3.6 does not have the assert, obviously, but everything else is the same)
Attachments
OpenTTD.PNG
OpenTTD.PNG (3.24 KiB) Viewed 8049 times
TTDPatch.PNG
TTDPatch.PNG (3.56 KiB) Viewed 8049 times
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
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

Could you point me directly to the GRF set you've been using? I had tested with the Remix version of the planeset and seemed to work fine. The Remix doesn't even have a zeppelin.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Oh, right. I was using the other version -- the 25/Jan/05 one. It's over here (and at 459's second link)
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
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

After Dominik played around with 459 it seems to work fine. The only thing that is "missing" is that the choppers don't have rotors in the 'build new aircraft' window.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

I'll see what I can do. :) One more question: Are zeppelins supposed to be choppers or airplanes? Or is there a new variable specifically for zeppelins? I couldn't find any information about that in the GRF Specs.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
Prof. Frink
Tycoon
Tycoon
Posts: 3849
Joined: 20 Jan 2003 14:51
Location: Broadstone, Dorset
Contact:

Post by Prof. Frink »

They're helicopters, but with "wagon override" on the rotors to show a blank sprite.
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

I need some help with those rotor overrides. This section in the grf file is supposed to do it:

Code: Select all

//Airship rotor overrides
 464 * 4	 01 03 01 02
 465 d:\pelit\ttd\TDX_EDIT\SPRITES\SPRITES\planesetw.pcx 2 1792 01 1 1 0 0
 466 d:\pelit\ttd\TDX_EDIT\SPRITES\SPRITES\planesetw.pcx 18 1792 01 1 1 0 0
 467 * 9	 02 03 04 01 01 00 00 00 00

Line 464 defines a set of sprites for planes. One sprite set (=one vehicle) is specified, consisting of 2 sprites. The two sprites to override the rotors follow. Then in line 467 cargo IDs are defined (Action 02) for airplanes (type 03). It defines cargo ID 4, with only 1 state used while moving and only 1 state for loading/unloading. Set 0 (as previously defined) is used for both moving and loading/unloading.

So basically my question is: Are rotors defined as cargo graphics?
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

the problem is that cargo ID's and sprite set ID's are used interchangeably.

in this case it's a sprite set ID (thingamajib)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I'm not sure I understand your question Dominik, so I'll just try to explain what's going on.

Code: Select all

//Airship rotor overrides
464 * 4   01 03 01 02
465 SPRITES\planesetw.pcx 2 1792 01 1 1 0 0
466 SPRITES\planesetw.pcx 18 1792 01 1 1 0 0
467 * 9   02 03 04 01 01 00 00 00 00

//LZ-127 "Graf Zeppelin"
468 * 4   01 03 01 08
//8 standard Graf zeppelin sprites
477 * 9   02 03 00 01 01 00 00 00 00
478 * 4   01 03 01 01
//purchase sprite for Graf (smaller, so it fits in the purchase window)
480 * 9   02 03 02 01 01 00 00 00 00
481 * 10  03 03 01 00 01 FF 02 00 00 00
482 * 7   03 03 81 00 00 04 00
Sprites 465-6 are the rotor sprites for both the Graf and the Hindenburg. The first sprite in a set of rotors is the sprite for when the rotor is stopped; the remainder should be cycled through to create the animation.
Sprite 481 sets the graphics for the Graf's body: sprite 479 in the purchase list, and sprites 469-76 in all other cases.
Sprite 482 uses a special-case livery override to replace the default rotor sprites with sprites 465-6.

I hope this helped.
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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Well, something's changed, but it's not for the better.

The Zeppelin is now drawn in the purchase window, but it's drawn like this. (This is the Jan 31 nightly; svn 1754)

@Dominik: did my previous help/make sense/etc?

Also, now that the Chinook has decent (IMSelfServingO) rotors it may get folded in soon. (Or it may wait until I draw umpteen more liveries for the body.) Either way, it's about as complex as rotor-overrides can get, so it may be a good test of the rotor-override code.

You should be able to find whatever you need over here, with the exception of decent comments in the source.
Attachments
Zeppelin.png
Zeppelin.png (7 KiB) Viewed 7665 times
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
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

@DaleStan: Thanks for your excellent information I now understand how it works. However, fixing it in the code isn't all that easy, at least not without getting used to the newgrf code. I've been reading up on it a lot lately, but it is still very frustrating. And besides that I've been distracted by World of Warcraft ;). I think I'll manage to fix the purchase list icon soon though. Rotor overrides are probably a bit more work.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Does anyone have a list of the values and meanings of byte 62 WRT the larger airports? I tested my GRF files earlier today, and discovered that the Osprey ... doesn't work. Not just the rotors (that's to be expected), but the engine nacelles too. I assume it's a simple matter of recoding the variational 02 on E2, but a list of meanings would be nice.
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
459
Transport Coordinator
Transport Coordinator
Posts: 330
Joined: 18 May 2004 13:37
Location: Finland

Post by 459 »

Planeset vs. OpenTTD 0.4.0:

-747 and An-124 latch noses don't work.
-Airships show garbage in buylist instead of those "scaled-down" pics.
-All advanced choppers have standard single rotors even if they shouldn't have rotors or if they have modified rotors.
-S-61 is called "Powernaut Helicopter" for some reason.

Developers: Do something :)
Users: Stick to the "Planeset 459 remix" with OpenTTD for the time being...
Planeset has been officially released!
Get it here. Help us to draw liveries for all planes!
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

On that subject, to make the Osprey work in the OTTD, I need:

1.) Access to TTD vehicle struct byte 62-equivalent information
2.) Access to TTD vehicle struct byte 66-equivalent information
3.) Airport type detection
4.) OTTD vs TTDPatch detection
5.) Working rotor overrides

Notes:
1.) v->u.air.state, apparently.
2.) I need to be able to determine:
Is in hangar?
Is on a pad? (Later, we'll need: Which pad?)
Is taxiing? (This should probably be split up, despite the fact that I don't forsee needing the distinction.)

In in flight?
3.) TTDPatch variable 44 (I'll need the second byte for the Chinook.)
4.) My proposal: Set action 7/9 variable 8D to 02 in OTTD.
5.) I can get the NFO done without these, but it won't look right until this is finished.

The 747s and Ruslan will need callback support, specifically, callback 19.

If someone around here can give me a brain dump on how the newgrf code in OTTD works, I could probably be convinced to work on these features myself.
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
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot] and 36 guests