playMaker

Author Topic: A* pathfinding (stable 0v841)  (Read 226760 times)

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #270 on: October 27, 2013, 02:03:15 PM »
That sounds excellent. You're bringing new Energy into this project :)
Best,
Sven

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #271 on: October 27, 2013, 02:38:46 PM »
No worries, glad I can help.

Have set up a project here:
https://github.com/grofit/playmaker-astar-actions

I would like to be able to make the project have some working examples etc, however as playmaker does not have a free version I have just put in the raw files, so the project will complain as its dependencies are not there, but the export should work in any project that has playmaker and a* pathfinder in.

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #272 on: October 28, 2013, 05:07:59 AM »
examples don't work because the AstarPath component and therefore all graph settings are lost on export. My idea for the future was to put both the Assets/... data and the Library/... data as they are into the installer. Then the installer could put everything in its' right place and no data should be lost. I never got around to testing this though.
Best,
Sven

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #273 on: October 28, 2013, 11:44:52 AM »
The c# conversion is just the raw actions and wrappers, it doesn't have any of the other dependencies, as its assumed you already have these in your project like the other playmaker actions.

So it shouldn't really matter where you put them as its no longer file system specific, they are just extracted via the attributes.

So you *should* be able to get a fresh project with playmaker and a* pathfinder, then import the unity package, and then should work. Well when I say work, it should at least compile.

Let me know once you (or anyone who knows the functionality of the actions) have managed to give it a test as I am keen to continue with my project (the one which spawned me looking here) and ideally want the A* playmaker logic, but cannot move the A* pathfinding folder or the pro features stop working.
« Last Edit: October 28, 2013, 11:46:25 AM by Grofit »

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #274 on: October 29, 2013, 05:03:38 PM »
I have updated the project (on github) so it now contains your example projects as well as the A* Pathfinder project, although you would have to import playmaker as we cannot package that.

It all compiles but certain scripts were missing from your example objects, like moveTo could not be found in its old place, so I have tried remapping them but dont have a clue what settings each script should have etc. So if you can clone the github repo, import playmaker and run the examples (I was just using the tower defense) and make sure the playmaker scripts are all set correctly etc, then let me know if you get any errors?

At least this way all you need to do is check out the code, and just match up missing scripts in your examples and see if it works.

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #275 on: November 01, 2013, 10:16:49 AM »
Any progress?

As much as I would love to continue to make changes and optimise certain parts I don't want to do any more on it until I know it is as functional as the previous one was (as far as examples go anyway).

As I would say in my day job, this is a blocker for me :(

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #276 on: November 01, 2013, 01:23:51 PM »
I couldn't start it before (unity just wouldn't load the project, the Unity.exe process just stopped without any kind of warning or error message :S ) So now I created an empty project and pasted the stuff inside, and now it works. So far I've only noticed that you had dismissed the default values for the moveTo action. However, those for the finishDistance etc are very important for newcomers. A year ago when this started I also just used 0 for all settings as a default and people complained :D Apart from that it seems to work fine though. I'll try to push my changes this evening, never really worked with git though, so it might not work :D

Edit: It won't move, but I might just have made some mistakes myself, I'm looking into it :)
« Last Edit: November 01, 2013, 01:30:17 PM by kiriri »
Best,
Sven

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #277 on: November 01, 2013, 01:34:05 PM »
ok, I'll just put my changelogs here :
- Added default values for moveTo properties;{moveTo}
- Added the override keyword to the actions, without it they won't start;{moveTo,addNodeConnection,ComplexPointGraphFromChildren,createNodes,createPathTo,duplicatePath,getAStarPathInfo,getClosestPointOnPath,getGraphInfo,getGraphInGraphs,getNearestNode,getNodeFromNodes,getNodeInfo,getPathInfo,nodeContainsConnection,PointGraphFromChildren,recyclePath,setAStarPathInfo,setGraphInfo,setNodeInfo,setPathInfo,smoothPath,translatePath}
- Changed the name of the Path-Parameter in OnPathComplete to path1 so it won't locally replace the private variable "path", and cause it to be inaccessible anywhere outside of the OnPathComplete function; {moveTo}

With these changes the moveTo action now works.
« Last Edit: November 01, 2013, 02:20:04 PM by kiriri »
Best,
Sven

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #278 on: November 01, 2013, 02:44:34 PM »
ok, I commited it, and I think I pushed it but I'm not sure. If I didn't send a push request then I don't understand how you would do it with the github program...
Best,
Sven

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #279 on: November 01, 2013, 04:47:52 PM »
No worries will go take a look, thanks for helping out will come back if I have any queries.

Just for future reference (and apologise if you already know this) but with git you have 2 levels of commital, local and remote. So you can commit locally (known as committing) as much as you want without the remote/origin knowing of your changes, then once you are ready to put your changes up you do a push which takes all the changes you have done since your last pull and sends them up to the server. I tend to use TortoiseGit as the command line git commands annoy the hell out of me. As for Github it just is a fancy web front end on the git repository.

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #280 on: November 01, 2013, 04:57:32 PM »
Cannot see any commits or anything. You have 2 options available.

1) This is the one to do if you want to do a bit of learning.
  • Go log into git hub, go to the project page and click FORK
  • It will then do some loading and you will have your own private version of the repo. You can tell this because in the title and url it will say <yourname>/<project-name>
  • Once you have this you will have the clone url (I recommend getting TortoiseGit for the git interactions) at the bottom right, clone it down and make your changes (or copy and paste them into this new repo)
  • Once you have done that, commit them against your local master branch
  • Once you are happy with the changes push them up to the remote master branch
  • Go to github and view the change in your fork of the project, then click pull request

Then it should notify me that there is a change to be merged in, so I can merge it into the main project.

You can find out more here:
https://help.github.com/articles/using-pull-requests

2) This one is if you dont really want to learn git. Just zip up the project and put it on here or email it to me (grofit1@yahoo.com)

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #281 on: November 01, 2013, 07:50:49 PM »
this is the reason why I never used git before... I just can't make it work. I got as far as committing it succesfully and seeing my commited changes etc, but when I want to push it it either can't find the server (in https) or it says I have insufficient permissions (ssh). It's enfuriating how I never seem to get the hang of it :S . Well anyways, I put the changes in the zip file. Just extract it in the FsmPathfinding folder and override the scripts there.
Best,
Sven

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #282 on: November 02, 2013, 03:37:30 AM »
Thanks, have updated it.

In github (and most other project git hosts, but not git itself) you cannot push directly to the main project, you can only push to your fork of it, then request it be merged into mine. Otherwise anyone could just come along and push all manner of broken guff into it. That being said I can see your fork of it, just no pushes into it, with github even if you dont have your SSH set up correctly you can normally still push but it will request your username and password when you do it, anyway if you do want to try to diagnose the issue you have with git send me a pm and we can discuss in there. (I am only pushing for your git access so if you want to take ownership of the project ideally you would need to be able to manage its commits etc).

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Re: A* pathfinding (stable 0v841)
« Reply #283 on: November 03, 2013, 07:23:33 AM »
Hey,

Just tried pulling all changes and running them but none of the examples work for me, still got lots of missing mono scripts on components etc. I am going through and doing a load of refactoring now that I have resharper installed again.

I applied your fixes from your upload but they were only for the actions part not for the examples. Also I just remembered when you said the project wouldnt run for you when you checked it out, did you import playmaker to the default locations etc? as playmaker isnt packaged and wont run without it.

Do you want me to raise future issues as an issue on the github project or continue to put it in here?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v841)
« Reply #284 on: November 03, 2013, 07:35:51 AM »
I prefer working via the forums. The examples were always broken, it's some weird library thing, I'm not sure if it'll work if I fix them, but I'll try it tomorrow anyways, it shouldn't be too much work.

Btw, would it be possible to give me full git rights while still retaining yours? Like, I would like to push to the real repo directly without having to go through all this fuss about pull requests etc, but I imagine it would be for the better if you could still manage it because I don't really have any clue whatsoever about what I would have to do as owner of the repo :D

EDIT : Oh and changing the classnames is a very good idea, it always enfuriated me when I tried to reference a type and only later when I compiled the script I find out that for some reason it didn't start with a capital letter :( As for the Mohogony() and DoStuff() functions... yeah that's me alright :D
« Last Edit: November 03, 2013, 08:11:54 AM by kiriri »
Best,
Sven