Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

209 Neutral

About jujumbura

  • Rank
  1. Hello all,   I've been working in the games industry for about 10 years now, primarily as a Gameplay Engineer.  And while it has been very exciting and fun at times, I have reached a point in life where the sort of hours you work in this role aren't meshing with my family life.   So I was hoping to just throw a question out to the winds, and see if anybody here has been/is currently a Tools Engineer in the Games Industry?  What is the day-to-day like?  What are the projects like?  What are the hours like?  I have worked with Tools Engineers in the past, and I am curious about the role.  I know that their schedules are often different than the rest of the team, since they are in a support position.   Thank you for any insight!
  2. I am working on a game, and I want to manually run the main event loop on IOS. That is to say, I want to dequeue the UIEvents myself from the source, and then send them on to the UIApplication.   I have found examples on how to do this for OS X, and it works. In that case, it is a matter of calling "nextEventMatchingMask" and then "sendEvent" on the NSApplication object.    However, I cannot find the equivalent means to gather events on IOS with a UIApplication object. I have been reading about an "event queue", but I do not yet see how I could get a reference to this queue object. Does anybody know how I could acquire UIEvents from the source, so that I can send them to the UIApplication?
  3. jujumbura

    Data Flow Between Systems

    Thanks guys,   I am going with the assumption that I should duplicate the data, for the reasons you describe Sean.  But my problem is the data needs to be in different orders for different systems, so when I duplicate it I end up having to jump all over memory to reorder it ( it's never a linear memcpy ).  I think that's probably inevitable, and I am trying to consider the best way to do it.   @Waterlimon - That's an interesting thought, regarding keeping it sorted over multiple frames.  However, although it's true that the order is unlikely to change, the data itself almost certainly will ( assuming these are all dynamic objects ), so I still need to re-write data into the sorted "slots" each frame.  I can cache the sorted index to avoid running the algorithm, but that's almost identical to the second method I was discussing ( which never actually entails a sort ).  Unless I am misunderstanding your suggestion?
  4. Hello,   I was recently watching Mike Acton's talk at the CPP Con, regarding "Data Oriented Design", and I've been thinking a lot about how I might be able to structure my game code to better take advantage of cache coherency.  The ideal here would be that all major processing is done on contiguous arrays of data, directly in-order.   But I've been struggling on one particular aspect of this: the problem is that the ordering requirement between various systems is not the same.  For example, suppose I have a typical flow of data: I have high-level behavior that updates positions/rotations, which then needs to be transformed by collision and collision response, and then converted into matrix transforms for draw calls.  There are distinct ordering requirements for each step here: behavior will want data grouped by type, collision will want it grouped by spatial locality, and rendering will want it grouped by draw order/material/etc.  Beyond that, these requirements will change as the state of my game changes ( not referring to static objects here ).   This means that I cannot simply set up fixed arrays and run my processing in the same order across the board.  Somehow, I have to convert between the different orderings as I go.  Specifically I am considering the efficiency of the reads from the source, the writes to the destination, and then the reads at the destination.  I have thought of three possibilities to do this:     Maintain the data in linked lists per-system   - This is what I have done for many years to solve this problem.  It is easy to use, and there is no major processing required to maintain ordering.  But the issue is, you end up iterating ( reads at the destination ) out of order, and you have all the node values filling up your cache.     Use linked lists for indexing and copy to arrays per-system   - I have just recently tried this out.  The iteration at the destination is noticeably faster, but the copy ( writes to the destination ) is now out of order and takes longer.  Overall, it has been only a minor speed boost for me.     Copy to arrays directly and sort per-system   - I have not tried this out yet, but I intend to.  Theoretically this could have the least amount of cache misses as everything is done in order.  It's hard to believe that the cost of running the sort algorithm would not outweigh the gains, but I'll have to test that.     Does anybody else out there have solutions that I am not thinking of?  I'd be greatly interested to know how people tackle this kind of problem.   Thanks for reading!
  5. I have been messing around with Android NDK development for a while now, and I just recently got an animation viewer up and running as a NativeActivity App on my Android device.     One thing I was shocked to discover, though, is that when I hit the "Back" or "Home" buttons while running my device, my App is given the "APP_CMD_DESTROY" command, signaling it to exit the thread.  I had assumed that when leaving an App, it retains a memory space which is restored when you return to that App.  But from this behavior, it appears that my App will be restarted from scratch each time I enter and exit.   I read up a bit on the Android lifecycle, which seemed to confirm this behavior.  The intent seemed to be using the "savedState" buffer to handle the restore myself.  If this is really the intended flow, I now have a lot more respect for every native App that seamlessly transitions in and out.  But if this is really true, then I'm wondering:   1) What is the max limit on the savedState size?  I'm assuming I couldn't copy my entire allocated memory range, for example. 2) Assuming the above answer is fairly small, doesn't that imply that you need to reload all resources again?  This seems like it would involve tons of loading time, even for a brief transition back to the main menu.   It just seems like I must be missing something.  I'm curiow now how iOS handles this...   Thanks for any advice!
  6. jujumbura

    Display Loop with Win32

    Think I found my problem!   In my display() function, I was calling glGetUniformLocation() for the projection, world and texture locations.  That seems to be what blocks, not glBindBuffers() ( I had been overlooking that in the profile region ).   If I instead cache the uniform locations on init after linking the shader, I no longer stall in my display() function.  Now SwapBuffers() is what takes the 16.6 ms as expected.   I am a little surprised that getting the uniform location would block like that, but maybe it's documented somewhere...?
  7. jujumbura

    Display Loop with Win32

    Thank you Spiro, that clarification helps a lot.   The only thing that doesn't make sense then is the profiling I am doing.  I built a little profiling class using QueryPerformanceCounter(), and I am using it to record time taken for blocks of code.  My loop looks like this: while(!done) { if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { if (msg.message==WM_QUIT) { done=TRUE; } else { TranslateMessage(&msg); DispatchMessage(&msg); } } else { display(); SwapBuffers(hDC); } } Now I have a start/stop timer block around the display() function and the SwapBuffers() function.  If the main thread wait occurs inside SwapBuffers(), I would expect that the SwapBuffers() timer would take around 16 ms ( as my scene is very light, just two quads being drawn ).  But from my numbers, the SwapBuffers() call takes almost no time and the display() call takes around 16.6 ms.  That's why it seemed like something in my display() function was blocking, which lead me to glBindBuffers().   But maybe I have an error in my timer class, or I am making an invalid assumption here?
  8. jujumbura

    Display Loop with Win32

    Alright, dug a little deeper:   I did some more timing to see where the block occurs in my display function.  It's not in glClear(), glUseProgram(), or any glUniform...() calls.  It appears that the wait happens when I call glBindBuffer() to activate my vertex data.   This to me sounds like the buffer resource is being locked internally while the GPU is using it to render.  This is actually undesirable for me, as I definitely want to be able to start writing draw commands for my current frame while the GPU is working on the last frame.  If I'm right about this, is there any way to avoid the stall?  Since I don't need to modify that data, it seems like there ought to be a way to use it for rendering without trying to lock it...
  9. jujumbura

    Display Loop with Win32

    Well, it's not that I want to control the VSYNC itself, its that I want to control when my thread is blocked by it ( or at least know exactly when it is going to occur ).  And that's the funny thing; I assumed it would occur on SwapBuffers, but it seems like it's actually happening somewhere in the OpenGL calls based on my profiling.  Really I just need to know what function is going to block as that will affect how I synchronize with other systems in the simulation.
  10. jujumbura

    Display Loop with Win32

    Thanks for the responses.  An update:   - I do have a double buffered Render Context, I apologize for not mentioning that initially.   - I tried removing the glFlush() call, which seemed to have no effect at all.  This surprised me, as I'm used to flushing my graphics pipe before any accumulated commands are sent.  Is this not required in OpenGL?   - I tried setting wglSwapInterval( 0 ) as you suggested Spiro, and that definitely behaves more like I was expecting.  Now I get far more than 60 iterations per second, with frame averages of around 0.15 ms.   So this makes sense, assuming that some process is waiting for the next VSYNC to actually swap the display buffers ( with the interval set to 1 ).  But what I am wondering is; where is my thread getting blocked exactly?  From my profiling it seems like it is happening during my display functions ( I could narrow that down further ... ), which is entirely OpenGL calls ( the SwapBuffers() call comes after ).  Does OpenGL just wait on the next call if a buffer swap has been requested that hasn't completed yet?   Just for clarity: the reason I'd like to know is so that I can control the VSYNC wait myself.  I actually want to be limited to 60 fps, but I'd like to be able to manage where that wait occurs in my render loop.
  11. Hello all,   I've been working on a little OpenGL test recently, and I was trying to set up smooth animation.  I am programming on Windows, using win32 for my application setup, and GLEW for my OpenGL calls.  I apologize in advance if this question is more win32 than OpenGL, but here goes:   My window is set up to support OpenGL, but is not full screen.  My main loop is the standard while loop, with a PeekMessage() once per iteration.  If no messages exist, I display and update my scene.  The display functions runs a bunch of OpenGL state changes, a few draw functions, and then calls glFlush().  Now, my expectation was that this loop would be running as fast as it can ( ie: no waits ).  But I noticed that my animations appear to be running at around 60 FPS; I profiled it with QueryPerformanceCounter(), and that does indeed seem to be the case.     Initially, I had thought that perhaps one of my win32 functions was blocking in order to fufill some sort of requirement, but upon closer inspection it looks like it is actually my display function that is taking around 16.6 ms on average.  In that function I only call glFlush() at the end, I do not call glFinish().     Does anybody know why this might be happening?  It's actually kind of what I *want* to happen, but I'd like to know why my loop is mysteriously locked to 60 FPS.  My understanding was that getting VSYNC with OpenGL and win32 requires special use of extensions to configure the swap interval, so I was pretty surprised with this behavior.   Many thanks for any advice!
  12. jujumbura

    Issue with GLEW, Eclipse, MinGW

    Woops!  Guess I should read the manual.  Looks like I needed the following:     glewInit();     ... before calling any of the extension functions.  Now no more dll issues!
  13. Hello all,   I have just recently been trying to set up an OpenGL environment in Windows, using Eclipse as my IDE and MinGW as my compiler.  I am stumbling along so far, but have successfully gotten a simple window up and rendering with freeGlut.   However, I started running into problems when attempting to call the function "glGenBuffers()" to allocate a vertex buffer and an index buffer.  I realized then that I needed a utility to get access to the extension functions, which is when I started looking at GLEW.  I downloaded the source and built it with msys ( make ), and I am currently trying to get the library functional in my application.   Initially it would fail immediately with dll errors, until I put the built "glew32.dll" in my Path.  Now I can get past the starting point, but as soon as I call "glGenBuffers()", I get another missing dll error.  Specifically it says in my console window:     Error: dll starting at 0x772f1000 not found. Error: dll starting at 0x760c1000 not found. Error: dll starting at 0x772f1000 not found. Error: dll starting at 0x77411000 not found. Cannot access memory at address 0x0     I am a bit confused at this point.  I would assume that if I were still missing the dll file GLEW needed, it would still be crashing on startup.  But maybe the dll is just enough to keep it from crashing initially but not actually compiled correctly for my platform?  I did end up with my msys setup being unable to find MinGW, but it built GLEW all the same ( perhaps with a different, incompatible compiler ? ).   Sorry, that's a lot of balls in the air, I apologize.  If anybody has any good advice to track this sort of thing down, I'd appreciate it.   Thanks much!
  14. Hello all,   I have a build pipeline for a game, which requires that a Win32 console executable be recompiled whenever certain files change.  This executable is not the game itself, but must be up-to-date before the game itself is compiled.  The compiler I am using for the game is not capable of compiling for the x86 platform, so I need to find a different one.   Typically I use Visual Studio when compiling Win32 applications, but I am doubtful that the licensing agreement allows me to take that compiler and redistribute it as part of our build pipeline.  Does anybody have any good suggestions regarding a free, redistributable C++ compiler that sounds like it might fit this purpose?   Thank you very much for reading!
  15. jujumbura

    Generating Vertex Normals

    Hello all,   I have been making some functions that create "rounded" vertex meshes for me by sweeping over two angles ( vertical and horizontal ) and then using trigonometry to determine x, y and z position values.  The normal for a sphere made this way is simple, but I have started generating more complicated shapes where the normal can't be easily stripped from the position.   So, I am trying to determine the best way to find this normal value.  I know that the normal is given by the reciprocal of the tangent of an equation, and I can find the tangent by taking the derrivative.  But I can I use my original equations for x, y and z in terms of the two angles, or do I need to use different equations?   Thank you for any advice!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!