• Content count

  • Joined

  • Last visited

  1. Yes, now I am finding the flaws as they surface. Sometimes after coming out of the background or a suspended state, the FPS calculation will spew a really high number and cause the game to move rapidly for one second, then go back to normal. This will result in death many times for the user. So yes, I dun f@#%ed up even more. The entire gameloop is too large and is a complete mess (I'll never code a game this way ever again). The delta_speed variable is a percentage that is multiplied against the entity's speed value so that it moves at an adjusted speed based on frame rates. I am not accumulating time as I did not plan this thing ahead or even consider the need for time based movement when I originally wrote it. Then when primitive counts started reaching the millions, frame rates dropped and then I realize "I dun screwed up". The loop is updated further down. I forgot to add that. If milisecond timing is a bad design choice, then I will do a way with it pronto. I wasn't aware of the poor accuracy, and if the margin of error is that great, then I'll most definitely stop using it. I wrote that half arsed timing function out of laziness. Speaking of high resolution timers, I'll need one that's portable to all three major OSes. Which I did find here: /* ----------------------------------------------------------------------- */ /* Easy embeddable cross-platform high resolution timer function. For each platform we select the high resolution timer. You can call the 'ns()' function in your file after embedding this. */ #include <stdint.h> #if defined(__linux) # define HAVE_POSIX_TIMER # include <time.h> # ifdef CLOCK_MONOTONIC # define CLOCKID CLOCK_MONOTONIC # else # define CLOCKID CLOCK_REALTIME # endif #elif defined(__APPLE__) # define HAVE_MACH_TIMER # include <mach/mach_time.h> #elif defined(_WIN32) # define WIN32_LEAN_AND_MEAN # include <windows.h> #endif static uint64_t ns() { static uint64_t is_init = 0; #if defined(__APPLE__) static mach_timebase_info_data_t info; if (0 == is_init) { mach_timebase_info(&info); is_init = 1; } uint64_t now; now = mach_absolute_time(); now *= info.numer; now /= info.denom; return now; #elif defined(__linux) static struct timespec linux_rate; if (0 == is_init) { clock_getres(CLOCKID, &linux_rate); is_init = 1; } uint64_t now; struct timespec spec; clock_gettime(CLOCKID, &spec); now = spec.tv_sec * 1.0e9 + spec.tv_nsec; return now; #elif defined(_WIN32) static LARGE_INTEGER win_frequency; if (0 == is_init) { QueryPerformanceFrequency(&win_frequency); is_init = 1; } LARGE_INTEGER now; QueryPerformanceCounter(&now); return (uint64_t) ((1e9 * now.QuadPart) / win_frequency.QuadPart); #endif } /* ----------------------------------------------------------------------- */ Since this game is cross platform, it has to work on everything. If nano seconds are the way to go, then I'll use that instead. And yes, using the frame rate isn't really a reliable way to do this (it blew up in my face). I found that using a fixed value will give me consistent results. A fixed delta doesn't generate any issues for me. Shogun
  2. my personal future in game programing

    Curious what country you are in? Spain? Eastern Europe? I guess I shouldn't have assumed you live in the same country I do, Murica Sorry, it's a bad habit. Can't say I recommend you come here if you are living elsewhere (I sometimes wish I could be elsewhere). So I was told that Sweden has more jobs and that it would be easier to find work there. If you have friends in Sweden, try reaching out to them and see if you can at least use them as a reference. Every leg up helps. Shogun
  3. my personal future in game programing

    First of all, why do you want to contract/freelance? If you plan to do game dev for a living, then I strongly do not recommend this route. I have been a contractor for years, and I've grown sick and tired of it (I can't get a full time position anywhere here to save my life). You would be better off just getting a full time position at a game dev company (maybe a well managed startup) and establish yourself that way. If this is going to be something part time and not your main source of income, then that's fine. Second, where do you live? Location is often key to your success not in gamedev only, but in software engineering as a whole. If you are in sillicon valley or areas with good tech jobs, then you should try going to development events and meeting people. In this industry, it's not all about what you know, but WHO you know. Knowing someone behind the scenes can be the difference between landing your dream position in the long term or the contractor who is unemployed for months on end between contracts. Even if necessary, you may have to take some game testing position(s) to get your foot in the door. Testing sucks but that's how I got started. If you aren't in a tech oritented area, then you might want to move. This is what I did also. Lastly, if you want to get started right away, try freelancing on A co-worker of mine recommends it and he gets work from time to time there. So if you do, work on building your profile, take some time to make a good one, and you may get some really neat projects to work on. So by all means, give it a go. There's an occasional game project there too, but make sure that you are working with competent people. Shogun EDIT: If you do come to a tech oritented city for a job, I highly recommend avoiding Seattle. There are people fleeing California and other places for the jobs and you will likely have an extremely hard time getting anything up here. I have 7 years of experience and I've been out of a proper dev job for over 8 months and there's no end to this BS in sight. At this point I want to leave and maybe go to Portland instead.
  4. Windows Mouse Handling Sucks

    Wow, I did not know that. Heh, learn something new every day! Shogun
  5. Windows Mouse Handling Sucks

    In my opinion, of course... My game not only needs to know if the mouse is currently out of the game's window, but also the position of the cursor relative to the window as it moves outside. MacOS and Linux give me this by default, but for Windows, I had quite a bit of trouble finding a reliable way to do it. This isn't the first time I've had issues dealing with Window's mousing handling. It's been a pain in my arse multiple projects. #if defined(_WIN32) && !defined(_WINRT) /* Because Windows mouse handling sucks in general compared to Mac/Linux, a little extra work is required to find out if the cursor is outside of the game's window to prevent cheating. In my experience, the reliability of GetCursorPos and ScreenToClient vary from one comp/OS to another, so a better idea is to check every frame and use those resulting coordinates only if it tells us we are off screen. No disrespect Microsoft, but why do you insist on making such trivial things a pain in my behind sometimes? */ struct vec2_t<float> bounds; This->get_bounds( bounds ); POINT pt; GetCursorPos((POINT*)&pt); ScreenToClient(GetActiveWindow(), (POINT*)&pt); if( pt.x < 0 || pt.x > bounds.v[0] || pt.y < 0 || pt.y > bounds.v[1] ) { This->mouse_move_func(pt.x, pt.y); } #endif So yeah, I can't believe it took me that long to get this stupid thing figured out. Anyone else have the same problem before? Anyone else come up with a better solution? I'm just glad it works.... Shogun
  6. Although I see that link shared alot, it actually made my timing issues worse for this particular game. In the future, I'll be sure to follow that guide to avoid future headaches. Also, I fixed the problem. Instead of using frame times, I used my game's actual frame rate divided by 1000. Now it works perfectly (so far). L. Spiro is going to kill me if he reads this, but I just want this game to work! Thanks. Shogun
  7. One of the biggest reasons why I haven't released my game is because of this annoying timestep issue I have. To be frank, this game was poorly planned, poorly coded, and was originally written as a small tech demo and a mini-game. Now it has evolved into a fully featured (and very messy code base of a) game. If you thought Lugaru was bad, Looptil is far worse! So what happens is that the delta is not really consistent. Sometimes enemies don't spawn fast enough because the delta isn't even consistent at 60fps, which is a big reason why the game is broken. static uint64_t last_time = 0; uint64_t current_time = time_get_time(); //( get_current_time() * 1000.0f ); int fps_limit = 60; float frame_time = float( current_time - last_time ); if( last_time != 0 ) This->m_delta_speed = frame_time / ( 1000.0f / 60.0f ); And this is my timing function: uint64_t time_get_time() { #ifdef _WINRT return GetTickCount64(); #endif #if __ANDROID__ /* TODO: Fix std::chrono for Android NDK */ uint64_t ms = 0; timeval tv; gettimeofday( &tv, NULL ); ms = tv.tv_sec * 1000; ms += tv.tv_usec / 1000; return ms; #else std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); std::chrono::system_clock::duration tp = now.time_since_epoch(); std::chrono::milliseconds ms = std::chrono::duration_cast<std::chrono::milliseconds>(tp); return (uint64_t) ms.count(); #endif } Now I know some of you will cringe when you see GetTickCount64(), but that's the only function that gives me reliable results on Windows 10 (UWP) ports, so that's staying. One more thing to note here, my game has a badly written game loop. It uses a switch statement, followed by draw_game_mode(), update_game_mode(), so I kinda screwed myself there. I tried changing it, but it broke the game completely, so I left it in it's messy state. Is it possible to simply just have a proper delta calculation function? Because it's adjusting itself based on the current frame time. This may not be the best of ideas, but it was something I whipped up because I needed to have this run okay when it goes down to 30fps without running half the speed. This works in general, but it's innacurate and causes problems. Any ideas? Thanks. Shogun EDIT: Feel free to ask anything in case I missed a vital detail. My lunch break is ending and it's time for me to go. Thanks.
  8. How to stay motivated?

    I'm curious on how you all stay motivated to work on your games and such. This used to be an easy thing for me. Now, not so much... I'm not trying to give you all a sob story (I've had worse; been homeless before) but The past months since late October have been really depressing and a real downer. Been out of steady work for 8 months (seattle's available job pool is dwindling and nobody wants to hire full time so I might leave), and now here I am working in a white collar sweatshop 8.5 hours a day, commuting 3+ hours a day, and very little time to myself. The pay isn't even the are minimum to get out of debt due to not having a job, and I literally have no money to myself. Everything goes to rent so I don't end up homeless again. When I do get home, I'm mentally exhausted and feel as if every brain cell in my head is busted. When that happens I can't seem to carry a thought in a bucket so I just go to bed. Cycle repeats. So how do you all stay motivated? For me it's a constant struggle not to get depressed and start drinking again. I have a game that's almost ready to be released but I have no money to do so. It's already cross platform with lots of great pier reviews too. I even had a Sony publisher take interest in it, plus I got id@xbox approval too, but my financial situation sucks. I spin my gears at max speed but I feel like I'm getting nowhere fast. Once again, I'm not asking for you to pity me or for sympathy because I'm done crying over it. Life sucks and that isn't going to change for everyone. What I AM asking is how to stay motivated even when everything looks hopeless and there's no way out? How do you all handle it? Thanks, Shogun
  9. HTML5 RSS Feed w/ matching style?

    Wow, this is more complex than I thought! It's times like this I wish I could just pay someone to do it for me. But either way, I will get it done, one way or another because it's gotta get done. I'll be honest here, I don't know jack crap about server side, jQuery, ajax, etc. I only know about HTML5, Javascript and XML. Everything else you said is like greek to me, so I'll have to take some online courses. Thanks fastcall! Shogun
  10. Since the general programming forum was nixed, I hope that it's still okay to post such a question here. Mods, if it doesn't belong here, feel free to move it. Thanks. Since I am not a web developer, I am having trouble getting this automatically generated RSS feed to match the style of my webpage. What I used was a pre-written template and went from there. So to be honest, I don't know jack crap about CSS, but I understand the basics of HTML (I need to be more like fastcall22). This is the code to my RSS feed that rssdog generated: <iframe width="100%" height="750" class="rssdog" src=""></iframe> For those of you that need it, this is a link to the website that generated it: And last but not least, this is a link to my website: Since I'm getting ready to make a submission of my game to id@xbox, I really would like to have my blog used to display project updates and so on. I know, I'm really anal about stuff like that, but I want to make the best impression I possibly can because as a poor indie without a dime in his name and one paycheck away from losing everything, I have little to no room for error. Any ideas? Thanks. Shogun
  11. Seattle's cost of living isn't too bad (even though housing prices have nearly doubled in the last 7-8 years) if you are making at least in the $40k-ish range, but I've made more than double that so I got comfortable rather easy and had plenty of disposable income before. Seattle is still far cheaper than, let's say, NYC. SF, however, is far worse. I don't believe it would be worth it. I've been considering Oregon, such as the Portland area, but apartments and rental houses are more expensive there. If I get another call about a job in Hillsboro for Intel, I'm taking it. Shogun.
  12. I know it's old, but I kinda forgot about this thread... I am in Seattle. Everyone says I shouldn't have trouble finding a decent tech job out here, but that isn't so. Microsoft has been hiring aggressively, but I didn't get a single position I interviewed for. And now that I am currently working at Microsoft under a managed contract, unless I can get full time, I can kiss any opportunities here at Microsoft goodbye for the next 6 months at least. I've been asked several times, "why don't you start your own company?" Well, easier said than done.. especially when you have no money. I wanted to do that before, but I decided to hold off because I was inexperienced and not mature enough (I likely would have failed). And now that I have a nearly finished game, I can't release it anywhere. Grant/loans? Yeah, right. My credit is f-ed and nobody is going to grant jack s@#% to some random broke black dude (not to turn this into a PC battle, but I've done plenty of searching and the vast majority of funding is for women only w/ very few for minorities, and minorities get loans at a significantly higher interest rate on average than white people so I have concluded that your best chances of getting this kind of funding is to be a white woman). So I don't see that as a realistic goal. So f-ing tired of this. I think it's about time I left Seattle because I get calls from recruiters all across the board telling me that they can't get enough devs in other states/cities. WA appears to have a surplus of devs that are willing to work for little to nothing, while the hiring companies can be as picky as they want. Shogun
  13. Sorry for the slow response, I appreciate your advice. I will be honest though, I haven't worked in every profession, but none of them come close to the sheer volatility of the tech industry in my experience. Job security is only a word, yes. That's nearly every industry/profession. And about freelancing, since you are the Nth person to strongly recommend this, I am going to just go ahead and do it. Previously, I was discouraged from doing so because I was told that you would be competing with people from other countries like India who are wiling to work for much less. So I signed up for and hoping that I will get approved within the next day or two because I already see a few gigs that I want to take my chances on. To be frank, I don't know what I should charge. Since I'm used to being paid $45-50ish/hr, I set my rate at $30. Should I set it lower? I don't claim to be the best developer in the world, but I'm not entry level either. And back to the competition thing, even with all the senior level devs out there, it seems that it would be hard to get a position, especially with 50 devs all applying for that one opening. The odds are against me, but not trying is the cowards way out. I'd rather try and fail than not try at all. Alias? As in a different username or a different legal name? Just want to be clear on that. My brother is in that field. Although I never liked jobs interacting with people, I'll consider it. Millitary programmer? Sounds interesting. Imagine having that on a resume... That's fair enough sir, I guess. Well, I'm not sure about how much they pay here, but I'm sure it's decent. Glad it works for you. My assumption is that it pays well in Hungary though. Although I've fantasized about moving to your nation several times, I don't believe that I can just get up and head for Magyarország that easily. I'm sure a mechanical engineer at a company such as Boeing would make a killing. Sadly, my career there was very short lived. Very sound advice. I am in my early 30s now. I have 7 years of relevant experience, and never have I had this much trouble finding jobs. So far, I've had some people say that my location is likely my issue. There are those that say, "you live HERE and you can't find a job?", and they are mostly peeps that don't work in the tech industry. Getting a job is never magic. If necessary, maybe I will leave here and go somewhere else. I'm told that there are some places so desperate for programmers that they won't even bother whiteboarding them. Here, there appears to be a surplus, so they can pick and choose who/whatever they want without giving your situation a second thought. It's also very cut throat and competitive. I really don't want to leave here, especially since other areas are either more expensive or not favourable climate wise. I enjoy coding more than anything. Writing is a second, but I'm not Stephen King to be frank. So sticking with what I'm good at may be my best option for the time being. I can accept that. Shogun EDIT: My other comp is pissing me off, so I had to half finish that last response, then come back to it. Just in case you were wondering.
  14. Not to be negative, but I am seriously considering leaving the IT/tech industry. Largely because I haven't been able to find stability ever since I've started 7 years ago. The constant hassle of companies only wanting to hire people through contracting, then suddenly lay you off for whatever reason has constantly put me in a bad situation. Even worse, I've never had a contract go it's full duration. No, not once. I'm constantly told, "you should seek permanent employment", but companies are not often hiring for fulltime. Others recommend startups, but my experience there is far worse than what I experience at gargantuan companies like Microsoft or Amazon. The interviewing process for many of these positions is either broken or poorly executed, making finding a new position nearly impossible. Sometimes I'm out of work for 2 months at a time, and the last period was 7-8 months. I have a job now, but it manual QA plus it doesn't even pay the bare minimum of my expenses, back rent, debts, and so on. I only took it because I can't get anything else right now. This industry hasn't been very good to me. If I'm going from making $XXX a day/year for X number of months, then getting the boot suddenly all the time, what is the point if there's no stability? How wonderful does it sound being employed at Microsoft, yet homeless at the same time?? I've heard others consider and say the exact same things. Lastly, it's easy to say "be positive" when NONE of the above is happening to you... So I'm asking if there's other career paths that some of you have taken that still pay a good living? As much as I hate to say it, I might even go back to school for it if necessary. To be honest, I don't know much else career wise and this is what I have the most experience in, so I'll likely be seen as a (former) dev/SDET for life so I don't know if I can even get out of tech if I seriously consider leaving. As usual, this sucks. Any ideas? Thanks. Shogun
  15. Could the push for diversity lead to unwanted results?

    The term DIEversity comes to mind when this whole diversity horses@#% is forced upon certain industries and franchises. Because when you brute force it, the result is not a genuine one if you ask me. More like an obligation. Btw, I'm black and I just don't care anymore. Hollywood movies suck royally these days and are often filled with political agendas and social conditioning garbage if you ask me. Not saying movies didn't before, but at least 20+ years ago, movies were actually featuring some level of originality. Shogun