@Braydon_SFX have you tried editing the polygon manually or limiting the vertex count to six ? I have found the auto shaping of Physics Editor to be highly variable and I think the close cropped edges (with alpha) is maybe making it work hard.
@AlchimiaStudios Physics editor works with multiple polygons too - which you need for complex collision shapes.
@Braydon_SFX I'll upload a video shortly of what I did to get the shape. I can't see why yours isn't working specifically, but I definitely did something different.
@crestwoodgames Can you post the image you used? I've created similar shapes successfully.
I think @crestwoodgames means that he can't touch and register a touch on his custom collisions. That's something that isn't supported yet and is what my demo was going to do: show a workaround.
@Braydon_SFX said:
I think @crestwoodgames means that he can't touch and register a touch on his custom collisions. That's something that isn't supported yet and is what my demo was going to do: show a workaround.
@tmann said: @Braydon_SFX have you tried editing the polygon manually or limiting the vertex count to six ? I have found the auto shaping of Physics Editor to be highly variable and I think the close cropped edges (with alpha) is maybe making it work hard.
@AlchimiaStudios Physics editor works with multiple polygons too - which you need for complex collision shapes.
Of course you need them for complex shapes. I couldn't ever get physics editor data to work in GS with more than one poly. Always had errors.
I have no idea what I'm doing wrong. I'm still having the issue.
Perhaps I just need to restart - I'll remove everything off of my Mac and download the tool and the GS file for the tool. Maybe I did something while setting up the tool.
@Braydon_SFX You did a few things differently to me - picked the exporter first, had the extra vertexes - but I really cannot see why either of those things would have any effect on the end result. It's very strange!
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
@Armelline said: @Braydon_SFX You did a few things differently to me - picked the exporter first, had the extra vertexes - but I really cannot see why either of those things would have any effect on the end result. It's very strange!
When I tried your way I picked the exporter after creating the vertexes. Yes, it is very strange. After I set up everything again I'll report back. I hope it's just something I did while setting up the files. We'll see.
I finally upgraded to PhysicsEditor this week - I was using the free software before. While the paid application is nice to use, I'm experiencing some odd issues when I import the data into GameSalad. I never had this issue with the free software.
I've recorded a brief 2 minute video explaining the issue. Maybe others have had this issue and I just missed the comment? Any thoughts or suggestions on how to fix this?
As always, much appreciated!
Given your object is spherical, it appears that a rectangular collision body is being applied, otherwise I'd expect some sort of wobble in the shape. So either the vertex data is wrong or the collision shape didn't get added to your actor correctly. Not sure which it is without looking at the data.
So @tmann do you have a project showing multipolygonal shapes made with Physics Editor working in GS?
Literally every time I try this it says invalid json data. If I delete the additional poly it works just fine.
(Note: As I said before I'm talking about how PE references polygons, as in the button labeled "add polygon". Not the underlying mesh creating polys between verts in one single unbroken "shape".)
@stevej Does what I describe sound like the intended behaviour for shapes from Physics Editor? Is the add polygon button making the "holes" described in the documentation and causing issues, or is this something on my end.
I finally upgraded to PhysicsEditor this week - I was using the free software before. While the paid application is nice to use, I'm experiencing some odd issues when I import the data into GameSalad. I never had this issue with the free software.
I've recorded a brief 2 minute video explaining the issue. Maybe others have had this issue and I just missed the comment? Any thoughts or suggestions on how to fix this?
As always, much appreciated!
Given your object is spherical, it appears that a rectangular collision body is being applied, otherwise I'd expect some sort of wobble in the shape. So either the vertex data is wrong or the collision shape didn't get added to your actor correctly. Not sure which it is without looking at the data.
Are you able to get the info from the project file i attached on the previous page?
@Braydon_SFX Armelline had his transparency threshold set at 100 so Physics editor is cropping up to 100.
@AlchimiaStudios see what you mean now - PBE happily exports data that includes separate remote collision areas ( 'Islands' ? )- Just going to see if I can get PE to do the same .
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
@tmann after watching his video I did set the threshold to 100%. Still getting the error.
@Braydon_SFX GameSalad released two versions of the exporter plugin. Did you grab it when they first released it, or did you grab the updated version? Perhaps that would explain the difference between your results and mine?
Sorry to hijack this thread but I found out the direct cause of the issue in the plugin. In the gamesalad.json file in the plugin folder the code is currently like this.
{ "rigidBodies": [{% for body in bodies %} { "normalized":false, "rescale":false, "origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}}, "size":{"width":{{body.size.width}},"height":{{body.size.height}}}, "polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %} [{% for point in polygon %} {"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %} ]{% if not forloop.last %},{% endif %}{% endfor %}{% endfor %} ] }{% if not forloop.last %},{% endif %}{% endfor %} ] }
When it should be like this:
{
"rigidBodies": [{% for body in bodies %}
{
"normalized":false,
"rescale":false,
"origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}},
"size":{"width":{{body.size.width}},"height":{{body.size.height}}},
"polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %}
[{% for point in polygon %}
{"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %}
],{% if not forloop.last %},{% endif %}{% endfor %}{% endfor %}
]
}{% if not forloop.last %},{% endif %}{% endfor %}
]
}
It was missing a "," in the rules. So that's why json errors are occuring for multpolygonal objects exported from Physics Editor. @tmann
{
"rigidBodies": [{% for body in bodies %}
{
"normalized":false,
"rescale":false,
"origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}},
"size":{"width":{{body.size.width}},"height":{{body.size.height}}},
"polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %}
[{% for point in polygon %}
{"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %}
]{% if not forloop.last %},{% endif %}{% endfor %}, {% endfor %}
]
}{% if not forloop.last %},{% endif %}{% endfor %}
]
}
Update guys:
I resolved the issue. Turns out I needed to download the required plugin again and create a new directory inside PhysicsEditor.
I assume there was an issue with the plugin I downloaded when the feature was initially released and I must have missed the update.
@AlchimiaStudios said:
Sorry to hijack this thread but I found out the direct cause of the issue in the plugin. In the gamesalad.json file in the plugin folder the code is currently like this.
{ "rigidBodies": [{% for body in bodies %} { "normalized":false, "rescale":false, "origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}}, "size":{"width":{{body.size.width}},"height":{{body.size.height}}}, "polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %} [{% for point in polygon %} {"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %} ]{% if not forloop.last %},{% endif %}{% endfor %}{% endfor %} ] }{% if not forloop.last %},{% endif %}{% endfor %} ] }
When it should be like this:
{
"rigidBodies": [{% for body in bodies %}
{
"normalized":false,
"rescale":false,
"origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}},
"size":{"width":{{body.size.width}},"height":{{body.size.height}}},
"polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %}
[{% for point in polygon %}
{"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %}
],{% if not forloop.last %},{% endif %}{% endfor %}{% endfor %}
]
}{% if not forloop.last %},{% endif %}{% endfor %}
]
}
It was missing a "," in the rules. So that's why json errors are occuring for multpolygonal objects exported from Physics Editor. @tmann
Hmm, your change should put a "," at the end of every block, including the last one, which shouldn't have one. The "if not forloop.last" tag should cause a comma to be put at the end of every block except the last one.
@stevej I never get errors or odd behavior with the "," at the end of every block. But I do get errors with the default plugin because after the first poly block with multi-polygonal data it starts to leave out a "," at the end which causes a json error on import for me.
Collisions appear to work fine wirth every block having a "," . Is there a reason this isn't suggested?
@AlchimiaStudios said: @stevej I never get errors or odd behavior with the "," at the end of every block. But I do get errors with the default plugin because after the first poly block with multi-polygonal data it starts to leave out a "," at the end which causes a json error on import for me.
Collisions appear to work fine wirth every block having a "," . Is there a reason this isn't suggested?
Technically it's not good JSON data. If it works, it's just because the JSON parser is ignoring it (we're using Apple's parser on Mac and the Newtonsoft parser on WIndows).
Comments
Not sure how that is causing my issue as @Armelline is using the editor in using.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@Braydon_SFX have you tried editing the polygon manually or limiting the vertex count to six ? I have found the auto shaping of Physics Editor to be highly variable and I think the close cropped edges (with alpha) is maybe making it work hard.
@AlchimiaStudios Physics editor works with multiple polygons too - which you need for complex collision shapes.
@Braydon_SFX I'll upload a video shortly of what I did to get the shape. I can't see why yours isn't working specifically, but I definitely did something different.
@crestwoodgames Can you post the image you used? I've created similar shapes successfully.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline - awesome, thanks!
I think @crestwoodgames means that he can't touch and register a touch on his custom collisions. That's something that isn't supported yet and is what my demo was going to do: show a workaround.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I'll be deleting the video in half an hour or so.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Ah, that makes sense!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Of course you need them for complex shapes. I couldn't ever get physics editor data to work in GS with more than one poly. Always had errors.
Follow us: Twitter - Website
I have no idea what I'm doing wrong. I'm still having the issue.
Perhaps I just need to restart - I'll remove everything off of my Mac and download the tool and the GS file for the tool. Maybe I did something while setting up the tool.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@Braydon_SFX You did a few things differently to me - picked the exporter first, had the extra vertexes - but I really cannot see why either of those things would have any effect on the end result. It's very strange!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
When I tried your way I picked the exporter after creating the vertexes. Yes, it is very strange. After I set up everything again I'll report back. I hope it's just something I did while setting up the files. We'll see.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Given your object is spherical, it appears that a rectangular collision body is being applied, otherwise I'd expect some sort of wobble in the shape. So either the vertex data is wrong or the collision shape didn't get added to your actor correctly. Not sure which it is without looking at the data.
So @tmann do you have a project showing multipolygonal shapes made with Physics Editor working in GS?
Literally every time I try this it says invalid json data. If I delete the additional poly it works just fine.
(Note: As I said before I'm talking about how PE references polygons, as in the button labeled "add polygon". Not the underlying mesh creating polys between verts in one single unbroken "shape".)
Follow us: Twitter - Website
@stevej Does what I describe sound like the intended behaviour for shapes from Physics Editor? Is the add polygon button making the "holes" described in the documentation and causing issues, or is this something on my end.
Follow us: Twitter - Website
Are you able to get the info from the project file i attached on the previous page?
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@Braydon_SFX Armelline had his transparency threshold set at 100 so Physics editor is cropping up to 100.
@AlchimiaStudios see what you mean now - PBE happily exports data that includes separate remote collision areas ( 'Islands' ? )- Just going to see if I can get PE to do the same .
@tmann after watching his video I did set the threshold to 100%. Still getting the error.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
how many vertices in the export? can you post the data file
@AlchimiaStudios the json form PE is missing a comma ! ( , ) more details in a while
@AlchimiaStudios e.g.
-----------------Invalid JSON data as exported by PE-------------------
{
"rigidBodies": [
{
"normalized":false,
"rescale":false,
"origin":{"x":0,"y":0},
"size":{"width":120,"height":104},
"polygons": [
[
{"x": 1, "y": 50 },
{"x": 28, "y": 0 },
{"x": 92, "y": 0 },
{"x": 120, "y": 49 },
{"x": 91, "y": 51 }
],
[
{"x": 92, "y": 104 },
{"x": 91, "y": 51 },
{"x": 120, "y": 49 }
] (comma missing)
[
{"x": 45, "y": 102 },
{"x": 5, "y": 102 },
{"x": 5, "y": 62 }
] (comma missing)
[
{"x": 69, "y": 83 },
{"x": 48, "y": 83 },
{"x": 48, "y": 64 }
]
]
}
]
}
------------------Valid JSON ------------------------
{
"rigidBodies": [
{
"normalized":false,
"rescale":false,
"origin":{"x":0,"y":0},
"size":{"width":120,"height":104},
"polygons": [
[
{"x": 1, "y": 50 },
{"x": 28, "y": 0 },
{"x": 92, "y": 0 },
{"x": 120, "y": 49 },
{"x": 91, "y": 51 }
],
[
{"x": 92, "y": 104 },
{"x": 91, "y": 51 },
{"x": 120, "y": 49 }
],
[
{"x": 45, "y": 102 },
{"x": 5, "y": 102 },
{"x": 5, "y": 62 }
],
[
{"x": 69, "y": 83 },
{"x": 48, "y": 83 },
{"x": 48, "y": 64 }
]
]
}
]
}
the valid JSON has commas between ALL polygon elements
@AlchimiaStudios
Pretty sure a tiny modification (add a comma : ) ) is needed to the GS exporter plugin but it will have to wait till the morrow as I'm a European
Nice, will try making those changes.
Follow us: Twitter - Website
Yep @tmann looks like a minor error with the exporter. Put commas in correct place and all is well. Thanks
Follow us: Twitter - Website
@Braydon_SFX GameSalad released two versions of the exporter plugin. Did you grab it when they first released it, or did you grab the updated version? Perhaps that would explain the difference between your results and mine?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Sorry to hijack this thread but I found out the direct cause of the issue in the plugin. In the gamesalad.json file in the plugin folder the code is currently like this.
{ "rigidBodies": [{% for body in bodies %} { "normalized":false, "rescale":false, "origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}}, "size":{"width":{{body.size.width}},"height":{{body.size.height}}}, "polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %} [{% for point in polygon %} {"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %} ]{% if not forloop.last %},{% endif %}{% endfor %}{% endfor %} ] }{% if not forloop.last %},{% endif %}{% endfor %} ] }
When it should be like this:
It was missing a "," in the rules. So that's why json errors are occuring for multpolygonal objects exported from Physics Editor. @tmann
@CodeWizard @stevej @QASalad might want to update the plugin.
Follow us: Twitter - Website
interesting my solution was this
{
"rigidBodies": [{% for body in bodies %}
{
"normalized":false,
"rescale":false,
"origin":{"x":{{body.anchorPointAbs.x}},"y":{{body.anchorPointAbs.y}}},
"size":{"width":{{body.size.width}},"height":{{body.size.height}}},
"polygons": [{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %}
[{% for point in polygon %}
{"x": {{point.x}}, "y": {{point.y}} }{% if not forloop.last %},{% endif %}{% endfor %}
]{% if not forloop.last %},{% endif %}{% endfor %}, {% endfor %}
]
}{% if not forloop.last %},{% endif %}{% endfor %}
]
}
which seemed to work
Mine works fine without import error as is. If I put the comma in it says invalid. I have having issues with collides.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@Lost_Oasis_Games @Armelline @stevej
Update guys:
I resolved the issue. Turns out I needed to download the required plugin again and create a new directory inside PhysicsEditor.
I assume there was an issue with the plugin I downloaded when the feature was initially released and I must have missed the update.
Thanks for your help!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Hmm, your change should put a "," at the end of every block, including the last one, which shouldn't have one. The "if not forloop.last" tag should cause a comma to be put at the end of every block except the last one.
@stevej I never get errors or odd behavior with the "," at the end of every block. But I do get errors with the default plugin because after the first poly block with multi-polygonal data it starts to leave out a "," at the end which causes a json error on import for me.
Collisions appear to work fine wirth every block having a "," . Is there a reason this isn't suggested?
Follow us: Twitter - Website
Technically it's not good JSON data. If it works, it's just because the JSON parser is ignoring it (we're using Apple's parser on Mac and the Newtonsoft parser on WIndows).