• BeSpell
  • Gridus
  • Hamburger
  • Tug
  • Mood Board
  • Conditional migrations in NodeJS using Sequelize

    I’m running SequelizeJS as my ORM for Enki. Recently I wanted to add a location field to tasks so users could “geolocate” the work items they were adding in world space. Click on a task and Sextant will zoom you to that point on the map where the work needs to be done. All you need to do is bring a shovel and a hard-hat.

    I’d already done one migration earlier on to add an active field to tasks so I knew the basic commands to fire off:

    node_modules/sequelize/bin/./sequelize -c 0.0.2
    

    … Edit some code to migrate …

    node_modules/sequelize/bin/./sequelize -m
    [BIZZ-BLGXXL-CRACKLE-SPIT] Column Exists [FOO-BRAKL-BARK-BARK-HISS]
    

    OOPS

    But this time when I went to run the migration, I hit an error. It seems that because it fires all migrations in sequence, if you add a column in an earlier migration you really need to wrap it in a test to see if the column exists first.

    Here’s my code:

    up: function(migration, DataTypes, done) {
        // add altering commands here, calling 'done' when finished
        migration.migrator.sequelize.query(
            "show fields from Tasks where field = 'active';"
        )
        .success(
            function (records) {
                    if (records.length > 0) {
                        done();
                        return;
                    }
                    migration.addColumn(
                        "Tasks",
                        "active",
                        DataTypes.BOOLEAN
                    );
                    done();
            }
        );
    }
    

    This is only the up-migration path but the down would be pretty much identical. Thinking about migrations on a longer timeline it becomes very clear that this portion of your application needs to do the most amount of defensive driving. You have to assume that before the migration ran; you cannot guarantee what the state of the database is going to be.

    Gotcha

    One other thing that’s important to point out, by accessing the sequelize object buried inside of the migrator tool; you have access to all the asynchronous goodness of Sequelize. You need to remember to invoke the “done()” callback in both cases, otherwise the versions check during migration will stop on this case. Hopefully this little chunk of code helps someone out of a bind.

    6programming, enki, mutiny, game development, indie dev,

    Mood Board Update

    I just spent the weekend working on nothing but Mood Board. It’s an application that helps you quickly put together concept documentation for creative projects like jewelry, paintings, illustration, concept art, weddings and pretty much any kind of project where style or visual look development is important.

    I’ve been meaning to get a bunch of updates done for a while but I’ve let other projects take precedence and that just isn’t right. So without further ado, here are a list of the changes that went to Apple for approval today:

    • (Fixed) Image sorting when adding new assets to your Boards. This means that new materials will always be at the top of your stack in the document, ready for you to move into position as you see fit. It also inadvertently means that assets stay “in order” more reliably.
    • (Fixed) the crashing bug reported from users attempting to drag images directly from the new “modal” google image search results into a board. This was caused by my erroneous assumption that the urls posted to the clipboard by Safari (ne. google) would actually be sane strings. Short answer, they are nothing like what you’d consider to be an actual url.
    • (Feature) Added the ability to pan the view. This is done using two-finger scrolling on the trackpad. Implementation should work similarly on any supported device for multi-touch input. (I’m working out how this should function for non-standard devices, would love to hear from users if this is a big issue.)
    • (Fixed) Export and Edit Node were conflicting on Command+E. Export is now (the more standard) Command+Shift+E while edit remains Command+E.
    • (Feature) Implemented the ability to zoom into boards. This is a pretty big feature and I am almost positive that we’ll be revisiting this. When you bring in assets at native scale we should be able to up-sample those assets while you’re zooming so that if you have the resolution in an asset you get to see more detail. Whether or not this is happening natively is hard to tell because my display is higher resolution and everything pretty much always looks awesome.
    • (Fixed) The scale tool now responds in the way you’d expect a state-ful tool to act. Instead of snapping to min-scale when you drag in either direction, scaling now only offsets the current asset scale making things feel far more natural. While I’d agree that Mood Board doesn’t scale things normally (always from the bottom right edge?!) this is for a reason that should be come more clear in the next update.
    • (Feature) I’ve improved rendering performance by almost 30% so even boards containing large numbers of assets should render more quickly. The background plane is now ready for you to be able to assign custom art and overload the color selection models to be able to produce exactly the kind of board you want.
    • (Feature) I’ve also implemented a new color selection setting called “Most Unique” This works by calculating the average of all selected assets and then picking from that set the one color that most deviates from the selected average. If you work with pictures of jewelry this is really going to help you find better background colors to let you focus on your overall color-styles. If you had a silver band with a colored gem in a setting, shot on a white background; you would get the color the gem almost every time in your board background selection.

    This is a really huge update and I’m proud of what I’ve done here. I feel kind of bad about the time it took to get this update out but I think it was worth the wait.

    6mood board, urbanfort, mac app store, development, indie dev,

    .. just leave this here..

    Jesus H… That music.

    Dev Blog #3: Stats f

    nerdkingdomofficial:

    Hello everyone!

    Introduction! Yay! Alright, for all of you who have no idea who I am, my name is Artie (onemanparty). I have a B.S. in Mathematics applied to Economics and joined Nerd Kingdom at its inception as a research assistant for data analysis. I am now part of the design team, and my…

    Source: nerdkingdomofficial

    6the untitled game,

    Working with Asynchronous Operations in Unity3d

    We’re building a fairly large framework of components for our new game Bedlam. As part of these web services contracts we need to be able to very rapidly fire off commands to the server to persist data, fetch status updates for user collision detection and a bunch of other stuff. We are using the excellent (RestSharp)[http://restsharp.org] library for all of our state-ful, non-socketed network communication. This library provides a really handy template method for firing Asynchronous requests and we ultimately want to use that for every single call that goes out to the server. Ordinarily we’d just throw these calls in an IEnumerator block and forget about it but for this particular product we wanted to make sure that we were locking down all the pieces as we go. We needed a more thoughtful solution.

    The basics of what we’ve done to work around the fact that Unity only allows you to modify the state of a GameObject on the main thread is by implementing a message queue. This centralized singleton provides us with a common broker for all network response handling and there’s really no limit to what you can do once you’ve implemented it for dealing with asynchronous operations.

    The basic MessageQueue class:

    // In case we need to work with unity native types.
    using UnityEngine;
    // For the messages list.
    using System.Collections.Generic;
    
    public class MessageQueue
    {
        private static MessageQueue _instance;
        public static MessageQueue Instance
        {
            get
            {
                if (_instance == null) {
                    _instance = new MessageQueue();
                }
            }
        }
    
        private List<string> serverMessages;
    
        public int MessageCount 
        {
            get {
                return this.serverMessages.Count;
            }
        }
    
        public MessageQueue ()
        {
            this.serverMessages = new List<string>();
        }
    
        public string ShiftMessage ()
        {
            string result = "";
            if (this.serverMessages.Count > 0) {
                result = this.serverMessages[0];
                this.serverMessages.RemoveAt(0);
            }
            return result;
        }
    
        // Here you could wrap the insertion of a new message to take some other action
        // when new data comes in, fire an event, etc.
        public string PushMessage (string msg)
        {
            this.serverMessages.Add(msg);
        }
    }
    

    This class contains all of what we need to handle simple text messages from the server (like Operation Successful, Operation Failed) along with any metadata we might want to include. The serverMessages member could just as easily be a dictionary that contains the response from your web service.

    In our main network broker class we have an IEnumerator:

    private IEnumerator ManageQueue ()
    {
        // This enumerator should run for the lifetime of our app.
        while (true) {
            float delay = 3f;
            if (MessageQueue.Instance.MessageCount > 0) {
                string msg = MessageQueue.Instance.ShiftMessage();
                Camera.main.GetComponent<GUIWrapper>().statusString = msg;
                if (msg.IndexOf("Error") > -1) {
                    delay = 6f;
                }
            } else {
                Camera.main.GetComponent<GUIWrapper>().statusString = "";
            }
            yield return new WaitForSeconds(delay);
        }
    }
    

    This enumerator is invoked as a coroutine in the Awake method of the network broker and runs continuously checking the queue for new server messages. Once it finds one it assigns it to the GUI class that can display server messages. We even extend the delay until we recycle the message if there is a reported error. (I would agree our approach here is ham-fisted but hey…)

    In order to push new content into the queue our network broker invokes following RestSharp method:

    var client = new RestClient(url);
    var request = new RestRequest(endpoint);
    client.ExecuteAsync(request, response => {
        if ((int)response.StatusCode != 200) {
            MessageQueue.PushMessage(string.Format("Error: {0} - something bad happened.", response.StatusCode);
        } else {
            MessageQueue.PushMessage("YAY!");
        }
    });
    

    This allows you to pretty much manage any kind of state you want without blocking on numerous network requests that are bound to occur in your game. Please feel free to use the Ask link on my blog if you run into any problems; I’m happy to help out. I hope you find this little snippet of code useful. I highly recommend switching from Unity:WWW to RestSharp as soon as you can manage it.

    6mutiny, unity3d, restsharp, enki, code, programming, game development,

    Bedlam Update 20140311a

More landscape exploration. It&#8217;s amazing how quickly I can put to use all the preamble work I did over the summer with perlin generation. I played around with box noise (diamond maps) but honestly the results just weren&#8217;t that spectacularly different from what I&#8217;m getting now with layered noise.

To which end here, I&#8217;m layering perlin noise at a couple of different octave/frequency combinations. The compositing rules are pretty simple because I&#8217;m working entirely in grayscale (although Processing does have a habit of throwing in some weird-ass color artifacts from time to time which keeps things interesting.)

After each layer pass I apply a simple convolution matrix to the whole image. These are applied in descending iteration frequency so that the closer to the &#8220;top layer&#8221; things get, the sharper they are. Pretty simple stuff really but I love the &#8220;volcano&#8221; accidents. These maps are generated at 1024 so I&#8217;d eventually have to serialize these and regenerate higher frequency noise on top of them.

Before I do that though, I have to learn a few new tricks regarding decay and erosion models. There should be cracks, fault lines and rivers in these maps that are missing right now and those are going to be essential for gameplay.

Cheers!
    ZoomInfo
    Bedlam Update 20140311a

More landscape exploration. It&#8217;s amazing how quickly I can put to use all the preamble work I did over the summer with perlin generation. I played around with box noise (diamond maps) but honestly the results just weren&#8217;t that spectacularly different from what I&#8217;m getting now with layered noise.

To which end here, I&#8217;m layering perlin noise at a couple of different octave/frequency combinations. The compositing rules are pretty simple because I&#8217;m working entirely in grayscale (although Processing does have a habit of throwing in some weird-ass color artifacts from time to time which keeps things interesting.)

After each layer pass I apply a simple convolution matrix to the whole image. These are applied in descending iteration frequency so that the closer to the &#8220;top layer&#8221; things get, the sharper they are. Pretty simple stuff really but I love the &#8220;volcano&#8221; accidents. These maps are generated at 1024 so I&#8217;d eventually have to serialize these and regenerate higher frequency noise on top of them.

Before I do that though, I have to learn a few new tricks regarding decay and erosion models. There should be cracks, fault lines and rivers in these maps that are missing right now and those are going to be essential for gameplay.

Cheers!
    ZoomInfo
    Bedlam Update 20140311a

More landscape exploration. It&#8217;s amazing how quickly I can put to use all the preamble work I did over the summer with perlin generation. I played around with box noise (diamond maps) but honestly the results just weren&#8217;t that spectacularly different from what I&#8217;m getting now with layered noise.

To which end here, I&#8217;m layering perlin noise at a couple of different octave/frequency combinations. The compositing rules are pretty simple because I&#8217;m working entirely in grayscale (although Processing does have a habit of throwing in some weird-ass color artifacts from time to time which keeps things interesting.)

After each layer pass I apply a simple convolution matrix to the whole image. These are applied in descending iteration frequency so that the closer to the &#8220;top layer&#8221; things get, the sharper they are. Pretty simple stuff really but I love the &#8220;volcano&#8221; accidents. These maps are generated at 1024 so I&#8217;d eventually have to serialize these and regenerate higher frequency noise on top of them.

Before I do that though, I have to learn a few new tricks regarding decay and erosion models. There should be cracks, fault lines and rivers in these maps that are missing right now and those are going to be essential for gameplay.

Cheers!
    ZoomInfo
    Bedlam Update 20140311a

More landscape exploration. It&#8217;s amazing how quickly I can put to use all the preamble work I did over the summer with perlin generation. I played around with box noise (diamond maps) but honestly the results just weren&#8217;t that spectacularly different from what I&#8217;m getting now with layered noise.

To which end here, I&#8217;m layering perlin noise at a couple of different octave/frequency combinations. The compositing rules are pretty simple because I&#8217;m working entirely in grayscale (although Processing does have a habit of throwing in some weird-ass color artifacts from time to time which keeps things interesting.)

After each layer pass I apply a simple convolution matrix to the whole image. These are applied in descending iteration frequency so that the closer to the &#8220;top layer&#8221; things get, the sharper they are. Pretty simple stuff really but I love the &#8220;volcano&#8221; accidents. These maps are generated at 1024 so I&#8217;d eventually have to serialize these and regenerate higher frequency noise on top of them.

Before I do that though, I have to learn a few new tricks regarding decay and erosion models. There should be cracks, fault lines and rivers in these maps that are missing right now and those are going to be essential for gameplay.

Cheers!
    ZoomInfo

    Bedlam Update 20140311a

    More landscape exploration. It’s amazing how quickly I can put to use all the preamble work I did over the summer with perlin generation. I played around with box noise (diamond maps) but honestly the results just weren’t that spectacularly different from what I’m getting now with layered noise.

    To which end here, I’m layering perlin noise at a couple of different octave/frequency combinations. The compositing rules are pretty simple because I’m working entirely in grayscale (although Processing does have a habit of throwing in some weird-ass color artifacts from time to time which keeps things interesting.)

    After each layer pass I apply a simple convolution matrix to the whole image. These are applied in descending iteration frequency so that the closer to the “top layer” things get, the sharper they are. Pretty simple stuff really but I love the “volcano” accidents. These maps are generated at 1024 so I’d eventually have to serialize these and regenerate higher frequency noise on top of them.

    Before I do that though, I have to learn a few new tricks regarding decay and erosion models. There should be cracks, fault lines and rivers in these maps that are missing right now and those are going to be essential for gameplay.

    Cheers!

    6mutiny, bedlam, enki, processing,

    Ck Burch - Online f

    ckburch:

    Guess what? I’ve launched my very website yesterday. While there is still a bit of rearranging to do, you’ll find news, books, and contact info. Come have a look! More updates coming soon!

    Source: ckburch

    Tower of Guns - Overview video f

    Ni no Kuni: Wrath of the White Witch has sold over 1.1M - Destructoid f

    This is such a great game if you have a PS3. I absolutely love the way they reworked the combat system to be a mix of turn-based random encounters and real-time button-mashing. The story is engaging (although I wish that they’d have forgone the Scottish phonetics with Drippy in the text-only portions; or done voice over for 100% of him.) I’ve been playing it with Josie so we still haven’t beaten it but.. just a great game.

    I’m very glad they are finding success with it.

    6games, game development, ni no kuni,

    Introducing Bedlam... f

    mutinygames:

    image

    Well, here we are, gearing up for a new project at Mutiny… and we’re really excited to start talking about this one.

    Our resident strategy RPG enthusiasts, Geoff and Rob have been hoping to do a title like this for a while now.

    We’re excited to announce that the title was…

    Source: mutinygames

    Bedlam Update 2014030902

I&#8217;ve reduced the workflow in Enki to taking raw images as input for the various height-maps and other informative structures required for initializing a world build. This made a lot more sense than trying to constantly generate procedural content at the server. Noise support in NodeJS is kind of not great and frankly I didn&#8217;t feel like spending the time to get libnoise set up on the server, etc. It just adds a ton of additional pre-requirements to installing the local development build.

This way, we can use whatever tools we&#8217;re comfortable with, Processing is my personal favorite for quickly roughing up procedural content and eventually I could see a real need to use photoshop for building the base dataset for the world for Bedlam.

Above are a few samples from the work I did this morning on building a new dataset. The final world dimensions for Bedlam are (quite frankly) astronomically large. So large that I can&#8217;t even generate a single world in processing with my current memory setup. Instead I&#8217;ll be producing several different land-masses and then stitching them together for the final import set.

Not much of an update I realize, but at least this one includes pictures. :)
    ZoomInfo
    Bedlam Update 2014030902

I&#8217;ve reduced the workflow in Enki to taking raw images as input for the various height-maps and other informative structures required for initializing a world build. This made a lot more sense than trying to constantly generate procedural content at the server. Noise support in NodeJS is kind of not great and frankly I didn&#8217;t feel like spending the time to get libnoise set up on the server, etc. It just adds a ton of additional pre-requirements to installing the local development build.

This way, we can use whatever tools we&#8217;re comfortable with, Processing is my personal favorite for quickly roughing up procedural content and eventually I could see a real need to use photoshop for building the base dataset for the world for Bedlam.

Above are a few samples from the work I did this morning on building a new dataset. The final world dimensions for Bedlam are (quite frankly) astronomically large. So large that I can&#8217;t even generate a single world in processing with my current memory setup. Instead I&#8217;ll be producing several different land-masses and then stitching them together for the final import set.

Not much of an update I realize, but at least this one includes pictures. :)
    ZoomInfo
    Bedlam Update 2014030902

I&#8217;ve reduced the workflow in Enki to taking raw images as input for the various height-maps and other informative structures required for initializing a world build. This made a lot more sense than trying to constantly generate procedural content at the server. Noise support in NodeJS is kind of not great and frankly I didn&#8217;t feel like spending the time to get libnoise set up on the server, etc. It just adds a ton of additional pre-requirements to installing the local development build.

This way, we can use whatever tools we&#8217;re comfortable with, Processing is my personal favorite for quickly roughing up procedural content and eventually I could see a real need to use photoshop for building the base dataset for the world for Bedlam.

Above are a few samples from the work I did this morning on building a new dataset. The final world dimensions for Bedlam are (quite frankly) astronomically large. So large that I can&#8217;t even generate a single world in processing with my current memory setup. Instead I&#8217;ll be producing several different land-masses and then stitching them together for the final import set.

Not much of an update I realize, but at least this one includes pictures. :)
    ZoomInfo
    Bedlam Update 2014030902

I&#8217;ve reduced the workflow in Enki to taking raw images as input for the various height-maps and other informative structures required for initializing a world build. This made a lot more sense than trying to constantly generate procedural content at the server. Noise support in NodeJS is kind of not great and frankly I didn&#8217;t feel like spending the time to get libnoise set up on the server, etc. It just adds a ton of additional pre-requirements to installing the local development build.

This way, we can use whatever tools we&#8217;re comfortable with, Processing is my personal favorite for quickly roughing up procedural content and eventually I could see a real need to use photoshop for building the base dataset for the world for Bedlam.

Above are a few samples from the work I did this morning on building a new dataset. The final world dimensions for Bedlam are (quite frankly) astronomically large. So large that I can&#8217;t even generate a single world in processing with my current memory setup. Instead I&#8217;ll be producing several different land-masses and then stitching them together for the final import set.

Not much of an update I realize, but at least this one includes pictures. :)
    ZoomInfo

    Bedlam Update 2014030902

    I’ve reduced the workflow in Enki to taking raw images as input for the various height-maps and other informative structures required for initializing a world build. This made a lot more sense than trying to constantly generate procedural content at the server. Noise support in NodeJS is kind of not great and frankly I didn’t feel like spending the time to get libnoise set up on the server, etc. It just adds a ton of additional pre-requirements to installing the local development build.

    This way, we can use whatever tools we’re comfortable with, Processing is my personal favorite for quickly roughing up procedural content and eventually I could see a real need to use photoshop for building the base dataset for the world for Bedlam.

    Above are a few samples from the work I did this morning on building a new dataset. The final world dimensions for Bedlam are (quite frankly) astronomically large. So large that I can’t even generate a single world in processing with my current memory setup. Instead I’ll be producing several different land-masses and then stitching them together for the final import set.

    Not much of an update I realize, but at least this one includes pictures. :)

    6enki, bedlam, processing, unity3d, game development, heightmap,

    Bedlam Update 20140309

    You can now paint textures and have them persisted in the database!

    A button on the main gui “Test Function” allows you to push your texture changes for the currently visible chunk up to the server. This sort of manual thing is not at all what I’m hoping to implement but there are a lot of factors involved in timing these sizable updates to the server.

    In the future this will want to be on a delay and happen totally in the background.

    I spent some time working with Async RestSharp to try and get it working but ended up backing out of it. While the code is easy enough to switch (and I think we really need to) you have to conform to thread-locked resources when dealing with GameObjects. This is perfectly sensible because Unity is pushing stuff to the graphics card constantly and it needs to know what the state of the objects it’s brokering is.

    I’m hoping we can look at splitting off all of the chunk mesh-creation code from being GameObject dependent (it’s just a component sitting on a GO right now.) Instead we’d create everything in memory before we do a single batched swap-out of it (much like I’m doing with textures) so we can get the benefit of not waiting on the server to deliver packets while the UI hangs.

    All in all a really productive weekend. Looking forward to what comes next. Check out Bitfune if you haven’t. I’d love to get some feedback on things that could be added to make it a better resource for understanding auto-tiling using bit-sequence matrices.

    6bedlam, mutiny, enki, unity3d, restsharp,

    
101 dalmatians {scenery}
    ZoomInfo
    
101 dalmatians {scenery}
    ZoomInfo
    
101 dalmatians {scenery}
    ZoomInfo
    
101 dalmatians {scenery}
    ZoomInfo
    
101 dalmatians {scenery}
    ZoomInfo
    
101 dalmatians {scenery}
    ZoomInfo
    
101 dalmatians {scenery}
    ZoomInfo

    101 dalmatians {scenery}

    (via jennifer-mcgee)

    Source: loserslurgy

    Bitfune

    I updated the Bitfune tile generation page slash write-up.

    • You can now hit “Play” to configure the calculator to show you all possible values of tile combinations while you relax in your own home.
    • Clicking on the center (total) display brings up a prompt so you can enter whatever number you want and it will show you how to make that number happen on the grid.

    While a lot of the values are totally logical combinations for tiles; most just aren’t. For instance: 16, 32, 64 and combinations that leave islands inside the matrix obviously wouldn’t get converted to tiles.

    Does anyone know how to programmatically determine only the most meaningful entries (those that result in contiguous portions only?)

    Also of note is that many of the shapes simply rely on existing tiles. I’m wondering if there isn’t a way to narrow the list of total hits so that you don’t have to alias some entries to others (although that’s a totally elegant solution to.)

    Source: static.tomingham.org

    6game development, indiedev,

    -
    Follow me on App.net