Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

464 Neutral

About pTymN

  • Rank

Personal Information

  • Role
  • Interests
  1. pTymN

    A question about coloring grayscale game sprites

    This is a glsl fragment shader that maps magenta to another color, taking the magenta's brightness and alpha into consideration.
  2. pTymN

    Neural networks fundamentally flawed?

    Neural nets are flawed, if we define flawed to mean "does not follow the model the brain provides". Dendrites are seen as simple signal absorbers from the neurons they touch, but they actually perform filtering functions. This is probably a very crucial step, and it has an implication about the role and meaning of a neuron. Essentially, instead of weights and thresholds, the actual brain uses conditions and signals.
  3. I think that I have the basis for a solution. I needed to convert from my turn speed to the curvature, the curvature to a circle radius, and finally the circle radius to acceleration towards the center of that circle.
  4. If I have a Px(t) = At^3 + Bt^2 + Ct + 0 and Py(t) = 0 for my character's position while running and a constant radians/second that my character can turn, how can I transform that into an explicit formula for Px(t) and Py(t) after turning is applied? Is this related to fresnel and euler spirals or track transition curves? Much thanks to anyone who can give me a strong kick in the right direction. Edit: I figured out a piece, that I ought to be figuring out P''x(t) and P''y(t) instead of thinking about curves at all.
  5. In situations where you need to actually update that many objects each and every frame, well tuned spatial hashing will handily beat all other broadphase methods for large amounts (1000s) of uniformly sized objects - where the largest are within 4-8 times the radius of the smallest objects. If you can get away with only updating a subrect of your game world, that's another optimization you should consider.
  6. I've written what amounts to a random access video codec for my texture assets. Whenever the same GL texture handle is used in consecutive draw calls, my renderer automatically batches quads. The original implementation calls glTexImage2D on textures from a pool for each loaded image. Images whose textures are not used by the end of the current frame are discarded for reuse. This was increasing my draw calls to ~70 per frame, mostly the fault of the drawn font strings (batched glyph quads). However, it does give me 29-34 fps according to the Instruments GL Driver profiler. The implementation that I tried yesterday uses glTexSubImage2D to update portions of dynamically created atlases. Even though the draw call count dropped to ~10, and even though Instruments shows that my atlas rectangle choosing is not the cause of the slowdown, I am seeing a drop from ~30fps to ~22fps. Is glTexImage faster than glTexSubImage? Does the iPad's tiled renderer hardware operate more efficiently with smaller textures? Would it be reasonable to expect that there are GPU caching issues in play and that the constant trimming down of in-memory GPU assets is making up the difference? Is there a possibility that if I queue up render calls in order to batch glTexSubImage calls, that my on-the-fly atlas approach could be faster? I appreciate help from anyone with insight on how the particulars of the PowerVR SGX affects performance in my situation. Thank you so much for taking time to help me understand. Except for situations with some crazy multitexturing or complicated shaders, I haven't seen less draw calls be slower than so many more draw calls before.
  7. pTymN

    Tile ripper utility

    Blog post with source and sample Check out the links to see what it does to an image. Whether you are writing a C++ or AS3 Box2D app that needs to manipulate images that are larger than you can fit in memory, you could use the utility to make your work easier. Also, if someone does compile the tile ripper utility for MSVC, please link me with the project and executable so that I can make it available to everyone.
  8. pTymN

    Tile ripper utility

    Just got a mac, don't have C# to help me out here :-P
  9. I am having difficulty finding any useful info on google for a tile ripper. I have a giant 20,000 x 5,000 png that I want to: 1. Break into tiles 2. Throw away duplicates 3. Output an atlas png of the tiles or multiple tile pngs. 4. Output an xml file with information on how to construct original image from unique tiles. It seems like a problem that would have been solved before. Any suggestions?
  10. Hello, My paranoia is pretty high now regarding the fact that the Flash GC seems to completely leak any object with a circular reference, including a MovieClip who has a child or maybe somehow SoundChannels, due to a very naive reference counting algorithm. Here's some questions that I can't find detailed answers for: 1. When is the code from a closure generated? 2. When is the code from a closure garbage collected? 3. When are objects that are referred to from a dead closure garbage collected? 4. It seems like a very big oversight that a basic type of object like a MovieClip has exactly the kind of circular reference problem that the garbage collector chokes on when it contains an also unused child (parent and presumably hidden field children cause parent and child DisplayObjects to point to each other circularly). Do all experienced Flash developers already know this, or am I doing something really stupid in my AS3 code? 5. Eventually my game starts getting null return values from anySoundInstance.play(), but the game is able to play way more than 32 sounds (I have to run it for a few hours in an autoplay mode before I see the problem when I come back to my PC). My sound playing function sets up a sound.complete event (which removes itself from the SoundChannel when triggered) and returns a function that takes a fade out time in milliseconds and adjusts the channel's volume very 50 milliseconds. I'm wondering if closures can cause memory leaks. 6. I can't find any reference to the parent SoundChannel in SoundTransform or SoundChannels in Sound, so I really cannot find any circular references in the class heirarchy. If you have any insight, please share. For SoundChannels that come from soundInstance.play() calls, it seems that even though I null all references to that soundchannel, they do seem to eventually accumulate over time until all 32 are used up.
  11. pTymN

    Raknet vs OpenTNL vs ???

    I was pretty frustrated with OpenTNL's documentation. RakNet is a good price, if you are willing to use non-free software.
  12. pTymN

    Simplifying rotation calculations

    Say that you have a "rotation vector" r that is (sin(30), cos(30)), that's the equivalent of your rotation angle = 30. If you wanted to rotate it by 10 degrees, you'd take r2 = (sin(10), cos(10)) and do an operation like this: r' = r.x * r2 + r.y * (-r2.y, r2.x) Occasionally, you'll need to renormalize r. You can cache the value of r2 and avoid using sin or cos at all. All the fmod(|r| + 360.0f, 360.0f) wraparound stuff that keeps |r| normalized for scalar rotation values can be avoided. Also, it is trivial to use that kind of rotation vector to accumulate linear velocity.
  13. pTymN

    Simplifying rotation calculations

    I recommend that you use 2d rotation vectors if at all possible. The occasional renormalization is cheaper than many sin/cos calls, and you can use simple dot product to rotate a rotation vector by another one.
  14. I'm trying to find a complete and decently performing UI solution to use in my application. Previously, I was using a Flash overlay, but there were a myriad of crashes that have stopped since I removed that. I prefer not to use something quite as obtuse as CEGUI, certainly a layout editor would be nice. Has anyone successfully used SilverLight in a C++ game? Is the C#->unmanaged C++ interop code a pain?
  15. Its more downsampling passes if the resolution was 1024x768 instead of 640x480. 3^6=729 4^5=1024. One less pass is required at a sane resolution if 4x4 downsampling is used.
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!