Tile measurement tool [v.8]

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

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

sorry, double post
Last edited by MeusH on 17 Apr 2006 15:45, edited 1 time in total.

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Version 4 is out.

There are no slight bugs except measuring height. Now it's up to you to make decissions, please :) I mean, suggestions are welcome:
  • Colour - what should be the colour of measurement? Currently it's light blue.

    Behaviour - v4 shows only when shift is pressed. Would you like it as patch-option? Personally I see point of it only when pressing shift, but you are the players.

    Small distances - do you want information like area = 1x1 or length = 1? I think I'd hide it, but again, you are the players, and you may want to see such a info.

    Autorail, diagonal directions - you think it is allright as it is or the measurement is too big by one tile?
Attachments
measurement_4.patch
r4457
(16.73 KiB) Downloaded 252 times
measurement_4_win32.rar
Win32 binary
(496.92 KiB) Downloaded 198 times

gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Well nice to see a attached win32 exe but i prefer a picture to look at myself :)

I think show it without shift is better, but a patch option would be good too. So the User can switch between "off", "Always on" and "when shift pressed"

Small distances and areas are not needed. I read somewhere that humans can count to 4 with one look, if is has more then 4 you begin to count each. So i think you can let it disabled for small distances and areas

edit 1: stupid question: what version of lang files are used? damn win32 exe .. i want not to compile it myself today :( But i have to if i want to test since they are not included in the archive

edit 2: looks nice, the color is ok i think. just fixing some bugs :)

yesterday i found something in the suggestion forum:
http://www.tt-forums.net/viewtopic.php?p=283401#283401

maybe you can implement that too, would be nice :)

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

To encourage you to post ideas, here you have some screenshots :wink:
Attachments
measurement4.png
measurement4.png (332.09 KiB) Viewed 5127 times

User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

What about changing the light-blue to red or black?
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

I'll take a look how does it look red, but I think it will be black, as peter1138 suggested, too.

How about short distances? Do we need info like Area: 1x1 or Length: 1?

User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

MeusH wrote:I'll take a look how does it look red, but I think it will be black, as peter1138 suggested, too.

How about short distances? Do we need info like Area: 1x1 or Length: 1?
Yes, that would even have a positive side effect: You don't need an if-statement like this anymore:

if(distance == 1)
{
// dont display
}

:P
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

Can you add a cost "preview"? (mostly for the tracks)
Does this work for the stations too?
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.

User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

Meush, I compiled r4478 with your patch and MSVC6 showed me these warnings in attached text-file. A while ago I had the same warnings just with clean SVN source, you can find it in this topic: http://tt-forums.net/viewtopic.php?t=22 ... ight=c4096

----------------------------------------------------------------------------------------

And I think it still counts wrong? See attached image
Attachments
meush_compile_log.txt
(6.92 KiB) Downloaded 260 times
meush_measure.png
meush_measure.png (25.78 KiB) Viewed 5059 times
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

ganzpopp
Engineer
Engineer
Posts: 46
Joined: 20 Oct 2004 20:36
Location: The Netherlands

Post by ganzpopp »

gkirilov wrote:Can you add a cost "preview"? (mostly for the tracks)
Does this work for the stations too?
This would be very nice! I think that's even more useful than the length/height/area measurements! Overall, it's a good patch.

Does it also work for tunnels? (do not have time to test). Next to this, it looks best, I think, when all characters are black.

User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

ganzpopp wrote:
gkirilov wrote:Can you add a cost "preview"? (mostly for the tracks)
Does this work for the stations too?
This would be very nice! I think that's even more useful than the length/height/area measurements! Overall, it's a good patch.

Does it also work for tunnels? (do not have time to test). Next to this, it looks best, I think, when all characters are black.
I did a quick hack some time ago to have a full-featured autorail with red tiles where it can't be built, etc. The same principle would apply to the cost-preview. The problem is that this would make it pretty CPU-intensive since for every drag you will have to execute the build command in query mode.
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."

Bot_40
Engineer
Engineer
Posts: 105
Joined: 27 Jan 2005 18:56
Contact:

Post by Bot_40 »

I still think this should be 12x5; the area of land you are flattening rather than the number of grid points. I think the current reading is rather confusing; if you were trying to flatten land for a 13x6 station, for example.

(in fact I can't think of a single case right now where 13x6 is more logical than 12x5...are there any times when you are not flattening land for the purpose of building something on it?)
Attachments
landheight.png
landheight.png (49.5 KiB) Viewed 5005 times

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Hmm. Bot_40: You faced me against a big problem. Many tools use presizing, but the measurements must be changed (-1) for one tool. I'll think on how to fix that.

Grilkov and Ganzpopp: Just like Darkvater said, this may result in bad performace. Imagine station building processed 30 times per second just to show the result, which is the price. Shift+Click is a good behaviour IMO.

Ganzpopp: It works for tunnels and docks, too - Why for docks? Because docks use the same functions as tunnels.

webfreakz.nl: Was this serious? Such a statement doesn't hurt anybody, but IMO information about length = 1 is ridiculous.


Thanks for all comments and suggestions, keep up :)

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

MeusH wrote:Grilkov and Ganzpopp: Just like Darkvater said, this may result in bad performace. Imagine station building processed 30 times per second just to show the result, which is the price. Shift+Click is a good behaviour IMO.
Slightly over thirty-seven times, actually. Once every 27 ms.
It might be possible to only recalculate every time the mouse moved; this might reduce processor usage. Not that I think this is a good idea. Shift-click exists for a reason.
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
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

Meush, could you update this patch?
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Yes, webfreakz.nl :)

Expect something in two weeks. Now I'll be gone on holidays and I may do some coding when the weather is bad.

User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

Ah great!

If you've not already left us: happy holidays ;)
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

I'm still here, and I'd like to show you new version of the patch.

What has changed? Not much, but what else should be changed? (this was the question to you, people, please reply with suggestions. But please do so fast, as I'm leaving really very soon)

The height difference is now counted (more) properly - It takes under account possible usage of "build on slopes" feature.

I haven't touched autorail yet, but I'll do it, and maybye I'll even post version 6 of the patch.

From the visual side, the tooltip is just black and simple.

Bot_40 - I considered your suggestion, and I'll do my best to fix the area measurement, but I don't promise anything. It may be either very simple or impossible. Time will reveal everything.

Also I know the code is messy somewhere. Like comments, or not needed {BLACK} in english.txt. But this is just in case you want other color than black, like red or something
Attachments
measurement_5.patch
r5442
(16.2 KiB) Downloaded 205 times

User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

I get the following errors while compiling using MSVS2005 r:
music_gui.c
misc_gui.c
.\misc_gui.c(679) : error C2220: warning treated as error - no 'object' file generated
.\misc_gui.c(679) : warning C4013: 'GetStringPtr' undefined; assuming extern returning int
.\misc_gui.c(679) : warning C4047: '=' : 'const unsigned char *' differs in levels of indirection from 'int'
main_gui.c
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

That's something wrong with your compiler, I think.
It says it can't generate "object file". I think it wants to create a file with extension .o, but I'm not sure.

Check write permissions and your drive space (Thanks Eddi)

And I didn't touch that lines recently...

Locked

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests