EDIT: I know it's a bit messy over here

I just was in wiki exhibition again and looked those pictures.. They are made by various artists, thereby different. In-example the http://wiki.openttd.org/index.php/Image:Red_Flats_E.png I think should be 2x2 tiles, not 1x1 as original, for scalings sake. Same goes for http://wiki.openttd.org/index.php/Image ... _-_001.PNG. It just doesn't look good, when compared to other 1x1 buildings. The football stadium ( http://wiki.openttd.org/index.php/Image:Tag-stadium.jpg ) should even be 4x4 or 3x3, not 2x2.
http://wiki.openttd.org/images/b/b1/Gor ... ffices.png should be 4x4 too, I think. there are lot of examples. So I want to know from devs or somebody, that will there be major changes in that direction, so they wouldn't be sprite replacements, but new houses, which replace old ones. The tar or whatever it is in future, should contain only few things
1. The sprite
2. The sprite, when the new zoom-in levels are introduced. -> sprite with more details etc.
3. A text file. (extension may be ottdg -> OpenTTDGraphic or ogrf...Many possibilities

If it would be possible to branch it, I would be glad, but if not, then I don't mind it either. I know it would be a hell lot of a work


Enjoy reading, because it's long and messy text below

Lord
Anyway....the whole concept ->
All files are simple text files with extensions:
- *.ottd - some general things..Yet not sure
*.ottdh - various header files, used as templates for things like defining official grass tiles, pavement for graphics. Also usable for any other things etc
*.ottdg - defines new graphics and their props
*.ottdi - defines IDs for various things. In this example it's for buildings in town
other *.ottd*'s for any use.
*.png - good old 32bpp-sprites are pngs
Let's say there is a file, that defines the pavements for all town-centre houses. It would look like following..
template_house.ottdh - it's location is ../data/templates/template_house.ottdh
Code: Select all
//OpenTTD header file
#define ('general_pavement')
id=000001
layout=1
sprites {
1 [
url="pavement/1.png"
elevation=0
]
}
#enddef
//end of template
Now there is a list of house-ids so the engine knows what to replace
id_house.ottdi it's loacation is in ../data/id/
//OpenTTD ID defining file
#define_id (
Shops_and_offices_temperate=000002
Flats_tropical=000003
Houses_temperate=000004
)
#enddef
//end of file
Now we want to make a new house, which would replace Shops and Offices in temperate OpenTTD. Let's say there is some *.ottd file, which is *big* and defines all default buildings and other objects. The id_house.oddti is then just reference for new graphics makers.
myawesomehouse.ottdg - it's location is in the ../data/new_graphics/
Code: Select all
//OpenTTD New Graphic File
#include
{
url="../templates/template_general.ottdh"
}
#define_props {
gfx_id=LordAzamath00 //Should be unique, like in "real" grfs
gfx_name="My awesome render"
author="LordAzamath","Azamath","Lord","LA"
type=house
name="Shops and offices"
accept=passengers(1/8),mail(1/5),goods(4/6)
generate=passengers(5/8),mail(1/10)
replace=000002
house_type=centre
intro_year=1965
del_year=1978
//Here they are just most common. It may come in other years too
layout=1/2, 3/2, 4/2, ; 5/2, 6/2, 7/2
}
#enddef
#define_sprites {
1 [
url="1.png"
elevation=100
]
2 [
('general_pavement')
]
}
3 [
url="3.png"
elevation=100
]
4 [
url="4.png"
elevation=100
]
5 [
url="5.png"
elevation=100
]
6 [
url="6.png"
elevation=100
]
7 [
url="7.png"
elevation=100
]}
#enddef
Include command should order the parser to include those template files.
template_house.ottdh is used for pavement (look at sprites, sprite nr2. It uses ('general_pavement') from template_house)
id_house.ottdi is used for "replace_id=000002"
Define_props will define the properties for the object
gfx_id is something like in action8 id in real grfs. It's a string
gfx_name is the one it shows in "Configure GRFs" right now
Author is author. Multiple authors are separated with commas. They're strings, so should be between quotation-marks
type is the object type, you'll going to define. In this case it's house
avilable types are house, industry, track, general, ground
name is the one it shows in-game
acceptance-produce is common for industries and houses, but it's not limited to them. So if one want's (s)he can make ie. rails produce pax. It's the same thing as it shows in-game right now.
replace is the id, defined in id_house.ottdh, of which it object it might replace. If the value is false, then there must follow "add=999999" or soemthing like that. add function does the same thing as #define_id, but it's inside #define_props
layout is the layout of the object. If one one tile there are multiple sprites, they're separated by slash (/). The beginning of next tile is defined by comma (,) and new row by semi-colon (;). If there is 0 between commas, then it means there is no part of object in-tile. This should make possible irregular houses like "layout=1/2, 0, 4/2, ; 5/2, 0, 7/2" it means, that there are two 1x2 buildings in one object, but they're parted by one 1x2 space, where could be whatever...roads, rail, stations...even other houses.
#define_sprites will define sprites
1 is the sprite number, used in layout.
url is the location of the sprite.
elevation, is again for layout. It describes what sprite should be in front and what should be in background. Also for tunnels, it defines the place where a vehicle should go behind tunnel entrance. There could be even a standard elevation for i.e roads - road vehicles can only drive on that type of object, what has proper elevation. That makes possible to make "over-road" buildings. One value for roads is 50. And the other 51. A bus can ride on both of these, but a on elevation 50 it looks on road, on 51 it looks behind road, or a building. The layout would be road/building, whereas the road has elevation of 50 and building in that specific sprite 51. It's like a custom tunnel. For steam/diesel trains it could be 52,53,58,59...maglev - 54,55 monorail - 56,57, electrified trains only 58,59 It allows to create custom rails and different roads. Elevation over 100 isn't anymore special and is just - the greater the nubmber, the more front the sprite is. Elevation 0 is special for pavement under various buildings If there are two sprites for let's say steam trains then the elevations are 52 and 52+1
Another example for a steamer.
now some things must be added for general template
//OpenTTD header file
Code: Select all
#define ('general_pavement')
id=000001
layout=1
sprites {
1 [
url="pavement/1.png"
elevation=0
]
}
#enddef
#define ('rail')
id=000005
layout=1/2
sprites {
1 [
url="rail/steam_diesel/1.png"
elevation=52+1
]
2 [
url="rail/1.png"
elevation=52
]
}
#enddef
//here the elevation defines it's a place, where trains can go. It's special elevation value.
//end of template
myawesometrain.ottdg - it's location is in the ../data/new_graphics/
Code: Select all
//OpenTTD New Graphic File
#include
{
url="../templates/template_general.ottdh"
}
#define_props {
gfx_id=LordAzamath01 //Should be unique, like in "real" grfs
gfx_name="My awesome train"
author="LordAzamath","Azamath","Lord","LA"
type=train
name="ES 101 DMA"
add=012345
train_speed=120
//speed is mph
train_price=64 250
//price is in £
train_weight=80
//always in tonnes
train_tractive_effort=2400
//in kN
intro_year=1976
del_year=2002
vehicle_reliability=86
//in percents (%)
life=18
//in years
capacity=passengers(36)
//if no capacity the it's 'false'
layout=1
}
#enddef
#define_sprites {
1 [
url="1.png"
elevation=52,53,58,59
]
//again special values, so it can go on standard rail, under std rail, and same for electric rails.
#enddef
Sorry for the text being very messy. It originated from reply to a blender thread, and the my thoughts only evolved


EDIT: I forgot to make some things like introduction years, weight and speed for trains and stuff. Now repaired

Lord