Jump to content
The Dark Mod Forums

Some entity properties not listed; which and why


Recommended Posts

Well, I guess I'll just use firefox then, I was using IE7.

 

Help getting it to work in IE 7 is still appreciated, tho :) I tested in Opera, Firefox and Konqeuror, and with a one exception (the back/forward buttons) it works fine. IE always has to need some special attention :(

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

  • Replies 249
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I can get this error out of it:

Line: 148

Character: 4

Error: 'length' is empty or not an object

Code: 0

 

I updated the online version, but I could only guess what went wrong and have no idea if that will now work :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

It's working now, but slow as you said :) .

 

Ah cool :) I have some ideas how to speed it up, so it will get better.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Flanders, I have seen you adding some documentation, very appreciated :)

 

However, could you please add a atdm:entity_base definition and make all our other atdm:*base entities inherit from it, and then attach the doc (the ones that are valid for all entities) to this specific definition? (Place it into def/tdm_base.def please).

 

That way things like "editor_var inherit" do not need to be defined twice :) (this is basically anguas idea above :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Flanders, I have seen you adding some documentation, very appreciated :)

Yes, I wasn't finished with that actually. I was trying to get that inspect.pl working for me. I got activeperl to run it, but it didn't create a new index.html, I thought it worked that way. The added editor_vars do show up in Dark Radiant, so I know they're working. But I wanted to check them with the documentation. Because I couldn't get it workin so far I was hoping you'd update the online documentation.

Link to comment
Share on other sites

Yes, I wasn't finished with that actually. I was trying to get that inspect.pl working for me. I got activeperl to run it, but it didn't create a new index.html, I thought it worked that way. The added editor_vars do show up in Dark Radiant, so I know they're working. But I wanted to check them with the documentation. Because I couldn't get it workin so far I was hoping you'd update the online documentation.

 

Ah, sorry, you must have missed the post where I described the *new* *new* workings of inspect.pl :)

 

The file now creates just a devel/doc/js/entities.js file. The index.html, the tdm.js and and the tdm.css file are not touched and just stay what they are. You can then simply view the documentation by going opening devel/doc/index.html in your browser, which should work now from SVN, too.

 

The online version at bloodgate.com is just a copy and I will update it frequently, but the most up-to-date version will always be in SVN.

 

Btw, if you recreate entities.js, you should check it in into SVN, too. :)

 

Hope that explains it, if there are any more questions, please just ask.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

To get a grip on why the GUI takes so long to initialize, I added profiling info. You can enable it by setting the PROFILING variable inside devel/doc/js/tdm.js to 1. Here are the results on my laptop (times in ms):

 

Firefox:

 

Function 	Time (ms)
init hashes 	11
init spawnargs 	1019
generating overview 	34
build tab overview 	3
generating entities 	33
build tab entities 	199
generating spawnargs 	21
build tab spawnargs 	262
generating undocumented 	24
build tab undocumented 	343
generating files 	2
build tab files 	329
generating search 	0
build tab search 	339
calculateSize 	3

 

The times for building the tab are for inserting the HTML into the DOM. However, it is clear that a large chunk of time is wasted just for initializing the spawnarg data, probably due to the normalization of the spawnarg names. I think precomputing them in inspect.pl will help a lot.

 

The other issue is that inserting the tabs one by one causes a document reflow for each tab. You can see that the time "generating" the tab content is very small (33 ms for the overview and the entity tab, all others even less), but inserting the tab content into the dom ("build tab XYZ") takes always at least 199 ms, with increasing times, probably because inserting the next tab causes a complete reflow (nicely shown when inserting the almost empty search tab, it takes even longer than any previous tab).

 

So generating all the content at once, then inserting it into the DOM will certainly cut this time down to about 1/5.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Here are the timings for Konqueror and Opera on my laptop:

 

Konqueror - ouch!

 

init hashes  47
 init spawnargs  9991
 generating overview  141
 build tab overview  2
 generating entities  1225
 build tab entities  178
 generating spawnargs  477
 build tab spawnargs  335
 generating undocumented  426
 build tab undocumented  453
 generating files  23
 build tab files  499
 generating search  0
 build tab search  505
 calculateSize  94
 Overall:  14396

 

Opera - faster than firefox due to much faster DOM reflow, but the JS is actually slower. Interesting:

 

init hashes	10
init spawnargs	1600
generating overview	26
build tab overview	0
generating entities	47
build tab entities	31
generating spawnargs	41
build tab spawnargs	60
generating undocumented	44
build tab undocumented	86
generating files	6
build tab files	94
generating search	0
build tab search	131
calculateSize	268
Overall:	2444

 

Would be interesting to see what IE has to say to that :)

 

Anyway, I am confident I can shrink the times :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

The file now creates just a devel/doc/js/entities.js file. The index.html, the tdm.js and and the tdm.css file are not touched and just stay what they are. You can then simply view the documentation by going opening devel/doc/index.html in your browser, which should work now from SVN, too.

In that case, when I run the script it does nothing with entities.js. It opens it but it makes no changes to it even if I made changes to the def files. When I run inspect.pl I get a flash screen that reads:

 

inspect.pl v0.08 / Inspect entities and definitions and generate doc

parsing definition files:

def/

 

And when I open index.html it does not show the changes I made.

Link to comment
Share on other sites

In that case, when I run the script it does nothing with entities.js. It opens it but it makes no changes to it even if I made changes to the def files. When I run inspect.pl I get a flash screen that reads:

 

inspect.pl v0.08 / Inspect entities and definitions and generate doc

parsing definition files:

def/

 

Does it output any more or just exit? Also, are you running it from a DOS window or via the menu? In both cases, what is the working directory for the script?

 

Could you run it from the SVN root via a DOS command window and post me the full output please?

 

And when I open index.html it does not show the changes I made.

 

It looks like the script terminates early. Maybe wrong working directory, or some dependency is missing?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Does it output any more or just exit?

 

tried again using the DOS command window. I noticed some lines flashing just before it exits. Captured it with a print screen, it says:

error in state 2: expected '}'or '"spawnarg" "value"', but found 'no_random_headturning'in ..\def\tdm_ai_builder_guard.def at line 97

Link to comment
Share on other sites

tried again using the DOS command window. I noticed some lines flashing just before it exits. Captured it with a print screen, it says:

 

There is a setting to keep the command window open on errors but I forgot where it is in windows -sorry :)

 

error in state 2: expected '}'or '"spawnarg" "value"', but found 'no_random_headturning'in ..\def\tdm_ai_builder_guard.def at line 97

 

Ah duh, I see the same error - it must be new because it worked a few days ago. Either the def file really has a typo in it, or some new setting confuses my parser. I have a look :D Sorry again.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Ah yes I found it. My parser is much stricter than D3s parser and it stumbled over the apparently new keyword "no_random_headturning". Teached it it and updated SVN. Should work now :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

These are the times on my computer for IE:

 

Function	Time (ms)
init hashes	15
init spawnargs	1750
generating overview	63
build tab overview	31
generating entities	6812
build tab entities	422
generating spawnargs	4860
build tab spawnargs	593
generating undocumented	5516
build tab undocumented	688
generating files	93
build tab files	782
generating search	0
build tab search	781
calculateSize	94
Overall:	22500

Link to comment
Share on other sites

These are the times on my computer for IE:

 

Function	Time (ms)
init hashes	15
init spawnargs	1750
generating overview	63
build tab overview	31
generating entities	6812
build tab entities	422
generating spawnargs	4860
build tab spawnargs	593
generating undocumented	5516
build tab undocumented	688
generating files	93
build tab files	782
generating search	0
build tab search	781
calculateSize	94
Overall:	22500

 

Yikes! :o Could you please post the FF times for reference?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Here you go

Function 	Time (ms)
init hashes 	4
init spawnargs 	397
generating overview 	14
build tab overview 	2
generating entities 	19
build tab entities 	105
generating spawnargs 	13
build tab spawnargs 	125
generating undocumented 	13
build tab undocumented 	164
generating files 	1
build tab files 	155
generating search 	0
build tab search 	164
calculateSize 	1
Overall: 	1177

Link to comment
Share on other sites

All the loot entities are documented now. Made a entity_base def that works like this:

Atdm:entity_base ->atdm:frobable_base -> moveable_base ->atdm:moveable_base ->atdm:moveable_loot_base

 

Only inherited is documented in entity_base now, the rest should be documented by others who document other entities.

 

One other thing about the script, I'm not sure if it searches all parents of entities for documentation on spawnargs. inv_loot_type and inv_loot_base are documented in atdm:moveable_loot_base but show up undocumented in atdm:moveable_loot_amethyst.

If that is fixed a help request can be made IMO.

Link to comment
Share on other sites

All the loot entities are documented now. Made a entity_base def that works like this:

Atdm:entity_base ->atdm:frobable_base -> moveable_base ->atdm:moveable_base ->atdm:moveable_loot_base

 

Only inherited is documented in entity_base now, the rest should be documented by others who document other entities.

 

One other thing about the script, I'm not sure if it searches all parents of entities for documentation on spawnargs. inv_loot_type and inv_loot_base are documented in atdm:moveable_loot_base but show up undocumented in atdm:moveable_loot_amethyst.

If that is fixed a help request can be made IMO.

 

Yes, thanx a lot for the effort! I'll look into the issue you mentioned when I look at the search function over the next few days :)

 

(Just returned from the south:)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Yes, thanx a lot for the effort! I'll look into the issue you mentioned when I look at the search function over the next few days :)

 

The editor_var where named "loot_value" and "loot_type", but they are actually named "inv_loot_value" etc :) Fixed it now and updated the online version, too.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I improved the JS code now in two ways:

 

* devel/inspect.pl now pre-calculates the normalized spawnarg names, this saves expensive regexp operations when initializing the documented/undocumented lists:

 

(All timings are the shortest times I managed on my PC, because the CPU scales with the load and if you don't have the fastest CPU speed atm you get sometimes values up to 4 times higher so I just tried until I saw the lowest sum overall. This means the timings are only indicating a trend and not really accurate down to the millisecond :)

 

Time to init spawnargs list:

 

Opera: 161ms vs. 260ms

Firefox: 277ms vs. 308ms

Konqueror: 2147ms vs. 6572ms (!)

 

This didn't help much for the two main browsers, but watch Konqueror - and I guess IE sees similiar speedups.

 

In addition, the JS code to normalize the spawnarg names didn't work properly, which means we got many more undocumented spawnargs (1207) as we actually have, now it lists about 722. Since the prefix-removing now works much better, documenting a few selected spawnargs (like "snd_jump" etc.) will drop this value down much further :)

 

Last but not least I reorganized the code that builds the tabs for the GUI - instead of building them one by one and inserting them one by one (which triggers costly reflows of the DOM in the browser), the code now builds the text for all of them, then inserts them all at once.

 

For instance, in Firefox you got formerly the values of:

 

build tab overview 	3
build tab entities 	129
build tab spawnargs 	206
build tab undocumented 	257
build tab files 	358
build tab search 	351

 

where you can see that each DOM reflow took more and more time (since the DOM grew bigger and bigger), even when inserting the last tab "search" - which is basically empty and shouldn't take any time at all.

 

Now the timings for Firefox look like this:

 

build tab overview 	1
build tab entities 	1
build tab spawnargs 	1
build tab undocumented 	2
build tab files 	2
build tab search 	1
inserting tabs 	297

 

As you can see, there is one new time (inserting tabs) and it is much shorter than the combined time from the former code :)

 

Here are overall times to init the GUI in the three browsers I can test, I think IE will see similiar speed ups as Konqueror (e.g. go from "slow as hell" to "almost usable" :)

 

Opera: 616ms vs. 1672ms

Firefox: 820ms vs. 1726ms

Konqueror: 5719ms vs. 11612ms (!)

 

Enjoy :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

After yesterdays optimization clicking on one entity and viewing it was broken, this is now fixed.

 

Also implemented a full-blown search formular with the usual options one expects :) This was far more work and much more tricky than I anticipated - javascript is really not a nice development environment :wacko::blink:

 

But it is done now, please test:

 

http://bloodgate.com/mirrors/tdm/pub/doc/index.html#search

 

:)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...