armory3d / armory

3D Engine with Blender Integration
https://armory3d.org/engine
zlib License
3.07k stars 316 forks source link

Cannot build / publish to C target when using HaxeRecast #1147

Open greyheron opened 5 years ago

greyheron commented 5 years ago

When trying to build/publish a project in either Android C or Windows C the build fails with the following error:

..\armsdk\lib\haxerecast\Sources/haxerecast/Recast.hx:28: characters 3-13 : Type not found : HaxeRecast ..\armsdk\lib\haxerecast\Sources/haxerecast/Recast.hx:37: characters 3-13 : Type not found : HaxeRecast ..\armsdk\lib\haxerecast\Sources/haxerecast/Recast.hx:54: characters 3-13 : Type not found : HaxeRecast

greyheron commented 5 years ago

I did a bit more troubleshooting on this, and comparing it with navmesh example, the only thing I noticed is that my project was including the following line in khafile.js:

project.addLibrary("C:/Development/Armory/armsdk/lib/haxerecast");

I had set Navigation to "Auto" in Armory Project > Modules, same than the example mentioned above, the only way to skip the error was to manually set it to "Disabled". `

I haven't been able to test the build but it seems to build successfully.

greyheron commented 5 years ago

I tested it and I can confirm that navigation as expected doesn't work. Having the same problem with navmesh example when doing C target, not sure if it is misconfiguration on my side or a genuine issue.

luboslenco commented 5 years ago

Sorry it's an issue in armory, thanks for bringing that up. Fix coming.

AdrianLeeMagill commented 4 years ago

Was a fix to this problem published? I am finding the exact same thing right now, trying to publish.

greyheron commented 4 years ago

@AdrianLeeMagill I don't think so. What I have done for the time being is work around it by not using and implementing my own navigation however the NavAgent trait can be used as long as you pass them an array of Vec4 with the nodes of a given path.

AdrianLeeMagill commented 4 years ago

@greyheron Thanks for the heads up. I am currently working on a work around as well but would like this problem fixed as I am going public with my game soon. As soon as it starts making money, I would like to support this project, but can't do it until I can publish my work.

N8n5h commented 4 years ago

I don't know much about how the hashlink/cpp part of the engine works, but I figured that maybe with an approach similar to how Haxebullet does it at least it would compile again. So this is what I did: https://github.com/N8n5h/haxerecast/tree/fix-c-compiling Right now is not complete, as the findPath function is causing problems that I'm not sure how to solve:

Also I don't have the setup to compile to C targets so I can't test if this would work after compiling the project.

@luboslenco is this the correct approach, or something else should be done for haxerecast for C targets?

AdrianLeeMagill commented 4 years ago

@N8n5h Thanks. I think there may have been an update that took care of the problem. I uninstalled both Blender and Armory3d then reinstalled Blender, adding Armory3d as an add on and it seems to be publishing to HTML5 without errors, though I have not had the chance to test the results yet. I will post an update on this thread to let everyone know how it goes when I get the chance to work on it again.

N8n5h commented 4 years ago

@AdrianLeeMagill

I think there may have been an update that took care of the problem

Yes, in the latest version of Armory the current exposed functionality of recast navigation should work fine with html5 and Krom targets. The problem is with C targets, that's what my attempt of solving it was for.