Page 5 of 28

Posted: 30 May 2006 08:01
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.

Posted: 30 May 2006 10:25
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)

Posted: 01 Jun 2006 01:59
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?

Posted: 01 Jun 2006 09:18
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 ?

Posted: 02 Jun 2006 00:07
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...)

Posted: 02 Jun 2006 09:24
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

Posted: 02 Jun 2006 10:54
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.

Posted: 02 Jun 2006 20:34
by gkirilov
Frostregen, can you check if you can compile with the latest revision?

Posted: 03 Jun 2006 02:49
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

Posted: 03 Jun 2006 09:38
by gkirilov
I think you need to make new release :).
With r5082 the game crashes when I want to copy a house.

Posted: 03 Jun 2006 10:35
by Frostregen
Hmm, not for me...
Are you are using some other patches too?

Posted: 03 Jun 2006 12:27
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.

Posted: 03 Jun 2006 16:06
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.

Posted: 03 Jun 2006 23:53
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

Posted: 04 Jun 2006 04:33
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 :)

Posted: 04 Jun 2006 11:54
by skidd13
I would be cool if the icons of the menu woluld be a bit nicer, like the attatched image.

Posted: 04 Jun 2006 15:43
by Frostregen
Ok, I'll look into newgrf...

Posted: 05 Jun 2006 01:26
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)

Posted: 05 Jun 2006 08:49
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)

Posted: 05 Jun 2006 09:41
by bobingabout
STRG? that is control right? i can't remember, but is that a german keyboard?