Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


blueshogun96

Member Since 09 Jun 2005
Offline Last Active Today, 02:17 AM

#5240305 SDL 2.0.x game controller events not working.

Posted by blueshogun96 on 14 July 2015 - 01:07 PM

Nevermind, it's my own code causing the problem.  The deconstructor in my gamepad handle class gets called after adding it to the vector due to it going out of scope.  I should have used a smart pointer instead to delay that.  Thanks for reading.

Shogun.




#5236177 Read a text file from a .zip container

Posted by blueshogun96 on 22 June 2015 - 10:56 AM



If you have garbage at the end of your shader:

 

Are you storing the 0 terminator with the string in the zip file? If not (likely) your buffer to read a text file should be allocated so it has space for one extra '\0' character at the end.

Otherwise basically all methods expecting c strings will read over the end of the string since there is no marker denoting the actual end.

Actually, I tried this before I posted, but it didn't work at first.  That's because what I did was this:

 

vs[size-1] = '\0';

 

I did it that way because I didn't want to go beyond what was allocated.  But when I did this, it worked:

 

vs[size] = 0;

 

Now it works every time.  Thanks.

 

Shogun.




#5236123 Read a text file from a .zip container

Posted by blueshogun96 on 22 June 2015 - 02:47 AM

I've got a rather strange issue, one that I've only found one google result on, but no solutions.  My game needs to be able to read a text file from a zip archive.  Reading files such as textures, sound effects, and other binary formats work fine, but a text file can contain some garbage characters it seems like.  To be more specific, I'm trying to read and use my GLSL vertex and fragment programs.  When I use the string I get, it gives me strange errors regarding text that I know for a fact was never placed in the text file.

 

I'm using miniz.c because it's simple and easy to use.  This is basically what it looks like:

bool KeZipResourceArchive::Read( std::string filename, void** ptr, size_t* size )
{
	*ptr = mz_zip_reader_extract_file_to_heap( (mz_zip_archive*) archive, filename.c_str(), size, 0 );
	if( !(*ptr ) )
		return false;
    
	return true;
}

And an example usage:

 

pArchive->Read( "square_vp_es2.txt", (void**) &vs, &size );
pArchive->Read( "square_fp_es2.txt", (void**) &fs, &size );
 
No idea what the problem is.  Any ideas?  Thanks.
 
Shogun.



#5235534 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 18 June 2015 - 12:17 PM

Well, whaddayaknow, Mr. Sloper was right today.  One of my interviewers told me I was a bit Junior, but wanted to continue to interview me anyway because of my level of enthusiasm.  The 2nd phone interview is tomorrow morning.  I just wish they'd bring me in already...

 

Shogun.




#5234669 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 13 June 2015 - 06:50 PM


I tried checking your website. The overall template is solid, but you have a dead link on your contact page, no resume page, and I still see a lot of boilerplate. I don't know if you've used this site in your job hunt, but it's the kind of thing that can set some interviewers off on the wrong foot (read: the site that you use to promote yourself looks like you don't finish what you started). From my experience, I've had much more luck just saying I took it down because what I had up there was no longer reflective of my skills, and that I haven't had time to update it because I've been working on X. I then use that as a launching pad to talk about X.

My website isn't for attracting potential employers.  You're right, I need to fix that, and a few other things, but I haven't gotten around to it.

 


I saw that you've been in touch with recruiters, that's a good thing. Being in many IT recruiter databases means you'll get contacted more often when some of their clients are looking for work. That being said, many recruiter based jobs are quite boring. I've used those as a launch pad to work my way towards more interesting, meaty work. I hope that in your area you can do likewise.

I haven't been able to successfully find ANY jobs in my city without the help of recruitment agencies.  Looking on the bright side, getting an IT gig is much easier than, lets say, trying to get a job at McDonalds or some other blue collar job that doesn't require special skills.

 


P.S. Even though I "know" the material in this article, I find rereading the following puts me in the right mood for interviewing. It may not work for you, but I recommend finding some ritual that gets you in the right mindset. (yes, salary negotiation is the last step, but it still works for me)

http://www.kalzumeus.com/2012/01/23/salary-negotiation/

Thanks.

 

 

 


Also, to my surprise, it's not easy finding peeps in my area on this website.  Especially those who are professionals who are doing non-gaming IT work.

Wait, what? There are a ton of us on this site who live/work in Seattle.

 

Haven't knowingly met any yet.  Oh yeah, forgot to start that thread.

 

Shogun.




#5234537 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 12 June 2015 - 05:55 PM

Then I'll start a thread about it and find out!

 

Shogun.




#5233002 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 05 June 2015 - 01:26 PM

 

Didn't notice that this thread was bumped again.  Since it's still open, I'll add that I'm back where I started again.  Time to go though this BS job hunt crap again.  And tbh (I'm not saying this to stir up drama), I S-T-I-L-L not convinced that employers care about skill, but only job experience and your ability to ace the whiteboard on the first try.  That's the ONLY way I ever get IT jobs.  I almost had a job as a deployment engineer for Starbucks, but I got outclassed by one guy.  Soooo close.

 

Going to go back through the thread and re-discover a few suggestions.

 

 

Did you try going with placement agencies and working as a contract to hire first? 

 

That's exactly what I've been doing my entire career.  No one has ever hired me from a contract because most of employers aren't looking to hire.

 

Shogun.




#5232979 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 05 June 2015 - 11:51 AM

Didn't notice that this thread was bumped again.  Since it's still open, I'll add that I'm back where I started again.  Time to go though this BS job hunt crap again.  And tbh (I'm not saying this to stir up drama), I S-T-I-L-L not convinced that employers care about skill, but only job experience and your ability to ace the whiteboard on the first try.  That's the ONLY way I ever get IT jobs.  I almost had a job as a deployment engineer for Starbucks, but I got outclassed by one guy.  Soooo close.

 

Going to go back through the thread and re-discover a few suggestions.

 

 

Okay, 17 interviews later, finally got a new job.  It pays rather well for a position that doesn't require immediate coding ($70k). 
 
I guess I just had a Vegeta moment for a while there.
 
Shogun.

Someone like me would happily take $10/hour job because its already a lot of money per month if you live in India. Avg. income of an Avg. person in India is $1000 per month.

 

$1000 usd/month isn't enough to survive on here, and is considered poverty.  In the small town I used to live in, I made slightly less than that.  But now, such a low wage is illegal in the US.

 

Shogun.




#5223575 GLSL Procedural Animation bug

Posted by blueshogun96 on 15 April 2015 - 07:35 PM

Okay, finally fixed it.  After altering some instructions a bit to tweak stuff, I discovered that it was the EXP instruction that was causing the problem, which I'll explain in minute.  I got curious and replaced exp with sin and some variations below:

 

R0.y = sin( R0.x * 3.0 ) * 0.5;

 

That worked, but it was inaccurate.  So I looked up the EXP instruction on the ARB_vertex_program documentation, and it said this:

 

 

Section 2.14.5.9,  EXP:  Exponential Base 2 (approximate)

 
    The EXP instruction computes a rough approximation of 2 raised to the
    power of the scalar operand.  The approximation is returned in the "z"
    component of the result vector.  A vertex program can also use the "x" and
    "y" components of the result vector to generate a more accurate
    approximation by evaluating
 
        result.x * f(result.y),
    
    where f(x) is a user-defined function that approximates 2^x over the
    domain [0.0, 1.0).  The "w" component of the result vector is always 1.0.
    
    The exact behavior is specified in the following pseudo-code:
 
      float ScalarLoad(floatVec source) 
      {
          float operand;
 
          operand = source.c;
          if (negate) {
            operand = -operand;
          }
 
          return operand;
      }
 
      tmp = ScalarLoad(op0);
      result.x = 2^floor(tmp);
      result.y = tmp - floor(tmp);
      result.z = RoughApprox2ToX(tmp);
      result.w = 1.0;
 
    The approximation function is accurate to at least 10 bits:
 
      | RoughApprox2ToX(x) - 2^x | < 1.0 / 2^11, if 0.0 <= x < 1.0,
 
    and, in general,
   
      | RoughApprox2ToX(x) - 2^x | < (1.0 / 2^11) * (2^floor(x)).
 

It didn't hit me right away, but EXP is a multi-function instruction, and the original author was using the 2nd function.  You select the function you want by selecting the destination field in your vector.  So I changed that line to this:

 

R0.y = R0.x - floor( R0.x );

 

And now it works perfectly.  Never would have guessed that was the problem.  Now I can finally get on with life.  Thanks for reading.

 

Shogun.




#5222088 Using named POSIX mutexes?

Posted by blueshogun96 on 08 April 2015 - 10:26 AM

 


I'm asking because the primary purpose I'm asking is because I'm attempting to write some code that detects multiple instances of my app running on the same machine for Linux and MacOSX.  The steps (in theory):
 
- Attempt to create a mutex with a specific name that matches the app's ID.
- If it already exists, then this app is already running.
- If not, save this mutex until the app exits, then destroy it so the app can be relaunched.

 

I realize you may have already found an answer to HOW, but I'm wondering about the reason WHY?

 

 

Is there some reason you must prevent multiple instances of your app at once?   I know often you prefer your game to be run one way, but is there a reason you must absolutely forbid it from being run another way?

 

 

As an example, on several titles I found it useful to launch several instances of a game, perhaps 2 or 3 or 4, all on a single machine.  I'll have them connect to a game server (also running on the same machine) and hook up one or two debuggers as needed.  Yes, the performance degrades into something terrible, but for debugging purposes it is far easier than finding four open machines to use, or configuring my machine to run four virtual machines and running the game inside each. 

 

As another example, sometimes games appear to close quickly by destroying and hiding windows but continue to run in the background cleaning up resources for quite some time. Or they crash and it takes the operating system an extended time to clean everything up.  In that case I may want to launch another instance of the game immediately, and if some stupid shared object is still hanging around it can take quite some time before I am allowed to start my next instance.

 

 

The point is, it seems like you are trying to force your decision that your game is really a singleton onto the user.  For whatever reason, you have decided that even if the user wants more than one the user is wrong, and the user's decision shall be overruled.  Usually that is the wrong decision.

 

Good points (and many of which I didn't think of).  Although I have multiple machines handy to test networked games, I'll have to try that idea.

 

This is actually some functionality I'm adding to my engine (not necessarily to a specific game), where the programmer can choose what he wants to do when there's multiple instances existing.  The exiting/shutdown case you stated is a good reason not to force it, but sometimes when it takes a minute or two for your game to load/start, the user might get impatient and just start clicking away thinking "why won't you start?", and then end up with multiple instances of the game running as a result.  This has happened to me before, and it's been a pain to close out multiple windows of a AAA resource hog, especially if I'm in fullscreen.  To me, it's undesirable from an end user standpoint.

 

A better solution would be to display a dialog stating that there is another instance of the game running, and allow the user to confirm that he wants two or more instances running.  And as a bonus, include a check box that says "Do not display this message in the future".  How does that sound?

 

Shogun.




#5221762 Using named POSIX mutexes?

Posted by blueshogun96 on 06 April 2015 - 09:01 PM

I'm not sure if pthread defines system-wide named mutexes, but the POSIX standard defines named semaphores, and a mutex is just a special kind of semaphore (that only takes values 1 and 0 and that is initialized to 1) so that should be good enough if not as handy.

 

Look at the sem_open function for how to use it. You might also want to read that SO question: http://stackoverflow.com/questions/16400820/c-how-to-use-posix-semaphores-on-forked-processes

I tried the POSIX semaphore idea, and that worked like a charm.  So much nicer than file locking...

 

Shogun.




#5221699 Using named POSIX mutexes?

Posted by blueshogun96 on 06 April 2015 - 02:49 PM

Okay, I have a question about using POSIX mutexes.  I've searched all over the net, but I can't find any examples on how to create a named POSIX mutex.  Can this be done?  I've searched google for quite some time, and no concrete answers appear.

 

Also, assuming a named POSIX mutex can be created, can I create the same named mutex twice?  I'm asking because the primary purpose I'm asking is because I'm attempting to write some code that detects multiple instances of my app running on the same machine for Linux and MacOSX.  The steps (in theory):

 

- Attempt to create a mutex with a specific name that matches the app's ID.

- If it already exists, then this app is already running.

- If not, save this mutex until the app exits, then destroy it so the app can be relaunched.

 

This is how I handle this problem using Windows, so I assumed you could do the same thing using MacOSX and Linux.  If not, then I'll use a slightly messier solution, a file lock (yuk!).  Any ideas?  Thanks.

 

Shogun.




#5220782 From scratch vs Unity

Posted by blueshogun96 on 01 April 2015 - 01:27 PM


Takes a lot longer to get anything done
Potentially less deployment options

Good points overall, but I don't quite agree with these cons of writing your own completely (for reasons I've stated in my last response).

 

- If you are writing every component from scratch, then yup, you're going to be at it for a long time.  That's why I chose to use many particular open sourced libraries for the complex and redundant stuff.  Unless you really want/need to, I don't recommend writing every component from scratch.

 

- Well, it depends on what your engine requires.  If you are using PhysX for example, then it will limit your deployment options unless you can pay for a license.  To get around that, I simply used Tokamak because it's a well written C++ library, and called it a day.  What you decide to use can limit your options if you are building a commercial game for platforms with higher exclusivity.

 

Shogun

 

EDIT: I really should write an article about my experiences with writing a custom engine to hopefully clear up certain misconceptions and invoke in depth discussion, one that even I could hopefully learn from :)




#5220554 How it will be a company?

Posted by blueshogun96 on 31 March 2015 - 02:14 PM

Szía Gábor, hogy vagy?

 

Geri igaza van.  A szofverfejleszto"égek elhagyják Magyarországot, mert az adók túl magasak. sad.png

 

Minden magyarnak sikeresnek kell lennie! smile.png

 

Shogun.




#5219758 From scratch vs Unity

Posted by blueshogun96 on 27 March 2015 - 07:03 PM

I wrote my own engine for these reasons:

 

1. Portability: My engine needs to work on whatever platform I want it do.  "But Unity runs on everything, including <insert platform here>", it becomes a problem not being able to use your language of choice.

2. Licencing: No need to worry about licensing fees, which is great.

3. Optimization: Have you ever tried optimizing a closed source commercial engine?  It sucks because you can't do it.  Size optimization is one issue.  One issue I see people talk about when it comes to Unity is minimum binary size.  I already have a rather complex engine, and I can remove the complex components that aren't being used if need be.  My engine generates very large executables (15mb in general, but VS13 takes 3 minutes to optimize it down to roughly 3mb).  Sometimes, that's not desirable, especially if you are running on a platform with fixed resources.  Another is rendering.  Sometimes, I need certain functionality that Unity might not give me, such as GPU fencing, command buffers/lists, or direct hardware access on certain embedded platforms.

4. Custom needs: Unity can't do *everything*.  It does many things, but sometimes, a closed source engine can limit your game in some ways, sorta like above.

 

Reasons I don't use Unity (don't take offense to this, I'm entitled to my opinion):

 

1. I wouldn't be caught dead writing a game in C# (my preference).

2. Pride as a seasoned and experienced programmer; I'm not a n00b.

3. I don't like Unity, or the fanboys who can't do a dammed thing without it, and yet criticize those who write their own.

 

I'm also going to say this (and I've said it before).  When people hear the words "writing your own engine", they are immediately thinking "writing everything from scratch, hence re-inventing the wheel".  This isn't always the case, and in mine, definitely not.  My engine consists of multiple open source components with compatible licenses making it suitable for commercial projects.  You don't have to write everything yourself.  Let me give you a rundown as to how I chose my engine's components:

  • Tokamak for physics.
  • Stb for texture based ttf font rendering and ogg decompression.
  • Assimp and OpenCTM for 3D mesh parsing.
  • SDL for various portable solutions involving threading/synchronization, timing, OpenGL context management, input devices, etc.
  • Some misc code from the NVSDK used for debugging and other stuff.
  • NVIDIA's Gameworks SDK for lots of misc stuff, like the excellent open source and extensive math library.
  • NVTriStrip to "stripify" primitives.
  • jo_jpeg, a simple jpeg library I use for screenshots.
  • ezxml or irrXML for XML parsing.
  • Enet as a reliable UDP based networking client.
  • Angelscript for scripting.

What I have written is basically the glue to put everything together in a neat and organized set of interfaces.  Some things I wanted to write myself, such as an extendable 3D rendering, audio and input interface that supports Direct3D, core OpenGL, OpenGL ES, OpenAL [soft], FMOD, OpenNI, Leap, etc.  So putting this all together was done rather quickly, and done in about 2 months worth of work off and on.  You might say that "I don't have that sort of time".  Then fine.  Time is the most valuable resource, as it is not renewable, but it's also important to use your time wisely, and considering my needs, it was well worth it, (and no, I didn't do nothing but write this engine; I worked on it in conjunction with a planned title).

 

This isn't an attempt to belittle those who use Unity, it's my defense from those who act like they are better than me because I don't.  Do what works best for you.  I've chosen my path, and it works best for me.  If you need Unity or UE4, go for it.

 

Shogun.

 

EDIT: I ended up replacing NVTriStrip with TriStripper because I hear that it's not only faster, but has less bugs and has greater flexibility.  Also added "recastnavigation", which uses Detour and Recast for AI navigation for 3D realms.






PARTNERS