• Home
  • Contact
  • Careers
  • Socialize With Us:
  • Send us Mail
  • Follow us on Twitter
  • Join our Facebook Group
  • /
  • Linkedin
  • /
  • Vimeo Videos
  • /
  • Youtube
  • /
  • RSS Feed
  • Search Site

  • About UsAwards & Bio
  • PortfolioOur Latest Work
  • TrainingTips & Tutorials
  • BlogGreat Articles

You are here: Home / Tag: Experimental

Tag Archive for: Experimental

Unity, Meet Server

Category: Quick Tips     |     Tags: C#, Design Patterns, Experimental, Unity3D

Unity 3D & C#

Unity3D is a powerful suite of tools (Project IDE, Code IDE, run-time) for game development.

As always, RivelloMultimediaConsulting.com/unity/ will be the central location for deep articles and tutorials, Facebook.com/RivelloMultimediaConsulting (like us!) will engage the growing RMC+Unity community, and for the latest opinions and cool links follow me at Twitter.com/srivello.

There is incredible momentum in the Unity3D product and its community. I recently posted “The Best C# Code Naming Conventions” and “Unity Best Practices“.  Here we will explore communication between Unity and the external environment.

Why External Communication?

Unity projects are packaged, by default, into one self-contained file.  This may be an executable for Mac, PC, or Linux, it may be embedded in a supported desktop web browser, or may be deployed to the app stores. While the capabilities of a self-contained project are impressive communicating with the ‘outside world’ still has many benefits.

  1. Persistence – Store state permanently for future use in the same app, on another device, or in another app altogether. Sky’s the limit!
  2. Collaborate – With the containing environment (such as the embedding page in a browser-based project).
  3. Multiplayer – Send data between instances of your game for turn-based (asynchronous) or real-time (synchronous) communication.
  4. 3rd Party APIs – Contact Facebook, Twitter, send email, etc…

Here is a cursory summary of what is possible and relevant references.

What is Possible?

General Data

  • RPC

Load JSON

  • WWW, WWWForm
  • Parse: ?

Load XML

  • WWW, WWWForm
  • Parse: BiterScripting, System.Xml

Load Image

  • WWW, WWWForm
  • Texture2D.LoadImage

RPC Calls

  • RPC with NetworkView

Access Twitter

  • Compare many packages in the Unity Asset Store

Access Facebook

  • Compare many packages in the Unity Asset Store

Unity Web Player <-> Browser Communication

  • Embedding In Browser
  • Application.ExternalCall
  • Unity Manual

Multiplayer

The network view is the binding material of multiplayer games. With this you can define exactly what is to be synchronized over the network and how it should be done. Game objects can have NetworkView components which can be configured to watch other components for the object. For more information see the Network View manual page and the component reference page.

  • Intro To Networking (Video)
  • Unity Documentation: Network, NetworkView, MasterServer
  • Photon Server
  • AppWarp Server
  • RedBedlam Server
  • Tutorial: Unify MMO – Using SmartFoxServer
  • Tutorial: Unity iPhone Multiplayer – While this applies to iPhone development, the networking part of it still applies
  • Tutorial: Unity Networking Example – Using NetworkView
  • Discussion: MMORPG – UnityAnswers forum about multiplayer

Asset Bundles

AssetBundles (a Unity Pro-only feature) are files which you can export from Unity to contain assets of your choice. These files use a proprietary compressed format and can be loaded on demand by your application. This allows you to stream in content, such as models, textures, audio clips, or even entire scenes separately from the scene in which they will be used. AssetBundles have been designed to simplify downloading content to your application. AssetBundles can contain any kind of asset type recognized by Unity, as determined by the filename extension. If you want to include files with custom binary data, they should have the extension “.bytes”. Unity will import these files as TextAssets.

  • Unity Manual
  • Caching
  • DRM for your assets (imperfect)

What Do YOU Think?

Have a comment? Please post below. This is a hot topic and I’ll respond promptly over the next month.

Unity C# State Management

Category: Quick Tips     |     Tags: C#, Design Patterns, Experimental, Unity3D

Unity C# State Management

Unity 3D & C#

Unity3D is a powerful suite of tools (Project IDE, Code IDE, run-time) for game development.

As always, RivelloMultimediaConsulting.com/unity/ will be the central location for deep articles and tutorials, Facebook.com/RivelloMultimediaConsulting (like us!) will engage the growing RMC+Unity community, and for the latest opinions and cool links follow me at Twitter.com/srivello.

There is incredible momentum in the Unity3D product and its community. I recently posted “The Best C# Code Naming Conventions” and “Unity Best Practices“.  I came across one best-practice that requires a bit of setup, so here it is; using symlinks for game development.

What Is State?

As UnityGems points out – Every program you write is a state machine.  The moment you write an if statement you have created code that can be in at least one of two states – the more code you write the more states the program can be in.  An explosion of switch and if statements can quickly get out of hand, with strange bugs appearing for apparently impossible to fathom reasons as the complexity of the solution increases and interactions between components causes unexpected consequences.  Your project becomes hard to extend and even harder to conceptualize.

How Do We Manage It?

You are probably already managing state in your projects; perhaps just with simple conditionals. As your skills mature to match your growing needs you may benefit from some alternative solutions.

Here is a partial list of options (from least to most complex/powerful);

  1. Conditionals (or similar ‘manual’ technique)*
  2. State Pattern
  3. State Machine*

* Full source code and Unity project available. See ‘Member Resources’ below.

State Machine Example

In the following example, imagine a camera and a cube in the scene. The cube has one script attached; StatesByStatePatternComponent. This class holds _stateType as a variable of type StateType. Upon user mouse-click the state is toggled. Toggling updates the iState variable of type IState to either an instance of the class FirstState or the class SecondState. The granular, state-specific functionality is handled within those two classes.

In a more complex use of the State Pattern, such as that of a full game, the state could be used to handle the input and movement. Perhaps a PlayerComponent which controls our hero has a WalkingState, JumpingState, and ShootingState. We would want only ONE of these to be active at a time and the character would behave differently depending on the state. Just like that!

3 Examples are below

  • States By Conditionals– This is the most simple, intuitive approach for beginners with simple needs
  • States By State Pattern – This is more robust. This addresses the typical demands of many projects. For advanced uses, add concepts of actions, triggers, transitions.
  • States By Interfaces – An alternative approach.

 

States By Conditionals

[gist id="813f2d88bd075cc9c9b0e0d0fa534777"]

States By State Pattern

[gist id="6fb85d3298e6e3ddcb9a3857c71d321a"]

States By Interfaces

[gist id="0119d67a4c850d103b1e2c01e456a5b2"]

 


Wait, An FSM?

Finite State Machines (FSM) are as much a style of programming as they are the code that realises them – says UnityGems.  We strongly urge you to consider thinking about your game and everything in it in terms of the states that they can maintain.
What are Finite State Machines?

Want to see my full demo of FSM? It is not yet posted. Please comment below.

The clue is in the word finite – in other words: limited, known and understood.  When you build a finite state machine you define clearly all of the states that an object can occupy and you think about the object being in just one of those states at a time.

Thinking about your project in terms of finite state machines helps you conceptualize your game at a higher level, enabling you to keep more of it in your head at one time and more clearly see the path to implementing the killer feature you just thought up or your play testers demanded.

What Do YOU Think?

Have a comment? Please post below. This is a hot topic and I’ll respond promptly over the next month.

Member Resources

[private_Free member]Enjoy this members-only content!

  • Download the full Unity project with source-code

[/private_Free member]

Event Dispatching in Java

Category: Quick Tips     |     Tags: API, Experimental, Java

My professional focus is on client-side development. For a recent project, I re-learned some substantial Java concepts and completed server-side coding.

During the project, I was surprised to find there is no native java event messaging (event dispatching and event listening). While some UI frameworks have a solution, the solution appears to be coupled to those frameworks.

So I created a custom Java solution to handle it. The system uses common Observer pattern and modeled it after the spirit of what is present in ActionScript 3.0. I used abstraction and interfaces so its fairly decoupled and flexible. Take a look.

Usage

[actionscript3]
public EventsDemo()
{

// CREATE
SampleEventDispatcher s = new SampleEventDispatcher();

// LISTEN
s.addEventListener(Event.EVENT_NAME, this, "_onEvent1");

//TEST ‘HAS’
/*
if (s.hasEventListener(Event.EVENT_NAME, this, "_onEvent1") ){

//TEST ‘REMOVE’
s.removeEventListener(Event.EVENT_NAME, this, "_onEvent1");
}
*/

// TEST A DISPATCH OF EVENT (IN A FAKE, TEMPORARY WAY)
s.doDispatchTestEvent(new Event (Event.EVENT_NAME, this));

}

public void _onEvent1 (Event aEvent)
{
System.out.println (" _onEvent1(): " + aEvent + " , " + aEvent.getType() + ", " + aEvent.getTarget() );
}
[/actionscript3]

It rocks!

Next Steps

  • Download the code and check it out! (See Member Resources)
  • Comment below with your thoughts.

Member Resources

[private_Free member]Enjoy this members-only content!

  • Download my JavaDemos
  • Create ‘EventDispatcherDemo’ project set compiler dependency to project ‘RMCCodeLibraryJava’ and publish ‘EventDispatcherDemo’.

[/private_Free member]

Las Viditas – Comparing ActionScript 3.0 and 7 Rules for Biological Life

Category: RMC News     |     Tags: AS3, Experimental, Games

Las Viditas (The Little Lifes) is an exploration project which compares ActionScript 3.0 programming concepts and structure to the 7 criteria for biological life.

You can see the Live Online Demo. I originally presented this project on a fantastic 360|Flex sponsored 7-Day cruise in the Caribbean several years back. What a great event! Finally, its all available now online..

I always find it fascinating to compare the technical world and the biological world. There is even an area of technological innovation where engineers study animals to influence new robotics designs. Here is a great Ted.com video of Robert Full Learning From Gecko Lizards. In my simple demo I learned a lot too, and am inspired with many game ideas too.

See Screenshot

The ecosystem on the right is the “petri dish” where the green viditas grow and move. There intelligence guides them to eat the blue ‘food’ and bounce off the walls. As they eat, they grow. As they starve, they shrink. Too much time without food, and they will permanently die.

Experiment with the settings and see how the population’s survival rate changes.

The sliders on the left allow for several changes such as;

  • Simulation Speed
  • Viditas Population Size
  • Food regeneration frequency
  • Food amount that is created each distribution

Watch Slideshow

[slideshare id=11770278]

Next Steps

  • Run the Live Online Demo.
  • Download the full source code (See ‘Member Resources’ below).

Member Resources

[private_Free member]Enjoy this members-only content!

  • Download the full source code

[/private_Free member]

Tag

3D AIR API AS3 AS3.5 AssetStore Augmented Reality Business C# Charity Debugging Design Patterns DevDiary ECS Architecture Experimental Flash Flex Game Design Game Design Prototypes Games GUI HTML5 Java Loom Mobile MVCS Architecture Optimization Project Planning PushButtonEngine ReactiveExtensions Review Robotlegs Smash Testing Unity3D UnityApplicantTest WordPress WordPress Plugin

Brazilean Developers

  • Abendita.com
  • dclick.com.br
  • dm9.com.br
  • Fellyph Cintra
  • IgorCosta.org
  • MonadaSolucoes.com.br
  • PossibleWorldwide.com.br
  • Unit9.com

Developers

  • Adobe Blogs
  • Ben Forta
  • Colin Moock
  • Enrique Duvos
  • Flash Mobile Blog
  • Jess Freeman
  • Kevin Hoyt
  • Lee Brimelow
  • Paul Trani
  • Quasimondo
  • Renaun Erickson
  • Ryan Stewart

Free Assets

  • Free Sounds
  • HasGrafics

HTML5 Games

  • Closure JS Library
  • Eloquent JS Manual
  • Game Framework – CraftyJS
  • Game Framework – EaselJS

Italian Developers

  • alchimedia.com
  • corlan.org/
  • creativesource.it
  • dimix.it
  • fabiobiondi.com
  • gnstudio.com
  • Interpreting-tech.com/bemobile/
  • leonardorisuleo.info
  • lucamascaro.info
  • mart3.org
  • mxml.it
  • nxn.it
  • pirosoft.it
  • Preload.it
  • sonnati.wordpress.com/
  • webgriffe.com

Products

  • Adobe.com
  • Amazon Kindle E-Reader
  • ElectroServer
  • F*CSS
  • Flash Development Toolkit (FDT)
  • O'Reilly PureMVC Book
  • Samsung Galaxy Tablet
  • Unity3D

RMC

  • RMC Consulting

Spanish Developers

  • Flash Adictos
  • HTML Cinqo
  • Tutoriales Flash

Tutorial

  • Active Tuts
  • AS3-to-Unity3D Training Videos
  • Doing 2D in Unity3D
  • Learning C#
  • Unity3D Tutorials

Unity3D Games

  • AS3-to-Unity3D Training Videos
  • Doing 2D in Unity3D
  • Learning C#
  • Matt Eley's Blog
  • Unity3D
  • Unity3D Tools
  • Unity3D Tutorials

Interesting links

Besides are some interesting links for you! Enjoy your stay :)

Latest Portfolio

  • Coins And PlatformsMarch 19, 2014, 6:04 am
  • Paddle SoccerMarch 2, 2014, 9:13 pm
  • Spider StrikeFebruary 21, 2014, 4:19 am
  • Custom Game System APIJuly 8, 2013, 8:05 am

Latest News

  • RMC Primer: Everything Virtual Reality (VR)September 3, 2016, 10:29 am
  • Unity3D Architectures: EntitasJuly 29, 2016, 11:15 pm
  • RMC Primer: Get A Job In Game DevelopmentAugust 19, 2015, 10:18 am
  • Unity UI: Overview – Part 1 of 3December 10, 2014, 9:55 am

Archive

  • September 2016
  • July 2016
  • August 2015
  • December 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • December 2012
  • October 2012
  • September 2012
  • July 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • April 2011
  • March 2011
  • January 2011
  • December 2010
  • October 2010
  • September 2010
  • April 2010
  • March 2010
  • January 2010
  • October 2009
  • August 2009
  • June 2009
  • May 2009
  • April 2009
  • January 2009
  • December 2008
  • November 2008
  • August 2008
  • May 2008
  • April 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • August 2007
  • May 2007
  • January 2007
  • October 2006
  • April 2006
  • March 1999

© Copyright 2006 - 2023 - Rivello Multimedia Consulting - RMC by Samuel Asher Rivello