POLL: Which Platforms would you like to see IwGame Support?

Hi Everyone,

We are looking to propagate the IwGame engine beyond the platforms currently supported by the Marmalade SDK and as such we are considering porting IwGame to a number of other platforms in the near future. Which platforms would you like to see support for the most (you can select up to 3):

[poll id=”4″]

When we begin porting, some things will unfortunately change as we would need to abstract all Marmalade specific functionality away from the engine to enable easier porting. Mostly this will involve hardware specific functionality and replacement of things such as resource groups. We will however do our best to minimise the disruptions.

Porting will begin when we reach around v0.50, so hopefully in a few months time.

If you are interested in porting IwGame to a different platform then please let us know.

Thanks for voting!

Marmalade SDK v6.0

I was pleased as punch this afternoon after I visited Marmalade’s web site. Why you may ask? Well, the simple answer is that they have updated their road map giving us a sneak preview of what’s to come this year. The main thing that I am happy about is the fact that the first release due in Q1 is entitled “Web Marmalade”. I’m going to go out on a limb here and assume that this is targeting the web as deployment platform, which is even more awesome than the $25 credit card sized Raspberry Pi! (Think that we are going to have to name this one Awesomade!).

Anyways, hers a short extract from Marmalade’s release page:

“Hybrid Applications, Enhanced Native UI and support for new platforms.”

Yummy, eh? Well what could these features mean?

  • Hybrid Applications – Could we be talking hybrid web / native applications? Does this mean some kind of integration with Google’s Native Client (NaCl) – Like the way Google used the chemical name for salt, makes it nice and memorable. or maybe Marmalade can target HTML 5 some how?
  • Enhanced native UI – I think that we can safely assume this will include support for many more native controls?
  • New Platforms – Ok, it’s obvious what this means, but which platforms? Would be fantastic to see support for Raspberry Pi and Windows Phone 7, although I think WP7 is a closed system so maybe not. What other platforms could we see Marmalade support?

Feel free to leave your own speculations as a comment.

Raspberry Pi – The $25 Computer

Want to begin raising awareness of a new computer that’s coming out very soon called the Raspberry Pi (http://www.raspberrypi.org/). It’s basically a $25 credit sized computer that plugs into a display / keyboard etc.. I like to call it mini-awesome!

The computer is reported to have better performance than the iPhone 4S. Heres the basic specs:

  • The SoC is a Broadcom BCM2835. This contains an ARM1176JZFS, with floating point, running at 700Mhz, and a Videocore 4 GPU. The GPU is capable of BluRay quality playback, using H.264 at 40MBits/s. It has a fast 3D core accessed using the supplied OpenGL ES2.0 and OpenVG libraries.
  • RAM 128MB (Model A), 256MB (Model B)
  • USB Ports: 1 (2 on Model B)
  • Video Outputs: Composite RCA, HDMI
  • Audio Outputs: 3.5 mm jack, HDMI
  • On-board Storage: SD / MMC / SDIO card slot
  • On-board Network: None (Model A) , 10/100 Ethernet (RJ45) (Model B)

And its small enough to fit in your wallet! Like I said mini-awesome

We are so impressed with this little marvel that we are considering porting the IwGame Engine over to enable hobbyist and indie developers to get games up and running quickly on the platform.

Would like to hear your thoughts on the Raspberry Pi

IwGame Engine v0.29 Released – XOML is evolving

New here? What’s IwGame? IwGame is an open source free to use cross platform game engine for iPhone, iPad, Android, Bada, Playbook, Symbian, Windows Mobile, LG-TV, Windows and Mac, built on top of the Marmalade SDK. You can find out more and download the SDK from our IwGame Engine page.

The Universe conspired against me this week, first of all landing me with a nice flu, followed directly by some horrible sickness bug that featured projectile vomiting of the likes only seen in movies such as the Exorcist! Thankfully the Universe decided to give me a break this week so an IwGame Engine update got finished.

Most of the changes this week are XOML related as this is the general direction we want to take the game engine. A good mix of XOML mark-up and solid coding should make games and media apps very quick and easy to develop.

Oh and we got a new logo for the IwGame Engine woohoo! Feel free to use the logo in any of your IwGame powered products, or if you want to link to us.

Ok, onto the list of iwGame Engine changes for v0.29:

  • New style system added to XOML. Actors and scenes can now use a style to reduce repetition
  • Actors and scenes now handle events such as OnSuspend, OnTapped, OnBeginTouch etc.. When an event fires it executes a collection of actions
  • Actions added to XOML to allow definition of collections of actions that can be executed. Many default actions are suppported such as ChangeScene, KillScene, PlayTimeline, PlaySound etc.. Custom actions can also be added toextend the system
  • CIwGame now handles touch begin touch, end touch and tapped events
  • CIwGame now has new Postdraw() method for adding in custom post draw rendering
  • Actors can now be made tappable and now handle OnTapped(), OnBeginTouch() and OnEndTouchEvents()
  • Actors have new HitTest() method that can be used to check if a point is inside the actors visual
  • XOML now supports creation of cameras
  • XOML now supports creation of variables and update of variables using actions, supports string, bool, int, float, vec2, vec3 and vec4
  • XOML files can now load other XOML files with new LoadXOML tag as well as LoadXOML action
  • Scenes now support a type field
  • CIwGameBitmapSprite now supports image transforms (flips. mirrors etc) which can be also applied to actors visuals using FlipX and FlipY attributes
  • You now change the current time of a CIwGameAnimInstance and CIwGameAnimTimeline
  • Bug Fix – Actor visibile state now works properly
  • Bug Fix – CIwGameShape::setShape() now works
  • Bug Fix – Transform is now reset after CIwGameAdsView finishes rendering
  • Bug Fix – JPEG file detection fixed, was not detecting certain types of JPEG files
  • Bug Fix – CIwGameString::FindNext() crash fixed

Quite a few changes and bug fixes. Note that someo f the bug fixes directly affected IwGameAds so an update to that API will be released shortly.

Lets take a look at the changes in more detail.

XOML Variables

XOML got variables, but why? Well, there are a number of reasons:

  • We want to be able to define values that can be read by the main code
  • We want to change these values via actions
  • When we implement the UI system we are looking to add data binding capabilities that will rely on values

You can declare a variable in XOML like this:

    <Variable Name="PlayerName" Type="string" Value="Player One" />
    <Variable Name="PlayerScore" Type="int" Value="0" />
    <Variable Name="PlayColour" Type="vec4" Value="255, 128, 64, 8" />

You can later modify the value of that variable using a SetVar action, more on this later.

Each scene contains its own variables collection and the global resource system also contains a global variables collection.

XOML Styles

XOML now supports the styling of actors and scenes using the new Style tag. XOML styles enable you to create a set of properties and values that are common across a range of objects then apply tat style the to them all. Hers a quick

example:

<Style Name="BasicActorStyle">
    <Set Property="Size" Value="60, 60" />
    <Set Property="Angle" Value="0" />
    <Set Property="SrcRect" Value="0, 0, 36, 40" />
    <Set Property="Image" Value="Sprites" />
    <Set Property="Timeline" Value="Player1Intro1" />
    <Set Property="Shape" Value="PlayerShape" />
    <Set Property="Box2dMaterial" Value="BounceyBall" />
    <Set Property="CollisionFlags" Value="1, 1, 1" />
</Style>

<TestActor Name=”Player2″ Style=”BasicActorStyle” Position=”0, -150″ />

The TestActor Player2 will be assigned all of the values in the properties defined in the style saving you a whole bunch of typing as well as making your mark-up much more readable and easier to maintain.

XOML Events And Actions

Actors and scenes now support various events that can fire off user defined actions. The following events are currently defined:

Scenes:

  • OnSuspend – Called when a scene is suspended
  • OnResume – Called when a scene is resumed

Actors:

  • OnTapped – Called when the user taps an actor
  • OnBeginTouch – Called when the user begins to touch an actor
  • OnEndTouch – Called when the user stops touching an actor

More will be added as we think of them or when requested. You can also add your own custom events youself. Check out the CIwGameActor class for a reference on how to do this.

Events wouldn’t really be much use unless we could carry out some kind of action when the event occurred. Actions are defined in XOML using the Actions tag, heres an example:

<Scene Name="GameScene3" Style="GenericSceneStyle" OnSuspend="SuspendActions">
    <Actions Name="SuspendActions">
        <Action Method="SetTimeline" Param1="SceneTransition1" />
        <Action Method="PlaySound" Param1="explosion" />
    </Actions>
</Scene>

You actually create a group of actions that are all executed when the action is called by an event.

The following actions are currently supported:

  • ChangeScene – Changes the currently focused scene to the specified scene
  • SuspendScene – Suspends the specified sceme
  • ResumeScene– Resumes the specified sceme
  • HideScene– Hides the specified sceme
  • ShowScene– Shows the specified sceme
  • ActivateScene – Activates the specified sceme
  • DeactivateScene – Deactivates the specified sceme
  • KillScene – Destroys and removes the specified sceme from the game, all contained resources amd actors will be also be destroyed
  • HideActor – Hides the specified actor
  • ShowActor – Shows the specified actor
  • ActivateActor – Activates the specified actor
  • DeactivateActor – Deactivates the specified actor
  • KillActor – Kills and removes the specified actor
  • PlayTimeline – Plays the specified timeline. If no timeline is supplied then the current actor / scenes timeline will be restarted (depends on where the action was defined)
  • StopTimeline – Stops the specified timeline. If no timeline is supplied then the current timeline will be stopped. (depends on where the action was defined)
  • SetTimeline – Changes to the specified timeline. If no timeline is supplied then the current timeline will changed and restarted. (depends on where the action was defined)
  • PlaySound – Starts playing a sound effect
  • PlayMusic – Starts the playing specified music file
  • StopMusic – Stops the music player playing
  • LoadXOML – Loads a XOML file into scene or globally. If a scene is provided then the XOML will be loaded into that scene
  • SetVar – Sets the value of a variable

Again, more will be added as we think of them or when requested. You can also add your own custom actions youself. Check out the CIwGameXomlAction_Actors class for a reference on how to do this.

Coupled together the events and actions system provide a very powerful way of creating fully interactive content without having to write a single line of code.

Loading Other XOML Files

It is now possible to load other XOML files from a XOML file using the new LoadXOML tag. Heres an example:

<LoadXOML File="Common.xml" />
<LoadXOML File="Sceme2.xml" />
<LoadXOML File="Scene3.xml" />

You can also (as shown in the actions section) load a XOML file from an action.

Using this system you can create fully interactive navigation based content. Think adventure games, books, magazines and informational apps etc..

Scene Cameras

Cameras can now be defined in XOML and attached to scenes. You can also switch a scenes camera using the animation system.

Image Transforms for Sprites and Actors

Sprites and actors can now use an image transform allowing you to flip the source image used to render the object. The ne FlipX and FlipY attributes are now available in XOML.

Well thats it for this update. IwGame now has some very cool features that should hopefully make game / app development much easier and quicker for everyone.

We are going to assess the possibility of wrapping up Marmalades cool UI system with XOML very soon, will keep you all posted on how that goes. I am also looking at producing a new article on in-app purchasing with the Marmalade SDK, which will form the basis of in-app purchasing for the IwGame engine.

IwGameAds and Raw OpenGL Issues

Its been brought to our attention that if you are using raw Open GL functions and IwGameAds together then one system can affect the other.

The problem is that Iw2D is quite naughty in that it does not really save / restore GL states so many of the open GL states could have changed. A few things we noticed in particular are the GL shading model and texture matrix.

To switch back to smooth shading use:

     glShadeModel(GL_SMOOTH);

To repair the texture matrix add the following before you render your GL content:

    glMatrixMode(GL_TEXTURE);
    glPushMatrix();
    glLoadIdentity();

After your GL rendering is finished restore the GL texture matrix:

    glMatrixMode(GL_TEXTURE);
    glPopMatrix();

We will provide an additional GL test bed in our next update

IwGameAds SDK – Free Open Source Cross Platform Ad Engine for Mobile Games and Apps

We’ve received a fair few requests to extract the ad engine from the IwGame engine so that it can be easily used in existing products or products that do not want the fully fledged game engine. So we decided to go ahead and create a new API that supports just the ad engine. Its new home is at http://www.drmop.com/index.php/iwgameads-sdk/ and its now called the IwGameAds SDK. The SDK currently has support for 12 ad providers including:

  • Inner-active
  • AdFonic
  • Vserv – Also provides support for InMobi, BuzzCity, JumpTap, ZestAdz / Komli Mobile and Inner-active
  • Mojiva
  • Millennial Media – Also provides support for AdMob, Amobee, JumpTap and Mojiva
  • AdModa

Features include:

  • Native and cross platform
  • Free and open source
  • Fully documented
  • Support for multiple platforms (iPhone, iPad, iPod, Android, Bada, Playbook, Symbian, WebOS, Windows Mobile, Mobile Linux, LG-TV, Windows and Mac OS)
  • Asynchronously request text, image and html based ads from a variety of ad providers
  • Automatic extraction of ad data, such as image url, click url and text
  • Provision for targeted ads by age, gender, location etc..
  • Integrated ads view that can display animating ads to the user as well as detect clicks and launch the external URL / app that deals with the click destination
  • Cache and display multiple ads from multiple providers
  • Eye catching animating ads system that is currently generating 3%-8% CTR
  • Ad mediation using the priority based IwGameAdsMediator class
  • Very simple to install, set-up and use

We have not removed the ad API from the IwGame engine, this is just an additional SDK for those that want to use the ad API away from the game engine.

POLL – Which Features Next for IwGame?

Please take our poll. Which features would you like to see come to IwGame next?

[poll id=”2″]

You can select up to 4. Oh, if you have additional ideas then please feel free leave them as a comment.

IwGame Engine v0.281 Released – Box2D Fixes

We found a couple of mistakes in the Box2D integration in  IwGame 0.28, so here is the fixed version, changes include:

  • Actor / scene Box2D implementation switched from multi-inheritence to composition
  • Bug Fix – Fixed issue with incorrect actor orientation when placed under Box2D control
  • bug Fix – Values for velocity, angular velocity etc were not being applied in XOML

You shouldn’t need to change any of your game code with this update.

IwGame Engine v0.28 Released – Box2D Physics Integration has Arrived

New here? What’s IwGame? IwGame is an open source free to use cross platform game engine for iPhone, iPad, Android, Bada, Playbook, Symbian, Windows Mobile, LG-TV, Windows and Mac, built on top of the Marmalade SDK. You can find out more and download the SDK from our IwGame Engine page.

IwGame Game Engine Update

The magical elves of Pocketeers Land have been incredibly busy hammering out the latest update to the IwGame game engine and here it is. We’ve had a lot of requests for Box2D integration so we shunted it in there and managed to integrate it into the XOML mark-up language as well.

Here’s the list of changes for IwGame 0.28:

  • Image, resource group and timeline managers have been collapsed into a single resource manager. All calls to scene and global resource managers should go through getResourceManager()
  • All resource types can now be marked as managed
  • New Box2D IwGame classes added
  • Box2D integrated into the scene, actor system as well as XOML. Box2D can be disabled by undefining IW_GAME_BOX2D in IwGameBox2d.h
  • New shape system added IwGameShapes that allows you to define box, circle and polygon shapes, also available in XOML
  • XOML tag names and attrbutes are now case insensitive
  • Scenes XOML now supports Gravity and WorldScale
  • Actor XOML now supports new tags Box2dMaterial, Shape, COM (centre of mass), Sensor and CollisionFlags
  • Timelines can now be shared across different actors and scenes without them playing back too fast and not updating properly
  • CIwGameActor now has a new mthod removeVisual() which removes the actors visual from the scenes visual sprite manager
  • ToLower() and ToLower() methods added to CiwGameXml. These methods will convert all tag name and attribute names to lower or upper case (values are left untouched)

Yes, we did go ahead and remove all of the different types of managers and rolled them into a single resource manager. We also got rid of case sensitivity for tag and attribute names, which should save many of you the pain of tracking down case issues when writing XOML. I for one welcome the change 🙂

I was playing with time lines yesterday and discovered that if I attached the same one to more than one object, it got updated multiple times during a single frame, which causes the animationto play back too fast. A fix has now been added for that, so time lines can now be re-used across multiple actors and scene.

Now on to the meatier changes

Box2D Integration in Detail

Ok, so Box2D integration requests approached critical mass so we went ahead and integrated Box2D into the engine and the XOML system. The tst bed now shows anew scene (GameScene3) which has a solid floor, 2 walls and a bunch of actors that are dropped into the scenes. As you can see from the tst bed the physics is working pretty well. Lets take a quick look at the Game3Scene in XOML:

<Scene Name="GameScene3" CanvasSize="320, 480" FixAspect="true" LockWidth="false" Colour="255, 255, 255, 255" AllowSuspend="false"> <Box2DMaterial Name="Solid" Type="static" Density="1.0" Friction="1.0" Restitution="0.1" /> <Box2DMaterial Name="BounceyBall" Type="dynamic" Density="1.0" Friction="0.9" Restitution="0.6" /> <Shape Name="PlayerShape" Type="box" width="60" height="60" /> <Shape Name="Wall" Type="box" width="20" height="320" /> <Shape Name="Floor" Type="box" width="320" height="20" /> <Timeline Name="Player1Intro1" AutoPlay="true"> <Animation Anim="PlayerImageAnim" Target="SrcRect" Repeat="0" StartAtTime="1"/> </Timeline> <TestActor Name="Floor" Position="0, 200" Size="320, 20" Angle="0" SrcRect="0, 0, 32, 32" Image="Block" Shape="Floor" Box2dMaterial="Solid" CollisionFlags="1, 1, 1" /> <TestActor Name="LeftWall" Position="-140, 0" Size="20, 480" Angle="0" SrcRect="0, 0, 32, 32" Image="Block" Shape="Wall" Box2dMaterial="Solid" CollisionFlags="1, 1, 1" /> <TestActor Name="RightWall" Position="140, 0" Size="20, 480" Angle="0" SrcRect="0, 0, 32, 32" Image="Block" Shape="Wall" Box2dMaterial="Solid" CollisionFlags="1, 1, 1" /> <TestActor Name="Player1" Position="-50, -200" Size="60, 60" Angle="0" SrcRect="0, 0, 36, 40" Image="Sprites" Timeline="Player1Intro1" Shape="PlayerShape" Box2dMaterial="BounceyBall" CollisionFlags="1, 1, 1" /> <TestActor Name="Player2" Position="0, -150" Size="60, 60" Angle="0" SrcRect="0, 0, 36, 40" Image="Sprites" Timeline="Player1Intro1" Shape="PlayerShape" Box2dMaterial="BounceyBall" CollisionFlags="1, 1, 1" /> <TestActor Name="Player3" Position="50, -200" Size="60, 60" Angle="0" SrcRect="0, 0, 36, 40" Image="Sprites" Timeline="Player1Intro1" Shape="PlayerShape" Box2dMaterial="BounceyBall" CollisionFlags="1, 1, 1" /> <TestActor Name="Player4" Position="0, -1000" Size="60, 60" Angle="0" SrcRect="0, 0, 36, 40" Image="Sprites" Timeline="Player1Intro1" Shape="PlayerShape" Box2dMaterial="BounceyBall" CollisionFlags="1, 1, 1" /> </Scene>

In the above XOML scene we declare two materials, one for our solid environment pieces (floor and walls) and then another for our bouncy players.

Next we define a shape for our player, a shape for our floor and s shape for our walls.

Lastly, we create actors that represent our floor, left wall, right wall and 4 player actors, assigning the correct shapes and materials.

The above creates a scene with animating interactive physics objects

Box2D integration will be expanded in future updates to more features to IwGame and XOML.

If you want to learn more about the internals of the Box2D integration then take a look at the IwGameBox2D source files.

Shapes in XOML

You now create shapes in code or by using XOML mark-up. Take a look at the new shape classes in IwGameShapes.h. Below is an example showing a few shapes defined in XOML:

<Shape Name="PlayerShape" Type="box" width="60" height="60" /> <Shape Name="AlineShapel" Type="circle" radius="20" /> <Shape Name="Platform1" Type="polygon"> <Point Value="-100, -100" /> <Point Value="-100, -200" /> <Point Value="100, -100" /> <Point Value="100, 100" /> <Point Value="-100, 100" /> </Shape>

Shapes can be used to define physical collision boundaries for the integrated physics system. Eventually IwGame’s new path system will utilise shapes (when its implemented)

New Resource System

The new resource system now handles all resources of any type, so all the old separate resource managers have gone. To ensure that developers do not have to be too careful with naming resources, different resources can share the same name. However, this does mean that when you ask for a resource you do need to specify its type. Here’s a few examples:

CIwGameImage* image = (CIwGameImage*)IW_GAME_GLOBAL_RESOURCES->getResourceManager()->findResource(“Sprites”, “Image”);
CIwGameAnim* animation = (CIwGameAnim*)IW_GAME_GLOBAL_RESOURCES->getResourceManager()->findResource(“PlayerImageAnim”, “Animation”);

Note that the 2nd parameter specifies the type of resource, in this case it is an Image and an Animation.

Valid type names are as follows:

  • Game – Game objects
  • Scene – Scene objects
  • Image – Image objects
  • Timeline – Animation timeline objects
  • ResourceGroup – Resource group objects
  • Animation – Animation objects
  • Shape – Shape objects
  • Box2dMaterial – Box2D material objects

This does not include any of your own custom types that you add to the system yourself.

Well, that’s it for this update. We are very likely moving onto creating the editor to accompany the engine as our next task so IwGame engine updates may come a little slower.