Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

30. April 2011

6a00d8341c858253ef00e54f2306618834-640wiSo, choosing Blender for my art pipeline has some very big upsides, and a couple massive downsides.

 

Amongst the biggest downsides is that Blender is in the midst of a very long move from 2.4x to 2.5x, which means you are effectively using beta software in production.  Frankly, the 2.5x branch is probably as stable as the 2.4x branch with some major feature improvements.  That said, there is a giant downside… all kinds of documentation is simply and massively WRONG.

I just spent 2 hours trying to get a textured model into Unity, and for the love of all that is, I simply couldn’t get textures to work.  After many google sessions, I read that TexFace needs to be enabled… simply press F5 or F9, but again, these instructions are for 2.4x and are outdated.

I finally found the way after much confusing.

Properties->Material Icon ( the Ball )->New Material->Assign, then scroll down to Options and click Face Textures.  Done.  That was intuitive now, wasn’t it?

 

The following video illustrates that process.  Again of key note If you are using Blender with Unity, your textures WILL NOT WORK if you do not follow this process.

 

Enabling TexFace in Blender 2.56

Art , ,

29. April 2011

I just received the following email and thought I would pass it on.  I’ve received a few of these offers, so if you are looking to purchase in the future, wait for the next promo.

 

Greetings,

At Unity, we love games and want to see your game on mobile devices. To help get your Unity-powered game live in the App Store or available on any of the 30 million-plus Android devices out there, we are offering you a 20% discount on your purchase of a Unity iOS or Unity Android license. Simply visit our online store by April 30th and enter UFRM0430 when asked for your Rebate Code.

Unity Mobile - 20% off

Enjoy,
The Unity Team

Both links edited as they contained tracking info linked to my email address.

General

26. April 2011

So today, after 6 days of downtime I get word from Sony that apparently mine and 75 million other accounts have been compromised, including pretty much all of my personal information. Worst of all, this information included my password and possibly my credit card information.

 

This is an unforgiveable sin on many levels, but more than anything I have to say this… if you are storing sensitive information in your game, encrypt the hell out of it!  Really, it’s not that hard.  Actually here is how you do it…  this is code I have used in another project, but sadly I forget exactly where I got it from for proper crediting.  So, if you are the author, let me know and I will give proper accreditation.

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace ConfigurationLibrary
{
    public sealed class CryptoString
    {
        private CryptoString() { }
        private static byte[] savedKey = ASCIIEncoding.UTF8.GetBytes("YOURVALHERE");
        private static byte[] savedIV = ASCIIEncoding.UTF8.GetBytes("YOURVALHEREASWELL");
        public static byte[] Key
        {
            get { return savedKey; }
            set { savedKey = value; }
        }
        public static byte[] IV
        {
            get { return savedIV; }
            set { savedIV = value; }
        }
        private static void RdGenerateSecretKey(RijndaelManaged rdProvider)
        {
            if(savedKey == null)
            {
                rdProvider.KeySize = 256;
                rdProvider.GenerateKey();
                savedKey = rdProvider.Key;
            }
        }
        private static void RdGenerateSecretInitVector(RijndaelManaged rdProvider)
        {
            if(savedIV == null)
            {
                rdProvider.GenerateIV();
                savedIV = rdProvider.IV;
            }
        }
        public static string Encrypt(string originalStr)
        {
            // Encode data string to be stored in memory.
            byte[] originalStrAsBytes = Encoding.ASCII.GetBytes(originalStr);
            byte[] originalBytes = { };
            // Create MemoryStream to contain output.
            using(MemoryStream memStream = new
                     MemoryStream(originalStrAsBytes.Length))
            {
                using(RijndaelManaged rijndael = new RijndaelManaged())
                {
                    // Generate and save secret key and init vector.
                    RdGenerateSecretKey(rijndael);
                    RdGenerateSecretInitVector(rijndael);
                    if(savedKey == null || savedIV == null)
                    {
                        throw (new NullReferenceException(
                                "savedKey and savedIV must be non-null."));
                    }
                    // Create encryptor and stream objects.
                    using(ICryptoTransform rdTransform =
                           rijndael.CreateEncryptor((byte[])savedKey.
                           Clone(), (byte[])savedIV.Clone()))
                    {
                        using(CryptoStream cryptoStream = new CryptoStream(memStream,
                              rdTransform, CryptoStreamMode.Write))
                        {
                            // Write encrypted data to the MemoryStream.
                            cryptoStream.Write(originalStrAsBytes, 0,
                                       originalStrAsBytes.Length);
                            cryptoStream.FlushFinalBlock();
                            originalBytes = memStream.ToArray();
                        }
                    }
                }
            }
            // Convert encrypted string.
            string encryptedStr = Convert.ToBase64String(originalBytes);
            return (encryptedStr);
        }
        public static string Decrypt(string encryptedStr)
        {
            // Unconvert encrypted string.
            byte[] encryptedStrAsBytes = Convert.FromBase64String(encryptedStr);
            byte[] initialText = new Byte[encryptedStrAsBytes.Length];
            using(RijndaelManaged rijndael = new RijndaelManaged())
            {
                using(MemoryStream memStream = new MemoryStream(encryptedStrAsBytes))
                {
                    if(savedKey == null || savedIV == null)
                    {
                        throw (new NullReferenceException(
                                "savedKey and savedIV must be non-null."));
                    }
                    // Create decryptor and stream objects.
                    using(ICryptoTransform rdTransform =
                         rijndael.CreateDecryptor((byte[])savedKey.
                         Clone(), (byte[])savedIV.Clone()))
                    {
                        using(CryptoStream cryptoStream = new CryptoStream(memStream,
                         rdTransform, CryptoStreamMode.Read))
                        {
                            // Read in decrypted string as a byte[].
                            cryptoStream.Read(initialText, 0, initialText.Length);
                        }
                    }
                }
            }
            // Convert byte[] to string.
            string decryptedStr = Encoding.ASCII.GetString(initialText);
            return (decryptedStr);
        }
    }
}

Now its as simple as calling ConfigurationLibrary.CryptoString.Encrypt(somestring);  and ConfigurationLibrary.CryptoString.Decrypt(somestring).

 

It is this easy to encrypt your info, compromising your users security is never justified!  Just be sure to protect your encryption keys as much as possible.

 

For the record, I don’t know if Sony encrypted this information or not, but they haven’t communicated that they did, which leads me to believe that they didn’t.  If they did, Sony has done a horrible job at PR.  If they didn’t, Sony made a mistake a first year CS student never should have!  Either way, Sony just screwed up really badly.

Programming, Totally Off Topic , ,

26. April 2011

blender_logoSo, I am a bit late to the party as this was actually announced on the 22nd, but the newest version of Blender, 2.57a has been released.  As Blender is one of the primary tools we will be using to create our game even a minor bug fix release is important.  A full list of bug fixes is available here.  No new shiny sexy features, but 100 less bugs is nothing to sneeze at.

If you haven’t already, go ahead and download Blender here.

Art

25. April 2011

 

After deciding that Unity is my Engine of choice, a new contender threw their hat in the ring.  Apparently Crysis is going to be freely available in August.

“In August 2011 we will be launching a free CryEngine SDK. If you want to use it for fun, like all our previous MOD SDKs it will be completely free of charge, to anyone who wants to play with it,” he added.

“We'll be giving you access to the latest, greatest version of CryEngine 3 - the same engine we use internally, the same engine we give to our licensees, the same engine that powers Crysis 2.
“This will be a complete version of our engine, including C++ code access, our content exporters (including our LiveCreate real-time pipeline), shader code, game sample code from Crysis 2, script samples, new improved Flowgraph and a whole host of great asset examples, which will allow teams to build complete games from scratch for PC.”

Documentation, written by those who made the engine, will also be available for all, Crytek said.

To be honest, this doesn’t affect my decision in the slightest.  These mod turned engine releases normally are supported and documented so poorly as to be useless.  More importantly, iOS and Android are IMHO the golden goose of the indy game markets, while Crysis is squarely aimed at the high end PC and console market.  Of course, we still have no idea what the commercial license costs will be.

That said, pretty cool to have another entrant in the field, options are never a bad thing.  Nobody sane would ever question the capability of the CryEngine.

General ,

Month List

Popular Comments