Venturi DevLog #6 – Undo/Redo System and Loadout UI Recode


Hi guys, we’ve been super busy these past two weeks working out different bugs and adding some cool new features (we spent last weekend coding instead of blogging) and we’re excited to share with you what’s new! Nick incorporated an awesome command history system that lets us undo/redo actions in the editor, Dustin FINALLY finished the loadout UI, and we added in some cool smaller bits as well. Let’s go!

Undo & RedoNickBlog

Last week we added a command history system to the level editor; that is, an undo & redo system. This is something we’ve been lacking for a while now, and we decided it was time to add it in. We’re all intuitively familiar with undoing and redoing in other applications, so we won’t go into detail here. However, Nick has an in-depth explanation (and all of the source code!) of the system’s implementation on his blog for those who like knowing how things work.

Loadout UI recode

Dustin and Tyler have spent the last month (at least) designing and coding the inventory system and loadout user interface. This is a mechanic that they’ve never implemented into a game before so it was quite a learning experience (read: pain in the ass). There were several design problems we had to figure out: which data structure would be best for the inventory; how to add, remove, insert, and move items around the inventory without duplicating items or running into ArgumentOutOfRange exceptions for array-based structures; how to design a UI that would accurately reflect the inventory and be able to communicate back and forth between the UI and InventoryController; and how to design a UI that’s powerful while staying simple and intuitive.

We were actually about done with the UI when we decided to scrap some of the internals and rewrite many of the systems. It seems pretty common when writing new and unfamiliar code—to start with what we know and improvise the rest, and over time learn the cleaner and more efficient ways of doing things. We practice that it’s better to refactor in good code early on rather than building new code on top of a shitty foundation that will probably change anyway. Overall it seems like a good decision and writing the new code didn’t take as much time as we anticipated.

  • The new code was bit cleaner under the hood, separated into smaller methods that were more reusable
  • It doesn’t duplicate inventory information which helps prevent duplication and other bugs
  • Set us back a few days to rewrite the UI code, but fortunately the inventory code was mostly untouched
  • Allows dragging of inventory icons from anywhere to anywhere
  • Smoothly transitions icons
  • Allows sorting and filtering by name
  • Eventually will lead to a system of dragging icons from the editor library into the game world to easily place items

We’re really looking forward to where our development takes us the next few weeks and months. Our next steps are to get weapons and effects fixed up with all of the backend changes we’ve made, get a dialogue system working, and finally start working on our level designs and multiplayer! There’s a helluva lot to do before we’re ready for our Kickstarter/Greenlight but every day we’re making strides towards our goal. Please check us out on IndieDB, Facebook, and Twitter! Subscribe and follow us. That positive feedback pushes us to keep working on Venturi!

© 2014 Venturi, All rights reserved. Dashboard