Archive

Archive for September, 2009

Ninja portal contest and October promotion

September 29th, 2009 No comments

Between the 1st and 31st of October 2009, the first 31 people to go through checkout with promotion code OctoberGoldRush will receive a 20% discount. The total will be applied on the summary page at checkout.

Design a character that can be used in a Turn Based Fighting game. Your character can be a hero or a villain, humanoid or not. Your character should use a sword, rifle, pistols or magic (wether with a staff or without)… Are you getting the picture, yet? You can design anything you like! How is that for a competition!

See the rules here :

http://ninjaportal.com/NinjaPortal/Promotions.html

Update me when site is updated
Categories: Unity3d

Unity3d Singleton scripts : To be or not to be…

September 29th, 2009 4 comments

Yesterday I found myself to contemplate my Singleton GameObject which is becoming a Nightmare. I had to make a new scene in my game (passed from a zoo scene to multiple scenes) and just found out that i would probably be better off dropping a single Singleton onto a GameObject rather than multiple ones and Re-Edit them all. One Thing I had as a problem was that some of them took reference to the main camera (I have multiple camera settings for various reasons of game play). So I had 3-4 managers that I had to manually select the main camera as reference and it was a bit akward. So I went on to remodel my Singleton Architecture so that most of them where not Singleton anymore but sub-objects of my main game manager.

Main object for synchronization

So I have a main game singleton which is used as a state machine to update the various aspects of the game play. Instead of having a myriads of independent Singleton that are anyways under automatic synchronization, this permits for example to pause the game and not have to check in each of them the current game state (no redundant code).

I Got these states :

enum GameState
{
NOT_SET= 0,
ADVENTURE_MODE= 1,
BATTLE_MODE= 2,
MAIN_MENU_MODE= 3,
CREDIT_MODE= 4,
INITIAL_CINEMATIC= 5
}

with 2 variables :

private var lastState:GameState = GameState.INITIAL_CINEMATIC;
private var state:GameState = GameState.INITIAL_CINEMATIC;

Theses two variable permits me to do state transitioning when there is a state change :

function ChangeState(newState:GameState)
{
lastState = state;
state = newState;

OnStateExit();
OnEnterState();
}

function OnStateExit()
{
 Debug.Log("State exit function for state " + StateToString(lastState));

 switch(lastState)
 {
     case GameState.ADVENTURE_MODE:
        //Here i do cleaning for this state, that would probably be in my submanager
        // such as AdventureManager.CleanUp();
     break;
  }
}

//This function set transition to enter a new state
function OnEnterState()
{
  Debug.Log("State enter function for state " + StateToString(state));

  switch(state)
  {
     case GameState.ADVENTURE_MODE:
         //Here you initialize the manager for the mode you are in
         // such as AdventureManager.Initialize(...)
     break;
  }
}

//In this function of the main manager you update other sub managers.
//Since it's the only MonoBehaviour object attached to a GameObject, it is
//the only one who will get the Update, Start, Awake functions.
function Update()
{
	switch(state)
	{
		case GameState.NOT_SET:
				break;
		case GameState.ADVENTURE_MODE:
			if(!DialogMode)
			{
				AdventureManager.ProcessPlayerInteractions();
			}
		break;
         }
}

Declaring other managers and get access to it

My singleton is usually accessed via its internal static variable such as : GameManager.instance. When you declare another Manager that needs to be updated by you main state manager, you simply declare it public or private (depending on if you want it to be visible as a sub entry in the inspector). Be sure to initialize the variable in Awake. This as the drawback that you cannot change the values in the inspector and keep them when the game start. This is simply because the object exist temporarily in the editor only. Be sure to initialize properly your default values after adjusting them in real time while the game plays in the editor. The good thing even if the values do not persist, you can play with them in the inspector if your sub manager is declared public, and i suggest you do until you are satisfied with the values. Here is an example of my Awake function in my main game manager.

function Awake () {
	DontDestroyOnLoad (this);

	 // This is where the magic happens.
	 //  FindObjectOfType(...) returns the first GameController object in the scene.
	 instance =  FindObjectOfType(GameManager);
	 if (instance == null)
	{
		Debug.Log ("Could not locate a LumeManager singleton object. You have to have exactly one LumeManager in the scene.");
	}
	else
	{
		if(WorldCamera == null)
			Debug.LogError("World camera must be set in LumeManager");
		ChangeState(GameState.ADVENTURE_MODE);

		AdventureManager = new AdventureModeManager(WorldCamera.GetComponent(Camera));
	}
}

Probably all of this is a matter of taste, but as your project grows and you need to set everything up in a new scene each time to test it in a unitary fashion, you will find that adding a single object for your game designer is always easier !

Update me when site is updated
Categories: Unity3d

Unity3d Camera Fade In and Out

September 29th, 2009 No comments

Today I asked myself if there was an easy way to add fade In and out for a camera, as it stand out, the Unity3d framework does not support it by default but I found an useful script on the Unity3d Wiki that does just that. It takes a single pixel image and draws it as an overlay GUI over the Camera.

Link here : http://www.unifycommunity.com/wiki/index.php?title=FadeInOut

Update me when site is updated
Categories: Unity3d

CBC News – Canada – Sovereigntist filmmaker Pierre Falardeau dies

September 26th, 2009 No comments
Quebec filmmaker Pierre Falardeau, seen with sovereigntist demonstrators disrupting Canada Day celebrations in 2002, made a name for himself creating documentaries and writings that focused on the political identity of Quebecers. (Jacques Boissinot/Canadian Press)

Quebec filmmaker Pierre Falardeau, seen with sovereigntist demonstrators disrupting Canada Day celebrations in 2002, made a name for himself creating documentaries and writings that focused on the political identity of Quebecers. (Jacques Boissinot/Canadian Press)

Quebec filmmaker, writer and outspoken sovereigntist Pierre Falardeau has died of cancer at the age of 62.

The University of Montreal’s hospital centre announced early Saturday that Falardeau had passed away Friday night.

Known as a colourful character, Falardeau made a name for himself creating documentaries and writings that focused on the political identity of Quebecers.

Born Dec. 28, 1946, in Montreal, Falardeau grew up to study anthropology but turned to making films, directing his first short, Continuons le combat, in 1971. That movie compared sport fighting with the search for a Quebec identity.

http://www.cbc.ca/canada/story/2009/09/26/falardeau-obit.html

Update me when site is updated
Categories: Politics

Gamasutra – News – Amazing Society Using Unity Middleware For Marvel MMO

September 24th, 2009 No comments

Middleware house Unity Technologies said developer The Amazing Society is using the Unity game engine to develop the upcoming kid-friendly MMO Marvel Super Hero Squad.

The Unity engine is growing in popularity as a development platform for 3D browser-based games. Unity also supports iPhone and Nintendo Wii. “Unity has always been focused on workflow and quick iteration time,” said Unity chief creative officer Nicholas Francis in a press release.

Gamasutra – News – Amazing Society Using Unity Middleware For Marvel MMO.

Update me when site is updated
Categories: Unity3d