[RFD] Tunnels (what is a tunnel?)
Moderator: Transport Empire Moderators
If there can be sloped structures. Or if tracks can be sloped on flat ground.Hyronymus wrote:I think that's the best approach to it but let's suggest we want a graded tunnel. Is that as possible as graded track?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
I like the idea.
I'm not too found on the roof and surface terms though, but that's only language.
Every building/track is built at a certain height, and has a certain clearance. Different structures (eg: a building and a train track) can only be built when their clearances don't overlap. Compatible structures (eg: 2 tracks, track+road, ...) can either be built without overlapping clearances, or with the same "base height" (level-crossings).
Oh, and I attached an image to make it a show what I wanted to say with:
I'm not too found on the roof and surface terms though, but that's only language.
Every building/track is built at a certain height, and has a certain clearance. Different structures (eg: a building and a train track) can only be built when their clearances don't overlap. Compatible structures (eg: 2 tracks, track+road, ...) can either be built without overlapping clearances, or with the same "base height" (level-crossings).
Oh, and I attached an image to make it a show what I wanted to say with:
track follows the ground up to a certain max. slope, if the slope is steeper, it is automatically changed to tunnel/bridge. I don't like this because you don't have enough control, but it can be used as an initial "proposal" that the player can modify. (ie: select 2 points => use 3DTT style between them : transform track to a constant slope, automatily create cuttings/tunnels/bridges)
- Attachments
-
- height changes.png (4.69 KiB) Viewed 5802 times
/me likes the idea too.
There is one drawback (abit depending on how it would work else):
Only the height of the whole surface of a cell can be changed. Which make diagonal tunnels, and bridges wider than nececcary, I think. We might be able to create structures that is not cell shaped but the shape of the surface will alwas be cell shape.
There is one drawback (abit depending on how it would work else):
Only the height of the whole surface of a cell can be changed. Which make diagonal tunnels, and bridges wider than nececcary, I think. We might be able to create structures that is not cell shaped but the shape of the surface will alwas be cell shape.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Looks good. Work will have to be put into the UI so it is clear when a tunnel is the only option and such. Don't force changes and not explain them. I'd prefer it only tried to build a tunnel in extreme cases as they aren't cheap.
Why should the land be such strictly cell based? If we use a 360 degree track system, it is better to have a more freeform system for everything else. Especially for things like landscape. If your going cell-based, an isometric view is a better option than the 3d option planned.zuu wrote:/me likes the idea too.
There is one drawback (abit depending on how it would work else):
Only the height of the whole surface of a cell can be changed. Which make diagonal tunnels, and bridges wider than nececcary, I think. We might be able to create structures that is not cell shaped but the shape of the surface will alwas be cell shape.
zuu wrote:Only the height of the whole surface of a cell can be changed. Which make diagonal tunnels, and bridges wider than nececcary, I think. We might be able to create structures that is not cell shaped but the shape of the surface will alwas be cell shape.
The surface can only be modified on a cell basis, that's right (sorry, you'll have to get over it Steve, you can't draw a map without a squares/triangles that make up the ground).
Those "clearance" heights could be checked not for each map cell, but for each track unit (the black dots in my prototype). If you do it on a map-cell basis, you wouldn't even be able to put a track and a building in the same cell.
Late replies but I felt like it. If we stick to triangels we can define terrain in triangles verticaly too right? One rectangle can be split into 2 identical triangles. The way to define diagonal tracks might then be to have 1/2 cell as a tunnel and the other half not. Or is this too simplified thinking by me?
Your seem to contradict yourself. I'm saying why use the large map cells when we'll be using smaller units for other things anyway. You say that'll never happen and then go and suggest a similar thing?PJayTycy wrote:The surface can only be modified on a cell basis, that's right (sorry, you'll have to get over it Steve, you can't draw a map without a squares/triangles that make up the ground).
Those "clearance" heights could be checked not for each map cell, but for each track unit (the black dots in my prototype). If you do it on a map-cell basis, you wouldn't even be able to put a track and a building in the same cell.
I presume we'll be having varying steepness of hills and such? To make a more realistic formed land?
The pro of having big cells is that you can make bigger maps.
Steve: yes there will be serval steepness. I suggest that there should be just a few, but the FRD says every 5 degree or so.
Steve: yes there will be serval steepness. I suggest that there should be just a few, but the FRD says every 5 degree or so.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
maybe a littleSteve wrote:Your seem to contradict yourself.
As far as I know, we still haven't decided on this. It might seem like that, but we have not yet decided to use a freeform system or a cell-based one.Steve wrote: I'm saying why use the large map cells when we'll be using smaller units for other things anyway.
And I thought you wanted to get rid of cells completely :
I read this as "no cells for the landscape". But landscape is exactly the only thing you will always need cells for.Steve wrote:Why should the land be such strictly cell based? If ... , it is better to have a more freeform system for everything else. Especially for things like landscape
If we stick to a cell-based approach for everything, it would be a good idea to split each square into 4 "corners" and do collision detection on a per-corner base instead of per-cell.Hyronymus wrote:One rectangle can be split into 2 identical triangles. The way to define diagonal tracks might then be to have 1/2 cell as a tunnel and the other half not.
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
I didn't realize until last meeting how good this idea actually is. However, I do think the terminology is a bit ambiguous. Also I think it has to be changed slightly to be able to implement it.jfs wrote:Another idea for handling tunnels and bridges:
Each map square has a number of landscape surfaces and landscape roofs. Always at least one surface (the ground.)
Structures can only be built directly on top of a landscape surface. Every structure has a height. There has to be enough space between a landscape surface and the next landscape roof/surface to account for the entire height of a structure built on the surface.
This is of course entirely internal to the game. When the user builds a tunnel, s/he is in fact adding a new landscape surface and roof below the original landscape surface, and probably also filling out the new room that's been made.
Bridges would be similar, except that it just adds a new landscape surface (including decoration) above ground level. Some but not all bridges might have landscape roofs over them.
So I propose the following setup:
Definitions
- Floor: Objects have to be placed on floors. Each object (bridge, tunnel, building, whatever) provides a new floor, which is directly above itself.
- Ceiling: Objects have to be placed below ceilings to avoid conflicts with other objects. Each object provides a new ceiling, which is directly below itself.
(I'll post a Locomotion screenshot with the same info if desired.)
Tunnels will work exactly the same, except that they are built underground. The landscape surface can be considered as an object in this scheme. The ceiling will be the value of the lowest corner. The floor will be the value of the highest corner.
Implementation details:
For every tile with objects on it, we need to store a list of floors and ceilings. For empty tiles, this list can be empty, because it would be useless to store that information until something is actually placed on the tile and the list becomes relevant.
In practice, I don't think that people (or AI players) will place more than 10 objects above each other. Hence, we don't need any fancy O(log n) search structures. A linked list will suffice. In fact, I believe that in lists this small, a linked list would be at least as fast a balanced binary search tree, which takes roughly twice as much memory. Remember, the list will only be accessed when something is built on the tile.
In C++ code, this could look like this:
Code: Select all
class CMapTile {
// other members and methods
private:
// The linked list to store the floors and ceilings.
// If empty, this will just take 4 bytes (sizeof(void*)) on 32-bit systems
CFloorCeilingList* pFloorCeilingList;
public:
// Check if an objects will fit at the desired location. This is a non-virtual
// method and will hence not use any memory in the object data.
bool CheckIfObjectFits(unsigned long floor, unsigned long height);
// etc.
};
class CFloorCeilingList {
public:
CFloorCeilingList* pNextItem;
unsigned long lFloor;
unsigned long lCeiling;
};
- Attachments
-
- Used in this post
- floorceiling.png (3.66 KiB) Viewed 5712 times
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
I think there should be two kind of floors. Floors that you can place objects on (used for bridges) and floors that just tell that the space abouve is free, but the object have to provide some pillars it self.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Who is online
Users browsing this forum: No registered users and 17 guests