Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (788)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (860)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Drawing a Tech Tree  (Read 320 times)
0 Members and 1 Guest are viewing this topic.
Offline fenaryh
« Posted 2019-04-11 18:57:56 »

Hi, guys!

I'm developing a game that is going to have a tech tree (like Civilization, for example);

So, I began to search how to draw and discovered that this is quite tricky. A tech tree is actually a directed acyclic graph. So, we have to draw a graph. I found tons of academic material, but most of them grows in complexity, since they try to optimize the code (in terms of Big O).

So, I would like to know if anyone knows a working algorithm that is not tooooooooo complex to implement. For now, I don't need to be optimized.

Thanks!
Offline Longarmx
« Reply #1 - Posted 2019-04-12 02:04:57 »

If your tech tree won't change during gameplay, you may find it easier to just layout the graph beforehand, either manually or using some external software. One option would be to use GraphViz and exporting the layout in their plain text format. Then, convert it to a custom format or write an importer for your game to layout your tech tree.

As you probably discovered, laying out DAGs to minimize edge crossings is NP-hard. Some methods I found from a quick Google search that may be useful are Suigyama Drawing (this might be good since it structures nodes into layers) and Topological sorting. You may also find this paper useful: https://www.graphviz.org/Documentation/TSE93.pdf

Offline fenaryh
« Reply #2 - Posted 2019-04-16 01:27:11 »

Hi, Longarmx,

thanks for your answer. It never occourred to me to simply draw it beforhand, lol.

Actually, I still don't know how it will be. It will not exactly dynamic, but if it's too big, may be I could use just some "cuts", but I think it will be less work with the image.

These algorithms are really annoying.

Thanks again!

Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (2081 views)
2018-11-16 13:46:03

hadezbladez (799 views)
2018-11-16 13:41:33

hadezbladez (2050 views)
2018-11-16 13:35:35

hadezbladez (414 views)
2018-11-16 13:32:03

EgonOlsen (3444 views)
2018-06-10 19:43:48

EgonOlsen (3674 views)
2018-06-10 19:43:44

EgonOlsen (2271 views)
2018-06-10 19:43:20

DesertCoockie (2993 views)
2018-05-13 18:23:11

nelsongames (3070 views)
2018-04-24 18:15:36

nelsongames (3802 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!