Build Templates (Copy&Paste) (r13911 + 0.6.3 + 0.6.2)
Moderator: OpenTTD Developers
Frostregen, have you tested it in multiplayer game?
I'm afraid sending many commands may clog the connections, so I came up with idea to change the internal behaviour of your patch.
I know this may be a big change, but it would greatly reduce amount of commands sent to minimum. Read: 1.
I imagine player sending a command "copy" with parameters "from x y width height" and "to x y width height". This way every client would receive only one command, and all the copypasting work would be done on client's machine.
Keep in mind that if your patch makes multiplayer play impossible, both players and developers won't be happy merging it. Read: it wouldn't get committed.
I'm afraid sending many commands may clog the connections, so I came up with idea to change the internal behaviour of your patch.
I know this may be a big change, but it would greatly reduce amount of commands sent to minimum. Read: 1.
I imagine player sending a command "copy" with parameters "from x y width height" and "to x y width height". This way every client would receive only one command, and all the copypasting work would be done on client's machine.
Keep in mind that if your patch makes multiplayer play impossible, both players and developers won't be happy merging it. Read: it wouldn't get committed.
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
@Mr.X:
Would be nice indeed, but this has to wait until the rest works
@gigajum:
This would not prevent the single Prices from being displayed.
But I'll see what I can do.
Current Status:
Roads implemented, different railtypes implemented.
Would be nice indeed, but this has to wait until the rest works
@gigajum:
This would not prevent the single Prices from being displayed.
But I'll see what I can do.
Current Status:
Roads implemented, different railtypes implemented.
- Attachments
-
- Nindinghattan Transport, 25. Feb 2023.png (48.62 KiB) Viewed 9993 times
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
Yeah MeusH, your right.MeusH wrote:Frostregen, have you tested it in multiplayer game?
I'm afraid sending many commands may clog the connections, so I came up with idea to change the internal behaviour of your patch.
I know this may be a big change, but it would greatly reduce amount of commands sent to minimum. Read: 1.
I imagine player sending a command "copy" with parameters "from x y width height" and "to x y width height". This way every client would receive only one command, and all the copypasting work would be done on client's machine.
Keep in mind that if your patch makes multiplayer play impossible, both players and developers won't be happy merging it. Read: it wouldn't get committed.
According to Meus: i think he calls every build command seperated. So he can't prevent the textoutput. That is the wrong way to to the job. If you post a current diff file someone can help, but without you get it done but it's useless due to the wrong usage of the openttd internal DoCommand system. (imo)Frostregen wrote:@gigajum:
This would not prevent the single Prices from being displayed.
But I'll see what I can do.
No, they don't. Railtype comes whenever the first engine of that type does, and that can happen a year early for one player.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
I did not test it, if a DoCommandP may build it, it is possible.What happens if you try to copy a competitor's layout, and you don't have access to the railtype yet?
But it should be useless anyway, since you dont have a train to run on it
Should be 1 line of code to prevent it.
@MeusH:
I did not test it with mutliplayer.
There are some problems with the "one command" approach:
-You could only supply the selection (starttile - endtile) parameters.
If someone changes something within this area, your copy would change too.
Currently I store the changes in some array's, so they are independent from the map, after copy. (See next point)
-May work for a copy&paste feature, but I started this with the Template feature in my mind. (Save+Load your copied areas)
If there is a possibility to delay the execution (like AI), this should not clog a network game.
It should be not much work to move it from the current implementation to a network friendly version. I'll try both.
At the moment the code is a bit messy, since i have to figure out how to access the map, and how the DoCommands work. (Signals are strange...)
When this is cleaned up a bit, i will post a diff file.
I guess I need some help later anyway. I tried to move the code into a new sourcefile, but got only header/compilation problems... So currently it stays in terraform_gui.c which is not nice.
If you're using make to build:
grep -n terraform_gui.c Makefile
You'll get output that starts with a line number. Add the new source file somewhere near that line number.
If you're using basically anything else, add the new source file to the project file.
grep -n terraform_gui.c Makefile
You'll get output that starts with a line number. Add the new source file somewhere near that line number.
If you're using basically anything else, add the new source file to the project file.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
sure, also i tought this, but on a multiplayer game, one player accepted the first monorail engine in the blue popup, but i also had the monorail without engines for a year (i'm sure of this because this player was playing on the pc that is about at 1meter of distance from my pc )DaleStan wrote:No, they don't. Railtype comes whenever the first engine of that type does, and that can happen a year early for one player.
Frostregen, can you include this also to the scenario editor?
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
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.
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.
If the button exists in the scenario editor it should not be any problem. He only needs to move the two buttons from the rail construction to the landscaping menu and you can use it in the editor, since rail construction is not available in the editor (better place for them IMO).gkirilov wrote:Frostregen, can you include this also to the scenario editor?
I need it for the road constuction.
But anyway it can copy only the things you can build and you can not build rails in the editor.
I also think that the position of this is in the landscaping bar.
I shortcut key would also be nice
But anyway it can copy only the things you can build and you can not build rails in the editor.
I also think that the position of this is in the landscaping bar.
I shortcut key would also be nice
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
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.
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.
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
The Buttons already moved to the landscaping toolbar.
I'll include it in the scenario editor too. (Only for landscape height there)
Latest addition:
Signals implemented *finally*
Implemented:
-Landscape (Height)
-Rail
-Road (+Rail/Road Crossings)
-Tunnels (Rail+Road)
-Signals
Missing:
-Bridges
-Stations
-Depots
-Waypoints
I'll include it in the scenario editor too. (Only for landscape height there)
Latest addition:
Signals implemented *finally*
Implemented:
-Landscape (Height)
-Rail
-Road (+Rail/Road Crossings)
-Tunnels (Rail+Road)
-Signals
Missing:
-Bridges
-Stations
-Depots
-Waypoints
- Attachments
-
- Copying a large 4way crossing
- Frost Transport, 21. Mär 2005.png (147.5 KiB) Viewed 1382 times
Can you make it also for duplicating roads in the scenario editor?Frostregen wrote: I'll include it in the scenario editor too. (Only for landscape height there)
Implemented:
-Landscape (Height)
-Rail
-Road (+Rail/Road Crossings)
-Tunnels (Rail+Road)
-Signals
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
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.
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.
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
-
- Engineer
- Posts: 34
- Joined: 10 May 2006 14:09
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
@Drummer:
This delay, like the AI would be my favorite way to do it:
->Looks nice
->Reduced network traffic
But first i have to get it working for all possible buildable things.
News:
Bridges done.
Next:
-Stations
-Depots
-Waypoints
This delay, like the AI would be my favorite way to do it:
->Looks nice
->Reduced network traffic
But first i have to get it working for all possible buildable things.
News:
Bridges done.
Next:
-Stations
-Depots
-Waypoints
- Attachments
-
- Lutown Transport, 27. Jun 2023.png (55.77 KiB) Viewed 9494 times
Frostgen,
Looking pretty sweet here.
About delaying, wouldn't it just be possible to use a standard C timer which would trigger the next build event when the time is up. It has the advantage that the speed could also be set. Or is there some sort of syncronization problem I'm not aware of?
Oh and a couple of suggestions to keep in mind for future versions:
1) Rotation. Allow what's in your buffer to be rotated 90 degress in either direction or 180 degrees.
2) A "ghost" image of what you have copied so you can see the outcome before you past.
Not commenting on the difficulty of these options and I certainly think they are extras rather than the main course.
Keep up the good work! Oh, and keep your work updated to the trunk. That thing seems to be updated more and more every day.
-Hazelrah
Looking pretty sweet here.
About delaying, wouldn't it just be possible to use a standard C timer which would trigger the next build event when the time is up. It has the advantage that the speed could also be set. Or is there some sort of syncronization problem I'm not aware of?
Oh and a couple of suggestions to keep in mind for future versions:
1) Rotation. Allow what's in your buffer to be rotated 90 degress in either direction or 180 degrees.
2) A "ghost" image of what you have copied so you can see the outcome before you past.
Not commenting on the difficulty of these options and I certainly think they are extras rather than the main course.
Keep up the good work! Oh, and keep your work updated to the trunk. That thing seems to be updated more and more every day.
-Hazelrah
Why not use the game internal timer (_tick_counter)?Hazelrah wrote: About delaying, wouldn't it just be possible to use a standard C timer which would trigger the next build event when the time is up. It has the advantage that the speed could also be set. Or is there some sort of syncronization problem I'm not aware of?
An array should not be hard to rotate, equal if a 1D or 2D array is usedHazelrah wrote: 1) Rotation. Allow what's in your buffer to be rotated 90 degress in either direction or 180 degrees.
i think this is not possible currently, since there is no where a preview mode. But nice suggestion for a own patchHazelrah wrote: 2) A "ghost" image of what you have copied so you can see the outcome before you past.
Who is online
Users browsing this forum: No registered users and 5 guests