tIDE icon indicating copy to clipboard operation
tIDE copied to clipboard

tIDE cannot open tilesheets that are 3 or more directories above the directory a map file resides in.

Open TheBroodian opened this issue 5 years ago • 9 comments

Hello, to outline the problem: in image #1, you can see that I have a tide file in D:\C\B\A named test2.tide.

image

This file has reference to a tilesheet file "E.png" located in the root of D:\

image

The file maps properly when creating the tide map initially, however after saving the file, closing it, and attempting to reopen it, the following error occurs:

image

I notice that the error declares that it is attempting to open a png file residing in "D:\C\B" - which will naturally cause an error, because the tilemap file does not exist in this directory. However, when examining the tide file's data, it doesn't make sense why it would be searching that directory for its tilemap file?

<Map Id="test2">
  <Description><![CDATA[]]></Description>
  <TileSheets>
    <TileSheet Id="untitled tile sheet">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[..\..\..\E.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
  </TileSheets>
  <Layers />
  <Properties />
</Map>

So far as is evident to me, the data path to the image appears to be correct ("CDATA[..\..\..\E.png]"). So as to why it is being interpreted differently does not make any sense to me?

TheBroodian avatar Nov 11 '19 19:11 TheBroodian

Hi there,

I suspect the issue is not due to the number of levels above the map file, but due to the fact that the tilesheet is in a root drive. Have you tried moving everything one level down? That is, Make a folder X in D: and move the tilesheet and C/B/A inside it?

I have not maintained this project for many years actually. I hope the above suggestion helps. Typically I wouldn't expect a tilesheet or a map file itself to be in the root of some drive.

Regards Colin

On Mon, 11 Nov 2019 at 20:08, TheBroodian [email protected] wrote:

Hello, to outline the problem: in image #1 https://github.com/colinvella/tIDE/issues/1, you can see that I have a tide file in D:\C\B\A named test2.tide.

[image: image] https://user-images.githubusercontent.com/8283556/68612654-40ecbf80-047a-11ea-8db3-ac2950c860dd.png

This file has reference to a tilesheet file "E.png" located in the root of D:\

[image: image] https://user-images.githubusercontent.com/8283556/68612825-a2ad2980-047a-11ea-8cb0-38e763836c0a.png

The file maps properly when creating the tide map initially, however after saving the file, closing it, and attempting to reopen it, the following error occurs:

[image: image] https://user-images.githubusercontent.com/8283556/68612691-52ce6280-047a-11ea-8954-d7240cd6e689.png

I notice that the error declares that it is attempting to open a png file residing in "D:\C\B" - which will naturally cause an error, because the tilemap file does not exist in this directory. However, when examining the tide file's data, it doesn't make sense why it would be searching that directory for its tilemap file?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/colinvella/tIDE/issues/1?email_source=notifications&email_token=AAJPXBW7L5MUG3NNKKZLPTTQTGUS3A5CNFSM4JLZSCM2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HYP4CCQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPXBRPFP4RBFAWGTBHQNTQTGUS3ANCNFSM4JLZSCMQ .

colinvella avatar Nov 11 '19 20:11 colinvella

Thank you for your reply - I realize that this project hasn't had any updates made to it in quite some time. I've actually been using it for many years, and it has otherwise worked without any issue until now. If this issue is not worth the time to look into it, I do not blame you - I just wanted to inquire with you just in case it interested you.

It does not appear to me that the issue has to do with the map texture file being located in the root of a drive - I have tested this in other scenarios with both the .tide file and the tilemap texture file being nested deeper into a file structure. This error only appears when the tilemap is 3 directories up from the .tide file.

To demonstrate, I have done as you said, and created folder X in the root of D:, and moved the tilemap file into it:

image

Note how tIDE continues to search in the wrong location, but also mistakenly puts the new directory "X" in the path after "B". This seems like some sort of a parsing error? The tide file's contents pasted below:

<?xml version="1.0" encoding="utf-8"?>
<Map Id="test2">
  <Description><![CDATA[]]></Description>
  <TileSheets>
    <TileSheet Id="untitled tile sheet">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[..\..\..\X\E.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
  </TileSheets>
  <Layers />
  <Properties />
</Map>

TheBroodian avatar Nov 11 '19 20:11 TheBroodian

Hi,

I'm not sure if we are sharing the same understanding (or I may be missing something :)). So what I meant is: D:X\E.png D:X\C\B\A\test2.tide

Such that the relative path to the tilesheet from the map file is maintained i.e. as "../../../E.png".

Here I'm trying to test if the issue is caused when the parser is reaching the root drive and that moving everything 1 level down (via X) avoids the bug.

So does the issue happen with 2 levels or 1? level Is it specific to 3? more than 3? Or does it happen when the tilesheet is "above" the map file in the directory tree?

I apologise if I am burdening you with the task of analysing the bug! But at the moment I'm not set up to test it myself.

Regards Colin

On Mon, 11 Nov 2019 at 21:49, TheBroodian [email protected] wrote:

Thank you for your reply - I realize that this project hasn't had any updates made to it in quite some time. I've actually been using it for many years, and it has otherwise worked without any issue until now. If this issue is not worth the time to look into it, I do not blame you - I just wanted to inquire with you just in case it interested you.

It does not appear to me that the issue has to do with the map texture file being located in the root of a drive - I have tested this in other scenarios with both the .tide file and the tilemap texture file being nested deeper into a file structure. This error only appears when the tilemap is 3 directories up from the .tide file.

To demonstrate, I have done as you said, and created folder X in the root of D:, and moved the tilemap file into it:

[image: image] https://user-images.githubusercontent.com/8283556/68619820-69c88100-0489-11ea-8f87-e6c642b9698b.png

Note how tIDE continues to search in the wrong location, but also mistakenly puts the new directory "X" in the path after "B". This seems like some sort of a parsing error? The tide file's contents pasted below:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/colinvella/tIDE/issues/1?email_source=notifications&email_token=AAJPXBWQPNMSB4CPKJJ4RW3QTHAMPA5CNFSM4JLZSCM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDYCMSA#issuecomment-552609352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPXBQFH2OEJRU7HWH3YO3QTHAMPANCNFSM4JLZSCMQ .

colinvella avatar Nov 11 '19 22:11 colinvella

Ahh okay, I understand you better now. I've rearranged the files to match your question:

image

image

E.png resides in D:\X test2.tide resides in D:\X\C\B\A\

Here is the tide file's data:

<?xml version="1.0" encoding="utf-8"?>
<Map Id="test2">
  <Description><![CDATA[]]></Description>
  <TileSheets>
    <TileSheet Id="untitled tile sheet">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[..\..\..\E.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
  </TileSheets>
  <Layers />
  <Properties />
</Map>

And here is the error tIDE outputs when trying to open test2.tide

image

To add some more information, I have another file, "test.tide" that resides in D:\X\C\B, and looks for E.png 2 directories up at the same location as the previous .tide file.

<?xml version="1.0" encoding="utf-8"?>
<Map Id="Test">
  <Description><![CDATA[]]></Description>
  <TileSheets>
    <TileSheet Id="generic tile sheet">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[..\..\E.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
  </TileSheets>
  <Layers />
  <Properties />
</Map>

This file opens, no issue.

Next, I will create another directory one folder further down the structure and follow the same pattern now.

image

<?xml version="1.0" encoding="utf-8"?>
<Map Id="Test3">
  <Description><![CDATA[]]></Description>
  <TileSheets>
    <TileSheet Id="generic tile sheet">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[..\..\..\..\E.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
  </TileSheets>
  <Layers />
  <Properties />
</Map>

Here is the error it returns when trying to open it:

image

From this, I think it is safe to assume that so long as the map is further down the file path beyond 2 directories from a tilesheet that it tries to read, it will fail. However, you raise a good question, I had not yet tested the opposite. I shall test this.

I created a test file in a new directory, D:\Red called 'test.tide'. This new directory has subdirectories as shown below:

image

I added several tilesheets to this tide file to test if it appeared to error when loading tilesheets that were deeper embedded in the file structure:

<?xml version="1.0" encoding="utf-8"?>
<Map Id="Test">
  <Description><![CDATA[]]></Description>
  <TileSheets>
    <TileSheet Id="generic tile sheet">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[Blue\Green\E.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
	    <TileSheet Id="generic tile sheet2">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[Blue\Green\Yellow\F.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
	    <TileSheet Id="generic tile sheet3">
      <Description><![CDATA[]]></Description>
      <ImageSource><![CDATA[Blue\Green\Yellow\Orange\G.png]]></ImageSource>
      <Alignment SheetSize="25 x 18" TileSize="32 x 32" Margin="0 x 0" Spacing="0 x 0" />
      <Properties />
    </TileSheet>
  </TileSheets>
  <Layers />
  <Properties />
</Map>

This file loads properly, and loads each of its tilesheets. This organization of tilesheets-in-relation-to-tidemap appears to have no issues.

No apology necessary! Thank you so much for taking the time to look at this with me.

TheBroodian avatar Nov 11 '19 23:11 TheBroodian

Thanks for testing this out so thoroughly. Is this issue a blocker for you?

Regards Colin

On Tue, 12 Nov 2019 at 00:18, TheBroodian [email protected] wrote:

Ahh okay, I understand you better now. I've rearranged the files to match your question:

[image: image] https://user-images.githubusercontent.com/8283556/68627791-efedc300-049b-11ea-878d-401a8067f585.png

[image: image] https://user-images.githubusercontent.com/8283556/68627866-23305200-049c-11ea-978d-403219990541.png

E.png resides in D:\X test2.tide resides in D:\X\C\B\A\

Here is the tide file's data:

And here is the error tIDE outputs when trying to open test2.tide

[image: image] https://user-images.githubusercontent.com/8283556/68627985-786c6380-049c-11ea-9a23-4e0a347e5150.png

To add some more information, I have another file, "test.tide" that resides in D:\X\C\B, and looks for E.png 2 directories up at the same location as the previous .tide file.

This file opens, no issue.

Next, I will create another directory one folder further down the structure and follow the same pattern now.

[image: image] https://user-images.githubusercontent.com/8283556/68628207-1c560f00-049d-11ea-88cb-ccdbaf02384e.png

Here is the error it returns when trying to open it:

[image: image] https://user-images.githubusercontent.com/8283556/68628290-60e1aa80-049d-11ea-8a43-25b4030d8a46.png

From this, I think it is safe to assume that so long as the map is further down the file path beyond 2 directories from a tilesheet that it tries to read, it will fail. However, you raise a good question, I had not yet tested the opposite. I shall test this.

I created a test file in a new directory, D:\Red called 'test.tide'. This new directory has subdirectories as shown below:

[image: image] https://user-images.githubusercontent.com/8283556/68628681-91761400-049e-11ea-8c82-7e35e3382abf.png

I added several tilesheets to this tide file to test if it appeared to error when loading tilesheets that were deeper embedded in the file structure:

This file loads properly, and loads each of its tilesheets. This organization of tilesheets-in-relation-to-tidemap appears to have no issues.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/colinvella/tIDE/issues/1?email_source=notifications&email_token=AAJPXBXYY7CTOIM3OUXDLNLQTHR35A5CNFSM4JLZSCM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDYPDBI#issuecomment-552661381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPXBU6SR4SSLKITURT36DQTHR35ANCNFSM4JLZSCMQ .

colinvella avatar Nov 12 '19 08:11 colinvella

Well, it doesn't halt my work entirely, however it does hinder my ability to organize my map files in such a way where I can nest "sub-areas" maps inside of folders belonging to their "parent areas" folders. I'll just have to settle on a simpler organization scheme.

TheBroodian avatar Nov 12 '19 15:11 TheBroodian

Hmm.. sorry about that :(

I can't promise anything, but if I find time I'll try to look into it and sort it out.

On Tue, 12 Nov 2019 at 16:29, TheBroodian [email protected] wrote:

Well, it doesn't halt my work entirely, however it does hinder my ability to organize my map files in such a way where I can nest "sub-areas" maps inside of folders belonging to their "parent areas" folders. I'll just have to settle on a simpler organization scheme.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/colinvella/tIDE/issues/1?email_source=notifications&email_token=AAJPXBQEJI2CZQFU2GFESGLQTLDUFA5CNFSM4JLZSCM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED2T6HA#issuecomment-552943388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPXBU4AV6JVMBSUOLKWKTQTLDUFANCNFSM4JLZSCMQ .

colinvella avatar Nov 12 '19 15:11 colinvella

No problem!

In the event that you do take a look into this, I have one more tidbit of information that may be useful to you: This problem does not persist when a map is loaded and run within an XNA game, it appears to be an issue with the tIDE editor specifically.

TheBroodian avatar Nov 12 '19 17:11 TheBroodian

Thanks for letting me know.

If it is of any help, since you familiarized yourself with the file format, one possible workaround for now, is to move the tilesheet images to your desired location and amend the relative paths in the tile map file manually. Obviously it would make sense to do it just when releasing your project, not while editing maps.

On Tue, 12 Nov 2019 at 18:04, TheBroodian [email protected] wrote:

No problem!

In the event that you do take a look into this, I have one more tidbit of information that may be useful to you: This problem does not persist when a map is loaded and run within an XNA game, it appears to be an issue with the tIDE editor specifically.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/colinvella/tIDE/issues/1?email_source=notifications&email_token=AAJPXBVP5U37TBEA3I43JADQTLOY7A5CNFSM4JLZSCM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED2643A#issuecomment-552988268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPXBRVPG4JBXGXDLXSWFTQTLOY7ANCNFSM4JLZSCMQ .

colinvella avatar Nov 13 '19 08:11 colinvella