Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Apr 23, 2019 7:03 am

All times are UTC




Post new topic  Reply to topic  [ 150 posts ]  Go to page 1 2 3 4 58 Next
Author Message
 Post subject: NewGRF Airports, try 2
PostPosted: Mon Oct 26, 2009 8:31 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Long-wanted by some, unkown to others, here it finally is: another NewGRF Airports implementation.

Goal of this project
A lot of the elements in OpenTTD can already be modified / added by NewGRF files, think about industries, vehicles, houses etc. So far airports have been an exception: while it is possible to replace the graphics, no new airports could be added. The goal of this project is to create and implement a spec for newgrfs to be able to change / add airports.

History
A very brief history for those who don't know what happened. In 2007 richk67 started work on a project called "NewGRF (Air)ports". I quote from his topic:
Quote:
The concept is to remove the hardcoded airports from OTTD, and provide them as modifiable and replaceable newgrfs, so allowing users the ability to design and include their own airports, along with specific new graphics.

Specific new features provided in this branch:
New GUI, with preview picture.
Rotateable airports (where defined)
Asymmetrical airports with holes!
Part land/part sea airports (for seaplanes)
Multi-tile depots so that a hangar can be scaled better to cross more than one tile.
Due to various reasons (which are not to be discussed in this topic) the development on that branch was stopped somewhere in 2008/2009. The approach of that branch was to include a list of nodes and transitions between nodes in a grf. For each transitions you could specify one (or a few) predifined rules when that transition was valid. Examples: block 1 is free, current aircraft is a helicopter, etc. This is very close to the internal OpenTTD airport implementation. While this allows for new airports to be created, it has the drawback that the newgrf writers are limited by the rules given in the spec. When development had just started Pikka wrote an alternative spec with more freedom for the newgrf writer. That is the spec I've taken as example and which I've build upon.

Features
  • New airports can be defined via NewGRF files
  • Non-rectangular airports
  • Rotated airports (only when a newgrf defines them)
  • Water airports
  • ... whatever airport coders can come up with

What this is not
  • Modular airports; On the other hand I'm sure Dimme wants to try and see if he can write a simple program that can create newgrf airport files.

The spec (for newgrf coders)
Please note that while this branch is being worked on the spec is subject to change. The full specification can be found here: http://users.tt-forums.net/pikka/wiki/i ... umentation.
Some design choices:
  • Airports are in many ways similar to industries. Airports are also split in "airport tiles" (the graphical component) and "airports" (the logic component).
  • The airport statemachine is completely implemented via callbacks. Every airport has 16 4-byte slots persistant storage (var 7C).
  • Aircraft gain one extra doubleword sized property to specify where they can land (normal airstrip, on water, heliport, zeppelin pylon) as well as the minimum runway length required. This property is available in the airport statemachine callback. The unused bits are reserved and can be used for other landing types.
  • The node-list is rotated by openttd. It's possible to use different nodes in different nodes by checking for the rotation in the statemachine callback, but for most airports this shouldn't be necesary.

Test airports
I've attached 5 test airports. mini_airport.grf contains a small airport with a diagonal runway and can be rotated in all directions. water_airport.grf contains a very simple water airports (without grahpics). However, since no normal plane can land on a water airport it isn't useable until someone creates a water aircraft newgrf. Graphics are partly by skidd13 and partly from opengfx. survey_camp_depot.grf is an industry with an airport, graphics by andythenorth. windfarm.grf contains the firs windfarm drawn by zephyris, it doesn't work as an airport but serves as test-case for animation. seaport.grf uses the windfarm graphics but can only be build on water. It's a testcase for the docks functionality, not-yet-complete but a ship can load at it.
License is of all newgrfs is gplv2, the source is included in the zip file.

A big thanks to Pikka for the original spec and for a lot of help with improving/discussing it to what it is now.

Download
Binaries are available here: http://www.openttd.org/download-airports
The source checked out via hg here: http://hg.openttd.org/developers/yexo/airports.hg/

Bugs / crashes
Please note that this is still in development, so an occasional crash can be expected. Please do report them.

NFORenum support
I've attached data files for nforenum that support implemented part of the spec. Also attached a diff against nforenum's data.cpp to create new data files.


Attachments:
File comment: 5 test airports
airports.zip [184.42 KiB]
Downloaded 3042 times
File comment: NFORenum data files
renum.zip [1.79 KiB]
Downloaded 795 times
File comment: Only needed if you want to compile nforenum yourself
renum_airports.diff [33.57 KiB]
Downloaded 578 times
Top
   
PostPosted: Mon Oct 26, 2009 8:35 pm 
Offline
Tycoon
Tycoon

Joined: Thu Apr 02, 2009 10:43 pm
Posts: 3008
Location: Massachusetts, USA
This seems like a really great project. Sorry that I was so eager to report bugs before. Another question that may have to do with this patch or GRFs in general, is there a maximum size limitation for airports? Also, do you have a diff for this?

Edit: Under test airports, you have a little BBCode bug, you just forgot the "]".


Top
   
PostPosted: Mon Oct 26, 2009 8:43 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
petert wrote:
This seems like a really great project. Sorry that I was so eager to report bugs before.
No problem.
Quote:
Another question that may have to do with this patch or GRFs in general, is there a maximum size limitation for airports?
Yes, there is a maximum, and I think it's the same as for industries. I'm not sure whether the limit is 16x16 or 127x127.
Quote:
Also, do you have a diff for this?
No, just learn to work with hg :p
Quote:
Edit: Under test airports, you have a little BBCode bug, you just forgot the "]".
Thanks, fixed.


Top
   
PostPosted: Mon Oct 26, 2009 8:47 pm 
Offline
Tycoon
Tycoon

Joined: Thu Apr 02, 2009 10:43 pm
Posts: 3008
Location: Massachusetts, USA
Yexo wrote:
No, just learn to work with hg :p

Well, hg isn't the problem, I was just hoping to look at the code difference, and how else are people supposed to add this to their patchpacks?
Also, TortoiseHG for Windows.


Top
   
PostPosted: Mon Oct 26, 2009 9:31 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Apr 29, 2004 9:53 pm
Posts: 150
here it is, great ! :D


Yexo wrote:
I'm sure Dimme wants to try and see if he can write a simple program that can create newgrf airport files.


for people like me that have a lot of trouble reading / writing a nfo, this kind of programm would be more than welcome.


Top
   
PostPosted: Mon Oct 26, 2009 9:36 pm 
Offline
Engineer
Engineer
User avatar

Joined: Tue Feb 13, 2007 8:16 pm
Posts: 67
Location: Essex, UK
Yexo wrote:
water_airport.grf contains a very simple water airports (without grahpics). However, since no normal plane can land on a water airport it isn't useable until someone creates a water aircraft newgrf.

What ever happened to that Ekranoplans grf that was being talked about...? *nudge nudge*

_________________
Image


Top
   
PostPosted: Mon Oct 26, 2009 9:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Sep 16, 2005 12:23 pm
Posts: 1517
Skype: the_gremnon
Location: /home
Actually, I'm fairly sure that in either AV8 or the old PlaneSet, there was a water-plane, at least one that worked on RichK's NewGRF ports.


Top
   
PostPosted: Mon Oct 26, 2009 10:37 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Eddie wrote:
Yexo wrote:
water_airport.grf contains a very simple water airports (without grahpics). However, since no normal plane can land on a water airport it isn't useable until someone creates a water aircraft newgrf.

What ever happened to that Ekranoplans grf that was being talked about...? *nudge nudge*

I have absolutely no idea.

Gremnon wrote:
Actually, I'm fairly sure that in either AV8 or the old PlaneSet, there was a water-plane, at least one that worked on RichK's NewGRF ports.
It'll have to be recoded since the spec is different.


Top
   
PostPosted: Mon Oct 26, 2009 11:01 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2825
Quote:
What ever happened to that Ekranoplans grf that was being talked about...?

You mean this one? Coding was never completed, because ekranoplan behave as ships, not planes, and are so limited to far below their real life speeds in-game. If you feel like recoding then these sprites are available.

On the subject of sea planes at one point it came upon me to model and spritise the Saunders-Roe Princess, the sprites are attached if anyone would like to code them (though I would do so outside of this thread to keep it on-topic...).

*edit* oops, forgot to say what I originally meant to: Awesome! This will be epic!


Attachments:
Saunders-RoePrincess.zip [51.04 KiB]
Downloaded 590 times
0007.png
0007.png [ 1.49 KiB | Viewed 29849 times ]

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net
Top
   
PostPosted: Tue Oct 27, 2009 12:22 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5373
Location: The Moon
Nice work Yexo. :) Sorry I've been a little slack about this, I'll have to try and get some av8ports coded asap. :)

_________________
Pikkarail.com blog | Patreon
Current development: UKRS3 - Av9.8 - TaI32 - CivilAI
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAI API - NoGo API


Top
   
PostPosted: Tue Oct 27, 2009 12:49 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon Jan 15, 2007 9:45 pm
Posts: 655
Location: FRANCE
Gonna be legen- wait for it - dary!

_________________
I am little, ugly, and nasty. How do you do?


Top
   
PostPosted: Tue Oct 27, 2009 2:35 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Yexo wrote:

Bugs / crashes
Please note that this is still in development, so an occasional crash can be expected. Please do report them.


Alright.
I'm using revision h1b3fcb99, which should be the tip of your repository at the time of this post.

I have downloaded your grfs and am using the mini_airport.grf. (selected in main menu)
When clicking on "Build airport" in the airport building toolbar, the window opens with the category "small airports" selected. I can build small airports without problems (commuter airport is disabled due to game date). I can also change category to "diagonal airport" and build your mini airport without problems. However, when I select one of the other categories, an assertion fails:

file: newgrf_airport.h
line: 59
expression: airport_type < lengthof(AirportSpec::array)


---
Good luck with this project :) Glad you picked it up :)

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Tue Oct 27, 2009 7:39 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Jul 30, 2008 12:42 pm
Posts: 277
Location: Trondheim, Norway
Great work Yexo :D

Yexo wrote:
What this is not
  • Modular airports; On the other hand I'm sure Dimme wants to try and see if he can write a simple program that can create newgrf airport files.

Sure, but it will take some time. Have just started learning nfo. With these specs I guess it is possible, looking at the amount of freedom put into it :)

First, I'm going to make some airports!

_________________
Try my modular airports minigame!

Image


Top
   
PostPosted: Tue Oct 27, 2009 11:41 am 
Offline
Director
Director
User avatar

Joined: Thu May 03, 2007 8:18 pm
Posts: 624
Location: England
A pair of flying boats which worked with the previous NewGRF Airports. Whether they work with this one is another matter.

The Beriev Be-200 here and the Boeing 314 here. Just scroll down the pages to find them.

_________________
The Revamped West Country


Top
   
PostPosted: Tue Oct 27, 2009 12:52 pm 
Offline
Tycoon
Tycoon

Joined: Thu Jun 05, 2003 4:21 pm
Posts: 2363
Location: Up North
Good to see someone having a good go at this.

Just a quick query about the newgrf spec. In Aircraft movement states it lists 02..04 as "going to pad 1..3, respectively". Does this mean this spec is limited to 3 terminal pads?

Cheers. RichK

_________________
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography


Top
   
PostPosted: Tue Oct 27, 2009 1:04 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4551
Location: /home/sweden
Oh, really nice to see you posting about your work. :-)


Yexo wrote:
Binaries will come soon, the source checked out via hg here: http://hg.openttd.org/developers/yexo/airports.hg/


If the binaries will be built with the existing build system or at least presented at http://finger.openttd.org/versions.txt and located at the usual place, I can add them to OpenTTD Auto Update.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Tue Oct 27, 2009 1:15 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Thanks for the bug report Roujin, it's fixed before the binaries were build.

richk67 wrote:
Just a quick query about the newgrf spec. In Aircraft movement states it lists 02..04 as "going to pad 1..3, respectively". Does this mean this spec is limited to 3 terminal pads?
No, using these states is fully optional. The only states with a special meaning are listed below. The complete list is there because aircraft newgrfs check for those states to use the correct graphics, so using +-the same states is advisable, but using state 02 for "going to some pad" is entirely ok. In fact the only limit on the number of pads is the amount of space on the airport, pads don't need to be exactly 1 tile big.

Zuu wrote:
Yexo wrote:
Binaries will come soon, the source checked out via hg here: http://hg.openttd.org/developers/yexo/airports.hg/


If the binaries will be built with the existing build system or at least presented at http://finger.openttd.org/versions.txt and located at the usual place, I can add them to OpenTTD Auto Update.
Binaries are as of now available via http://www.openttd.org/download-airports


Top
   
PostPosted: Tue Oct 27, 2009 2:02 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Yexo wrote:
Thanks for the bug report Roujin, it's fixed before the binaries were build.
[...]
Binaries are as of now available via http://www.openttd.org/download-airports


Sorry, but I'm still getting the assert with the binary you provided (h89c8ed46, win32).

"Assertion failed at line 59 of c:\openttd\compile\src\newgrf_airport.h: airport_type < lengthof(AirportSpec::array)"

Same procedure as above to produce the assert.


(wild stab in the dark (that is, IF you are not experiencing the same): maybe you've got something in your global OpenTTD dir that's essential to run this; I'm thinking of something like a definition of the original airports in the new .grf format) Sorry if that's completely off, just ignore it then ;)

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
PostPosted: Tue Oct 27, 2009 3:24 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4551
Location: /home/sweden
Yexo wrote:
Binaries are as of now available via http://www.openttd.org/download-airports


Thanks Yexo. After a while they also shown up on http://finger.openttd.org/versions.txt, so now I have added "Last NewGRF Airports" as a target to OpenTTD Auto Update for the people using that program.


Regarding the bug Roujin posted, I also get the same crash.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Tue Oct 27, 2009 5:10 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Jul 30, 2008 12:42 pm
Posts: 277
Location: Trondheim, Norway
I also get the same crash as roujin, it appeared when I started the game in 1975 and tried to build an airport. When I started the game in 1990, I could build the commuter and diagnal airports, but I got the crash again after waiting a while (had some planes flying between the two mentioned airports).

_________________
Try my modular airports minigame!

Image


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 150 posts ]  Go to page 1 2 3 4 58 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.