Copy & Paste patch, reworked

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

kraZz
Engineer
Engineer
Posts: 36
Joined: 03 Jan 2008 02:08

Re: Copy & Paste patch, reworked

Post by kraZz »

the patch i had used in 0.6.3 never caused any desyncs or crashes for me or two other admins on my servers. it's still somewhat buggy, as it often left out some commands and you always had to check again what you built with it. that only happens online though, single player always works fine.

from a gameplay point of view: it often happened that i had great plans what connections i would build next but then i just thought about the several depot spots i'd need to build on the way and other repetitive tasks to do. these repetitive things don't belong to the creative (= fun) parts of the game, they are just a a hurdle you unfortunately got to jump. it often made me change my mind to not start a bigger line that would have been fun in itself, to build it but without enough depot spots so i suffered from many breakdowns or to even quit the game because it was just too annoying. i am like "playing a game should be fun, what i gotta do now isn't fun, so i'll stop right now" and just leave.
for 0.6.3 i initially found the copy-paste patch and it removed this hurdle and thus increased the fun. i am not using it for big junctions though usually, they belong to the creative part fitting it into the existing landscape is an interesting thing to do. nevertheless i do agree that other people use it to just throw a gigantic junction at some place where it wouldn't be even needed (in this size) and level much more land then necessary for it. this part of it is one of the reasons why it shouldn't go into any official version.

i don't know anything about how clean that patch is and i do think it doesn't need to go into the normal version if main coders don't see any good relation between the risks and benefits it would bring into the work version. i would just be happy if, like with 0.6.3, someone would come up with an inofficial patch i could use.
They should all be ashamed, those wo thoughtlessly make use of the miracles of science and technology, without understanding any more of them than the cow does of the botany of the plants it eats with enjoyment. (Albert Einstein)
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Copy & Paste patch, reworked

Post by Iguanna »

A couple of bugs with the 15821 version:
Copy-Paste Bug1.PNG
Copy-Paste Bug1.PNG (35.22 KiB) Viewed 4585 times
Copy-Paste Bug2.PNG
Copy-Paste Bug2.PNG (48.39 KiB) Viewed 4584 times
I also had trouble with previous versions, with crashes upon loading some templates which had just been saved and also with land not being raised/lowered in certain cases when it's set to neutral, but couldn't reproduce this. Not sure exactly what caused it - maybe the problems were fixed or maybe I didn't do whatever caused the problem when testing.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Copy & Paste patch, reworked

Post by SirkoZ »

IguannaB - did you perhaps experience any desyncs with the patch?
Bøtteknott
Engineer
Engineer
Posts: 35
Joined: 08 Jul 2008 18:43

Re: Copy & Paste patch, reworked

Post by Bøtteknott »

Will we see an update for 0,7,0? Does it work with 0,7,0?
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

Bøtteknott wrote:Will we see an update for 0,7,0?
No.
Bøtteknott wrote:Does it work with 0,7,0?
Yes. Just pick the patch for 0.7.0-RC1 - it applies without any modification to 0.7.0-RC2 and final 0.7.0 too.

Get the patch from my post in this thread about two pages ago, or simply click this link to get there:
http://www.tt-forums.net/viewtopic.php? ... 47#p773947

Apply the patch and compile...
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)
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Copy & Paste patch, reworked

Post by Iguanna »

SirkoZ wrote:IguannaB - did you perhaps experience any desyncs with the patch?
I only used it in single player, so didn't have the opportunity.

Saving a template where there is a bridge over a tunnel will cause a crash:
Edit: This only occurs with the CopyPaste_r15821.patch version of this patch. the 0.7.0 version seem ok.
Attachments
Copy-Paste Bug3.PNG
Copy-Paste Bug3.PNG (57.83 KiB) Viewed 4449 times
Crash Report.txt
(6.8 KiB) Downloaded 115 times
Last edited by Iguanna on 06 Apr 2009 15:17, edited 1 time in total.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

I tried drawing exactly the same thing as you, then copying, saving, loading and pasting the template, but no crash happened and it seems to be pasted correctly.

Weird ... have you done something that I have not in the process? Have you managed to reproduce that bug?
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)
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Copy & Paste patch, reworked

Post by Iguanna »

This was from the CopyPaste_r15821.patch, and the build I'm using has a couple of other patches, but they are very minor things, like altering some debug text, so I wouldn't expect them to have any effect. I'll compile with just copy and paste and see if it changes.

Here's the savegame anyway.

Edit: yeah it happens every time, for new games too.
Attachments
C_P Test3.sav
r15821
(146.75 KiB) Downloaded 117 times
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Copy & Paste patch, reworked

Post by Iguanna »

I tried with the 0.7.0 rc1 version, and the save/load bug didn't occur, so I assume that's what's different. The first 2 bugs I reported, with signals around the wrong way and bridges disappearing after rotation still occur in the 0.7.0 version however.

There was problem applying the 0.7.0 RC1 patch to 0.7.0 in settings.cpp with tortoise SVN (patch outdated etc), but I dunno why as the files looked the same in that section. So I copied the 3 lines across for that file and made a new patch from that for 0.7.0 (attached) and a win32 binary which is attached too.

Quick question, if someone using this binary connects to a server without C&P and desyncs, will that affect the other people on the server at all?
Attachments
copypaste_070.diff
Updated version of copypaste_070rc1.diff for OpenTTD 0.7.0
(129.16 KiB) Downloaded 279 times
0.7.0 win32 Copy and Paste.zip
copy over the 0.7.0 files and you should be good to go
(2.59 MiB) Downloaded 749 times
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

IguannaB wrote:There was problem applying the 0.7.0 RC1 patch to 0.7.0 in settings.cpp with tortoise SVN (patch outdated etc)
Weird, it worked fine for me ....
IguannaB wrote:Quick question, if someone using this binary connects to a server without C&P and desyncs, will that affect the other people on the server at all?
desync means that your game state will be different than what is on server - if the desync is due to your patches, it will be only your problem, it won't affect other people.
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)
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Copy & Paste patch, reworked

Post by Iguanna »

cool, thanks
Bilbo wrote:
IguannaB wrote:There was problem applying the 0.7.0 RC1 patch to 0.7.0 in settings.cpp with tortoise SVN (patch outdated etc)
Weird, it worked fine for me ....
Yeah, I'm not surprised, I get that all the time applying patches which sound like have worked for others no probs. If there was a button accompanying that message 'I don't care, just take your best guess' I would be a happy fella :). I've got the latest version of tortoiseSVN, 1.6 IIRC, but I'm considering finding a different SVN client for windows to see if it can merge patches any better. If anyone has any suggestions, pls let me know.
Toiski
Engineer
Engineer
Posts: 6
Joined: 04 Apr 2009 23:38

Re: Copy & Paste patch, reworked

Post by Toiski »

If I say something really stupid, it's probably because I'm new at this. This is my first time applying a patch to ottd, but all the instructions I've found have helped me mostly through. My current problem is this:

The patch by IguannaB gives me an error with settings.cpp at 1591, and I looked through the source code. I find nothing of the sort of code that was supposed to be there before the patch, at that line or anywhere else in the file. It appears the trunk has changed since that patch. What revision should I download for that patch to work?
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Copy & Paste patch, reworked

Post by Iguanna »

It's made against the 0.7.0 tag, svn://svn.openttd.org/tags/0.7.0
Toiski
Engineer
Engineer
Posts: 6
Joined: 04 Apr 2009 23:38

Re: Copy & Paste patch, reworked

Post by Toiski »

Ok, now the patch applies without problems, but when I try to compile it, I get errors with missing strings:
/home/vtoiviai/.openttd/src/0.7.0/src/lang/russian.txt:2773: warning: String name 'STR_CAN_T_COPY_SHARE_ORDER' does not exist in master file
/home/vtoiviai/.openttd/src/0.7.0/src/lang/russian.txt:2774: warning: String name 'STR_CAN_T_ADD_ORDER' does not exist in master file
/home/vtoiviai/.openttd/src/0.7.0/src/lang/russian.txt:2775: warning: String name 'STR_CAN_T_ADD_ORDER_SHARED' does not exist in master file
Which repeats for all the languages, as far as I can see. I'm sorry to crowd this topic with my problems... If I have more, should I make a topic in Problems?
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Copy & Paste patch, reworked

Post by Bilbo »

Those are not errors, merely a warnings. Just ignore them :)
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)
Toiski
Engineer
Engineer
Posts: 6
Joined: 04 Apr 2009 23:38

Re: Copy & Paste patch, reworked

Post by Toiski »

Okay, it seems to work in game mode, but in the scenario editor, a part of the c/p button appears outside of the landscaping window, and disappears if anything moves over it (looks like a graphics glitch). Is it supposed to work in the scenario editor as well?
Attachments
Screenshot of the glitch
Screenshot of the glitch
screenshot.png (5.18 KiB) Viewed 4207 times
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Copy & Paste patch, reworked

Post by Frostregen »

Yes it should work. seems like some updater lost the dialog size addition.
kraZz
Engineer
Engineer
Posts: 36
Joined: 03 Jan 2008 02:08

Re: Copy & Paste patch, reworked

Post by kraZz »

many thanks IguannaB, your win32 patch is just what i wanted, really appreciate that. it works just fine.

unfortunately it can't load my old templates, as it says they are newer. comparing some files and looking into the diff file you posted i see the 0.7.0 copy paste patch has a header with 4x4 bytes ['TMPL'], [version], [width], [height] while the templates i got use ['TMPL'], [width], [height], [version], which also explains the "newer" message - it takes the width as version which is always higher than 1 (the current internal version). also the rest of the file seems to be different.
i am a little confused, i thought i had used the copy paste patch in 0.6.3 from the same author but that does not seem to be the case or he broke his own specification.
speaking of specifications, does anybody know a place where these template formats are described? too bad i don't have the source code of the old patch anymore, i was using a binary, otherwise i could just compare the code.

i guess i will just paste my templates in 0.6.3, save the game, load it in 0.7.0 and copy them again :P
They should all be ashamed, those wo thoughtlessly make use of the miracles of science and technology, without understanding any more of them than the cow does of the botany of the plants it eats with enjoyment. (Albert Einstein)
User avatar
kyosuke1989
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 24 Mar 2008 13:04
Location: Finland

Re: Copy & Paste patch, reworked

Post by kyosuke1989 »

IguannaB wrote:I tried with the 0.7.0 rc1 version, and the save/load bug didn't occur, so I assume that's what's different. The first 2 bugs I reported, with signals around the wrong way and bridges disappearing after rotation still occur in the 0.7.0 version however.

There was problem applying the 0.7.0 RC1 patch to 0.7.0 in settings.cpp with tortoise SVN (patch outdated etc), but I dunno why as the files looked the same in that section. So I copied the 3 lines across for that file and made a new patch from that for 0.7.0 (attached) and a win32 binary which is attached too.

Quick question, if someone using this binary connects to a server without C&P and desyncs, will that affect the other people on the server at all?
Thank you very much for the binary! :bow:
maartena
Route Supervisor
Route Supervisor
Posts: 470
Joined: 11 Jul 2003 04:53
Location: California, U.S.A.

Re: Copy & Paste patch, reworked

Post by maartena »

I have been using the 0.7.0 binary (thanks for that) and played several online games over the weekend without any issues or desyncs. Of course I have a 100 Mbps link to my servers, and a 15/2 Mbps pipe to the internet, so that may make a difference. But from what I have been able to test, it looks pretty stable.
Guess what! I got a fever! And the only prescription...... is MORE COWBELL!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 14 guests