Tuesday, 16 July 2013

Poultron: Day 2

Added a decent sky (from the awesome SkyBox valume 2 found on the Unity store), made a geodesic dome for scenery and decided on going for a WE'RE IN SPAAAACE theme.

I spent most of my day implementing the ballistics system. What I currently have is probably not the best solution but it works. There's bullets, that can collide with level geometry (like the ground, buildings, etc) and there's Hitboxes, that can only collide with bullets. Once a bullet touches anything it checks to see if that object has a hitbox. If it does, it triggers a death effect.

Features:
  • A small tank that walks up to you and says "Hi" (ok, it doesn't really say "Hi" but you get the idea)
  • Longer legs for the mech (it was hard aiming down and it made the controls a bit easier but not too much)
  • Bullets that do things
  • Explosions!
  • SKY! (the moon was my own personal addition, boy do I feel proud)

Current issues:
  • The effects should be tweaked to make them more coherent (and cooler)
  • Bullets impacting the ground just disappear. This simply cannot do
  • The poor little tank doesn't fight back
  • The tank was programmed to keep his distance but that doesn't seem to work
  • In related news, you can walk right over the tank and nothing happens
Tomorrow:
  • Fix all the tank issues
  • Maybe make the tank shoot back
  • Improve the explosion effects (graphics and sound)
  • More things to prettify the scenery (maybe a small corridor uniting several domes, that would be nice)
You may make fun of my accomplishments for the day here.

I modelled it after a Panther and a Leopard 2.
Yes I'm aware only tank geeks will know what those are.

Monday, 15 July 2013

Poultron: Day 1

I expected to have more done in the first day but all thing's considered it wasn't that bad.

You can move the little robot around and shoot. It's still a bit glitchy and I'm not sure if I'll be able to iron out all the kinks without churning out my own physics system.

Features:
  • Walking!
  • Shooting with animations and recoil
  • Screen shakes if you hit the ground going too fast

Current issues:
  • Sometimes the foot gets stuck in an awkward position and we have to lift it up again. (should be fixed now)
  • Nothing to do besides walking
Tomorrow:
  •  Stuff to shoot! (can't promise any AI)
  • More things to prettify the scenery
  • A decent sky I hope
Click here if you're feeling brave and want to see how it plays out.

Poultron: Intro

To unwind a bit from working on Brian Storm for almost a year, the guys at Titan Forged Games decided to do a small one-week (starting today) game jam with the least busy members of the team. It was originally meant to be one artist and one programmer but due to the intricacies of fate I now find myself alone working on a small prototype I call Poultron.

But what is Poultron?

Let's start with where the idea came from. For some reason I was thinking of Power Rangers and realized it must have been hard to have each person in the team control a different part of the robot. I imagined it would be something like multiplayer qwop.
Obviously such an idea can't go to waste. I quickly wrote up a small story (I'm weird like that):

The peaceful people of the planet Pa'inis realized the universe was eventually going to be attacked by an evil empire of anthropomorphic aliens (and by anthropomorphic I mean humans with a slightly blueish skin, but that's beside the point here). In order to defeat them they did what an ancient people focused on saving the universe usually do: build a huge modular robot which has to be assembled by different parts, each driven by a different teenager.

Soon, the rest of the universe followed suit and built there own robots just in case.

Eventually the evil guys came (they were pink) and the defence robots were activated. However by this point no one was entirely sure which parts belonged to which robot. Not to mention teenagers are not famous for their driving skills...

 Eventually I found myself with no artist and had to lower my expectations: instead of a friendship crushing game I would have to settle for single player one (as I had no one to play with for every iteration I made).

The art style (or lack thereof)

While the decision to make this single-player (for now) fixed some of my immediate concerns, this still left me with another problem: the art style. I'm a programmer guy that writes code, not an artist.

As you can see, this proves I'm indeed a programmer

I started doing some sketches (slightly better than the one above) when it hit me: I could try going for an intentionally bad "made of paper" look for the whole game. I mean the whole idea was to make goofy looking robots doing goofy things. It took me around 5 entire seconds to sketch the parts of a robot and a couple of hours to crop the pieces, build some 2D shaders and put it together.
OH GOD KILL ME NOW
This led to some other problem: if the mech was made of paper this would lead to some expectations that the universe would be entirely made of paper: soon I had a grid paper sky, with paper menus that floated away softly when you clicked on them and... That was it. I had no idea where to keep going with the paper motif. How could I make firing a projectile interesting without non-papery particle effects? When I was testing out hit sounds nothing felt natural - I couldn't just pretend the robot was a huge construction made of steel when the player could clearly see it was made out of pieces of paper.


So I went back to the drawing board and settled on another approach: I am fairly decent at making 3D models and animation but I suck at texturing. Maybe I can get by with a plastic-y/cartoonish look without too much effort.
Hopefully by the end of the day this thing will be doing things already
Despite looking like the least practical design ever, it will probably the easiest robot you'll be able to pilot in Poultron :)

Saturday, 6 April 2013

Unity3D Version control with Dropbox and Mercurial



After a few months I think we're ready to share our Unity3D (free) version control setup. Keep in mind this is not ideal and it was designed to hack some sort of code tracking into the free version of Unity. We are using mercurial but there isn't (shouldn't be) any reason it wouldn't work with any other type of version control system. Always be aware you shouldn't have more than one person editing the files that are not on your VCS.

I'll assume everyone reading this has a basic knowledge on Mercurial and Aliasing/Symlinking and go straight to the point. If you need anything more specific feel free to comment and I'll consider adding it.


The concept:

There's 2 types of files in our project: binaries which we don't/can't synchronize (Unity Pro and the asset server solves this somewhat) and code (text) files. We don't want to do version control for binary files. Let's begin by putting all our binary files into a separate folder. This is what our project's hierarchy looks like:


 

Setup:

First thing's first, launch your project and go to Edit->Project Settings-> Editor. In the inspector change the version control mode to meta files and Asset Serialization to Mixed mode. This means from now on all the data on your Prefabs, materials, scripts, etc will be store in .meta files in their respective folder instead of clumped up in the Library folder.




Basically we just shove everything that's not a text file into the Binaries folder. Close unity, take this folder and put it's contents into a Dropbox folder (we'll be using "\Titan Forged Games\Brian Storm\Unity Project\Assets\Binaries").

Create the repository. This is the contents our .hgignore file (aka the files and folders our repository should ignore):

syntax: glob
     Library/
     Temp/
     Assets/Binaries

     *.userprefs 
     *.pidb
     *.unityproj
     *.csproj
     *.asset
     *.cache

    Assembly-CSharp-vs.csproj 

    Assembly-CSharp.csproj
    ourProjectNameGoesHere.userprefs

    *.orig

    *.orig.meta



The Library folder should never be synced. Doing so is a recipe for disaster. It has local data regarding the project and will always be regenerated based on the .meta files. The library folder will ALWAYS be unique for every person so DON'T even try to sync it and always make sure it's not being shared (we almost lost an entire project due to a silly mistake with the Library folder being corrupted on a single machine).

The rest of the list exists mostly to keep useless binary data or personal preferences from our repository. The .orig are files generated by mercurial if you wish to store backups of files before a merge operation - feel free to ignore that line (it's just personal preference).

 

How to use it:

Clone the repository.
Create a symlink (or shortcut) for the binary files in the Dropbox folder.

In our most current project we're using the dropbox folder "Titan Forged Games\Brian Storm\Unity Project\Assets\Binaries" to "place" binaries into our repo's "Assets\Binaries"

On windows 7 (and 8) you can launch the command console and type: mklink /J "YOUR REPO PATH\Assets\Binaries" "C:\Users\YOUR NAME\Dropbox\Titan Forged Games\Brian Storm\Unity Project\Assets\Binaries"

From now on, everything that is on "C:\Users\YOUR NAME\Dropbox\Titan Forged Games\Brian Storm\Unity Project\Assets\Binaries" will be identical to
"YOUR REPO PATH\Assets\Binaries"


Notes:

  • Don't ignore the newly created .meta files when commiting a new code file. They are what allows Unity to know if your GameObjects use a certain script (otherwise you'll just get missing script Errors on GameObjects that use them).
  • When testing things out and doing drastic changes it's best to avoid people tweaking an editor scene (besides not being able to work on the same scene at the same time, it's also likely he's messing with inspector attributes that will no longer exist once you commit your code).
  • The silly mistake I mentioned earlier deleted all our binaries on the dropbox folder. Don't be silly and do regular backups of the Binaries - in fact, just backup your entire project once in a while, you'll be thankful for it some day.

Wednesday, 17 October 2012

Just a little side project

Here's something I'm working on as a side project to Brian Storm.


As awesome as things like Hextech are, I'm afraid I don't have the 100$ to dish out for it so I'm building my own hex grid framework from scratch. Currently on the lookout for intuitive ways to access the grid's tiles through XY coordinates - there's got to be something more efficient than Bi-dimensional arrays.

Saturday, 25 August 2012

Level workflow in Brian Storm

Here's how we're currently doing our Blender-Unity3D level design workflow for the Brian Storm project. This is a result of several experiments we've done and our experience with level design. We're open to suggestions and if you're trying it out yourself and have some doubts on how it's done, feel free to ask me.

This is meant to be short and isn't a Blender or Unity3D tutorial of any sort. Though I might go more in depth later if there's a demand for it.

Also, keep in mind none of these images contain final art and are mostly placeholders while we programmers are still figuring things out.


Here we go

First we make a level segment: some geometry for the player to see and some collision meshes.

The actual mesh we see and it's collision mesh, shown in wireframe

We make sure to add "_collision" to the collision meshs' name. I'll explain this in more detail later on.

_collision just means the mesh is just a collision and should not be rendered.


We then put both types of geometry into the same group. Usually we use the file's name for consistency's sake.


We then create a level.blend file which appends (links) the groups in the other files as building blocks to create the level.

Tip: if you hide a mesh in it's original file, it will stay hidden after you import it. Very useful if you don't want to see your collision meshes while previewing the level here.

Two LongCorridors making up a longer corridor

Now we just import level.blend directly on our Unity scenes and all the meshes linked in it are correctly presented in our level. However, we have no collision yet - adding it manually would be a lot of work for levels of even smaller sizes.

A custom script, extended from AssetPostprocessor checks if we're importing a "level" file. We then go through every GameObject that we imported and check if it's name contains "_collision" - in which case we remove it's renderer and create a mesh collider for it using it's own mesh.
Another option we have so far is "_canhide", which adds a box collider to the mesh and configures it in such a way that it can be hidden if it obstructs the player's view.

We then use the Unity3D editor to add waypoints (paths our characters follow during gameplay), along with other extras we didn't import from the blender file and we're set.

VoilĂ , a complete placeholder level


Issues

Here's some concerns we have with this method:
  • Waypoints have to be setup after importing the level. We should find a way to automate this as it get's very annoying to update huge clusters of waypoints after even slight changes to level layout.
    • The same is valid for enemies, player start position, checkpoints, lighting and other non-geometry objects
  • Having the level split up in "blocks", each with their own collision meshes might make the game suffer performance wise.

Note: We disabled importing of animations for the level file, as unity has some issues with Default takes on Blender.

Tuesday, 10 July 2012

Post-Mortem: Space Vengeance

Here's the long awaited (cough cough) second of the quick post-mortems I promised way back.

The main menu. Nothing fancy here.

What was this game about?

Space Vengeance was mostly a silly excuse to do another video game for a college project. The true (academic-wise) purpose of this project was mostly to showcase our OpenGL skills. The name was our attempt at picking the most generic thing we could name our old-school space shooter. If I recall correctly I think we had a list of generic-sounding video game adjective (like retribution, vengeance, rebellion, etc) and we just added space before it.


Again, no artists to be found here so it looks like shit.


The ships actually rotated a bit when moving up and down.

What happened?

Well I'm sure any of you experienced programmers can imagine what happens if someone jumps into C++ and OpenGL rendering after previously making a game in flash. We spent most of our time trying to figure out "boring" things like why our ships weren't being drawn and why when they did so, they started flying sideways. It all went mostly fine tough and we kept to our schedule. We dropped some features like visually attaching "gun" modules to ships due to a mix of factors like our lack of 3D modelling skills and the .3ds importer we were using giving us enough problems as it was.

We gave up on the project after that class because it was too difficult to add new ships, levels, guns, etc, as everything had to be hardcoded and compiled and we didn't feel like our game would add anything to the genre.

How was it made?

  • Plain old C++
  • OpenGL for rendering, mostly
  • SDL for input and sound
  • lib3ds for importing 3D models
  • freetype for font rendering (I think, it's been some time and I'm feeling lazy)

Step right up for the final boss. He's big. He's (not) scary.
 And he moves up and down menacingly.

What did we learn?


That we should probably learn how to create cool shaders one of these days.

That simple things can make the game more enjoyable. We noticed huge improvements in the fun factor once I made ships blink white after being hit.

The more steps it takes to do something, the more half-assed the result tends to be and the easier it is to find reasons to put it off or just give up. This happened during power up creation (weapons for instance, had to be hardcoded and required creation of bullets, particle effects, etc) and level creation (levels consisted of several instances of a "wave" class that had to be compiled to a binary file and read by the actual game later).