• BeSpell
  • Gridus
  • Hamburger
  • Tug
  • Mood Board
  • Search results for 'mutiny'

    IndieGames.com Super Galaxy Squadron is a modern SHMUP that's heavy on the retro f

    You know we sell a SHMUP too right?

    6games, mutiny, tug, indie game devs,

    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,

    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,

    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,

    Bedlam now supports auto-tiling texture projection painting! Load up a chunk of the world data and switch to the paint tool; click away! It just figures out what shapes need to go where so it feels very natural when you’re plopping down clumps of grass and hunks of rock. Very cool stuff.

    Additionally, you can see that I’ve refactored the toolbar quite a bit. I’ve removed the need to switch to Orbit, Pan, Zoom and put them on keyboard modifiers because you really do end up doing that a lot more than I thought.

    Additionally now that we support painting in a sensible way we’ve added: * A brush size selector. * A brush type picker (only Solid, Noise and Smooth for now.)

    Rob and I worked quite a bit on sever I/O and we’ve got realtime deformation in place with persistence at the database. We ended up using the excellent RestSharp API which took a bit of doing to get installed (maybe Rob will do a write-up so others can get the benefit of breaking away from the antiquated WWW/WWWForm classes in Unity.

    As part of the process of getting auto tiling working for textures, I was able to implement a much leaner method of storing the texture information so we’ll be looking at packed texture descriptions on the order of 6 times smaller than before. That should mean that we can store thousands of unique textures in just a couple of megabytes worth of game download.

    I’ve done a ton of work on tuning the database to perform well but honestly I think we’ve kind of outpaced a single-instance MySQL server. Right now we’re loading chunk-sets (around 4k nodes per query) in 0.03 seconds but transmission time and other factors mean we only load chunks in around 10 frames per second. It would be great to get those figures down further but unless I get a lot more intelligent about InnoDB I think we’re stuck. I really don’t want to refactor for Mongo or Redis but that might have to be the way it goes.

    If you’re interested in getting more timely information we’re going to be using the Forums more and more over the next few weeks. We’ve set up the excellent NodeBB and you can use your Steam or Facebook account to log in.

    Sorry for the long post but hopefully these details make up for the fact that I was pretty much vacant this week. Cheers!

    6mutiny, bedlam, enki, unity3d, nodejs,

    In a surprising turn of events we decided to start streaming data from the Enki server into our chunk renderer. The result is above which, I realize looks an awful lot like the earlier mesh data, but I can assure you it’s not.

    Pretty soon we’re going to be working on data persistence. Last week I stood up a new NodeJS service to warehouse all our data and keep all the members of the team working in the same space. I’m not entirely sure if this is how Unity saw their tools being used, but I have to say I’m loving it.

    There’s been some discussion about whether or not to keep the entire world persistent, as a single player game, with remote save game storage. The more that we work with these network services; the more value I can see in doing things this way. Our world is “procedurally generated” but in a way that’s not really at all like the way Minecraft or Banished are.

    We generate a single “bible” map out of a few different permutations and math that I barely understand. Once that’s done we can all work in the same space making changes that get merged together in the single datasource on the server and redistributed.

    I keep thinking about the idea that this could be incredibly fun for users. What if we could do global events that change the entire plot of the game mid-stream. “Didn’t finish the main quest yesterday? Tough it’s gone forever. Here have a demon lord!” Crazy, crazy stuff.

    There’s also the possibilities for multiplayer that I think are most obvious. We could very easily build match-making into Enki and have massive tactical battles in turn-based arenas without a whole lot of extra coding. I’m sure the discussion will keep going, we’re kind of evenly split on the whole idea of requiring at least periodic connections to the home server and we don’t have any way to manage the cost of the hosting itself.

    In any case, the above is an example of the newest version of the editor (now running as a desktop application instead of a web player as previous versions were because of cross-domain scripting policies.) Ultimately I think we’d like to get back to the web player possibility because that would open the door for the Facebook market.

    All in all a ridiculously productive week. If you haven’t checked out the mutiny blog or rob’s blog you definitely should.

    6mutiny, enki, bedlam, games, game development, unity3d, rpg,

    Works on PC. Can you tell?

    6mutiny, bedlam, enki, game development, unity3d,

    Geoff made a really good point. Requiring the user to keep clicking to cycle through tile art is dumb.

    I knew I could do better so I sat down this morning and crafted the new “Chooser” palette. Once you’ve assigned a tile set to a layer, whenever you have the paint tool active you get a list of tiles you can paint in to the map. This works out really well when you’re trying to plan and I know that we can go one step further (and even show you the tile that will be dropped before you paint it down.)

    I had a bunch of work-work to take care of today or I’d have gotten farther with this; on the whole I’m happy to have taken a break from it for a bit and get some perspective. What progress I did make ain’t too shabby either.

    6mutiny, enki, bedlam, games, game development, unity3d,

    As a kind of testament to the amount of code we just wrote; this most recent screenshot demonstrates our editors new ability to modify the tile maps we’re creating. Right now we’re brute forcing the placement of tiles but in the future we plan on having some moderate heuristics in place to speed the process up. The above also demonstrates layer isolation; which is one of those things you don’t really think about unless you do graphics for a living. :)

    The way tile editing currently works is each “Texture” group contains a stylesheet that defines the available tile sets. The texture is then constructed from “Layers” and each layer can have a single prefix-type (tile set) that can be painted.

    When you paint into the surface we place the midpoint tile (solid color.) You can then use the turn tool to swap out the specific tile inside of the prefix set to get things looking the way you want to create a shape.

    Probably worth mentioning that the blobs I created to use as sample textures are super crummy; I’ll be making better stuff soon now that the proof of concept for the editing tool is pretty much done.

    6mutiny, bedlam, enki, graphics, unity3d, games, game development,

    Updates for the game building tools (for Bedlam)

    • Layer Selection Interface
    • Ability to hide layers
    • Example Chunk browser UI
    • Ability to automatically track whatever layer you are on and only show you data relevant to that layer.
    • Added ability to reorganize layers.
    • Added ability to remove layers.
    • Added tool graphics (yay)

    I started the code for doing the raycast but it’s getting late and my brains stop working for the maths. Things are really shaping up and I hope to be serializing map data next.

    6mutiny, bedlam, enki, unity3d, games, game development, indie game devs,

    Added tools to control visibility of the texture builder. Also mapping to the terrains we’re generating.

    6mutiny, bedlam, enki,

    Work on Bedlam continues. While this example doesn’t look like much it is the result of about 20 hours of planning and design. You’ll see more of this type of thing in the next few days.

    6mutiny, bedlam, enki,

    I realize I might be stealing a little of Rob’s thunder on this but we worked our asses off last night and got the new meshing class finished that produces valid quad meshes using a pyramid triangulation pattern. This gives us really smooth output from distances but maintains the square pattern that will be essential for placing units in the future.

    We’re not talking a lot about what the new project is yet but I guarantee that folks are going to be really interested in the gameplay type.

    6mutiny, sextant, enki, robuuuu,

    -
    Follow me on App.net