s0600204 / 0ad-techtree

Generated-on-demand diagram showing the current state of the technology tree in "0AD : Empires Ascendant"
2 stars 0 forks source link

Something is broken #1

Closed techtonik closed 8 years ago

techtonik commented 8 years ago

http://s06eye.co.uk/0ad/techtree/ says

Hmm... something went wrong. Try again later, and hopefully I'll be fixed!

And error console logs this error:

http://s06eye.co.uk/0ad/techtree/mods/0ad/art/textures/ui/session/portraits/technologies/undefined 404 (Not Found)
s0600204 commented 8 years ago

I'm sorry, but I'm unable to replicate. The tree draws correctly for me, and I don't get an error message.

In addition, the underlying data this version of the tech-tree is generated from is several years out-of-date. If you've got 0ad installed, you'd be better off using the in-game Structure Tree.

techtonik commented 8 years ago

This is on Chrome - Firefox works fine.

techtonik commented 8 years ago

Here is more:

(civ select) Calculating starting points of tree
techtree.js:420 (draw) Drawing tech tree.
svg.min.js:1 Uncaught TypeError: Cannot read property 'numberOfItems' of undefined
SVG.extend.parse @ svg.min.js:1
SVG.Array @ svg.min.js:1
SVG.PathArray @ svg.min.js:1
SVG.Path.SVG.invent.extend.plot @ svg.min.js:2
SVG.Path.SVG.invent.construct.path @ svg.min.js:2
drawDepLine @ techtree.js:602
draw3 @ techtree.js:577
selectCiv @ techtree.js:112
onchange @ (index):22
undefined:1 GET http://s06eye.co.uk/0ad/techtree/mods/0ad/art/textures/ui/session/portraits/technologies/undefined 404 (Not Found)

Looks awesome on FF, BTW. I am looking at it as for a tool for general data representation.

techtonik commented 8 years ago

Found exact bug - http://stackoverflow.com/questions/35120590/svg-numberofitems-property-not-working

s0600204 commented 8 years ago

Ah, I don't use Chrome and don't have it installed on any of my machines.

I've updated the version of svg.js being used (which was "fun" as they'd changed parts of their api). Could you try again?

And as a tool it's not brilliant - I never back-ported the data caching code I wrote for v2, so it causes needless file reads on the server every time the page is visited. Not to mention the colour scheme...

techtonik commented 8 years ago

Yes. It works now. =)

I can't say that color scheme is so awful - it is not distracting and readable. Much better than most open source project web designs and 99% of bootstrap copies out there. )

techtonik commented 8 years ago

Are there any pluggable cache solutions? So that you can grab files by name from directory, from DB or local cache or whatever?

s0600204 commented 8 years ago

If it works, then I'll close the ticket. Thanks for reporting it.


As to the cache - this version of the techtree does grab files from a directory. Problem is, there's about a hundred of them, and they're all loaded, the data contained within them is processed, and then the result is passed to the client browser. And this happens every time the page is accessed.

However, with the techtree-v2, the first time the 'tree is ever accessed, the server loads the necessary data files (3-4 times that of v1), parses the data contained within, then saves a copy of the parse-result to an auto-created file before sending said result to the client browser. The next time the page is accessed (by anyone), the server just returns the contents of the saved parse-result. Faster for (subsequent) users, and less stress on the server.

Anyhow, off-topic. Problem fixed, issue closed. Thanks again. (Will now update the svg.js library of the techtree-v2, as that most likely suffers from the same problem)