Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (798)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (865)
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 1473 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.

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:

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  

Riven (81 views)
2019-09-04 15:33:17

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

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

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

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

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

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

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

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

nelsongames (3998 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

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 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‑
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!