IRC Log Viewer » #firebreath » 2013-08-28

IRC Nick Time (GMT-7) Message
st4ck_ 07:08 f
taxilian 09:08 st4ck_: read your explanation and I'm afraid I'm not following what you're trying to do. if you have infinite loops anywhere on a page it's going to cause a problem
st4ck_ 09:08 taxilian: i'am trying to draw 2D radar, this drawing player on the radar, player position are readed from the plugin with ReadProcessMemory ! so i have to update soons as possible the player position.
taxilian 09:08 okay, so the first thing to consider: you realize that you can never update more than every 13ms? (60 hz)
st4ck_ 09:08 taxilian: yes 13ms is sufficient
taxilian 09:08 so you never, ever want to actually do an unending loop
use some sort of timer instead
that every 1/60th of a second (actually I'd do 1/30th if it were me) checks the data and renders it
st4ck_ 09:08 taxilian: player position is readed from another process that's why i need ReadProcessMemory and the plugin.
taxilian: yes it's work for me but plugin uc usage is going to up.
taxilian 09:08 uc?
what exactly is uc?
st4ck_ 09:08 pluging processor usage
taxilian 09:08 okay, so for future reference call that "cpu usage" or "cpu utilization"
are you drawing in javascript or with the plugin?
st4ck_ 09:08 javascript
taxilian 09:08 okay, so first make it asynchronous, since you're doing IPC with it
you could do it a couple of ways
you could start a thread and have it just fire a javascript event every 1/30th of a second or so
or you could start a new thread each time you request an update and have it call the callback function when it gets the result
if your cpu utilization is going through the roof it's most likely because you're doing a loop with no delay
st4ck_ 09:08 In javascript code the loop is made with requestAnimFrame. and i set timeout, acctualy (1000/60).
taxilian 09:08 and the plugin requests the data only in response to that?
st4ck_ 09:08 yes
taxilian 09:08 then it may just mean that it's cpu intensive enough that 60 fps is that hard on the cpu
or you may be doing something somewhere that you don't realize
st4ck_ 09:08 Okay, maybe because in one loop, i made 4 method call from plugin, 1 per data, maybe better to return all data in one method.
and i loop 64 time, i have 64 players.
taxilian 09:08 hmm. could be. so a couple of things to know:
1) there is a performance hit every time you make a call to or from the plugin, because it's cross process. This means that calling the plugin once and getting a large string is faster than calling it 4 times and getting 1/4 of that string each time
2) when you return a FB::VariantList or FB::VariantMap to become a javascript array or object it has some serious performance implications because it has to call back into javascript once to create the object and then again for each item that gets stored in the array or object
so if you're returning a large amount of data it's always faster to return it as a string
st4ck_ 09:08 my datas are : 1) my view angle[float], 2) my position [vec3{x,y,z}] , 3) player position [vec3{x,y,z}] 4) my teamID[int] 5) player teamID[int].
does is considered large ?
taxilian 09:08 at 60 * 64 per second? yes, you'd be much better sending that to the browser as a json data structure
json string, I mean
st4ck_ 09:08 Okay thanks
taxilian 09:08 see
st4ck_ 09:08 Realy appreciate your help !
taxilian 09:08 good luck
pat__ 14:08 I am trying to run the BasicMediaPlayer example on Mac (OSX 10.7.5). I was able to build it, but both Safari and Chrome did not pick it up. The FBTestPlugin and the empty project I created worked. Any ideas?
I tried both the 1.7 branch and the latest from GitHub
taxilian 14:08 not offhand; basicmediaplayer on mac is just a rendering example
pat__ 14:08 not sure I understand. The browser was not able to find the plugin.
taxilian 14:08 yes, I gathered that. I don't know offhand why that would be
unless perhaps it didn't really build
it isn't maintained very well
basicmediaplayer, that is
pat__ 14:08 yes, the example packaged
I need to learn how to render to Mac window and that is the example I need working
taxilian 14:08 first thing I'd do is make sure the binary is where you think it is
and that it's the right type (32 bit, at least)
pat__ 14:08 yes, I did a file on the symblic link. It shows both architectures
taxilian 14:08 which symbolic link is that?
pat__ 14:08 FireBreath BasicMediaPlayer Plugin.plugin
then cd into it
under Internet plug-in directory
taxilian 14:08 you might try copying instead of symlinking the .plugin directory
also don't rename it, just to verify
pat__ 14:08 I have tried it already. But I will do it again just to make sure.
taxilian 14:08 unfortunately, other than that I have no ideas
it's been a long time since I last tried to build that project
pat__ 14:08 also, I installed the other two plugin the same way. So I doubt it is the problem.
No, copying it didn't help.
taxilian 14:08 no idea :-/
pat__ 14:08 I have some more questions. In that BasicMediaPlayer example, there is a subclass of BasicMediaPlayerPlugin for Mac. Is this autogenerated with the scrips?
taxilian 14:08 it is not
but it is the way that I generally recommend doing anything platform specific
pat__ 14:08 so what is the work flow to add those files in the project? I watched the videos and it told me not to add them in the xcode project directly. Does the prepmac script add it in?
taxilian 14:08 prepmac uses camek
so CMakeLists.txt contains the cmake configuration for all platforms; where it does include_platform() it includes the Mac/projectDef.cmake (or Win/projectDef.cmake, etc) file
so the projectDef.cmake files have project specific stuff for those platforms
pat__ 14:08 k, thx