tKircher

Members
  • Content count

    20
  • Joined

  • Last visited

Community Reputation

122 Neutral

About tKircher

  • Rank
    Member
  1. You were absolutely right, i'd ensured my rendering didn't use AA, but the images did indeed have soft edges. After some quick tweaks to them, it works fairly well. D'OH. I still don't like running every sprite through the equivalent of a replacement filter every cycle, but it still really beats drawing a few hundred quads to make one sprite.
  2. I have a number of complex sprites made up of very simple parts that don't change that often, and redrawing the parts real-time is a pretty big waste of cycles. So i'm trying to push the entire sprite onto a texture, and just use that texture as my rendering call for the sprite. This is all great, but whenever i try to copy, the texture i get is an image with the sprite on a black background. This makes sense, i'm clearing the buffer and drawing the entity, then glCopyTexImage2D() straight to the texture. Naturally i'll get whatever's in the gaps, which in this case is my clear color, black. I obviously can't have great black squares following my sprites, but i also can't get them into their texture without rendering them somewhere first. Is there a way to render directly to a texture, or to specify that i want the untouched portions of the texture to have zeroed alpha? Note; i tried a real hack that involved clearing to an ugly purple (1, 0, 1, 1) and running a 'replacement' shader that ignored fragments that would be purple whenever rendering the fragments of the sprite's texture, but this resulted in a sort of purple 'border' around everything, and the shader didn't quite work correctly anyway.
  3. [java] Java 6 input latency

    Found it, had to do with a background image loader thread which apparently had more priority than it used to; it was delaying the AWT thread but not the main one, even though it only cycled once every ~50ms. Increased the delay between image loads and the problem went away. I guess somewhere between 6u3 and 6u13 they gave program-created threads precedence over AWT.
  4. [java] Java 6 input latency

    Quote:How are you handling the input? Window is created, fullscreened at startup. -"InputManager" object is created and registers itself with the window as a keylistener, mouselistener, and mousewheellistener (for motion, i poll on a per-update basis with mouseinfo) -- Every time input is fired, the inputmanager (via AWT thread) throws condensed information about the event into an "InputQueue", which is really just a bunch of arrays with events stored in them. --- Every logical update, the main thread runs down all the collected input and acts upon it. I know you're thinking "well obviously it's a synchronicity issue with the inputqueue, or he gets terrible framerates" but it isn't. The program updates and renders as speedily as ever, and i didn't implement the InputQueue until after the problem started happening (i had thought i was loading down the AWT thread, so i offloaded to main thread). Quote:Assuming 1.6 is fancy internal-dev talk for Java SE 6, your Eclipse is about 13 u's behind the cutting-edge. There are plenty of deprecated methods in the GUI libraries - maybe you should update Eclipse, load up your project again, and see if any of your AWT calls have lines through them? Did, after i realized it was happening based on which JVM was running, i put 6u13 as the editor's standard JVM, updated the JDK and Eclipse. Nothing's deprecated (i'm not using anything exotic anyway, just the basic input listeners). I'll see if i can throw together a stripped-down example of what's happening.
  5. I've been tracking down an extraordinarily strange bug all day, and i finally tracked down what it is, but I'm not sure if there's even a way to fix it. The problem, in a nutshell, is this: All input seems "lagged," as in it takes about a half a second between the time that i press a key or move the mouse, to the time that the program recognizes the input. I'll make a note here and mention that i'm using a Frame dedicated to exclusive fullscreen through the default graphics device. It's not my code. This bug didn't crop up until i started exporting to .jar files and testing things out-of-editor. It happened in every machine i tested it on, but never in the editor. After tearing my hair out, i tracked it down to that my Eclipse uses JRE 1.6u3, while the executable defaults to jre6 (latest update). Using the older jre, the input is snappy and normal. When using the latest one, input is slow and unresponsive, and even "hangs" for entire seconds at a time before getting cycled over to my program. So, at last, my question is this. What changed between 1.6u3 and 6u13 to make input act so wildly out-of-focus? And, more to the point, what can i do to make this work? I'm guessing the AWT event dispatch thread changed somewhere, but i can't find any info on it, or what to do even if that is the case.
  6. While trying to load flat bytes (unsigned char) from a PNG file, I realized i was using the clunky old fread() and FILE* combination, which seemed sort of inelegant compared to the more C++ ifstreams. So, in trying to convert to it, i realized that i'd never read flat bytes using that method, and that, (surprise surprise) there's no method to do it. I tried using reinterpret_cast, but it just errored out during the read. I tried a quick hack to this effect.. //unsigned char inValue //ifstream* in in->read((char*)&inValue); Thinking myself clever, it ran and didn't crash. Oh, but the best part, it gave incorrect results. For whatever reason, it doesn't give me the same bit pattern as fread() did, and also doesn't line up to what PNG specification says should be the initial bytes. Is there any way to read flat bytes without writing a novella of workaround code, or should I just go back to fread() and deal with it?
  7. Using a 3D plane's 2D coordinates

    You're right, i didn't really explain the entirety of what i was after. I'm trying to create a multitextured effect that applies its' effect across multiple tris (for which i've created planes), so the idea is to find appropriate texture coordinates for the effect's texture for each vertex on the plane. To do so, i can't simply find regular distance (otherwise only half the texture will ever be applied to the geometry, which wouldn't look right). Anyway, long story short, i need to use the planes i've created as 2D 'canvases' so i can properly put the effect anywhere in the game world. The easiest way i can think to do this is to use the planes as arbitrary 2D "graphs" much like one would use an orthogonal projection in DX or GL, or in a simple 2D game. Which brings me back to trying to find out how to use an arbitrary 3D plane with 2D coordinates.
  8. I have a 3D plane that i need to be able to use very much like a traditional 2D "coordinate system." That is, i have points on the plane, and i wish to find the distance between them in X and Y across the plane, rather than the 3D coordinates of the plane itself or the world around it. I know it has something to do with linear algebra and orthogonal projection, but i can't find any good resources dealing with this sort of problem, so i'm at a loss for an algorithm or even a starting place. My plane is defined by an origin and normal (or is defined by just a single vector, if you wish to be strictly orthodox about it), and the 'origin' is even where i would ideally like to use as (0, 0), help's appreciated.
  9. Relating to Characters Intellectually

    Personally i find that to make a resounding character, you have to keep the player/audience/reader from being able to catagorize your character. As animals, we think in stereotypes as a way to gauge how dangerous someone/something is to us. Anymore, it's easy to categorize characters as thugs, scientists, businessmen, mages, whatever. So, in my opinion, you have to create a character that doesn't fit in a box, a category. The player will think for a second, then realize he's interested in what this character is, what makes it tick, or even just what the character will do in a given situation. Making the character visually different helps, such as having a unique appearance or manner of walking. Voice types help too, making the character's accent difficult to place, or have him have a style that pauses erratically, forcing the player to 'wake up' and pay more attention, things like this. It can be overdone, however... (G-Man from HL, as an example). From there, the player will be drawn to the character, trying to figure out what the character is 'thinking.' Even the most unanticipated actions the character makes could be imbued by the player as 'personality.' Example, a character whose random "finishing moves" might be interpreted as personal style, even if you had no intention of making a personal style. Anyway, just my musings. Came from watching Dark Knight, and not being able to stereotype Ledger's performance as the Joker. But in more direct response to the OP, I think you can certainly make a game about 'numbers' characters, the Japanese do it every day. I've never found anything worth remembering in that style of storytelling, but obviously there's plenty of people that have.
  10. Working with vista and 64

    I've been developing some basic game-ish things on winxp 32bit. Everything works great on the developing box, both in and out of editor, but as soon as i try it on my "gaming box" (which has vista 64bit), it won't work. It pops a little message saying "this application has requested the runtime to terminate it in an unusual way..." I'm using Visual studio 2k8 express, and I made sure to do the "use multithreaded" settings, and all the required libraries (opengl, glut, openal, ogg) are set in the system32 as they should be, i even tried "run as admin" and compatibility mode, same result. I checked, the window is set up fine (i put in debug lines, but it's annoying to do debugging on a different machine than the dev box) So i have no other choice than to assume there's caveats about vista i'm not aware about, something with permissions or 64bit that's crashing the program. Do i have no other choice than do fill my code with debug lines in the hopes of finding the problem, or are there common "gotchas" that might not apply in XP?
  11. I'm trying to make a 'fake' lighting scheme using a multitextured pass that blends "light" over a dark surface to simulate light, like you might see in the Quake style of game. I've got a good idea of how to do it, but i need a way to determine the closest point on a tri, to an arbitrary point in space. Example; let's say i have a tri T defined by three verts, V1, V2 and V3. I want to find the closest point on tri T to point P (which could be anywhere). I know it must have something to do with plane intersections, but i just can't put an equation together that gives me what i'm looking for. Help's appreciated.
  12. I have two classes which need to have circular dependancies (each one needs to have a pointer to the other, in the actual instance). A simplified version of what i'm looking at... //force.h class Force { Entity* owner; } // entity.h class Entity { Force* forces[]; } Doesn't work, of course. More than one Google search came up with a 'forward declaration' in the header, but this doesn't work either (i can have a pointer in the class, but in the .cpp definition it won't let me actually use the pointer, go figure) The only other possible fix i've seen is to abandon the header and just define the class in it's .cpp file, which won't work either; since i need other classes/files to be able to 'see' the classes involved. I know it's possible, so how is it done?
  13. Point in short, i have the 1.0 SDK with all the libs, dlls, and .h's, but i don't know what needs to go where in order for me to pragma comment in support for Vorbis, nor what has to be redistributed with my program once it's completed. I'm using Visual C++ 2008 (express), in Windows XP SP3, but i'd prefer to keep things in-code as much as possible, not with compiler settings (thus why i mentioned pragma comments). Any help's appreciated for a wayward noob.
  14. I've been trying to put together a general line-of-sight (or raycasting, take your pick) routine for a little bit, but i'm amazed to find so little information on how to do it, especially since this stuff has been around for ages... In short, what i'm trying to do is find if one point in world space can see another, and if any tris are blocking them; and what i'm doing now isn't working. I don't need field of view or anything, just if one could draw a line directly from point A to B without any tris in the way. Help's appreciated.
  15. Angle between two 3D points

    Quote:First, the formula does not generalize to plug in sin/cos/tan/asin/atan, it only works with acos. Second, unless you are using normalized vectors, dividing by the magnitude is actually very important. That's all i had to do, as soon as i normalized them the whole thing worked, acos/asin of the dot finally return the correct values! Thanks for all the help!