Build Templates (Copy&Paste) (r13911 + 0.6.3 + 0.6.2)

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

Post Reply
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

I didn't mean it should clear all tiles, just those that get a track... then you could paste a load-balancer directly into the mainline, for example.
I wouldn't want it to clear every tile needed for terraforming, that looks too unpredictable to me, at least without preview (we wont have that for a while, I guess)...
Speaking of preview - would it be possible to copy the screen (bitmap) when copying a template ? Then storing the bitmap with the template and display it ontop of the white rectangles when pasting... that's no exact preview of course but it would give an idea of what you're going to paste ;) I've got no idea whether ottd supports bitmap-overlays like this, and totation might be a problem here, too.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Ok, done.
I need some feedback, if this should be an option.

Yes, preview will take a while. (And should be another patch project, as this has many uses.)

EDIT: Terrain restoration seems broken within this release. (is fixed in next)
Last edited by Frostregen on 02 Jun 2006 00:10, edited 1 time in total.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Features:
-Delayed paste in Multiplayer. Tested on Brianetta's server. Sorry for destroying some landscape ;)
-Instant paste in Singleplayer.

Notes:
-Terrain restoration fixed.

Delayed copy&paste is implemented via a "DoCommandP queue".
Instead of executing the command instantly, it is put into the queue.
This queue is processing 1 Command every 10 "_tick_counter".
This value may need some tweaking. maybe dynamic to some frame-lag relative value? Or some network tick, instead of frame-tick?
Last edited by Frostregen on 02 Jun 2006 00:10, edited 1 time in total.
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

It works !
That's good news. :)

I noticed that the gui doesn't update itself upon loading a template. You have to close it and open it again for the paste-button to be active.
What about adding a configure-patches-variable for the command-queue-speed ?
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Changes:
-Twice as fast Paste in Multiplayer.
-fix copy&paste "half hill"
-fix Disabled-State of Buttons.
-fix double build of bridges/tunnels
-fix hold shift while paste
-Feature: added toolbar to scenario editor


DONE:

DONE-> paste: seperate "rebuild signals" from "rebuild rails" to have some time between rail<->signal build. Allows for much faster rebuild in multiplayer
DONE-> load: check widget disabled state on template load + unclick buttons slower
DONE-> CQ: paste side terrain: clamp to right, or up. if applicable. (paste "half hill")
DONE-> CQ: fix tunnel/bridge double build (->separate beginning and end...)
DONE-> CQ: Check needed Command amount. Don't execute, if queue has insufficient space. (Do a "testrun" and count commands used)
DONE-> CQ: fix hold shift while replay (why is shift checked within DoCommand?!?!?) (->set to false during queue exec)


TODO:
-> CQ: clear queue on abort/load game.
-> CQ: "stop paste" / "clear Queue" button?
-> Add 4 "Convert Rail buttons" all unclicked for template rail. if one is checked, convert(paste) all rail to this type.
-> Add Button: Continue on Error? (if one command fails, pasting is stopped.)
-> Tunnel end out of selection (+ Terrain is restored properly check)
-> Preview: Look into "Viewport" Code - different map array? - mini renderer?

-> CP Station (too complex atm...)
User avatar
proudmoore
Director
Director
Posts: 575
Joined: 01 Jun 2005 18:07

Post by proudmoore »

This patch is absolutely amazing!
Thanks very much Frostregen :D

I attached something to sorta prove it - i knockedoff that 1.38 million population city in 15 minutes using this patch - by copying a huge patch of 2*2 road grid. When i made the 1.5 million population one (did i mention that in this topic?), it took me several days!

Unfortunately, the version of OTTD i made it in (the one from the reply abve this) doesn;tlet me take PNG screenshots - so i only attached the scenario
Attachments
Massive city - 256.scn
City over 256*256 map - almost 1.4 million population
(32.3 KiB) Downloaded 318 times
For Knowledge, Civilisation, and Chocolate Waffles!
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Cygwin does not like png...somehow :-/
It is on my todo list...either switch to a different compilerset,
or get cygwin to compile with png.
Last edited by Frostregen on 03 Jun 2006 12:31, edited 1 time in total.
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

Frostregen, can you check if you can compile with the latest revision?
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.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Only some minor changes were necessary. It even simplified the code a little, because I don't have to specially treat road/rail under bridges :)

Changes:
-Restore+bulldoze land above a tunnel.
-Necessary changes for bridge_trunk
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

I think you need to make new release :).
With r5082 the game crashes when I want to copy a house.
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.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Hmm, not for me...
Are you are using some other patches too?
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Thanks to Haukinger for pushing the Preview Idea :)

DONE-> Simple Preview
DONE-> Limit CopyArea to MAX_COPY size... (== 64x64)
DONE-> CQ: clear queue on abort/load game.
Attachments
Frieddorf Transport, 5. Mär 1984.png
Frieddorf Transport, 5. Mär 1984.png (30.19 KiB) Viewed 5313 times
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

I made a special build only with this patch.
This is the error when i try to copy road+houses or industry.
Only road works fine.
edit: this is with the version in the previous post.
Attachments
Clipboard01.png
Clipboard01.png (118.19 KiB) Viewed 5278 times
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
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

First of all thanks for the amazing patch. :bow:

But I get the same error like gkirilov as well. This happens if there are trees, buildings or vehicles in the copy area.

Another bug is that the MagLev bridges were converted into railway briddges.

build revision: 5082
os: linux
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Thanks for the error messages.
I compiled with "Disable_Asserts", so I did not notice this assertion failure...
*I'll leave it on now*

Both bugs fixed :)
Attachments
copy_paste_rev5090.patch
(74.85 KiB) Downloaded 254 times
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

I would be cool if the icons of the menu woluld be a bit nicer, like the attatched image.
Attachments
gui2.png
gui2.png (2.42 KiB) Viewed 5183 times
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Ok, I'll look into newgrf...
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Nearly done.
I took your copy, paste, and load symbol. Is it ok for you?

The arrows will change into circle arrows (standard for rotate)
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

Oh great. :D
It's OK.
The circle arrows will be of course better.

Edit:
- keyboard-shortcuts (strg+c; strg+v) would be cool
- maybe a cut function (strg+x)
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

STRG? that is control right? i can't remember, but is that a german keyboard?
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: telegramsam and 3 guests