Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri Nov 24, 2017 1:04 pm

All times are UTC




Post new topic  Reply to topic  [ 46 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Sat Jan 05, 2008 5:54 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
More progress: Advanced Terraform - Drag and Draw v3.
edit: rediff for r12968
rediff for r13116
Rediff for r12436.

There have been some changes in behavior due to some critical responses I got. Now raise and lower will behave more like the big_raise and big_lower tools in the scedit: This esentially means that a raise operation will NEVER lower a piece of land and a lower operation will NEVER raise a piece of land.
Also, clear tile (= Dynamite) and in scedit placing rocks can now be drawn (holding CTRL, as usual).

complete changelist is here: viewtopic.php?f=33&t=35627&p=662577#p662577

Download:
Attachment:
File comment: advanced terraform - drag&draw v3 for r12436
adv_terraform_dragdraw_v3_r12436.diff [28.8 KiB]
Downloaded 360 times


Screenshot (new):
Attachment:
File comment: Drag and draw
terraform.png
terraform.png [ 45.81 KiB | Viewed 19497 times ]



---
older post:

Update: Advanced Terraform - Drag and Draw v2.

Now supports rivers! :) (and some stuff fixed)
For complete Changelog see here: viewtopic.php?f=33&t=35627&p=661651#p661651

---
older post:

Okay, it is done. (for now)

I present to you: drag-and-draw terraforming for normal game and scenario editor (when terraform size is set to 1)
A bit sad that no dev has commented on the 2nd step, hope they notice this one now... :?

It includes the changes i did in the "step 2" patch (see below).

What does it do? Hold CTRL while using the lower, raise or level tool to "draw" the selected terraforming mode in the landscape.

I personally think that maybe it's even more intuitive to switch the behaviors (this new one without CTRL and the area select with CTRL pressed). If I recieve positive feedback, I might add another version with it switched.

oh, and, feedback is very welcome :)


older post:
---
Step 2 updated to revision 11861.



It does several useful things:
- enables area_terraform in scenario editor when brush size is set to 1
- adds a an error string "Can't level land here..." (1st part)
- adds a an error string "Already flat" (2nd part)
- levelling now uses the Terraform command callback like raising and lowering (this also affects the played sound; is there any logical reason to have the exploding sound for leveling?)
- modifies the levelling code so that it counts the cost on when money runs out and displays not just the required cost for one tile but the estimated cost for the whole rest
- levelling (and generally all terraform actions) in scenario editor now doesn't make tiles brown anymore

Yep, that's it, i think. Here's the patch. Have a look at it, it should work fine... if not, please post a report.



Oh and by the way, the cost estimation for leveling (and thus for all area_terraforming) does not work correctly. That is a known bug since long time in trunk. (Won't promise to fix that...)

---

original post:


Okay, I renamed this thread because the patch i'm making somewhat turned in another direction and thus its name will be "Advanced Terraform".

So what is it about? Well, the final outcome should be that in both normal game and scenario editor you can:
- drag and drop an area for lower, level or raise
- drag and draw* an area while holding CTRL for lower, level or raise

* see picture in mikeel's post below


To do this i have made a patch first that moves the scenario editor terraforming stuff from main_gui.cpp over to terraform_gui.cpp (there's even a TODO by Darkvater in there that he'd do this sometime after 0.4.0 ;) )

The second step will be to somewhat unify the scenarioeditor- and normal game terraforming. This includes the area terraform that went into trunk short time ago (but is not available in scenario editor yet).

The third and last step will be to implement the new drag-and-draw function. Can't promise anything on that, but I'll try ;)


So, I hope my restructuring/preparation patch will be committed to trunk soon, so i can build on top of that. It doesn't really change anything (if i haven't screwed up badly :roll: ) and since it only moves the scenario editor stuff, I even doubt it would break any patches.
---
update:

Okay, the first step is finished and was added to trunk. Also, some stuff was moved to the newly created terraform_cmd.cpp by Rubidium. This makes stuff more structured and nicer to work on :)
Because of the changes my little "Area Terraform in Scenario Editor" hack needs a little update.

_________________
* @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


Last edited by Roujin on Fri May 16, 2008 7:06 pm, edited 30 times in total.

Top
   
PostPosted: Sat Jan 05, 2008 1:20 pm 
Offline
Engineer
Engineer

Joined: Mon Jun 03, 2002 9:55 am
Posts: 69
argh you're too fast :shock:
i posted a suggestion but in the other thread https://www.tt-forums.net/viewtopic.php?p=653500#p653500
it could be possible (and could you be interested to make something similar?

EDIT:
Ok now the link is correct :D
I link also the image explaining what i mean
Image


Last edited by mikeel on Sat Jan 05, 2008 10:54 pm, edited 1 time in total.

Top
   
PostPosted: Sat Jan 05, 2008 7:32 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Well your link leads only to the development forum :P

but i read what you wrote there and am thinking about it. To sum it up for other readers here's what he suggested:
mikeel wrote:
thanks!
Maybe in the scenario editor would be better another system:
keeping the left button and moving the mouse it raises (or lower) all the points, without clicking each time.
this would be useful to make non-squared terrains


edit: actually i wanted to work on this today, but got distracted by my other patches...
now that my industry station naming patch is somewhat satisfying for now, i can go on with this one next ^^

One thought that i've been having is that, if i manage to implement it, it won't look exactly like your example image because there's no way to move diagonally directly.

---

Anyways, the concept that i have thought of is the following:
iirc the CTRL key is not yet used for terraforming (up, down, level)
So the normal action will be drag and drop to area terraform, like it is now for all three terraforming modes.
When holding CTRL, this changes to drag and drop to draw (like in your image) also for all three modes.

This can be made avaliable for both Scenario Editor and normal game then.

(edit: thinking about it, it might be more intuitive the other way around - no CTRL for drawing, CTRL for area; that might just make the people angry who are used to the controls how they are now. Well, that is a minor issue and could be solved with a patch option, once the stuff is all done)


Don't expect results too soon though, first some code restructuring/cleanup will be necessary before i can think of properly implementing it.

_________________
* @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
   
 Post subject: Re: Advanced Terraform
PostPosted: Sun Jan 06, 2008 9:27 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
*bump* see first post

I hope that the devs see this soon and accept it into trunk ;)

_________________
* @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: Sun Jan 06, 2008 10:06 am 
Offline
Engineer
Engineer

Joined: Mon Jun 03, 2002 9:55 am
Posts: 69
Roujin wrote:
(edit: thinking about it, it might be more intuitive the other way around - no CTRL for drawing, CTRL for area; that might just make the people angry who are used to the controls how they are now. Well, that is a minor issue and could be solved with a patch option, once the stuff is all done)

i thought the same thing: is more intuitive.


Top
   
 Post subject: Re: Advanced Terraform
PostPosted: Sun Jan 06, 2008 9:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Apr 24, 2004 10:43 am
Posts: 1967
Location: Venezia - Italia
what about like roller coaster, where you can set the size of the brush and you can toggle between flat and linked borders by going to negative size

here can be: inreasing the size works with the standard behaviour
reducing the size to negative values (the picture of the grid should be different) allows you to paint the terrain with the brush (more you go negative, bigger you get the brush)

_________________
ImageImage
ImageImage
ImageImage
newgrf tests, see: newgrf test topic, my patches: Wolf01's Hire Point
Italian TTD Forum
Wiki Page


Top
   
 Post subject: Re: Advanced Terraform
PostPosted: Mon Jan 07, 2008 12:20 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Hm, personally i don't like the idea to going to negative values. It seems so... unprofessional.

But the idea of drag-and-draw with brush size > 1 is noted. Maybe only in scenario editor though.


On behalf of my patch...
The preparation patch is in trunk now, nice. I'm now on the next step, which turns out to be more complicated than expected, since i have noticed that the way the level tool was implemented is a bit...well.. maybe hack-ish from the beginning (sorry at the creator of the level tool for saying this :oops: ).

So i plan to remake this a bit, to fix some things (e.g. correct cost estimation; this has been off for ages now).

_________________
* @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
   
 Post subject: Re: Advanced Terraform
PostPosted: Mon Jan 07, 2008 2:32 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Jun 06, 2007 9:07 pm
Posts: 1710
Location: Czech Republic
Roujin wrote:
i have noticed that the way the level tool was implemented is a bit...well.. maybe hack-ish from the beginning (sorry at the creator of the level tool for saying this :oops: ).

So i plan to remake this a bit, to fix some things (e.g. correct cost estimation; this has been off for ages now).


I stumbled upon this too when I was trying my "Raising max. height to 127" patch. The level (raise/lower land too) tool stopped working correctly on larger land heights unless I increased some constants in it. But then it started to be slow. Well, considering how that piece of code is quite incomprehensible, it may be best to rewrite it from scratch.

_________________
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)


Top
   
 Post subject: Re: Advanced Terraform
PostPosted: Mon Jan 07, 2008 8:43 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Ok, the next step is done. Patch in first post.

What it does:
- enables area_terraform in scenario editor when brush size is set to 1
- adds a string for levelling "Can't level land here..."
- levelling now uses the terraform command callback like raising and lowering (this also affects the played sound; is there any good reason to have the exploding sound for levelling anyways?)
- modifies the levelling code so that it counts the cost on when money runs out and displays not just the required cost for one tile but for the whole rest
- levelling (and generally all terraform actions) in scenario editor now doesn't make tiles brown anymore

_________________
* @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
   
 Post subject: Re: Advanced Terraform
PostPosted: Mon Jan 07, 2008 11:36 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Jun 06, 2007 9:07 pm
Posts: 1710
Location: Czech Republic
I remember older 45° rotated rectangle clearing / leveling patch:

http://tt-forums.net/viewtopic.php?f=33&t=19311

Basically, it helps when building canyon for diagonal railroad track

Perhaps either merging code from that patch or implementing the idea from it would be also nice enhancement for your patch.

_________________
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)


Top
   
 Post subject: Re: Advanced Terraform
PostPosted: Wed Jan 09, 2008 3:38 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Thanks for the tip Bilbo, i'll see if I can get some use from this ;)


Currently I am waiting for some dev to notice my "step 2" patch and maybe look at it and comment if it's suited for trunk or not and, if not, what the offending points are. ;)

---

One change that might be noticable for the average player is that I define a leveling action that did not change anything because it already has the right level as succeeded. That means a sound will be played.
I did this because the other option (defining such as "failed") would now result in an error message displayed (because I enabled error messages for levelling).
OTOH, i could define it as "failed" again, and introduce a new string "is already flat." to be used as second part of the error message. "Can't level land here... is already flat."

Question is, which of these one is preferred?

---

Edit: okay, seems i did do something wrong in step 2.

Known Bug:
- Cost estimation displays 0 when estimating something one could not afford. done

so i'll have to do another version with this fixed for my "step 2" anyways. Then i'll define a "nothing leveled" action as failed again and introduce a fitting error message. If someone doesn't like it he can still complain and i'll remove it again.

---
edit: posted new version. look in first post.

_________________
* @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 Jan 15, 2008 12:50 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
updated patch to revision 11861. download in first post.

_________________
* @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: Wed Jan 16, 2008 12:46 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
It is done :P

I made drag and draw terraforming for both normal game and scenario editor. See first post for download. :)

_________________
* @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: Wed Jan 16, 2008 1:29 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Dec 20, 2006 1:31 pm
Posts: 973
Location: Aschaffenburg
Roujin wrote:
I personally think that maybe it's even more intuitive to switch the behaviors (this new one without CTRL and the area select with CTRL pressed).

I don't think it is more intuitive:
- It would imply to change the behavior of the level-land-tool, where everyone has become used to it's current behaviour.
- IMO rectangular leveling is needed more often (when building stations etc.)
- Dragging always selects a rectangular area all over the game.

_________________
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁


Top
   
PostPosted: Wed Jan 16, 2008 1:31 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Jun 06, 2007 9:07 pm
Posts: 1710
Location: Czech Republic
And what about diagonal leveling? Is it planned to support too in this patch somewhere in the future?

_________________
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)


Top
   
PostPosted: Wed Jan 16, 2008 1:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
I'm going to compile this right away. Since I haven't used either feature yet, I should be able to tell what's more intuitive...

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Wed Jan 16, 2008 2:00 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
@frosch: yes, the biggest problem with that is that people are used to how it is currently i think.
My argument is that you can do with drag-draw what you can with area select (making a square) but not the other way around (making an individual shape), thus the "mightier" tool (freeform draw) without CTRL, and the "more handy"/"faster" tool (area select) with CTRL.
This is just my idea though, not gonna lay that down on you :roll:


@Bilbo: I didn't plan on merging this with the diagonal levelling one.. Furthermore I already reserve the CTRL for drag-draw, that's what diagonal did aswell, right? But you can draw any shape you want with drag-draw, also a diagonal shape.

_________________
* @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: Wed Jan 16, 2008 2:22 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
Well, I tried it, and must say that I prefer more advanced features under the ctrl-button. In this case, I think that the 'drag'n'draw' function is more advanced.

This would also keep the behaviour for all three buttons the same.
A single click does what the button image says: 1 up, 1 down or level.
Draging does the same as click, but for a larger area.
Ctrl does something very different. Either draw for the up/down buttons, or (in future) diagonal for level-tool.


Something different: the drag'n'draw tool doesn't behave as I expected.

Currently when I, for example, drag using the '1 up' button, it doesn't do '1 up' for every grid intersection I drag over. It goes '1 up' for the intersection where I start dragging, but for the rest it levels to whatever the new height for the first intersection is.

I'd expect that it would do '1 up' for every tile I dragged over; no levelling involved. A feature like this would allow for the creation of more natural looking mountains. In case you hold the mouse on the same spot when dragging, it would go up, up and up.
And now I think of it, I'd expect such behaviour without having to hold ctrl :wink:

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Wed Jan 16, 2008 5:04 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Jan 04, 2006 6:16 pm
Posts: 222
Location: Alphen aan den Rijn, The Netherlands
Bilbo wrote:
And what about diagonal leveling? Is it planned to support too in this patch somewhere in the future?


I was planning to update the patch I'm supporting later today. I also have an idea to solve the remaining problems.

_________________
NukeBuster

Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: irc://irc.oftc.net/transportempire !

OpenTTD patch(es): Password at join


Top
   
PostPosted: Wed Jan 16, 2008 10:05 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Jun 06, 2007 9:07 pm
Posts: 1710
Location: Czech Republic
NukeBuster wrote:
Bilbo wrote:
And what about diagonal leveling? Is it planned to support too in this patch somewhere in the future?


I was planning to update the patch I'm supporting later today. I also have an idea to solve the remaining problems.


Hmm ... by adding extra button for diagonal levelling?

Also, I spotted one ... imperfection with this patch.

If you see the attachment, you can see three lines. First was done when moving the cursor slowly, second when moving the cursor with normal speed and third when moving the cursor fast when using the "drawing" mode. Seems in one frame I moved the cursor more than one tile, so perhaps it would be better not to rise only the points but to rise the line between the points too, to achieve more consistent results not depending on the speed with which you move the moue cursor while drawing (like paint progams: if you move mouse too fast when drawing, you draw lines, not discrete points)


Attachments:
File comment: Minor glitch
screenshot#2.png
screenshot#2.png [ 8.21 KiB | Viewed 20411 times ]

_________________
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 46 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: Google Feedfetcher and 4 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-2017 phpBB Limited

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