Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How would you code a dynamic skill/tech tree?

Author
Message
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jan 2013 12:24 Edited at: 23rd Jan 2013 12:27
One thing I struggle with is programming a tech tree.



I really want to override a treeview control and have it output each technology / skill in each branch in horizontal semi-symmetrical form. I really need something streamlined.

Drawing it in Photoshop or using HTML is viable, I even know how to control photoshop with VB.NET which could feed it dynamic data and output images in a 'push the button' batch process.

However, I get the feeling that later on I will want to change the tech/skill trees quite frequently during play tests; I'd prefer to avoid restarting the game to make a change in other words. I could auto file stream tech tree images during development mode without restarting the game, which I currently do with the characters and shaders for external tweaks; but my gut feeling tells me I should take the node by node hard code route, and produce the tree for the player from a database; much easier to update and maintain.

Again the best I can think of is a treeview override; or perhaps a grid; maybe even a Dark AI job on using entities as nodes, since an AI entity is not limited to characters.

How would you do it?

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Jan 2013 19:30
Are you asking about how to visually display the tech tree or how to code the structure linking techs to parent techs?

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jan 2013 19:55
Displaying the tree.

Preventing overlapping nodes. Drawing arrows that bend around unlinked nodes. All easy to use recursion and shift the nodes from each other, but it needs to be in good order.

Notice above how the top left nodes in the diagram (cut off) link to next column; some children have two parents, and need to stack close to parents in the Y axis.

I imagine the first node would need to start on the middle left, using CIVs example above, then alternate the Y location of each root node, below and above.

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 23rd Jan 2013 21:22
I started trying to work up a solution for you but I got bored.
I only got this far:




"I am a big dumb babby! " - TheComet
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jan 2013 21:38
Nice one. I can see where you are going with that; one could hide cells unused and use an algorithm to 'emit' child nodes to the right.

The part that confuses me is how to determine where children with multiple parents can go. Can't have one parent down the bottom and another at the top. I wonder if I should create WYSIWYG database, where the actual data is literally a grid rather than a hiearchy

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Jan 2013 03:21
OK I guess this is a bit much. I will use a table to define the tree manually.

Login to post a reply

Server time is: 2026-07-07 12:09:56
Your offset time is: 2026-07-07 12:09:56