IRC Log Viewer » #firebreath » 2012-07-21

IRC Nick Time (GMT-7) Message
Grimshaw 15:07 hello :)
anyone happens to be around?
reichi ?:)
i've made a plugin like flash, for games, it works ok when there is only one plugin instance in a tab
when i put 3 object tags in the html of apage
it works only sometimes
but mostly crashes the plugin
specially in firefox
what can cause such issues? i am running each plugin instance in a separate thread
one thread has nothing to do with the other, i find it weird because of this..
Grimshaw 15:07 Sometimes when i close a tab running a plugin, i get an assert of the expression weakHost.expired()
what could it be?
johannes 15:07 maybe some shared globals?
maybe in a lib you're using
Grimshaw 16:07 didnt think of that
jshanab_ 17:07 How do we add a framework in mac and xcode in the cmake files or is it bi-directional on mac
taxilian 18:07 jshanab_: Not sure I'm following your question
Grimshaw: almost guaranteed that you've got some shared data issues; remember that all your plugin instances share memory space
so basically what johannes said =]
Grimshaw 18:07 taxilian: Thanks for the feedback
but please tell me
in a single browser
e.g chrome in windows 32 bits
having 3 plugin objects in one tab
and 2 more in another
and 1 more in the last one
is this any different from having all 6 in the same page?
taxilian 18:07 not as far as memory goes
they would all access the same DOM , of course
the ones in the same page with each other, that is
Grimshaw 18:07 so, technically, for my implementation
i dont need to care about different tabs and pages, just about different runs
taxilian 18:07 different instances
Grimshaw 18:07 i dont access the dom
its a standalone plugin
taxilian 19:07 shouldn't be a problem, then
Grimshaw 19:07 for running games
but well, your opinion
i render through OpenGL
it all works fine, my engine integration was so easy
taxilian 19:07 that's because you're on windows
Grimshaw 19:07 but now i have a thread per object tag
so what is your opinion about that?
bad idea?
taxilian 19:07 that's what I'd do; you just need to be careful how you manage your globals
Grimshaw 19:07 i mean, if a user opens a lot of tabs, a lot of threads wil eventually slow down or be a hell to manage resources?
taxilian 19:07 tyhe problem most game devs run into is that most game engines were developed by people who assumed they own the process
lots of threads aren't neccesarily a problem
Grimshaw 19:07 each thread is self contained
in my case
taxilian 19:07 having it all on the same thread would be every bit as bad
Grimshaw 19:07 i could manage some things, but lose the processing power
too many games could be updating at the same time by one code flow, probably fps loss
taxilian 19:07 threads get a bad rep; on the desktop having one thread per plugin is really not a big deal *at all*
absolutely, but that's just CPU usage
Grimshaw 19:07 and you are absolutely right, i have no idea if there are globals in my dependencies
and thats a problem
i hope it works
taxilian 19:07 and that's as true if you run 5 different games at the same time as if you run 5 instances of your plugin
Grimshaw 19:07 i know pretty well the inners of the libraries but we never know
taxilian 19:07 most libraries expect to be used only once in a process
Grimshaw 19:07 the concept i decided to go with
taxilian 19:07 and starting multiple copies in the same process at the same time causes issues
Grimshaw 19:07 is to have each plugin instance owning a cache directory
for the resources
that is helpful
debugging the dll i ve managed to fix a few things
but i have a little doubts
HTTP SimpleStream download class is safe?
taxilian 19:07 define "safe"
Grimshaw 19:07 Just a download and save there
if i can use it concurrently
without issues
taxilian 19:07 yes; all actual activity occurs on the main thread
Grimshaw 19:07 as a blocking call from the thread downloading it
sounds good
another issue
for example in firefox
taxilian 19:07 ahh, the blocking call. that should be safe too, yes
Grimshaw 19:07 i have a way too simple plugin running
no file access
just blank openGL rendering
if i have one per page
it works in multiple tabs
if i make an html file with like 3 object tags in it
i get a plugin crashed - no report on startup
while in chrome it works ok (most of the time)
should it be what you refered to? initialization hazard of the libraries?
taxilian 19:07 my best guess would be that the crash occurs when two instances of your plugin try to start up too quickly after each other
Grimshaw 19:07 well, they do make a operation on a shared resource
each one of the instances sets a string content
but only set
should be a problem, not sure
i will play with that for an answer
if you think giving a few milisecond between instances is sensible, ill do it
taxilian 19:07 it's worth trying, anyway
Grimshaw 19:07 ive used htmlLog() to output window attachments, detachments and plugin shutdown
i get the plugin instanced and window attached logs correctly
but never a shutdown or detach
i tried everything and i dont get them
i have some kind of undefined behaviour going on
taxilian 19:07 htmlLog doesn't work once a shutdown starts
Grimshaw 19:07 because sometimes when quitting a tab in firefox, i get an assert
taxilian 19:07 but the htmlLog may be causing that assert
Grimshaw 19:07 Expression: weakHost.expired();
ohhh, right!
taxilian 19:07 I would recommend against using it, honestly
it's convenient now and again, but it's more than a bit of a hack
use log4cplus logging instead
Grimshaw 19:07 i won't, i was just looking for the issue :D
i won't use any logging once the basics are there :D
another behaviour i found
in the 3 object tag page
even in chrome
there was times the 3 started just fine
a refresh and they still work
but in some cases, only one or two start
even in log i dont see a third log for the third instance at all
should be the same cause for the firefox bugs
taxilian 19:07 I don't know. again, however, I caution you that those logs are sometimes worse than useless — they can be misleading
Grimshaw 19:07 since openGL is running independently in each thread, context wise and window wise, it shouldnt clash right?
taxilian 19:07 don't spend too much time worrying about "missing" log messages unless you've used file-based log4cplus logs and they aren't there
to be honest I don't know enough about opengl to know
Grimshaw 19:07 oh ok :)
i am quite used to it, but something always passes through :D
i will keep working on the software!
thanks a lot for the library
its absolutely wonderful
taxilian 19:07 glad it's handy
Grimshaw 19:07 nothing to argue against it :D
i am using it to port my win/linux/mac/android engine to the browsers as well
taxilian 19:07 cool
Grimshaw 19:07 therefore the same code works for all platforms
taxilian 19:07 throw up a link to your project on the "in the wild" page on when you get it up and running
Grimshaw 19:07 absolutely!
it will be something like unity web player
actualy, already is, since it works normally
i can setup quick trying outs later, so people can see their code deploy in the browser, pc and android :D
taxilian 19:07 cool
Grimshaw 19:07 anyway, sorry for bothering, thanks a LOT for the help, you do deserve a nice community
is the project accepting donations?
taxilian 19:07 we have a pretty good community
it is
there is a donate button on the homepage
it's even occasionally used
Grimshaw 19:07 if its not a secret, how much would it bring in?
anyway, when i get it to work, ill try to contribute :D
taxilian 19:07 to date it's brought in a total of maybe $2000, which has almost paid for the server costs
Grimshaw 19:07 you put a lot of effort in this .)
not bad at all
taxilian 19:07 I'm transitioning to cheaper hosting, but I haven't had much time lately
Grimshaw 19:07 :))
taxilian 19:07 that's from about 15 people
Grimshaw 19:07 by the way, how was working in facebook?»
taxilian 19:07 I'd be happier to have that much from about 200 people
particularly given some of the demands that occasionally people start throwing around =]
Grimshaw 19:07 i always wondered how it would feel in a workplace of a hyped business
didn't get that last sentence : /
taxilian 19:07 but at the end of the day I'd prefer contributions by way of blog posts, code fixes, sample code, etc
ahh, Facebook; it was interesting. I worked remotely so I wasn't there very often
Grimshaw 19:07 now i got it
met the Mark guy? : )
taxilian 19:07 the offices were insane; kitchens with tons of drinks, snack, cold cerial, etc. 3 meals a day from the cafeteria
Grimshaw 19:07 a lot of money to put into them ahah :)
taxilian 19:07 Zuck? I saw him around sometimes but never met him
30" LCD on every desk
Grimshaw 19:07 lol
taxilian 19:07 really
Grimshaw 19:07 not bad conditions
taxilian 19:07 there are reasons people like to work there
Grimshaw 19:07 i'd love to try such a company
but actually i am looking for a game dev job right now, as its my expertise
anything would be better than my current job anyway
im so frustrated having to work in a phone store, since i didnt yet manage to get something better
by the way if you wanna take a look at the website of the engine:
taxilian 19:07 ultimately I wasn't interested in moving to anywhere they are based and working remotely wasn't real rewarding; I didn't put as much as I could have into trying to learn enough to be brought in on my other skills besides plugin stuff and they decided the plugin approach was no longer worth it for the image uploading, so they didn't renew my contract
I was actually not that disappointed; I wanted to go fulltime where I'm at now
where are you located?
cool. I'm not really into game dev, but I'll take a look around
Grimshaw 19:07 Im from portugal
taxilian 19:07 but are you still in Portugal or just from there?
Grimshaw 19:07 yes, I live in the same place i was born still
I am actually only 20 years old at the time
So i hadn't enough time to grow professionally yet
taxilian 19:07 I got my first development job when I was 17, but I was lucky
Grimshaw 19:07 but I do work my ass off in the game dev
when i can afford to not be at work
taxilian 19:07 it's a good way to start, I'd guess. I don't know the work situations in portugal at all, but I'd imagine that developing skills is useful anywhere you go
Grimshaw 19:07 in this last week i was about to integrate a mobile game dev team
in a real company, but working remotely, but its pending, hope they call me soon :D
its a real mess in here
economicaly speaking
taxilian 19:07 well, I wish you luck. I need to get back to my sprinkler controller; gotta figure out how this bizarre ip stack was set up and why so I can decide if I can fix it or not
Grimshaw 19:07 basically i cant study further
because i need to work a lot to support it, and then i dont have time for it
and i dont like my job since its only a fix until i can work with my skillset
nice to meet you
Richard, right? Pleasure. Good luck, hope to hear from you soon, as a big time CEO :D
taxilian 19:07 heh. I'll stick with development myself, but best wishes to you as well
Grimshaw 19:07 ;)))
taxilian: sorry to ask again, but what is the meaning of the boolean return in the AttachEvent, im just returning false, what is this about?
taxilian 19:07 if you return true you indicate that the event has been handled and nothing else should receive it
in many cases it doesn't matter, because nothing else is attached to the subject anyway
Grimshaw 19:07 oh i see :) Thanks
taxilian 19:07 but if you don't return true for the draw event firebreath will do some default drawing
Grimshaw 19:07 draw event?
taxilian 19:07 RefreshEvent
Grimshaw 19:07 I am just swallowing the window handle and drawing openGL
do i need to use that?
taxilian 19:07 it *probably* doesn't matter because your opengl context most likely obscures the window anyway
but you should probably handle the event and send a message to your rendering thread whenever you get the refreshevent to minimize flicker
if you're drawing at 30fps it won't matter, of course