Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

468 Neutral

About Kitt3n

  • Rank
    Advanced Member

Personal Information

  1. Kitt3n

    Continuous Integration. The good, the bad and the ugly.

    Completely agree that you need some way of automated builds (idependent wether CI or nightly). It does force you to not hardcode paths, if makes sure the QA has a 'fresh build' on a regular basis and you don't get developers trying to manually put together a build copying files from whatever network locations (it does go wrong at one point). I would even go one step further and say that the build should result in not only an executable - but in an installer for a complete product (including all assets, sounds, scripts, .... ). >Build machines can be virtual machines, or separate physical boxes somewhere. It only really matters if your build takes an age to complete. If a full build takes "ages" to complete - then you have a serious problem anyway which needs to be addressed. It means in effect that your development team is waiting out a (big) part of the day doing "nothing". Be pro-active and look for options like incredibuild or optimize your #include-strategy ( [url="http://kitt3n.homeftp.net/wiki/dev/index.php/Buildtimes"]http://kitt3n.homeft....php/Buildtimes[/url] ). >The major gripe I have here is that the code itself has to be both testable Write tests for where it makes sense, math-code or in general code which is 'easily' tested - usually lower-level code. Keep it simple - it's no use to test a "big" system automatically this way because imo that does take too much time - that's the job of your QA department. >If a chunk of code [i]really[/i] takes a full week to write you've got some serious problems with your design. Agreed, however I've been in situations where you want the trunk to remain stable but need to do a compatibility breaking change. In this case you can decide to make a feature-branch. This gives you the possibility to do non-atomic commits (without disturbing anyone) and merge it back the moment you are done. >But you suggest that you would need to submit incomplete modules. I disagree. You certainly should check in atomic changes, not incomplete modules. imo make a seperate commit for every 'feature' (no matter how small). Then at least you have a chunk of code which is related when you track back in history. Which is way better then having 10 features pushed into one big commit.
  2. Kitt3n


    Hello, I've been studying the iPhone 3d programming "Bumpy" example, which demonstrates how to do bumpmapping. The example-code can be found here: http://examples.oreilly.com/9780596804831/readme.html However I've noticed that the used image ( converted into a header-file in the example) appears to be strange. The tangentspace.png texture (blue-ish) is converted into a header-file looks like below: A32BIT TangentSpaceNormals[] = { /* Header */ 0x00000034, /* dwHeaderSize */ 0x00000400, /* dwHeight */ 0x00000200, /* dwWidth */ 0x00000000, /* dwMipMapCount */ 0x00010415, /* dwpfFlags */ 0x00180000, /* dwDataSize */ 0x00000018, /* dwBitCount */ 0x00ff0000, /* dwRBitMask */ 0x0000ff00, /* dwGBitMask */ 0x000000ff, /* dwBBitMask */ 0x00000000, /* dwAlphaBitMask */ 0x21525650, /* dwPVR */ 0x00000001, /* dwNumSurfs */ /* Data */ 0x7F7FFF7F,0xFF7F7FFF,0x7FFF7F7F,... RRBBGGRR, GGRRBBGG, BBGGRRBB, So if I interpret that correctly, it looks like the "Green" channel is always 0xFF - i.e. it is a green-ish colored texture... To prove it, I changed the shader to not do any normal-mapping, but instead output the color directly: void main(void) { // Extract the perturbed normal from the texture: highp vec3 tangentSpaceNormal = texture2D(Sampler, TextureCoord).yxz * 2.0 - 1.0; // ... ... ... and replace replace it with a "Texture2D (Sampler, TextureCoord).yxz and gl_FragColor = vec4(texel, 1);" but that gives I get a red-tinted texture. If I take XYZ instead, it's the green (like to be expected from the texture-data up above..) So it's really confusing... where is my blue-ish normal-map texture? Why are the color channels mixed up? Any clues anyone what is going on here? Thanks for any help!
  3. Kitt3n

    How many of you use C for game programming?

    lol, exactly my point - I witnessed a substantial amount of programmers ignoring the "think" step, ending up with a big pile of junk ^^
  4. Kitt3n

    How many of you use C for game programming?

    In my experience, in C++ project people tend to write more "fluff". Especially beginners tend to make a mess of classes and create complex dependencies. Especially things like "Let's encapsulate it (because I don't want to use the other persons class directly)" leads to lots of bloat and unneeded interfaces. The same with making it futureproof (for any eventuality) - rather then just hardcode the limited # cases actually needed (and get it done) - we are adding more "fluff which might (but probably won't due to changing requirements) be used in the future, In some projects I saw multiple classes, interfaces, factories and stuff - which could have been hardcoded with just a few simple lines - instead everything is delegated to another class which i turn delegates it again. Much overhead and little code actually doing something for the end-product. So I started doing a multiplatform mini-project (osx, iphone, win32) in plain-C a few months ago - after programming for many years in C++. I set the followig guidelines for myself: - "If it takes much lines-of-code, rethink it because that solution is wrong ^^ - "it's done when it's impossible to remove any code (as opposed to "it's done when you couldn't possiblily add anything more - that might _potentially_ be used") - Add on-demand (don't look too much forward) - eg: no programming an entire matrix-class with all possible functions - if you currently only really need matrix-mul). - Don't be over-flexible/extensible (if I need 5 of something then "Something s[5]" will do fine - no factories, managers or dynamic datastructures needed). Sure, I miss template-containers - and yeah, you darn well know what you are doing with those void*'s - but it does have it elegance and simplicity. Anyway, don't just discard C because "it's old and C++ is better". Just my 2 ct
  5. I was staring at that code for 2 hours, wondering why it wasn't working - your tip took only 15 minutes of implementing and getting it working ^^ thanks!
  6. I'm trying to render a full-screen textured quad to my window with the following code. In the shader, if I use the "TextureCoordIn" it appears that I'm only sampling 1 texel (ie my screen is only 1 color). However, if I calculate the texture coordinate (code commented out), then everything works perfectly... So apparently the input-texture-coordinate is "not reaching" the shader (or maybe is always set to 0.0, 0.0) - but I can't figure out why... Any ideas anyone? const vec2 madd=vec2(0.5,0.5); attribute vec2 Position; attribute vec2 TextureCoordIn; varying vec2 TextureCoord; void main(void) { gl_Position = vec4(Position.xy, 0.0, 1.0); TextureCoord = TextureCoordIn; <= screen in 1 color, wrong //TextureCoord = Position.xy*madd+madd; <= this works } void render_fullscreen_rectangle(RenderDevice* _context, RenderTarget* _rt) { typedef struct _Vertex_V2fT2f { float x,y; float u,v; } Vertex_V2fT2f; Vertex_V2fT2f flat[4] = { { -1, -1, 0.0f, 0.0f }, { 1, -1, 1.0f, 0.0f }, { -1, 1, 0.0f, 1.0f }, { 1, 1, 1.0f, 1.0f }, }; glDisable (GL_COLOR_MATERIAL); // render fullscreen textured quad glVertexPointer (2,GL_FLOAT,(GLsizei)sizeof(Vertex_V2fT2f),&(flat[0].x)); glTexCoordPointer(2,GL_FLOAT,(GLsizei)sizeof(Vertex_V2fT2f),&(flat[0].u)); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } void render (void) { // render scene to texture/fbo // render texture to screen glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, _context->rt->texture); glActiveTexture(GL_TEXTURE0); glUseProgram (_context->m_blitting.program); glDisable(GL_DEPTH_TEST); render_fullscreen_rectangle(_context, _context->rt); glUseProgram (0); }
  7. Kitt3n

    fbo & texture size

    I just noticed the following extension on osx: GL_ARB_texture_non_power_of_two. I assume that if this is supported, I can safely use 960x640. Tried the iPhone simulator and it doesn't support this extension (however it also seems to work there). Haven't tried the device though. Anyone have any experience with non-pot textures on iPhone?
  8. Hello, I'm learning openGL and have some questions on FBO's and texture sizes. Assume my the window is 960x640 pixels. I understand that textures are preferably power-of-two, which means I need a 1024x1024 depth & color-texture in my FBO. However that will change the aspect-ratio from my rectangle-window to a square texture and either mean stretching or only using a part of the 1024 texture. Questions: 1. Is the aspect-ratio issue bad (stretching into texture & unstretching to window )? 2. Should I try to only use 960x640 pixels of this 1024x1024 texture? 3. When I try to use only 960x640 pixels (see rendertarget_push()), the image looks stretched - and on the right side a bar of 30 (or so) pixels is "missing" ? How to let it only use a small part of the 1024x1024 texture? Regards bool rendertarget_push( RenderDevice* _context, RenderTarget* _rt ) { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _rt->fbo); glPushAttrib(GL_VIEWPORT_BIT | GL_COLOR_BUFFER_BIT); glViewport(0, 0, _context->w, _context->h); // 960x640 //glViewport(0,0, _rt->w, _rt->h); // 1024x1024 glViewport(0,0, _rt->w, _rt->h); //_context->w, _context->h); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, _rt->depthbuffer, 0); } bool renderDevice_rendertarget_pop (RenderDevice* _context) { glPopAttrib(); glDrawBuffer(GL_BACK) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glDrawBuffer(GL_BACK); glReadBuffer(GL_BACK); } void renderDevice_render (RenderDevice* _context, Scene* _scene) { rendertarget_push (_context, _context->rt); { renderDevice_clear (_context); glUseProgram(_context->m_simpleProgram.program); < render the 3d scene > glUseProgram(0); } renderDevice_rendertarget_pop(_context); // copy rendertarget to backbuffer { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, _context->rt->texture); glActiveTexture(GL_TEXTURE0); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); glEnd(); } } vertex shader attribute vec2 Position; attribute vec2 TextureCoordIn; varying vec2 TextureCoord; void main(void) { gl_Position = vec4(Position.xy, 0.0, 1.0); TextureCoord = TextureCoordIn; } pixel-shader varying vec2 TextureCoord; uniform sampler2D Sampler; void main(void) { vec3 color = texture2D(Sampler, TextureCoord).xyz; gl_FragColor = vec4(color, 1); }
  9. Kitt3n

    Best way making Multiplayer?

    Quote:Original post by Mafioso Quote:Of course that doesn't mean you should have some massive function which can do *anything*. A function should be able to do one specific thing but be able to do it on any of a range of inputs. Instead of Making Move1(), Move2(), Move3(), etc., make Move(i) where i is 1, or 2, or 3, etc. and Move() uses that that to move the appropriate thing. Or make it Move(object) where object is some object that needs to be moved, and Move() will move it. Now Move() is more general. Ok it works what you said, but if I have linked list for one player, I can't make linked lists for many players. You could make a vector (size is #players) containing a list for each player...
  10. Kitt3n


    You would probably have a sprite class, containing a vector of images, a float timestamp which is incremented and then used with int-cast to index into this vector. Alternatively, you could put all your frames in one big texture, and then have a vector of texture-uv coordinates you refer to with your index. Then you could have some kind of "advanceTime (float _deltaTimeInSeconds)" which you call from your logic-loop with the elapsed time since last frame, and increment your sprite-timestamp. That would give you a basic, animated sprite. Now for a 2d-game, you'll probably want to add different walking directions, which implies more vectors with different animations (or a bigger texture containing all frames) and some kind of statemachine determining which animation to take, depending on the movement direction. Regards
  11. Kitt3n

    Decent video editing software?

    If you have a MAC, you could try Final Cut Express It's really nice movie editing software...
  12. Maybe an alternative, get a box like the qnap 2xx (or 4xx for the more expensive models). It's a little nas box with mail-server, webserver, ftp-server, ... possibility to install a subversion server,depending on the model 1, 2 4 or even more 2TB harddisk supported. Pretty easy to configure and doesn't get more flexible than that. Synology has comparable models... Regards www.kalmiya.nl
  13. Maybe you called your update function on a null-pointer? Next time youn get the assert, look at the contents of iter I'd also add an assert - just to be sure ^^
  14. Kitt3n

    Generic Skill system

    If you want to make a skill-system like in diablo, which not look at how they handle it? It's pretty generic, like a skill depends on max 2 other skills having a certain level (or more generic having some value larger, smaller then 'constant'). Then you can start doing an xml file (or lua - whatever) in which you set the pre-skill condition and constant value... Just google and analyze what D2 is doing, they actually have a pretty flexible system.
  15. Kitt3n

    Diablo-esque navigation

    Diablo2 is walking for the player is pretty primitive - just walk until you hit an object - then try to slide past it in the most obvious direction. If it doesn't work - idle.
  • 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!