Entradas

Mostrando entradas de marzo, 2015

How I implemented save/load in WoT: A Serialization Nightmare

Imagen
In every game dev project there comes a time when you have to face a technical challenge you don't like at all. For some people it's AI, for some others it's pathfinding and for me it's serialization. Let me explain a bit: I come from a web back-end development background, so persisting stuff is, by now, part of my very nature. But working for almost 10 years with databases (relational or otherwise) saving the whole state of a game in a single file via serialization sounds like a nightmare to me. Finally! After weeks of work, I can save the game and resume it later! The first approach Naturally, the very first thing I did was take a look at the C# serialization classes and hope that everything would be solved immediately. After reading some tutorials and articles about it, it sounded like the perfect solution. That did not last, though. I quickly ran into issues, though: It seems that some of the Unity classes that we hold near and dear to our hearts - ...

Clouds are here!

Imagen
Sometimes as a game developer you don't feel like working in the really important stuff. Sometimes you simply want to spend hours obsessed on getting some small detail right that doesn't add a lot to gameplay but you do it anyway because it's fun to implement it. That was exactly the case yesterday, when I decided to implement a cloud layer when you zoom out in the map. The final result is something like this: So, here is how I faced this pretty useless task. Step 1: Generating some cloud textures The first thing I did was open Photoshop and generate a few different cloud textures. In order to accomplish this I used the "render -> clouds" option and then put a mask in front of it where I drew random shapes and then applied some gaussian blur. The end result is something like this: Step 2: Making a cloud prefab The next thing, after importing the textures in Unity, was to build a cloud prefab. I don't need volumetric clouds for this gam...

How I implemented multiple selection and grouping

Imagen
The finished product Until a few days ago, you could only select one ship at a time in Winds of Trade. This, of course, makes managing a large fleet a pain in the butt, so I decided to go ahead and implement multiple ship selection and movement. These were the basic rules I decided on: Player can select multiple ships drawing a rectangular area with the mouse Player can select multiple ships while holding "ctrl" and clicking Player can move all of those ships at once Player can create selection groups using "shift" + number keys Player can then recall those groups I have to say I pretty much didn't know where to begin. So I decided to start with the most basic thing: replacing the datatype for the variable that holds the currently selected ship. I.e.: var selectedShip : Ship; Became: var selectedShips : List.<Ship>; After fixing all compile errors the change unleashed I decided to get started in the UI stuff. First step, making...

Out with the old, in with the new! (I love you, Unity 5!)

Imagen
Boy, competition is definitely a good thing: there were so many cool announcements regarding game engines lately! But the one that really matters for me and my project is the official launch of Unity 5, that now includes almost all of the pro features in the free version. Physically-based shaders? Sure! Real-time global illumination and real-time reflections? You got it! Profiler, occlusion culling, render to texture? Yup! It's all there! So far I have only migrated my project from Unity 4 to Unity 5 and it was a pretty straightforward process. I only ran into a few minor issues regarding skyboxes with weird black spots on them ( solution here! ) and audio sources being initialized in 2D mode instead of 3D, what made all of the sound effects in the game to play at the same time. I have also migrated the water effects from Water+ (a pretty cool and inexpensive add-on from the asset store) to Water4 (the one included with the pro version of Unity 4, now free). And does it look a...