Hi, I was unsure if this should go under support or combat forum. My question is what is the best way to debug a combat routine? Essentially I just want to step through an existing CR I currently have. After searching around I noticed i can run small pieces of code in the buddy console but wasn't sure how to test some code that checks enemies for certain debuffs (auras). I'm currently setup with VS2013 so if any one has any suggestions pm me or post here would be helpful.
Try putting different logging commands at different steps? Behavior Trees aren't the easiest thing to debug. You could write it in Coroutines (if you're not already) which would be much easier to debug.
This. Coroutines make debugging so much easier, you can attach visual studio to rebornbuddy and set breakpoints inside your code.
Hmm I'm not sure if coroutines are being used. I think await and async statement are used in lieu of coroutines. (this is a public CR that I'm tinkering with to learn how to develop my own) Now that I think about it. It is setup to mimic coroutines. I'll try setting up dumping to a log at certain points in my routine. When you say attach visual studio to buddy do you mean adding adding the .exe to my VS project references? How would setting break points in visual studios allow me to check values? It is my understanding the buddy bot is executing the code. Unless visual studio is executing the code wouldn't the break points be meaningless? Sorry if I'm missing something just trying to learn.
If you're using async and await then you are using coroutines. To debug stuff using visual studio:' 1) add rebornbuddy.exe as a reference to your project so intellisense would work 2)Start bot as you would normally 3)open the debug menu and select attach to proccess and select rebornbuddy.exe then you can set breakpoints on your code and theyll get pause rebornbuddy when they get hit.
Being able to debug with VS is definitely a huge help. However, I find certain things to just be easier to do in behavior trees. Especially, well, behavior itself. Otherwise for some stuff you end up with a bunch of nested ifs all over. So far I'm finding using coroutine nodes in some places useful and normal nodes in other places useful too.
You must be doing something silly. My coroutine code is 100x cleaner then a behavior tree can ever hope to be. I'm slowly working on converting all the existing tags over to coroutines and there is a good chance the default might become coroutines with the update for heavensword.