Lostcast 115: Ramble On Unity


  • Patron

    One of best things about this podcast is that we get to learn from your experience. If I am lucky, I might get to squeeze in an hour each day for my dev hobbies. I have to make them count. I do most of my programming on weekends, and I don’t get to have every weekend.

    I listen to podcasts while I am driving or walking the dog. With Lostcast, I get to hear about how X and Y failed, but Z seemed to work. I feel like I am multitasking. I now know that SpriteTile is probably the way to go when I finish the Unity tutorials and start to really put together a 2D game. If I want to have external game data, I now know XML is a viable option.

    How much time did @geoffb just save me? That knowledge may have taken him 2 days to acquire, and I got in 30 minutes. New idea for a show title: Lostpath. You can talk about all these rabbit holes and mistakes you had to dig yourself out of.

    Is there going to be another major HTML5-based game release from LDG, or are you now committed to Unity?


  • LDG

    We make mistakes, so YOU don’t have to! :D

    Thanks for the words, that’s a great perspective for the show. Seems unlikely we’ll commit to another major HTML5 game (tho crazier things have happened!). If we do a game jam, we might use Djinn, mostly cuz we can move really quickly without having to learn along the way.



  • I am a big fan of the podcast. I’ve been toying around with HTML5 (specifically with PhaserJS) for a little while now and it’s been great to hear real stories from devs who are taking the technology to market.

    I just started messing about with Unity as well and I thought I’d share a library I found to help load JSON. It’s called MiniJSON;

    https://gist.github.com/darktable/1411710

    It’s pretty easy to use and I would personally much rather have my external data in JSON format than XML.

    Thanks for the great cast!


  • Jammer

    I found it true Matt when you said in the show about receiving a spec (the design) for front end and implementing that. However, when I did the same thing at my past job, I found myself finding creative ways to implement it, or creative ways to approach a particular challenge. The designers would ask me “Is X possible” and sometimes that gave me a chance to research it. I also had the benefit of introducing responsive design and how that works to the company, so I guess things like that filled the niche.

    I am a big fan of the podcast. I’ve been toying around with HTML5 (specifically with PhaserJS) for a little while now and it’s been great to hear real stories from devs who are taking the technology to market.

    I was having a chat last night with a good friend of mine how I’ve kinda gone back to using Java, over HTML5 MelonJS engine for my next project. My main thought was “if I am looking to do a desktop game, why would i make something for web, then wrap it to make it desktop?”. I still think the web is an amazing compile target when you want to share games easily or target something for the web, but ways to doing that are growing ala emscripten.


  • Tiger Hat

    “…spoke of games and the arcane art of HTML5…”

    So the legend is true! Maybe? Kinda? Just a joke, I’m not trying to be a smart ar$e!

    I’ve really seen the rise in popularity of Unity when I go to game jams or game events here in Ireland. I think that might be in part due one or two of the Universities using it on their computer games / digital media courses. Either way, the speed at which people get quality prototypes and demos built during an 8 - 12 hour jam is amazing.

    Some guys I know from Bitsmith Games have been working on their 2nd game and I saw it go from basic geometry where I moved a capsule around a small single level to this in a couple of months. (Obviously they did work their socks off too, it’s not just Unity magic).

    I’m looking forward to the next “phase” of Lostcasts as I think you guys will have a lot of interesting design related things to talk about! :)


  • Jammer

    @anthony said:

    I think that might be in part due one or two of the Universities using it on their computer games / digital media courses.

    I think this is a big part of it. Global game jam toronto event, and TOJam are hosted at a Design & computer program campus of George Brown. I think all the machines ive ever seen have Unity, and more recently Unreal Engine 4.


  • LDG

    @bmceldowney said:

    I am a big fan of the podcast.

    Hey thanks for listening! And welcome to the forum :)

    It’s called MiniJSON;

    Cool we’ll check that out. JSON as a format is awesome.

    @agmcleod said:

    I found it true Matt when you said in the show about receiving a spec (the design) for front end and implementing that. However, when I did the same thing at my past job, I found myself finding creative ways to implement it, or creative ways to approach a particular challenge. The designers would ask me “Is X possible” and sometimes that gave me a chance to research it. I also had the benefit of introducing responsive design and how that works to the company, so I guess things like that filled the niche.

    haha yeah that was the “look how awesome my JavaScript is” bit – I still totally dig that. Even besides doing the job creatively sometimes those frontend gigs were pretty open about design, too. At my first job we were just given problems to solve (e.g. make this list sortable) instead of given specs, so we had complete freedom to design + implement. Either way, fun!

    @anthony said:

    I’m looking forward to the next “phase” of Lostcasts as I think you guys will have a lot of interesting design related things to talk about! :)

    Yeah crazy how popular Unity has become. Great to hear, looking forward to it!


  • Tiger Hat

    It’s been a while since I’ve really used .NET, but IIRC you shouldn’t have to mirror the class exactly. You should be able to use some serialization attributes like:

    public class Person {
        public string Name;
    
        [XmlIgnore]
        public string SomeInternalField;
    
        [XmlElement(ElementName = "hitPoints")]
        public int hp;
    }
    

    Also I think that some of the reason that JSON is not as readily available is because it lacks the strong typing (or schema). It’s much harder to deserialize a string into the proper code values when you have to guess what they are. JavaScript has the benefit of having all of that baked into the language specifically to deal with JSON. Not to say that I’m not a fan of JSON as well.

    I also wonder about the Binary serialization. I understand the desire to “protect” the save game files, but if the level configuration files are also unprotected, wouldn’t it be just as easy to go in and tweak the first level to contain only wimps and have a billion gold? It seems to me that there should be a solution by using XML for development, and deserializing those files and reserializing them into binary for release. I can also see because of this why they would have you build an internal editor for direct binary serialization. I would imagine there should be some kind of “automatic” form builder based off of similar serialization rules of the class using attributes. For simple field mapping (I’m sure other things can complicate matters) it seems like it should be easy to auto build a form (much how they already add fields to the component editor from your classes). In HTML terms, you could just stick a <textarea> on the page and let people edit some XML string OR you could make a form with inputs that’s a lot easier to deal with. I wonder if even your desire to use Sublime for this purpose is some form of clinging onto developing in the old world :)


  • Jammer

    Really binary encoding only removes the ability for people that dont know how to decode it. Can always save them encrypted, and have the game decrypt them on load if you really want. Though then i’m not sure how to safeguard the encryption key :/



  • @Warspawn said:

    Also I think that some of the reason that JSON is not as readily available is because it lacks the strong typing (or schema). It’s much harder to deserialize a string into the proper code values when you have to guess what they are.

    This is true, though you don’t really have to do much guessing, a value is either a string or an int with JSON, and you have to know the schema before hand anyway because you’re going to need a POCO set up at design time, even with XML. Sure, you have to manually cram your deserialized values into your POCO, which is one more thing to maintain, but that’s a price I’ll pay because of my own irrational dislike of XML. 8-P

    @Warspawn said:

    I also wonder about the Binary serialization. I understand the desire to “protect” the save game files, but if the level configuration files are also unprotected, wouldn’t it be just as easy to go in and tweak the first level to contain only wimps and have a billion gold?

    That is a really good point. I think another valid question is, “who is harmed if a player is allowed to cheat?” In a single player game the only consequence of cheating is that the player gets to see your content, which is one of the goals of a game in the first place. I would argue that you’re doing the player a disservice by trying to hide all the guts. By exposing all of your internal data to the player you may well spark an interest in how game development works and give them an introduction into basic game modding, which is how a lot of people get started in the industry.


  • Patron

    @bmceldowney said:

    I think another valid question is, “who is harmed if a player is allowed to cheat?” […] I would argue that you’re doing the player a disservice by trying to hide all the guts.

    I have one word to say about this (an acronym, actually):

    WAD

    P.S: Tho with Steam it’s a little bit different, specially if the user can trigger the game to get him achievements.


  • LDG

    @Warspawn Yeah, the XML serialization is pretty straight-forward. I’m pretty happy with the setup, dunno if that came across in the cast. The XML files aren’t just plain text readable to players, though. Unity has a way of packaging them (encrypting? not sure) along with the other bundled assets.

    I might have to break down and use Unity’s in editor editing at some point. I took an initial look at it seemed like more effort than it should be, which was sort of a turn-off.

    @bmceldowney Good points, I can’t really disagree save for the scenario where players can potentially earn public Steam achievements by modifying their save games. However, that’s possible with binary serialization, too; it just takes more effort.

    In a perfect world, I’d probably choose JSON over XML, but in this case the C#/XML flow is so clean and doesn’t rely any external code.


Log in to reply