Build Templates (Copy&Paste) (r13911 + 0.6.3 + 0.6.2)
Moderator: OpenTTD Developers
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
i think it should be instant... depending on the delay, you can lay the same thing quicker.... also, you can instantly place REALLY long sections of tracks, if you use an AI type delay, it would definitly take longer to duplicate long stretches of tracks, why duplicate long stretched of tracks? maybe the long stretch of tracks holds cross over sections, and junctions that you might want copying at regular intervals.
am i correct in assuming that the copy paste acts like a clipboard, so once you copy the junction you can place it multiple times, untill you select another section to copy?
am i correct in assuming that the copy paste acts like a clipboard, so once you copy the junction you can place it multiple times, untill you select another section to copy?
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Rotation won't be easy with (non-square) airports, and with newstations - some of which aren't properly rotatable (such as the Toronto Grand Central one).
I'm intreted to know how the copy feature deals, or will deal, with objects which extend beyond the selected area. Examples include the selection just covering part of a larger station, covering part of an airport, or one end of a long tunnel.
I'm intreted to know how the copy feature deals, or will deal, with objects which extend beyond the selected area. Examples include the selection just covering part of a larger station, covering part of an airport, or one end of a long tunnel.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Trainstations can be cutted into smaller ones. Not clever but it works.Brianetta wrote: I'm intreted to know how the copy feature deals, or will deal, with objects which extend beyond the selected area. Examples include the selection just covering part of a larger station, covering part of an airport, or one end of a long tunnel.
Copy only half of an airports will crash the game i think. On the other side is it clever to copy only half of an airport? So i think the copy function only should copy the airport if the whole airport is copied. The same to tunnels.
Rotating an airport wont work too. So then it should not be copied too.
Something left what can't be rotated?
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
If anyone wants to play around,
here is the patch + compiled windows exe.
Stations, especially non-uniform stations will require some thinking,
so this will take a while.
Current todo list:
-check tunnel-end out of selection
-check terrain before tunnel build
-implement Stations
-implement Depots
-implement Waypoints
One problem will always be that this patch depends on nearly all game structures. So if anything changes or gets added, this patch must be updated too.
EDIT:
Maybe someone should move this thread to developement.
here is the patch + compiled windows exe.
Stations, especially non-uniform stations will require some thinking,
so this will take a while.
Current todo list:
-check tunnel-end out of selection
-check terrain before tunnel build
-implement Stations
-implement Depots
-implement Waypoints
One problem will always be that this patch depends on nearly all game structures. So if anything changes or gets added, this patch must be updated too.
EDIT:
Maybe someone should move this thread to developement.
- Attachments
-
- copypaste.png (7.33 KiB) Viewed 8333 times
Some questions:
Why are you taking 7 arrays to store the information? Why not copy tile for tile into a small copy array of struct Tile. And only check tile for beeing copied or left out. And the past function builds exact the copy array onto the map.
Why are 100x100 tiles copyable? Aren't 16x16 or 32x32 (maximal) enough?
Why are you taking 7 arrays to store the information? Why not copy tile for tile into a small copy array of struct Tile. And only check tile for beeing copied or left out. And the past function builds exact the copy array onto the map.
Why are 100x100 tiles copyable? Aren't 16x16 or 32x32 (maximal) enough?
Depends what you want to copy. If you're trying to spare the effort of duplicating a huge junction, you might need a huge copy buffer.gigajum wrote:Why are 100x100 tiles copyable? Aren't 16x16 or 32x32 (maximal) enough?
No comment on your first point, though, as I dont have the background.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
huge junction? how big? 32 tiles are about 2 screens in 800x600. with 100x100 you can copy a whole 64x64 map and almost the whole 128x128 map. if would copy something i copy that within the screen since i need to fit that copy into the destination tiles. But with 10000 tiles where is the meaning? it's waste of RAM, imo. 16x16 should be enough. if something is missing, copy the missing part, too.Brianetta wrote: Depends what you want to copy. If you're trying to spare the effort of duplicating a huge junction, you might need a huge copy buffer.
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
The tile struct uses 8Byte,
At the moment the 6 arrays I use also take 8Byte per tile.
10000 * 8Byte is around 80kb, which is not that great memory waste.
Some of my junctions are larger than 32x32, so I decided to raise the
maximum from 1000 to 10000.
But maybe 50*50 is enough, which would be 20kb of RAM.
The tileheight(difference) needs to be stored for every tile.
I did not directly copy the tile-struct, to be somewhat independent from the map array. Which I noticed later, is futile anyway.
At the moment the 6 arrays I use also take 8Byte per tile.
10000 * 8Byte is around 80kb, which is not that great memory waste.
Some of my junctions are larger than 32x32, so I decided to raise the
maximum from 1000 to 10000.
But maybe 50*50 is enough, which would be 20kb of RAM.
The tileheight(difference) needs to be stored for every tile.
I did not directly copy the tile-struct, to be somewhat independent from the map array. Which I noticed later, is futile anyway.
10000* 8Bytes * 6 array!!!!Frostregen wrote:The tile struct uses 8Byte,
At the moment the 6 arrays I use also take 8Byte per tile.
10000 * 8Byte is around 80kb, which is not that great memory waste.
Some of my junctions are larger than 32x32, so I decided to raise the
maximum from 1000 to 10000.
But maybe 50*50 is enough, which would be 20kb of RAM.
The tileheight(difference) needs to be stored for every tile.
I did not directly copy the tile-struct, to be somewhat independent from the map array. Which I noticed later, is futile anyway.
so it is not 80KB it is ~470KB
ok the computers today have enough of that, that's not the problem. i only wanted to know why
If you have 50x50 junctions you could copy more single parts. 32x32 are big enough (imo)
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
The 8Bytes are for all 6 Arrays.
1 + 1 + 1 + 1 + 2 +2 = 8
NOTE:
In the sourcecode, the calculation is wrong.
It should read:
Somehow i counted the bits, instead of bytes
Code: Select all
int8 _copy_heightmap[COPY_MAX];
uint8 _copy_rail[COPY_MAX];
uint8 _copy_tunnel[COPY_MAX];
uint8 _copy_road[COPY_MAX];
uint16 _copy_signals[COPY_MAX];
uint16 _copy_bridge[COPY_MAX];
NOTE:
In the sourcecode, the calculation is wrong.
It should read:
Code: Select all
//Total Space used = 8 * COPY_MAX = 80kb
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
i want to be able to copy something like this
- Attachments
-
- Nonnwell City Transport, 19th May 1941.png
- (132.43 KiB) Downloaded 661 times
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
@bobingabout:
This is already possible
At the moment I am coding a gui.
They would be left out. Anyway this is finetuning, which will be something to think about later.
This is already possible
At the moment I am coding a gui.
This will be a problem with tunnels/bridges which are only partially contained.If you have 50x50 junctions you could copy more single parts. 32x32 are big enough (imo)
They would be left out. Anyway this is finetuning, which will be something to think about later.
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Who is online
Users browsing this forum: No registered users and 4 guests