Bug in Engine.procDeps

2 views
Skip to first unread message

jeremyosborne

unread,
Apr 16, 2011, 11:47:54 PM4/16/11
to The Render Engine
Likely, it's not a bug within procDeps, but this is where I was able
to stem a problem that I was having.

Problem: On Mac OS X, using anything other than Firefox (e.g. using
Chrome or Safari), my example code would load but would stop working
at the final dependency load. The game screen would seemingly freeze
(although it turns out it wasn't freezing, just going through a
succession of setTimeout call/responses) and then would dump out the
most bizarre message to my console:

Object 'ClosureGame' has the following unresolved dependencies: (1)
rendering

Solution (or at least workaround):

Within the third for loop of the procDeps method of Engine.js (at line
2128 in the 1.5.3 build), I added the following:

for (var d in fTable[f].deps) {
if (EngineSupport.indexOf(allDeps, fTable[f].deps[d]) ==
-1) {
// Begin HACK
// NOTE: I do not know where the rendering faux-
dependency is
// coming from, but it does appear when I'm working in
anything
// other than Firefox on my Mac OS X.
// This seems to work around the problems, but I'm not
sure why
// nor where the "rendering" dependency truly comes
from as the
// only "rending" text in my search of the code base
lies within
// comments.
if (fTable[f].deps[d] == "rendering") {
continue;
}
// End HACK
allDeps.push(fTable[f].deps[d]);
}
}

You have probably already taken care of this in 2.0, but I figured I'd
start with the stable stuff :)

bfat...@gmail.com

unread,
Apr 18, 2011, 9:43:55 AM4/18/11
to The Render Engine
The old dependency checker was just way too strict. It was an attempt
to catch issues that developers commonly made (such as referring to
objects that were never actually loaded). It was more of a headache
than a help. The new one in v2.0.0 is much more lenient and allows
developers to make these kinds of mistakes, but it also doesn't trip
on things that are potentially false alarms (like the "rendering" bug
you are seeing).

I'd suggest that you do your work with v2.0.0 if you're just starting
out. While it is still a ways away from being done, it's actually
quite close to being a beta version. It should be stable enough to
learn with. The documentation isn't great, but the demos and
tutorials which have been converted should help you to understand its
basic structure. That way you won't be frustrated with nuances of the
dependency checker, and instead be able to focus on giving good
feedback on the progress of v2.0.0 as a new engine.

Thanks,
Brett

jeremyosborne

unread,
Apr 18, 2011, 5:50:22 PM4/18/11
to The Render Engine
I'm one of those sorts of developers who likes to be in control of my
own dependencies, so this is great news and adds to my desire to use
v2 (which I wanted to do anyway)!

Do you think for the most part I can drop my code into a v2 setup? For
the most part, I'm using only the basic objects in my examples:
Object2D, canvas (of course), the Box based collisions, the move
component, and a few mouse events (mouse move and mouse click
listeners).

Don't worry, I can handle myself with the code, but any initial
pointers would be appreciated :) In return I will gladly contribute
bug fixes and updates if find any (good choice switching to github).

- Jeremy
Reply all
Reply to author
Forward
0 new messages