• Content count

  • Joined

  • Last visited

Community Reputation

278 Neutral

About astagg

  • Rank
  1. SFML Frame Per Second feedback

    Just starting out with sfml myself and learning my way around it. I should point out that the GetFrameTime() function has been removed in the new version (2.0) as they [url=""]didn't think[/url] it was accurate or needed. It is recommended that you use the clock class, most common way would be to get the time since the last call within the main loop and pass this to any functions that would need to know it. I would also personally assess the performance of the function of the time that you are spending within it rather than CPU %. You can do this again with the clock class, reset it at the beginning of your draw function and then get the time at the end to see how long you spent there. You can then decide from this if you are spending too long in this function.
  2. Why Game Programming?

    I think you really have to ask yourself the questions. Why are you making the game? Is it cause you enjoy the creation, what part of that do you enjoy? Are you making sample work to get a job? At the end of the day it is upto you to know why you should be programming or just scripting in an engine etc Personaly I enjoy programming, I know that I cannot make anything near as good as a profesional engine but thats not why I am doing it. I have tried using stuff like Unity and its very quick to put together something but in a sense I find this takes away some of the enjoyment for me. At the end of the day would you say I shouldn't make a fps game because I could never match the quality of battlefield or call of duty, no I would still do it because I wanted to enjoy the experiance. If your wanting to get into the industry and are working on sample work then you will need to create your game with the methods you would expect to use in the job you would go for to show you can do it. For example if you wanted to be a graphics programmer I would focus your effects on showing what you can do in directx.
  3. DirectX 11 How do I open an effects file?

    I read the directx 10 book from here I found it really useful and made my first 3d game come to life. The author has made a new directx 11 version that is due out within the next week or so I think. I will most likely be picking this up myself.
  4. managed to slowly make my way through the shopping process, required a few refreshes on the 500's but now got a licence in my email inbox ready to have a play with when I get home from work.
  5. RPG Funding

    [quote name='Ravyne' timestamp='1330974653' post='4919533'] I'm unable to find the source again, but I recently read an article about an indie team of 4 running on a budget of about 15k per month -- They had office space (so budget for rent, utilities, snacks, etc) and legal/business council, both accounting for around $1200 of the monthly budget each -- a small start-up team .[/quote] Was this it [url=""][/url]
  6. DirectX 11 How do I open an effects file?

    Hey keep in there The effects files are basically scripts used to make code that the graphics card will run. These are used to make shadders and all sorts. Your image will most likely be in the DDS file by the sounds of it. This is a directx texture file format. If you want to open it you get a texture tool as part of the directx SDK ( cant remember the exact name type something like Directx Texture Tool into your start menu and you should find it). You can use this tool to save other image files into the directx texture format if you wanted, but you can also use it to just look at the files. Also note that depending on the example you are looking at it could be possible that all the art assets have been packaged together into a custom file type, but I wouldn't image this to be the case with a example like you have described.
  7. Very interesting read through all the articles, just wanted to say thanks for all the useful information and sharing your experience. Would love to give the game a go once you have published it on android
  8. Performance and Efficiency problems

    Quote:Original post by MaulingMonkey Even if you can't outright skip drawing anything, if you can draw foreground/near objects first, this means the pixel shader can be skipped for the background bits that have been occluded by the foreground. Unintentional I have just been over my code and the order of objects drawn is as best it could be. Quote:This means you're probably fill-rate limited. If you're using any sort of anti-aliasing, turning that off should also help. There is no anti-aliasing in my program Quote: Original post by SirViver the actual implementation of PointLight() would be interesting. PointLight is untouched from the books example. float3 PointLight(SurfaceInfo v, Light L, float3 eyePos) { float3 litColor = float3(0.0f, 0.0f, 0.0f); // The vector from the surface to the light. float3 lightVec = L.pos - v.pos; // The distance from surface to light. float d = length(lightVec); if( d > L.range ) return float3(0.0f, 0.0f, 0.0f); // Normalize the light vector. lightVec /= d; // Add the ambient light term. litColor += v.diffuse * L.ambient; // Add diffuse and specular term, provided the surface is in // the line of site of the light. float diffuseFactor = dot(lightVec, v.normal); [branch] if( diffuseFactor > 0.0f ) { float specPower = max(v.spec.a, 1.0f); float3 toEye = normalize(eyePos - v.pos); float3 R = reflect(-lightVec, v.normal); float specFactor = pow(max(dot(R, toEye), 0.0f), specPower); // diffuse and specular terms litColor += diffuseFactor * v.diffuse * L.diffuse; litColor += specFactor * v.spec * L.spec; } // attenuate return litColor / dot(L.att, float3(1.0f, d, d*d)); } Quote:Have you checked if maybe VSync is enabled/forced on your laptop? I had already tried running both with and without VSync on. I prefer to run my game on my desktop with VSync on as this stops my gfx card running at 95% and starting turbo fan :) I am increasingly beginning to just think that my laptop is to underpowered to run what I would consider a very 'simple' game. I have loaded on a few of the SDK samples and anything with more than a simple model is also running slow. I am gonna try and find some computers (of friends) over the weekend that are slightly higher spec and see if I can find at what level the game will run correctly. I could even plug my old gfx card into my desktop and see how that handles it, this could also be something to try out earlier throughout my development thanks zedz As a slight detour on the subject could I ask if anyone knows what type of PC my game would be run on when I send it out as part of a application for a job? Should I be concerned that my game will not run smoothly due to a basic email PC being used, or would it be passed onto a Dev with a more capable PC? Thanks to everyone for your advice. Andy Tagg
  9. Performance and Efficiency problems

    I have managed to go through my code and do some profiling around my functions. On my desktop everything runs equally fast. On my laptop most of the times are only slightly slower except for the SwapChain Present call. This is taking almost 40ms to perform. I have tried messing around with a few things on my laptop and have found that reducing to a very low resolution will speed things up (obviously, however I would rather run the game at a reasonable size). Also if I comment out the code for my ball lights within the pixel shader in the effects file I get a performance increase. I currently have a fixed point light as a room light, and 4 moveable point lights that will have the same position as each ball (note: to start with there are 2 balls available so the other two lights are set to no colour/brightness level and outside the level box, these are brought in and attached to a ball when someone gets the multiball powerup). Would you consider this too much for a laptop to manage? Am I going about my lights the wrong way? I am not at my home PC right now but the code for the lights within the PS function is along the lines of: SurfaceInfo v = {pIn.posW, normalW, diffuse, spec}; float3 litColor = PointLight(v, gLight, gEyePosW); litColor += PointLight(v, gBallLight, gEyePosW); litColor += PointLight(v, gBallLight2, gEyePosW); litColor += PointLight(v, gBallLight3, gEyePosW); litColor += PointLight(v, gBallLight4, gEyePosW); return float4(litColor, alpha); Thanks Andy Tagg
  10. Performance and Efficiency problems

    Thanks for the reply SirViver. I had not thought of putting in a timer around certain calls I will try this tonight. I had tried commenting out functions and seeing the effects but I was unable to obtain any really information from this. Timing the actual functions seems like it should give some solid results. Regarding FPS I had read before about the scalability of FPS and was only really giving a rough illustration of the difference between my two systems. Converting this to ms will give my desktop taking 1.05 ms and my laptop 40 ms. This still seems like a drastic difference though. I will try adding in some onscreen times and see if I can pinpoint which functions are changing the most between the two systems. Thanks again Andy Tagg
  11. Hi, First off I have been reading around the forums for a while and have found a lot of information that has been helpful while creating my current game so thanks to everyone for that. I was also not sure exactly which area to post this in so apologies if this is incorrect. I have been creating a game at the moment using DirectX 10 while reading Introduction to 3D Game Programming with Direct 3D 10 by Frank D. Luna. The game I am creating is a cross between Breakout and Pong (smartly named Breakong). My intention is to use this game as part of my portfolio to try and get into the industry. I have got the game to a reasonable level and have begun to test the code on multiple machines. It runs fine on my desktop (fraps stating 900 – 1000 fps) however when attempting to run my game on a number of laptops the performance has taken a massive dip (down to 15-20 fps). I know that my (and friends) desktops all have a reasonable spec (Quad Core and ATI 4000/5000 cards) and the laptops are lower (dual core and ATI 3000/4000 mobility cards) however this seems a rather drastic performance difference. The main graphics engine and all DirectX interaction is taken straight from the book, however some small elements have been changed such has adding more light sources to the effects file for each ball. I am really not sure where I should start looking to make my code more efficient. I did start programming this game on my laptop so I know it did run ok up until I added the bricks. My guess is the problem is either in the way I am drawing the scene or I am spending too much time calculating variables within the update. I am currently stepping through all the items in the level and drawing them in the same manor objects are drawn in the book. For the bricks as there are multiple textures I check the brick’s life to give the correct colour texture and also if it is a special brick. If it is a special brick I also draw a second texture which is an image of the special ability with alpha clipping to see the texture around the logo. During the update process I do most the work within the Ball class. The ball will on each update check for collision with walls, players, other balls and bricks. For this I know that with each ball I have to check the position with all bricks (a 14x9 grid) and I have tried to limit as many distance checks to use the square distance to avoid square rooting, I actually find the closest brick to the ball and perform the full check on that brick only.. Also after the position updates of the ball I will go through all the bricks again to check for damage done and destroying bricks. I have also added in a basic AI now that will also perform a check to find the closest brick to aim for. Is there a more efficient algorithm of checking everything that I haven’t thought of? As I am not sure what area could be the issue and there is a lot of code I thought it would be best to put code up upon request rather than spam too much code. I am also currently at work and can’t get access to my code till I get home. I would appreciate any advice that could be given or any tools that are available for checking where my bottlenecks are. If you wish to have a look at my game it can be found on An executable is also available at Many Thanks in advance, Andy Tagg