Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm developing an editor for my game, and now it's time to make a visual scripting system to let designer modify behaviours.

This video shows what i have done and the problem

to resolve the link between nodes I'm using an A* path finding, when a path is set, I add a penalization bonus to each cell of the path, to avoid using the same cells for other path.

I would like that the lines do not intersect unnecesarily.

is there any algoritm or idea that allows me to do this better?

share|improve this question
    
Interestingly, I just yesterday started working on a node-based user-oriented visual scripting system for AI behaviour. I've been looking into some of the open source circuit diagram software, to see how they do it. –  Jordaan Mylonas Sep 15 '11 at 2:06
    
You could also check out Blender's source, since it features a node-based materials editor, and a node-based logic editor. –  Jordaan Mylonas Sep 15 '11 at 2:06
3  
The way you are doing it (A penalty in the node cost) is the way to do it with A*. You might also consider a penalty for any step that turns, which will clean up your messy corners. - in practice I think most things like this just draw a spline or something and intersections be damned. –  Blecki Sep 15 '11 at 2:45
    
@Blecki i think is a good idea the turn penalty, thanks –  Blau Sep 15 '11 at 12:57
    
@Blecki, your idea did the trick... :) if you make the reply I will accept it as right answer –  Blau Sep 15 '11 at 22:03
show 3 more comments

1 Answer 1

You could check out GraphViz for some inspiration: http://www.graphviz.org/Gallery.php

The tool itself produces static images, but it has a variety of modes for connecting nodes with limited overlap. Also it's open source in case you're interested in studying one of the algorithms that they use. Good luck.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.