mbaske / grid-sensor

Grid Sensor Components for Unity ML-Agents
MIT License
134 stars 28 forks source link

Detectable Game Objects not working with 2D gameobjects #14

Open SandaruwanFdo opened 2 years ago

SandaruwanFdo commented 2 years ago

image image

Detectable Game Objects not working with 2D gameobjects. what am I missing?

mbaske commented 2 years ago

Detectable Game Objects not working with 2D gameobjects. what am I missing?

Yeah, sorry,, that's expected behavior though. Please see readme page: "I debated with myself if I should add support for 2D physics, but decided against it in the end. The reason being that the typical use case for 2D physics is platformer games. Those tend to require pretty high resolution observations though. Using camera sensors should generally be the better option for platformers. "

SandaruwanFdo commented 2 years ago

I read it now. Do you have any solution for Top Down games?

mbaske commented 2 years ago

You could either use 3D physics or implement the detection code yourself - that is mapping your object positions to grid coordinates, like I did with the "maze explorer" example project in the repo.

SandaruwanFdo commented 2 years ago

Thank you for your response. Do you intend to provide a solution for that in your sensor in the future?

mbaske commented 2 years ago

No, I have nothing planned for the time being.

SandaruwanFdo commented 2 years ago

object positions to grid coordinates Can you provide a some examples or a video tutorial? "maze explorer" is a bit complex for me. I am a stranger to ml-agents

mbaske commented 2 years ago

Hi, I don't have any docs besides what's in the repo's readme. If you're totally new to ml-agents, I'd suggest looking into the example projects first. They are pretty basic and helped me a lot when I was starting with the ml-agents. https://github.com/Unity-Technologies/ml-agents/tree/main/Project/Assets/ML-Agents/Examples