Eyecandy (rev9790)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

@DaleStan:
I never did anything with newgrf,
so I might not have figured out how this system is intended to work ;)

To 1:
Ok, if i figured it right, the normal way would be:
1. Action1 to define sprites
...now some Realsprites
2. Action2 to give the previous action1 an id
3. Action3 to connect the id from action 2 with some internal id (or new-object)
4. Action0 to change/setup some values with ID from Action3

Since new-objects are given a new computed ID anyway,
why the detour over action 2/3 ?
(action0 prop08 creates a new id, which is lastid+1, which may be referred later by action4 or action0 again)

To 2:
As above.
The special handling for category-names will be changed to
"If highest bit is set, the name is applied to the category,
to which given eyecandy(eyecandyID) belongs to"
So no need to have it right after action0 anymore.

So the only difference is: I generate the ID's via Action0-prop08,
and don't have the user to create them with action2+3
I thought this is right because of this:
The IDs are therefore free to be chosen and will in fact be allocated automatically by the patch. In action 0, you only specify IDs relative to the set, i.e. the ID of the first object type is 00, the second object type is 01 and so on.
Quote from http://wiki.ttdpatch.net/tiki-index.php ... on0Objects

To3:
This is info missing ;)
If the highest bit is not set, it is the name for the eyecandy with given eyecandyID.

I thought a default bounding box was sufficient, since eyecandy's always occupy 1 full tile, and nothing else may sit on this tile.

hmm, desert, snow and water will be added soon, forgot about this. Thanks. (Will be groundsprite=4+)

Thank you for reading this.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Frostregen wrote:To 1:
...
Yes, except that it's "GRF-specific ID", not "internal ID".
Frostregen wrote:Since new-objects are given a new computed ID anyway, why the detour over action 2/3 ?
Because your system doesn't allow different sprites depending on above/below the snow line, for example.

The question "What types of slopes can this eyecandy be built on?" can only be sanely answered with a callback, and that also requires a 1/2/3 chain.
Frostregen wrote:So the only difference is: I generate the ID's via Action0-prop08, and don't have the user to create them with action2+3
I thought this is right because of this:
The IDs are therefore free to be chosen and will in fact be allocated automatically by the patch. In action 0, you only specify IDs relative to the set, i.e. the ID of the first object type is 00, the second object type is 01 and so on.
That's the way everything except vehicles works, I think. I know it's the case for houses and industry tiles, at the very least, and they have action 2s and 3s.
It's also the case for the D0xx and DCxx TextIDs.
Frostregen wrote:Hmm, I thought a default bounding box was sufficient, since eyecandy's always occupy 1 full tile, and nothing else may sit on this tile.
How do you determine how tall to make the bounding box?

Actually, I lied about the connection between 0/3 and 4. I got it correct for vehicles, but for anything else, byte-sized TextIDs are verboten, because there's no previously existing slot to hold the text. You need to use a TTD ID, a D0xx, or a DCxx ID, depending on the desired usage, and then you connect that to the 0/3 by putting it in a property.
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
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Right...
A custom Groundsprite is always the same, which is bad...
Ok, then this action2/3 stuff will be needed.

At first i did not think of custom-groundSprites at all,
because most of the eyecandy-graphics (infra) replace the
whole tile anyway.
(Ok, if they would change depending on snow/desert it would be nice too)

Slopes:
Currently an eyecandy may be build on any slope
(except the steep ones if it needs a flatArea).
if needsFlatArea is set, it will get a foundation,
else it is placed without a foundation.

BoundingBox:
I'm always using (16, 16, 16) ;)
Currently I have no (or have not found) glitches with this.

Action4:
Wouldn't it be ok to set language-id bit 7,
and use C6xx and C7xx (+some other free ranges, i need 1024+256).
Like newstations does it (C4xx and C5xx). ?

The DCxx range is limited to 1024 in total, so i would rather use some other free space.
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Code: Select all

+static void DrawEyecandyPreview(uint xoffset, uint yoffset, uint frameWidth, uint frameHeight)
+{
+	SpriteID image;
+	uint ymod = TILE_PIXELS / 2;
+	uint xoff, yoff;
+	uint lineLen, linePos;
+	uint x, y, w, h, i;
+	Point pt;
+	
+	//We have to draw it like the real drawer would do.
+	w = _eyecandy[usedEyecandy.realEyecandy].width;
+	h = _eyecandy[usedEyecandy.realEyecandy].height;
+	
+	xoff = (w - h) * ymod; //see yoff
+	yoff = -((w + h - 2) * ymod); //todo, center it real... (1x2, 2x4 etc...)
yoff, w, h, ymod — all is unsigned, why last line is there?
Image
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Please test if eyecandy correctly work
Attachments
Release.7z
(1.25 MiB) Downloaded 331 times
Image
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

@Quark: right, should both be signed int.
The strange thing is:
I just changed it to int, and it kept working the same way as before.

Did you change anything besides this in your release.7z?
I can not test it, because of some "grf missing" errors.
Is this MiniIN, or your own multipatch build?

When my exams are finished (around mid-march) I'll continue to develop this patch.
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Frostregen wrote:@Quark: right, should both be signed int.
The strange thing is:
I just changed it to int, and it kept working the same way as before.

Did you change anything besides this in your release.7z?
I can not test it, because of some "grf missing" errors.
Is this MiniIN, or your own multipatch build?

When my exams are finished (around mid-march) I'll continue to develop this patch.
I change minus to plus in variable declaration and change sign on every use of yoff. Maybe error is invisible there or it's compensated by second error, anyway there was at least one error.
In my build your patch was merged with MiniIN, trunk r.7865 and some additional patches.
Image
Chicago Rail Authority
Traffic Manager
Traffic Manager
Posts: 134
Joined: 09 Nov 2006 23:38

Post by Chicago Rail Authority »

Could you post a version that is either lined-up with a recent nightly, or the latest RC? I tried to load the file(s) you posted, but I'm not interested in shopping around to find all of the missing pieces that are req'd to make this run...

Thanks
Many thanks to those who make OTTD and TTDP possible.
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Frostregen wrote:I can not test it, because of some "grf missing" errors.
Is this MiniIN, or your own multipatch build?
It's something that I currently describe as MiniIN2, because it is more that MiniIN, but not that multipatch yet.
If some grf is missing try installing all grfs from MiniIN. It's based on MiniIN.
Image
hiperboreo93
Engineer
Engineer
Posts: 4
Joined: 15 Mar 2007 12:28

Re: Eyecandy (rev9790)

Post by hiperboreo93 »

I liked this feature very much, buy it seems to be forgotten in time

hope someone else will keep working on this one (I know very little about c++)

sorry for the bad english.
-------
sorry for the bad english
y a pesar de que el español es mi lengua nativa, van a tener que perdonar las faltas de ortografia.. jajajaja
User avatar
Sir A. Boey
Transport Coordinator
Transport Coordinator
Posts: 299
Joined: 17 Nov 2006 17:40
Location: Everywhere and nowhere

Re: Eyecandy (rev9790)

Post by Sir A. Boey »

Hello,

I really like this idea, but I wanted to add a suggestion...
Why not add a buffer which is NOT a station but a single track like in real life...
Also why not create a track with several carriages on them, like they do at most of the
traindepots... The traincarriages are left there when they are for example useless...

I will look for a picture to show you guys what I mean ok?

greetz
Image
_____________# If you believe in it, you can achieve it" # ____________
__________________# Check out My Closed Platform #___________________
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Eyecandy (rev9790)

Post by Wolf01 »

is possible to do all with this patch, it only needs the grf loading system
if you look at the picture in the first page, the city is entirely made by hand (roads apart) with this patch
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Eyecandy (rev9790)

Post by athanasios »

Sir A. Boey wrote:I will look for a picture to show you guys what I mean ok?
Attachments
retired.png
retired.png (155.78 KiB) Viewed 5666 times
200611301705474714836_hd.JPG
200611301705474714836_hd.JPG (35.1 KiB) Viewed 5665 times
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Sir A. Boey
Transport Coordinator
Transport Coordinator
Posts: 299
Joined: 17 Nov 2006 17:40
Location: Everywhere and nowhere

Re: Eyecandy (rev9790)

Post by Sir A. Boey »

yes that's what I meant...

Great that this could be possible, this could make my games more realistical...
Image
_____________# If you believe in it, you can achieve it" # ____________
__________________# Check out My Closed Platform #___________________
twistid
Engineer
Engineer
Posts: 67
Joined: 26 Dec 2007 00:53
Location: AC, NZ

Re: Eyecandy (rev9790)

Post by twistid »

heys guys, noob question but how do i install and use this patch?...iv tried downloading it and installing it but it wont let me start the game at all..

any help would be cool.

Thanks
one billion daleks
Traffic Manager
Traffic Manager
Posts: 198
Joined: 31 Oct 2007 10:54
Location: a/c closed

Re: Eyecandy (rev9790)

Post by one billion daleks »

Yeah, I had the same problem when I tried it yesterday ... it doesn't seem to compile successfully with the latest versions of OTTD. Note though, that this thread is now exactly a year old, so possibly the patch is no longer compatible and is not being maintained...

However, there is an eyecandy patch that works posted in http://www.tt-forums.net/viewtopic.php?f=32&t=35468 - but it only works within the Scenario Editor unfortunately ... :(
twistid
Engineer
Engineer
Posts: 67
Joined: 26 Dec 2007 00:53
Location: AC, NZ

Re: Eyecandy (rev9790)

Post by twistid »

ohh i see....thanks for the link though! :)
User avatar
Sir A. Boey
Transport Coordinator
Transport Coordinator
Posts: 299
Joined: 17 Nov 2006 17:40
Location: Everywhere and nowhere

Re: Eyecandy (rev9790)

Post by Sir A. Boey »

There's also something else take a look with the search-engine and look for
"pseudo-lok" or "-look"...

You can do such thing allready with a GRF file but I'll like the patch to BTW 8)

Looks really realistic If you take a look at the Belgian railroads just before you enter Ostend.

Edit: They don't cost you anything
Attachments
United_Transport_Ltd.,_16th_May_2015.png
(374.82 KiB) Downloaded 481 times
Image
_____________# If you believe in it, you can achieve it" # ____________
__________________# Check out My Closed Platform #___________________
User avatar
stunt_monkey
Engineer
Engineer
Posts: 48
Joined: 15 Feb 2008 09:16
Location: Hoppers Crossing, Australia
Contact:

Re: Eyecandy (rev9790)

Post by stunt_monkey »

I'm Impressed, this gives those bored players opportunities to build useless junk and waste the billions of dollars
Ive Been Playing Computer Games Since 1992, And I Love It
Batti5
Transport Coordinator
Transport Coordinator
Posts: 279
Joined: 06 Aug 2007 17:37

Re: Eyecandy (rev9790)

Post by Batti5 »

The exe in the EYE_9790.rar is corrupted.
Wish to earn some money for free just by viewing some advertisment? Click this banner for more info.
Image
It is Legal.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests