Posted: Mon Nov 06, 2017 10:31 pm Post subject:
Tunnel Tutorial
Subject description: Need a good explanation for setting up tunnels in your map? Look here.
TUNNEL TUTORIAL
If you're like me, you might have been interested in making your own maps with tunnels and you tried it in the FinalSun/FinalTI editor and it doesn't work when you try playing the map. I've looked everywhere for full information on this matter and I can't seem to find it. After quite a bit of testing, I've figured out how it works. If you need help with tunnels, this is my gift to you.
Firstly, don't use the editor's tunnel creator. Go to this page. (Credit to Q45 for this amazing tool)
Once there, you will be able to open the tool, it does come with its own instructions as well. Primarily, you need to find the coordinates of the middle tiles of the tunnel entrances. Don't worry about the other ones.
To make this much easier to identify, I'll show you the exact spots of the tunnel entrances. I've marked them just like how you should imagine them inside the tunnel tool linked earlier. Remember, you want the coordinates of the middle tile in the three marked tiles.
To find the coordinates, place your mouse over the "middle tile" of the tunnel and look here look here. Jot this number down in a notepad or just keep it in mind.
Now that you have the coordinates, place them into the tunnel tool above. Red or orange does not matter, just make sure the ends look appropriate. Note that the coordinates in FinalSun/FinalTI will be backwards. (For example, coordinates in Final sun will read 75/50, but the Tunnel Tool should read 50/75. There is an option in the tunnel tool to swap these numbers when clicked). Once the coordinates are entered into the Tunnel Tool, simply create your tunnel. Your tunnel may have turns and curves in it as well.
Once you have a nice tunnel created that fits your terrain, you will need to use the "Copy to Clipboard" option in the Tunnel Tool. Copy/paste this information into a notepad. It should look similar to this:
Each tunnel should create 6 lines of text, so if you want to make additional tunnels, use the "Index" function and add the lines to your text document. Note that the Tunnel Tool starts at 0, so you should be increasing in increments of 6 each time.
Once your notepad has every tunnel on it, you will need to add via Ini Editing. (Don't worry, you can add/remove/edit things in this notepad later) Save the notepad as "Tubes.ini" and place it where you remember it. Once done, go to INI Editing in FinalSun/FinalTI and import the .ini file.
Now that it is in your map, simply save it and try it out. As a suggestion, I recommend marking each of your tunnels in some way to help you find the specific 6 lines of text for a specific tunnel so you can easily edit it later. You can also check them by coordinates as well.
ADDITIONAL INFORMATION
I have not explained what the numbers in tunnel creator actually mean. I will try my best to explain in the simplest terms that I can. This should help to understand how the numbers work and can even be applied to other modding activities as well.
In the picture below, you can see a partially made tunnel. As you can see, its a relatively straight tunnel with a curve halfway through. The numbers below the tunnel maker are the code to insert into FinalSun.
For better viewing:
2=1,1,2,10,1,2,2,2,1,1,3,3,2,2,-1
3=10,1,6,1,1,6,6,7,7,5,5,6,6,6,-1
Each number has a different use.
1: This one is simple. This is merely the number which marks the tunnel/tube. Since it usually starts are 0, the first tunnel is marked 0, the next is marked 1, etc...
2: These two numbers are the starting coordinates of the tunnel. This is the tile where the units ENTER the tunnel. In this example, I used coordinates 1,10 and 1,1. With different coordinates, this number will change wildly.
3: This number is the direction of the tunnel. From the entrance of the tunnel, this shows which direction the units will travel (so it looks smooth). To make more sense of this, see the "Direction Grid" further below.
4: These two numbers are the ending coordinates of the tunnel. This is where the units LEAVE the tunnel. As you can see, the two numbers mirror the next tube's starting coordinates.
5: This is the tube itself. Basically, each number is one "move". This also follows the direction grid below. In this instance, 2,2,2 means that it will move southeast, 3 times. 1,1 means that it will move east 2 times. 3,3 means it will move south 2 times. 2,2 means it will move southeast 2 more times. Look at these numbers and compare them to the image of the tunnel above.
6: I could be wrong on this one, but this is the "stop". Every tunnel I have seen has this -1 at the end of it, seeming to show there are no more moves to complete.
This will give modders of TS & RA2 to make tunnels easier for their mods. _________________ If you are a MetalHead (Heavy Metal Fan) and don't want to be a metalhead, Just remove your metal ball from your head. �:p .
QUICK_EDIT
Sorry, I don't. I joined the forum to specifically post this tutorial because I spent a few hours trying to figure it all out and once I did, everything went MUCH smoother for my Twisted Insurrection map. Due to the lack of a tutorial with pictures (That I could find, maybe I missed it), figured I'd save everyone some trouble of having to figure it out on their own.
I threw this together real quick with MS paint lol QUICK_EDIT
In FinalSun with Marble Madness tiles like the one included in TS Client,
the entrance marking can also be seen in framework mode (Ctrl + F).
For these 3 entrance/exit cells, tunnel graphics in the game is assigned
with the Tunnel's Terrain Type (represented by number 5). A tunnel enter
cursor is shown in the game on mouse over, on these 3 cells. When tubes
entries are plotted with these correct entrance cells, selected units when
clicked on the enter tunnel cursor, will automatically move to the other
end of the tunnel. In case those marked coordinates for tunnel entrances
are not chosen for tubes entries, tunnels still works with limitations. An
alternate path reachable by land to the other end is needed for such tunnels
to work. Even a working tunnel will stop functioning if the alternate route
becomes unreachable in game like a bridge getting destroyed which was
the only alternative path to reach the other end.
In cases where train carriages get disconnected in the game, due to train
crushing some units inside the tunnel, instead of removing one entire
line to make it one-way for such tracks, the middle line could be switched
to the next cell for example
Code:
[Tubes]
0=80,80,0,80,70,0,0,0,0,0,0,0,0,0,0,-1
1=80,70,4,80,80,4,4,4,4,4,4,4,4,4,4,-1
2=81,80,0,81,70,0,0,0,0,0,0,0,0,0,0,-1
3=81,70,4,82,70,-1 ;The facing entry 4 could be changed by 1 value if turn looks drastic.
4=82,80,0,82,70,0,0,0,0,0,0,0,0,0,0,-1
5=82,70,4,82,80,4,4,4,4,4,4,4,4,4,4,-1
Other limitation of tunnels in game:
- A map can have a max of 127 tunnel lines, 21 tunnels with 6 lines each.
- Tunnels traversing different heights have problems, so should be kept
on same height level.
When the tunnel lines are drawn crossing or intersecting each other, a unit
would wait for the next cell (if that cell was occupied) to get cleared, in the
game to proceed further. QUICK_EDIT
Now this is a good tutorial. Consider this thread stickied
I've never noticed the "Insert another INI file content" button before, that's pretty handy! I've always had to close the map editor, open the map in Notepad and add/edit the [Tubes] section there.
Funny how even someone like me, who've made TS/TI maps for the last 12 years, can still learn something new.
E1 Elite wrote:
In cases where train carriages get disconnected in the game, due to train
crushing some units inside the tunnel
Are you sure this is possible? I don't recall ever having units crush others inside tunnels. They just seem to pass through one another as if they didn't occupy any physical space. _________________
I have seen train carriages getting disconnected, not sure if it is train speed
or infantry/visceroids coming accross in the tunnel or some terrain reason.
But I have been using the one-way technique mentioned above.
Not sure on crushing but I have seen the units wait for the next cell to get
cleared to move further instead of passing through that unit in cases of
tunnel lines crossing each other.
Edit: Looks like game behaves differently for units travelling from same
direction and opposite direction in the tunnel. Units coming from opposite
direction pass through and same direction checks for cell occupied status.
So, the one-way technique I was using was not needed at all. Even to and
fro path being same or different wouldn't have benefit of one over other. QUICK_EDIT
For the coordinates being shown in reverse in FinalSun/FinalTI on the status bar as Y / X - H, it can be changed to show as X / Y - H with an EXE hack available here.
On the [Tubes] entry numbers, 1 can be called as index, 3 can be called as facing and 5 as movement direction. 2 and 4 as enter X,Y and exit X,Y coordinates. QUICK_EDIT
For the coordinates being shown in reverse in FinalSun/FinalTI on the status bar as Y / X - H, it can be changed to show as X / Y - H with an EXE hack available here.
Just want to point out that they will be reversed in the coming update, i.e. shown in X / Y order. _________________
How the tunnels are plotted in maps, can now be viewed visually with the updated Map Renderer. Existing maps can be reviewed and mistakes like the missing directional entry plotted by FinalSun can be spotted with it. QUICK_EDIT
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 vote in polls in this forum You cannot attach files in this forum You can download files in this forum