Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 2:35 pm
All times are UTC + 0
FinalSun Tunnel Fixer
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
^Rampastein
Rampastring


Joined: 11 Oct 2008
Location: Gensokyo

PostPosted: Fri May 27, 2016 4:52 pm    Post subject:  FinalSun Tunnel Fixer Reply with quote  Mark this post and the followings unread

FinalSun has a very annoying bug that breaks all tunnels that you draw in the map editor. The tunnels usually work fine with vehicles, but infantry get stuck. This happens because every second tunnel tube that FinalSun generates into the [Tubes] section in the map has a wrong value in them.

As an example:

How tubes should be coded:
Quote:
0=147,110,4,147,117,4,4,4,4,4,4,4,-1
1=147,117,0,147,110,0,0,0,0,0,0,0,-1
2=148,110,4,148,118,4,4,4,4,4,4,4,4,-1
3=148,118,0,148,110,0,0,0,0,0,0,0,0,-1
4=149,109,4,149,118,4,4,4,4,4,4,4,4,4,-1
5=149,118,0,149,109,0,0,0,0,0,0,0,0,0,-1


How FinalSun codes them:
Quote:
0=147,110,4,147,117,4,4,4,4,4,4,-1,-1
1=147,117,0,147,110,0,0,0,0,0,0,0,-1
2=148,110,4,148,118,4,4,4,4,4,4,4,-1,-1
3=148,118,0,148,110,0,0,0,0,0,0,0,0,-1
4=149,109,4,149,118,4,4,4,4,4,4,4,4,-1,-1
5=149,118,0,149,109,0,0,0,0,0,0,0,0,0,-1


Basically, in every second tube FinalSun includes one proper value less than it should.

Another issue with FinalSun's [Tubes] code is that it includes a massive amount of useless extra -1s, cluttering the code. I removed them from the examples above; here's what a FinalSun-coded tube value actually looks like:
Quote:
0=115,101,2,124,102,2,2,3,2,2,2,2,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1


Because fixing these [Tubes] sections manually takes a bit of repetitive work and it was almost as quick to make a program that does the work for me, I made one.

To use it, simply drag-and-drop your map file into the TSTunnelFixer executable, and the tool will fix the tubes in the map and replace the original map file with the fixed version. I also included the tool's source code in the ZIP.

Note that I've only tested this tool with FinalSun-made tunnels; I haven't tested its effects on custom-made tunnels or tunnels made with Q45's TS/RA2 Tunnel Drawer. The tool is meant to just ignore those tunnels though (since they don't need fixing in the first place), and it'll likely do just that.

I don't know if FinalAlert 2 supports tunnels and whether it has the same faults as FS (if it does support tunnels). But if it does have the same bug, this tool should also be able to fix FA2's tunnels.



TSTunnelFixer.zip
 Description:

Download
 Filename:  TSTunnelFixer.zip
 Filesize:  16 KB
 Downloaded:  58 Time(s)


_________________
CnCNet Client | CnCNet TS patches | More Quality-of-Life Improvements for RA Remastered


Back to top
View user's profile Send private message ModDB Profile ID Facebook Profile URL
E1 Elite
General


Joined: 28 May 2013

PostPosted: Fri May 27, 2016 6:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

FA2 supports tunnels and has the same problem as finalsun, so this should work for RA2 maps as well.

It doesn't change Q45's tool generated entries, so no problem there.

Few observation:
- If a tunnel entry has no direction entry, this tool duplicates the last coordinate entry (Pros and cons, Tiberium
Filteration user maps)
- If some map or entries are skipped without correction, a log could be generated with the map filename.

Edit: Attached skipped case examples.



SkippedCases.txt
 Description:

Download
 Filename:  SkippedCases.txt
 Filesize:  1.83 KB
 Downloaded:  13 Time(s)


Back to top
View user's profile Send private message
Q45
Tiberian Fiend


Joined: 28 Feb 2009
Location: Tampere, Finland

PostPosted: Sat May 28, 2016 11:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

If only both of our tools could be added to the map editor itself in some form. Sad

_________________

Twisted Insurrection's Lead Campaign Developer

Back to top
View user's profile Send private message Send e-mail Visit poster's website
^Rampastein
Rampastring


Joined: 11 Oct 2008
Location: Gensokyo

PostPosted: Sun May 29, 2016 6:48 am    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:
- If some map or entries are skipped without correction, a log could be generated with the map filename.

If some entries are skipped without correction, the tool does tell it in the console window. ("Nothing to fix in tube X")

E1 Elite wrote:
Edit: Attached skipped case examples.

The tool expects that the tube indexes start from 0 and are always increased by 1. Which is currently intentional, since that's how FinalSun writes its tunnels. The tool will stop once it finds a tube index that doesn't exist, so in Tiber River's case the tool already stops after checking if tube #0 exists.

Skipping some indexes would be easy to implement though; instead of looking for tubes index-by-index it could look at all the INI keys in the [Tubes] section and apply the fix for the keys.

Q45 wrote:
If only both of our tools could be added to the map editor itself in some form. Sad

Yeah, it'd also be nice if FinalSun displayed the tunnels in the map. But this will probably have to do for the rest of Tiberian Sun modding, unless someone makes a new map editor.

_________________
CnCNet Client | CnCNet TS patches | More Quality-of-Life Improvements for RA Remastered


Back to top
View user's profile Send private message ModDB Profile ID Facebook Profile URL
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sun May 29, 2016 10:05 am    Post subject: Reply with quote  Mark this post and the followings unread

Had run the tool from a batch file on several user maps, so didn't see the console output.

Tool changes of the no direction entry cases in the aforementioned maps:
0=102,207,4,102,208,-1 -> 0=102,207,4,102,208,208,-1
4=33,97,6,32,97,-1  ->  4=33,97,6,32,97,97,-1

FinalSun 0.98 shows the tunnel lines which can be used for viewing.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can 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


Powered by phpBB © phpBB Group

[ Time: 0.1537s ][ Queries: 13 (0.0086s) ][ Debug on ]