KakiDev 0 Share Posted November 1 Having a proper debugger would be great, I spent a few hours the other day printf-debugging my implementation of behaviour trees, and being able to step through the code step by step would have made this a lot easier and saved me a lot of time. Link to comment Share on other sites More sharing options...
Aeglen 244 Share Posted November 1 Idk what your code looks like but I'd advise avoiding lots of little tree-leaf-node files for every step, no matter how leet some people say it feels to have such "organised" code, imo it often results in a time consuming mess. Hashtag 1 Link to comment Share on other sites More sharing options...
KakiDev 0 Author Share Posted November 1 2 hours ago, Aeglen said: Idk what your code looks like but I'd advise avoiding lots of little tree-leaf-node files for every step, no matter how leet some people say it feels to have such "organised" code, imo it often results in a time consuming mess. Yeah, I think they can help a lot, but if you overuse them it quickly becomes worse than if you didn't use them at all. 3 hours ago, Neffarion said: Thanks a lot, I feel like that should be turned into an official guide, I can't emphasize enough how helpful a debugger can be, it can really make your life a lot easier. Coming from C++ and Rust, so I had no idea that something like -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345 even exists. Link to comment Share on other sites More sharing options...
KakiDev 0 Author Share Posted November 1 Tried it out, works fine, doesn't break on exceptions though, I assume thats because they are caught by DreamBot. Piece of advise for Linux Users: You can set "Before Launch" tasks in IntelliJ, tell it to build the artifact and run a .sh (Run External Tool) with the following content: cmd="java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345 -jar ~DreamBot/BotData/client.jar" eval "${cmd}" &>/dev/null & disown; This will start DreamBot as a background process, so you don't have to manually start it. You can also use this to build a Run config that will build the jar and start DreamBot. Link to comment Share on other sites More sharing options...
xyz111 31 Share Posted November 2 15 hours ago, Aeglen said: Idk what your code looks like but I'd advise avoiding lots of little tree-leaf-node files for every step, no matter how leet some people say it feels to have such "organised" code, imo it often results in a time consuming mess. Wouldn't the ideal strategy vary with each situation? Have you read "The Art of Unix Programming"? It promotes the idea of writing code that's straightforward, clean, and modular, making it easier to upkeep and comprehend. While it's true that the initial setup can take time, the advantages, such as reduced likelihood of bugs due to less code duplication and enhanced readability, often outweigh the drawbacks Link to comment Share on other sites More sharing options...
camalCase 165 Share Posted November 2 45 minutes ago, xyz111 said: Wouldn't the ideal strategy vary with each situation? Have you read "The Art of Unix Programming"? It promotes the idea of writing code that's straightforward, clean, and modular, making it easier to upkeep and comprehend. While it's true that the initial setup can take time, the advantages, such as reduced likelihood of bugs due to less code duplication and enhanced readability, often outweigh the drawbacks you sound like a dork but yeah aeglens out of his mind like always. Link to comment Share on other sites More sharing options...
xyz111 31 Share Posted November 2 9 hours ago, camalCase said: you sound like a dork but yeah aeglens out of his mind like always. Fair point 😂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now