Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Jan 16, 2019 11:23 am

All times are UTC




Post new topic  Reply to topic  [ 239 posts ]  Go to page 1 2 3 4 512 Next
Author Message
PostPosted: Fri Jan 02, 2009 10:00 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 25, 2005 8:31 pm
Posts: 25
Here's a rework of the Copy & Paste (or "Build Templates") patch that Frostregen started a while back. Since making it work with trunk, a few bugs have been fixed. Thanks should go mostly to yorick who has done much of the coding.

I'll keep this post updated for as long as I am looking at it. Please post any bugs or requests in this thread, don't bother developers with them :)

The patch is currently known to work with r16050. You can get Windows builds which will be generated when there are enough changes to test. If you build from source you will still need copypaste.grf from the original thread.

Windows build last updated: 13th April 2009 (r16050)

The patch has currently not been tested with cargodest (perhaps in future, or try it yourself!).

You can track development progress on my site. You can checkout and build using Mercurial from the same address, this is advised if you want the latest build on Linux.

Important note: The format for saved templates is currently changing constantly, so templates saved with one build may not load in future builds until a stable patch is finished.


Attachments:
copypaste-r14781.diff [120.73 KiB]
Downloaded 478 times
copypaste-r14952.diff [131.16 KiB]
Downloaded 785 times


Last edited by davidc on Mon Apr 13, 2009 6:58 pm, edited 6 times in total.
Top
   
PostPosted: Fri Jan 02, 2009 10:01 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 25, 2005 8:31 pm
Posts: 25
Features which need adding:

  • Compression for saved templates
  • Copying train stations (including newgrf tiles)

Features added:

  • Dynamic size for copy/paste area (can reduce memory usage)
  • Rotation of one-way roads
  • Versions for saved templates, to stop old builds loading new templates
  • Copying of bus stations

Known bugs:

  • Tram tracks on roads apparently aren't copied properly (reported by Roest)
  • Doesn't integrate fully with distant-joint stations

Fixed bugs:

  • Improve the command queue after this update
  • All types of signal can now be copied and pasted
  • No longer possible to bulldoze water and build on it before it floods
  • Error handling when loading templates needs improving
  • Bridge rotation fixed


Last edited by davidc on Mon Apr 13, 2009 6:59 pm, edited 3 times in total.

Top
   
PostPosted: Sat Jan 10, 2009 12:36 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Aug 23, 2007 9:20 pm
Posts: 157
Location: Portugal
200+ views and no comments? :S

I haven't tried it yet because since reinstalling Leopard I haven't being able to compile stuff (I have to work on this).

I only tried copy & paste with 0.6.1 a few months ago.

When using it in a multiplayer game I noticed that if the paste was too big it was pasted with some problems. The terrain was badly "redone" making some bridges/tunnels being built wrongly and many signals would have wrong directions and/or types. The solution was to copy things in different parts having smaller pastes. Offline singleplayer had none of this problems.

Do you thing that "Features added: Dynamic size for copy/paste area (can reduce memory usage)" would resolve this?

Thanks


Top
   
PostPosted: Sat Jan 10, 2009 1:59 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 25, 2005 8:31 pm
Posts: 25
Windows build and the patch itself updated to r14952. This includes distant-joint stations, but the patch doesn't yet make full use of them (e.g. to copy a spread out station). This will hopefully be worked on. Pasting rail stations doesn't work yet either, there are newgrf related things to think about (what happens if you only copy half of a station which has a roof spanning 2 tiles?).

Please report any problems here if you test it.

nulio: The reduced memory usage will not affect multiplayer pasting. Two things have been changed: less arrays are used to hold the data and the size is dynamic. Using less arrays helps with memory usage and makes saved templates smaller. Making the size dynamic may help with machines will less memory (e.g. you set the max copy paste area to be 16x16, not 256x256).

If you can show exactly what you mean by your problem then it may be possible to fix. However, pasting terrain will never work exactly the way everybody wants. Personally I don't like pasting terrain as invariably it makes a mess of things!

And please, only use on multiplayer servers that allow it :)


Top
   
PostPosted: Sat Jan 10, 2009 2:07 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Sep 16, 2005 12:23 pm
Posts: 1517
Skype: the_gremnon
Location: /home
I attempted to patch it in on my build.... the only patches I have, don't affect any files it does.
I got an error about CommandStruct in command_type.h being a redefenition, and after a few various attempts to solve that, I can't paste anything copied.


Top
   
PostPosted: Sat Jan 10, 2009 2:55 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 25, 2005 8:31 pm
Posts: 25
Gremnon wrote:
I attempted to patch it in on my build.... the only patches I have, don't affect any files it does.
I got an error about CommandStruct in command_type.h being a redefenition, and after a few various attempts to solve that, I can't paste anything copied.


Are you using the older patch? I have just pulled from the Mercurial trunk and patched using copypaste-r14952.diff. It compiles fine.

The older patch will definitely fail with trunk as the distant-joint stations patch introducted the CommandStruct (distant-joint and copypaste were both written by Frostregen). Pasting will fail because CMD_NO_WATER is no longer used (yorick fixed that). So it definitely sounds like you're using the older patch :)


Top
   
PostPosted: Sat Jan 10, 2009 3:11 pm 
Offline
Chairman
Chairman

Joined: Sat Jan 20, 2007 12:08 pm
Posts: 776
Location: Germany
davidc wrote:
as the distant-joint stations patch introducted the CommandStruct (distant-joint and copypaste were both written by Frostregen)

It is CommandContainer in distant join and current trunk.

_________________
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008


Last edited by PhilSophus on Sat Jan 10, 2009 3:19 pm, edited 1 time in total.

Top
   
PostPosted: Sat Jan 10, 2009 3:14 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Sep 16, 2005 12:23 pm
Posts: 1517
Skype: the_gremnon
Location: /home
Yeah, I forgot to get the new version... my bad... and yes, it was container, I misremembered it, sorry bout that


Top
   
PostPosted: Sat Jan 10, 2009 3:23 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 25, 2005 8:31 pm
Posts: 25
Gremnon wrote:
Yeah, I forgot to get the new version... my bad... and yes, it was container, I misremembered it, sorry bout that


Glad you got it working, any feedback would be great :D


Top
   
PostPosted: Sat Jan 10, 2009 3:25 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Sep 16, 2005 12:23 pm
Posts: 1517
Skype: the_gremnon
Location: /home
I'm getting there... I keep forgetting it's there actually, I'm used to not having it...
One question though, before I try it and possibly break something... I use the routemarkers patch too, does it copy the routemarkers?


Top
   
PostPosted: Sat Jan 10, 2009 3:58 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 25, 2005 8:31 pm
Posts: 25
Gremnon wrote:
I'm getting there... I keep forgetting it's there actually, I'm used to not having it...
One question though, before I try it and possibly break something... I use the routemarkers patch too, does it copy the routemarkers?


If it's not in trunk, it wont be copied. I haven't seen the routemarkers patch, so I don't know quite how it works. If it provides sensible interfaces (e.g. GetTileType and CMD_BUILD_XX) then it would be very easy to add.


Top
   
PostPosted: Sat Jan 10, 2009 4:00 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Sep 16, 2005 12:23 pm
Posts: 1517
Skype: the_gremnon
Location: /home
Ah.... useful...
Right, back to playing my game... and possibly breaking it again if I patched it wrong.


Top
   
PostPosted: Mon Jan 26, 2009 10:58 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Aug 23, 2007 9:20 pm
Posts: 157
Location: Portugal
davidc wrote:
Features which need adding:
(...)
  • Copying train stations (including newgrf tiles)

(...)

Known bugs:

  • Doesn't integrate fully with distant-joint stations

(...)


I'm looking forward to see it! :D


Top
   
PostPosted: Wed Feb 04, 2009 6:11 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Apr 03, 2008 8:18 am
Posts: 215
update to current rev


Attachments:
copypaste_r15338.diff [128.94 KiB]
Downloaded 242 times
Top
   
PostPosted: Mon Feb 16, 2009 1:40 pm 
Offline
Engineer
Engineer

Joined: Fri Feb 13, 2009 5:43 pm
Posts: 2
hey there,

is it possible to make this work in the scenario editor? so i can copy industries?


Top
   
PostPosted: Fri Feb 20, 2009 3:52 pm 
Offline
Engineer
Engineer
User avatar

Joined: Wed Feb 27, 2008 5:26 pm
Posts: 27
Location: Rostock, Germany
hey, nice patch :D
i'd love to see this in trunk!!


Top
   
PostPosted: Fri Feb 20, 2009 8:15 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Mar 01, 2008 9:16 pm
Posts: 9
Location: Victoria, BC
Hello Folks!

i'm using Mac OS X 10.5.6 - is there someone nice who can compile a running Openttd with copy and paste functionality for me?? I'm not sure how to patch the r14953 :? It would be great if there someone who could help me!!

Thanks!
toast


Top
   
PostPosted: Fri Feb 20, 2009 9:03 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9102
Location: Sol d
With MacOS it should be quite easy: Install xcode from your DVD, install svn and you can compile yourself. An extensive walk-through is found in the sticky thread in this forum.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Sat Feb 21, 2009 12:51 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1498
Location: The sunny side of Alps
Would someone pretty please update this patch to 0.7.0 ß1? ;-)

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
PostPosted: Sat Feb 21, 2009 1:04 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Apr 03, 2008 8:18 am
Posts: 215
That one still applies to current trunk (r15541), didn't test it tho.


Attachments:
copypaste_r15495.diff [128.7 KiB]
Downloaded 243 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 239 posts ]  Go to page 1 2 3 4 512 Next

All times are UTC


Who is online

Users browsing this forum: BeSt-Com and 7 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-2019 phpBB Limited

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