Archive

Archive for August, 2008

Naive Users

August 21st, 2008 admin No comments
Desktop Image

Desktop Image

Coding Horror posted a great article on fake user interfaces. As Jeff AtWood says at the beginning of his post:

As a software developer, tell me if you’ve ever done this:

1. Taken a screenshot of something on the desktop
2. Opened it in a graphics program
3. Gone off to work on something else
4. Upon returning to your computer, attempted to click on the screenshot as if it was an actual program.

Aside from hovering your mouse over the desktop icons or checking the desktop background image directory there isn’t an easy way of figuring out you’re desktop has been duped, even for us geeks. Atwood’s example is just an old office joke, something harmless to pass the time. The real crux of his post asks the question: How does the average Joe or Jane recognize phishing attempts?

As an aside: This actually reminds me a joke I played on a friend of mine once. We had just argued pretty vehemently about the pros and cons of Apple’s Mac computer line. He’s very pro mac and I just don’t care but I love to raz him so I’ll argue for shits and giggles. One of his points was the ease of use. At the time Mac was still pretty beholden to the 1 button mouse thing. (I don’t own a new Mac but I’ve heard they’ve added more buttons.) So he leaves to hit the head and I decide to mess with his Windows PC to make it more like the Mac he so lovingly espouses about. First I edit his registry so that right click no longer works (because the Mac only has 1 mouse button), I also created a faux desktop, and lastly I created a limited user account with very limited rights. It was quite possibly the best 10 minutes of my life before he realized I had done something. I of course asked what was wrong since the computer was now basically a Mac. :)

Back to the main point: We geeks are a jaded cynical bunch and when things pop up while browsing the net, purporting to offer “free” anything, we tend to close them with nary a thought. Nothing is free on the net and when a window pops up automatically, 99% of the time it’s spam. Especially when these pop ups say I need to download a file to make it run, that is one big red flag. But, as I said, the real target is not the geeks but the average Joe. Would you, assuming you are an average user, know the difference between a spoof virus scanner and a real one? If you didn’t know all the tricks scammers use to deceive people would you even think anything was amiss in the first place. Chances are good that you wouldn’t and obviously phishing works because thousands are victims of identity and credit card theft each month.

Again, as Atwood’s article states, the only real method for protecting users is to educate them. Thus was born my educational list of net usery:

1.) Nothing is free. I don’t give a fuck if they are offering lonely puppies online for free, it’s a ruse, a hussle, a lie, a cheat, etc….

2.) The web is not your computer. If you are surfing the net and suddenly a window opens up that says you are infected with a virus just close it. None of the virus scanners I’ve ever used have giant pop ups, they generally do their work in the background. It’s important to note that websites CAN NOT access your computer unless you allow the connection which means any site telling you it ran a virus scan is full of shit.

3.) Guard your credit card like you’re the worlds fattest person and it’s the last cupcake on the planet. Honest to god it’s still amazing to me that anyone would willing give out their credit card number to an unknown site. Be sure when you enter a credit card for a legitimate site that the address in your address bar is still their site and always use a major credit card instead of a debit card in case of fraud. Oh, and don’t let companies store your credit card for future use. Are you so lazy that you’d risk theft just to avoid typing in 16 digits?

4.) Always look at your browsers status bar at the bottom before clicking on a link. 9 times out of 10 when I’ve suspected a link as being a ruse the status bar has shown the link going somewhere crazy that I didn’t expect. Sometimes people will shorten their link by using a service called “tinyurl” but I just avoid those completely because you don’t know where the link is going.

5.) Nobody likes you. I’m serious. If suddenly you’ve got a new online friend he/she is probably a scam artist. Be wary.

6.) If you are dumb enough to get scammed by someone in South Africa claiming to be a lawyer and that they need your help to get 10 million dollars then you deserve the loss of income.

7.) You don’t need that program of a cute kitty that runs around on screen. Chances are good that the kitty is stealing information.

8.) And lastly, you aren’t the grand prize winner of shit. Honestly this one always gets me. (Gets in the sense that it bothers me, not that I fall for it.) Why anyone would think they won a prize they didn’t sign up for is beyond me. So here is a tip: Get an email saying you won a prize or a pop up with the same message? Yeah it’s fake. 100% of the time it’s fake. This isn’t your local super market that rewards it’s 1 millionth customer. This is the net, a sordid mix of porn and hatred.

It’s time to stop being a victim and educate yourself:
Microsoft Phishing Info

Categories: Uncategorized Tags:

Yar, Pirates O’ the Net

August 14th, 2008 admin No comments

Ars Technica had a couple of interesting posts in the last couple of days. Post1 & Post2. Basically a gentleman by the name of Cliff Harris of Positech games made an open call to pirates asking them to explain why they pirate his software. Personally I believe this was less for the greater good and more about seeking publicity but that is neither here nor there.

While the list of reasons for piracy are nothing new the fact that someone might listen is. Here is the list as taken from the Ars Technica post:

1. The information wants to/free anarchists think copyright shouldn’t exist.
2. Games are too expensive.
3. The quality of gaming is too uneven.
4. DRM is hurting the legitimate customers.
5. Going to the shops is annoying.
6. Because piracy is easy to do with low risk for getting caught..

In response:
1.) “The information wants to/free anarchists think copyright shouldn’t exist.”

If anarchists get their way and information is completely open would they still be anarchists? Wouldn’t that then just be the status quo. Whatever the case this type of thinking is too 1-dimensional. Information should be free, I don’t disagree with that assertion. But pirates aren’t just stealing information, they are stealing fully fledged products made from that information. I say we give them what they want. The next major game out of EA should be released with the complete source code. Only the programmers should rearrange every line in the code. For the non-programmers reading this blog: Source code has to be organized in a specific way or it doesn’t do anything. Well I guess technically it could do something but it won’t be what you wanted.

Example: Here is a really dumb example that just spits out the letters to the phrase “Suck It.”

char *buffer = new char[256];
sprintf(buffer ,"Suck it");
 
for(int i = 0; i < strlen(buffer); i++){
    printf("Letter[%d]: %c\n",i,buffer[i]);
}

And now:

printf("Letter[%d]: %c\n",i,buffer[i]);
for(int i = 0; i < strlen(buffer); i++){}
sprintf(buffer ,"Suck it");
char *buffer = new char[256];

If you don’t program then none of this will mean anything. Take my word for it, that last chunk of code won’t work. BUT it does contain all of the code from original example AND it’s free.

2.) “Games are too expensive.”
I agree. Then just buy them from the bargain bin in a few years.

3.) “The quality of gaming is too uneven.”
Again, I agree. Games are too often over-hyped and under performing. Do your research first. No one needs the newest game the day it comes out. One of the piracy arguments I hear all the time is “I’m just demoing the game, if I like it I’ll buy it.” If thats true then great. Honestly though, if you beat a pirated game in 2 days you aren’t likely to go drop $50 dollars on that game.

4.) “DRM is hurting the legitimate customers.”
I 100% agree. DRM’s are the biggest fucking joke in the gaming industry. Imagine someone sold you a house. That house can only be opened with one key which is provided when you purchase the home. Now imagine that the key you receive doesn’t always work and, when it does, it often requires you to perform odd actions before it actually does anything. Now imagine some guy says he’ll give you the key and the house for free, period. Which option would you take? Yeah the guy is shady as hell but.. well… it’s free.

That’s basically how DRM’s work. They install themselves almost like malware, often opening up vulnerabilities in your computer. Sometimes they don’t work at all unless you uninstall some of your other programs. DRM’s must stop the pirates though right? HAHAHAHA!!! Sure, and I’m made of fucking pixie dust. DRM protected games are pirated and released at almost the same time as the actual game. Maybe the effective DRM’s will push that time back by a day but more than likely not. So who suffers? The legitimate consumer. Those of us who pay for our games because we get stuck with the DRM bullshit. Most of us will buy the game and then download the pirated version so that we can run it at any time.

5.) “Going to the shops is annoying.”
If you’re this fucking lazy then buy the game through EBGames streaming content, Valve’s Steam service, or pay the 5 fucking dollars for 2 day delivery and order the thing online. Who is this lazy?

6.) “Because piracy is easy to do with low risk for getting caught”
I can’t argue with this mentality because it’s true. Piracy is easy and the risks are almost negligible. The only thing I would ask is that you remember that the more games are stolen, the higher the costs will become to the consumer. This will drive down the demand and eventually the industry will need to come up with a better solution or games won’t be nearly the viable industry they are now. I don’t that will ever happen but one never knows.

Here is a fun response to a post I made on the Ars forums:

If I don’t give you 100 dollars just because you’re a nice guy, does that also mean I’m depriving you of revenue? What if you wear a blue shirt today? If I don’t give you 100 dollars for that am I depriving you of revenue? Money you wouldn’t make either way doesn’t make you deprived.

One of my all time favorite piracy arguments: “Money you wouldn’t make either way doesn’t make you deprived.” How many assumptions go in to this one sentence? If I steal a game and then say that that person would never have made money off of me is that an argument since, by stealing, I’m providing the basis for my own argument?

If you follow the first link I posted to Ars Technica you’ll see my posts under ‘Jerdak’. It’s also good fun reading through for the arguments by ‘Fiendish.’ He strikes me as your typical mid level college student/pirate with a smattering of education and a real need to prove piracy is ok to justify his own moral shortcomings.

What is the solution? Who knows, it’s hard to say at this point. Valve seems to have a good solution with their app. Steam that requires constant connection to validate. Of course their games have been pirated too but they do a good job of providing exclusive content that I think outweighs the desire to pirate.

Categories: Politics, Technology, Uncategorized Tags:

Havok and Ogre3d pt 2.

August 3rd, 2008 admin 19 comments


*I’m aware the framerate blows. I’m using Ogre’s default Stencil shading. I haven’t had the time to write a pixel shader. Notice the earth sphere? What you can’t see is that it is rolling on the environment. Content provided by ES3Studios.

About a month or so ago on my old blog I made a post about using the Havok physics engine in tandem with Ogre3D. Since that post I’ve made a few modifications, cleaned up the code a bit, and started using some content.

I’m going to try and actually provide a bit more of an explanation of what I’ve done hopefully to the benefit of others. Bear in mind what I’m not doing is writing a Havok/Ogre wrapper API. I have limited time during which to add features so I’m adding them as needed.

[Getting Started]

  1. Download the Ogre3D SDK.
  2. Download the Havok SDK.
  3. Download TinyXml and compile.
  4. Download the code I’ve created from an svn account:

    - URL: http://www.daksystems.net/svn/public/HavokTest1/
    - Login: Guest
    - Pass: guest

  5. Open Htest1.sln Visual Studio 2005. (Express should work too.)
  6. Add 2 environment variables to your PC. OGRESDK and HAVOKSDK. They should point to the root directory of each installation. Example: OGRESDK = F:/Libraries/OgreSDK
  7. I can’t remember if the pre-built OgreSDK with: .\Ogre3D\ogre\Samples\Common\include This folder contains the file ‘ExampleApplication.h’. My test program was built using this handy little file. If that file doesn’t come with the pre-built OgreSDK you’ll need to download the entire source repository of Ogre and compile it yourself.
  8. Switch HTest1 to build the release configuration. My compiled version of Ogre3D has trouble making debug versions of software.
  9. Modify Htest1 solution properties to point to the correct head and library files. First go to Project -> HTest1 Properties -> C/C++ -> General -> Additional Include Directories. Here you’ll see my usage of the OGRESDK and HAVOKSDK environment variables. I also define LIB to point to a base libraries directory. Inside this folder I create another folder for tinyxml’s .lib and .h files. You’ll need to do this step manually.
  10. Modify Project -> HTest1 Properties -> Linker -> General -> Additional Linker Directories in the same way as the last step. Make sure its pointing to the tinyxml lib.
  11. Compile.

[Getting Content]

This can be tricky. Honestly if anyone finds good free content drop me a line. I usually just google around for some maps or I go to Turbosquid and grab the free models. We pay for models at work so I have content to work with. Alternatively you can grab the content from the Havok library: hk550\Demo\Demos\Resources\Physics\Tk\CharacterController I’ll try and write a small tk2obj conversion program. If you are familiar with the .obj file format just open the .tk file and add a “v” to all of the lines not beginning “3″. For lines beginning with “3″ just replace the “3″ with an “f”. That’s it.

The next step is to download Blender. Other 3D programs will work but I’m most familiar with Blender. You can also make Blender in to a poor mans level editor by getting the BlenderSceneExporter script from the ogre repo. You’ll also need the OgreConverter script which comes with the Ogre3D source code. It’s in the Tools folder.

[GHavok]

This class can be ported to whatever program. All it does is condense the Havok initialization code and offers some functionality for adding Havok entities. GHavok is specific to my needs but it should work for simple examples. It also sets up Visual Debugging if you choose to use the free Havok Visual Debugger.

To Initialize:

GHavok::GetSingleton().SetupHavokEngine();

To Destroy:

GHavok::GetSingleton().DestroyHavok();

To Add Entities:

GHavok::GetSingleton().AddEntity(hkpEntity *ent)

To Add Objects:

GHavok::GetSingleton().AddObject(HKObject *obj)

This code was ripped from the Havok physics directory. The part specific to my program is:

void GHavok::Step(double dt){
	_dCurrentTime += dt;
 
	if(_dCurrentTime &gt;= _dHavokTimeThresh){
		double dTimeChange = _dCurrentTime;
		ResetThreadTokens();
		StartStepWorld(_dCurrentTime);
		WaitForStepWorldFinished();
 
		StepVisualDebugger();
 
		Lock();
 
		std::vector::iterator iter;
 
		for(iter = _vObjects.begin() ;iter != _vObjects.end(); iter++){
			(*iter)-&gt;Step(dTimeChange);
		}
 
		Unlock();
 
		_dCurrentTime = 0.0f;
	}
}

* _dHavokTimeThresh should NEVER be smaller than 0.02f. This controls how often Havok updates its world. In my tests I found anything faster 50 frames per second (0.02 milliseconds) caused some serious lag and broken physics.

All of my renderable objects are derived from the HKObject class. This class contains a virtual Step function. When GHavok processes another frame tick it calls the step function of any object attached to it’s HKObject list _vobject. The way my project is setup you only add the HKCharacterController and HKFactory to GHavok. The factory takes care of updating its attached entities.

Physics entities must still be added to GHavok first and then objects. Just adding an object won’t create the physics wrapper.

[HKPrimitive]

HKPrimitive a primitive wrapping class. Right now it spawns very specific models for spheres(the world) and cubes(a crate).

Example of creating a sphere:

//Assign new primitive descriptor
		{
			HKPrimitiveDescrip descrip;	
 
			Vector3 spawnPos = mCamera-&gt;getPosition();
 
			char buffer[256];
			sprintf(buffer,"Sphere_%d_",nObj++);
 
			descrip._sID = buffer;
			descrip._iPhysType		= HKObjectDescrip::OBJ_PHYS_SPHERE;
			descrip._iPrimitiveType		= HKPrimitiveDescrip::PRIMITIVE_SPHERE;
			descrip._vPos = Vector3(spawnPos.x,spawnPos.y+10,pos.z);
			descrip._ogreCamera = mCamera;
			_hkLevel-&gt;AddPrimitive(descrip);
		}

Since my last post I’ve modified the HKObjects a bit. Objects all have a descriptor class defined in their headers. This descriptor class is required to create an object. The above code will spawn a sphere 10 units above the main character. As I state previously, GHavok calls the virtual step function on all objects. In this case our new primitive is added to HKLevel. HKLevel will then attach that object to the Factory which is in turn called by GHavok. The important piece is the step function inside of HKPrimitive:

void HKPrimitive::Step(double dt){
 
	//Check for grabbed object
	if(!_bGrab){
		hkVector4 pos = _descrip._hkRigid-&gt;getPosition();
		hkQuaternion q = _descrip._hkRigid-&gt;getRotation();
		Ogre::Quaternion qOgre;
 
		qOgre.x = q.m_vec(0);
		qOgre.y = q.m_vec(1);
		qOgre.z = q.m_vec(2);
		qOgre.w = q.m_vec(3);
 
			//Apply ball position to ogrenode
		_descrip._ogreScene-&gt;setPosition(pos(0),pos(1),pos(2));
		_descrip._ogreScene-&gt;setOrientation(qOgre);
	} else {
 
		hkVector4 hkpos = _descrip._hkRigid-&gt;getPosition();
		hkQuaternion q = _descrip._hkRigid-&gt;getRotation();
 
		Ogre::Quaternion qOgre;
		Ogre::Vector3 ogpos = _descrip._ogreScene-&gt;getPosition();
 
		_descrip._hkRigid-&gt;setPosition(hkVector4(ogpos.x,ogpos.y,ogpos.z));
	}
}

_bGrab tells HKPrimitive that it is being held by the player and to skip moving the Ogre object.

So step 1 is to get the current state of the Havok entity. In this case it is a sphere:

		hkVector4 pos = _descrip._hkRigid-&gt;getPosition();
		hkQuaternion q = _descrip._hkRigid-&gt;getRotation();
		Ogre::Quaternion qOgre;

We then apply the Havok entity state to the Ogre entity state:

		qOgre.x = q.m_vec(0);
		qOgre.y = q.m_vec(1);
		qOgre.z = q.m_vec(2);
		qOgre.w = q.m_vec(3);
 
			//Apply ball position to ogrenode
		_descrip._ogreScene-&gt;setPosition(pos(0),pos(1),pos(2));
		_descrip._ogreScene-&gt;setOrientation(qOgre);

Voila. The ogre primitive will now move and rotate. Technically what we’re rotating and positioning is an Ogre::SceneNode. You attach entities to SceneNodes first and then update the SceneNode.

[Caveats and disclosures]

Admittedly a lot of this code is a hack. You may notice how a lot of the ogre functions are NOT wrapped by try/catch statements. This was an oversight. I never intended my example to do anything more than spawn a small sphere and maybe have a working character controller. Good coding practice tells you to use those functions otherwise Ogre may have issues like if you attempt to create an object with a name that has already been used.

I may clean this up.

[Conclusion]

I didn’t realize how fucking long it would take to write a few simple examples. Looks like a part 3 will have to be created. In the next installment I plan on adding a small blurb about the CharacterController and the StaticMesh class. More specifically I’ll go over using Havok’s GameUtils function for loading triangular meshes and creating a physical environment from that mesh.

Categories: Coding Tags:

New Blog

August 2nd, 2008 admin 1 comment


*Geodesic surface propagation on Optimash Prime 3D scan.

Welcome to the new and improved Daksystems.

Daksystems has finally moved to a new blog format, WordPress. Simplephpblog just wasn’t cutting it anymore. There was too much spam, no updates, kludgy interface, and a complex system of files that you as the user wouldn’t see but I had to maintain none the less. What a fucking hassle. Honest to god we’re talking a ratio of 20 to 1 between files from Simplephpblog and WordPress.

What you can’t see on your end is the slick interface for creating new posts and maintaining this site. It makes my life so much easier if I don’t have to manually edit files in a text browser and then upload them.

I’ve decided NOT to port my old blog posts to the new blog. I will, however, be keeping a permanent link to the old blog on the left hand side entitled “Old Blog.” In the next few days I’m going to be updating my feedburner link to point to the new rss feed.

Thank you for your patience.

-Dakota Read more…

Categories: Uncategorized Tags: