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.

47 thoughts on “POLL – Which Features Next for IwGame?

  1. drmop says:

    This is great feedback, please keep the votes coming. Looks like in-app purchasing is something that we should concentrate on next. Is it Android market billing / IOS in-app purchase your looking for or a custom platform agnostic solution via your own payment gateway or a payment provider such as Paypal etc? Or even both?

    We are quite eager to move forward something in the UI area, especially as we are needing this in some of our own up and coming products.

    Tiled and zone based game worlds will arrive very soon alongside the game / media editor.

    3D support is something else that we really want to get in there, purely down to the fact that 3D game development is our original development roots.

    Camera and video are quite small areas that can be added very quickly.

  2. tc says:

    I love the work and have been following this for some time. I would love to see some example of how to actually piece all of this together in an actual game. In my case I love to start off by making a card game. I have been trying to figure out the best way to apply concepts like a deck, hands, discards and such into the actor/scene model. Do I keep a pointer list for the actors in the deck…hands…discards? Do you keep a unique id for the deck…hands…discards and then search the scene for the associated actor when you need to handle the cards display properties? Do you setup a scene for the deck, a scene for each hand, A scene for the discards? If so, how do you control the placement on the screen of each scene…

  3. tc says:

    When reading this comment it wasn’t what I meant…take2….

    Do you keep a unique id for each actor in the deck…hands…discard pile and then search the scene by actor id for the associated actor when you need to handle the cards display properties? This would be required each time a card is either added, removed, sorted in the hand. Is this a better approach then having a separate scene for each grouping of cards. I haven’t reviewed the new xml layout code as it would relate to all of this.

    Maybe this is the round peg and square thing for what I am trying to do but still looks doable. I’d like to have the benefits of picking up the http, ad, display resolution abstraction, etc if I was to use this framework.

  4. drmop says:

    We plan on creating a simple game very soon (along with a walk through blog) so hopefully that will help to show how to use IwGame in a gaming environment.

    You can make an actor that can act as a card and use the scene update method to handle game logic or you could instead use the actor system to represent the visual display / visual logic (such as starting animations, handling taps / drags etc) of the card and have a separate card class that deals with the game logic. So basically when a change occurs to the logical card, it informs the visual actor card to update with the new data. I would opt for the latter approach as I like to separate logical and visual components

    The best approach would be to handle game logic in your IwGame derived class, probably handling packs of cards / discards etc using your own set of classes for dealing with them. Each time a card state changes you could pass that state change over to the actor so it can update visually.

    Its really down to your coding style though as to which way you go.

    You would probably be best naming all of your cards (such as card1, card2, card3, card4 etc..) in the scene then searching for them by name.

    Good point about the placement of scenes it would appear that we overlooked that in XOML. Currently the only way to move / scale / rotate a scene is to apply an animation to it. Whilst this is possible in code by adjusting the scenes camera we overlooked creation and addition of cameras in XOML. I will stick that on our urgent to do list.

  5. drmop says:

    Oh, you can also set an actors type (which is just an integer value) so you could store anything you liked in there.

    The scene / actor system is extensible so you could add your own custom tags and attributes to XOML. if this is something that your interested in then let me know and I will put a blog together covering it.

  6. I’d be interested to know your plans for the XOML based UI system. In particular, how will it handle resolution independence?

    For our game I stored all UI components in a coordinate system where the origin is the middle of the screen and the X and Y coordinates are in multiples of screen height. This was great for supporting different resolutions, but I would like to extend the idea to better handle different aspect ratios. We were supporting 4:3 and 16:9 which meant all the UI was squished into the middle, ie the 4:3 safe frame. I really liked having the screen height as 1, but perhaps the origin of each UI element could also be configurable? I think ideally you could make them relative to any of LeftTop, LeftMiddle, LeftBottom, MiddleTop, Middle, MiddleBotton, RightTop, RightMiddle and RightBotton.

  7. Criss says:

    Hi Mat,

    I loved how you approached the card game above. I felt at ease since I am approaching my other game kinda the same way. This is been said, how do you recommend that I go about implementing a wave of monsters attacking you where the wave is split around a certain period of time and that every wave in every level is different and have different monsters in order to make the game a bit challenging?

    As for an additional feature that I would love to see inside IwGame is the support for “Text Rendering” and “Fonts”. A small wrapper around that would be great and much appreciated and if this can become part of the XOML system that would be excellent and makes things easier.

    Is this something that you are thinking of making part of the UI system ?

    Have a great Sunday,

  8. drmop says:

    We’re not 100% sure which way we are going on the UI front just yet. We don’t know whether to wrap IwUI / IwNUI into XOML or create our own UI system from scratch.

    UI components would be stored in a scene so they would take on the underlying scene transform, this allows you to fill scale, uniform scale etc using the scenes transform. We want the UI system to be flexible and fast so it can be used for both apps and games. We also want to support data binding so you can attach a class in-code to the UI and the UI is automatically updated with data from the classes. For example, you would bind your score variable to a text box, so when the score updates the text box auto updates.

    Fir UI layout we would be supporting a number of layout containers such as Canvas, Grid, StackPanel and WrapPanel.

  9. drmop says:

    Hi Criss,

    I would create an actor that is a monster generator which generates monsters over time. The monster generator class would spawn monsters into the world within vicinity of the monster generator. If you need to style the monsters you can set up all the monsters in XOML, but make them in-active and invisible. When the monster generator decides to spawn a new monster you make the monster visible, active and move its position onto the screen. This approach would allow you to define different types of monsters in XOML. When its time to spawn a new monster you can search the scene for actors of a specific type and check its active state, if its in-active then you know that you can use it.

    I think that you should have as much variation in the game as possible so varying monster waves every level or two would be a good idea.

    Yep, text / fonts would be supported by the UI system.


  10. Criss says:

    Thanks Matt,

    I will try what you suggested.

    Have a good one.

  11. Phillip says:

    I’d also like to see some sort of gesture handling such as scrolling and two finger pinching.

  12. pugmartin says:

    I second the request for an in depth simple game tutorial using IwGame.
    That would be very handy.

  13. Keith says:

    Hello Mat,

    A game tutorial would indeed be handy. I think I’m doing okay, but…

  14. drmop says:

    This week I am going to have a crack at creating a game in a day then spend a day putting a tutorial together based on the game.

  15. Korwin says:

    Hello! Sorry for offtopic, but I dont know where I can ask for my problem: when I build and run my test .apk file I see a small white square with Marmalade logo, which jump for angles of the screen. How to fix that? P.S. sorry for bad english

  16. drmop says:

    Hi Korwin,

    The problem sounds odd, can you by any chance upload a screen shot or video so I can take a look?


  17. Korwin says:

    Ok, if you build the 0.28 example and run it on Android device you can see what I’m talking about. Its happen only on device, not on emulator. Strangely..

  18. drmop says:

    Does the same happen with 0.281? We’re not having any troubles with Android at this end, but the engine has changed significantly since 0.28/0.281. We are releasing 0.29 this week so you can try that version. What device you running on?

  19. Korwin says:

    Oh, its look not like a bug, maybe it something like a license(i use trial version)? Translucent white square, blue circle and white liter M on it

  20. Roman says:

    I guess it is because trial license. There is no way to publish to stores with it.

  21. Korwin says:

    Ok, thanks. I only start to study this engine, read docs, but have 3 questions:
    1. How may I to create a UI? A not find nothing about UI in docs and examples
    2. How to change screens in my game? For example I click on button in menu and I must go to my main game screen. How can I do this?
    3. And about animation: I have 5 frames with different sizes, but they zoom in for one size

    Maybe I must write it on forum, but I can’t find it ;(

  22. drmop says:

    1. You can either create your own by creating actors that behave as UI elements or you can use the IwUI / IWnUI UI API in the Marmalade SDK. Our UI wrapper wont be available for some time
    2. The scene system is designed to facilitate this kind of behaviour. I would recommend that you create a scene for each screen. When the user taps a button you hide the current scene and make the new scene visible. We are going to add automated support for this in XOML over coming weeks.
    3. You would need to create an animation timeline in XOML that contains two animations. The first animation would contain your image animation, whilst the second would contain a scale animation. Using the key frame time property of the animations you can sync up the scale to coincide with the image animation.

    Drmop does not have a forum I’m afraid, although this is something we will consider if the IwGame engine becomes popular.

  23. Roman says:

    I am not sure if some of IwEngine components can’t be used as it, but what about something like tween/easing engine? It probably wont be so comfortable as in AS3/HaXe but something similar to Tweener would be very useful.

    Also some transition effects would be great. I would love to see at least one, or two made by you to give a template for other people to add new.

  24. drmop says:

    We are looking to add easing between key frames at some point. Its on our list, just don’t know when we will get to it.

    Will try to put some additional XOML examples together for the next update later this week.

    We just need to get tap-enabled actors and actions working firstly then we can show some better examples that are implemented in pure XOML.

  25. Keith says:


    Glad to see about the XOML examples. You mention creating a scene for each screen. I find that in creating a screen, I’m running multiple scenes concurrently. It’s as though we need a container for scenes. I have grouped these screen scenes into separate xml files, but I suspect that isn’t the structure you intended.

    Using XOML is so efficient (Man, that makes thing easy!), it would be nice to use it exclusively.

    Anyway, I’ll wait (impatiently) for the update which will probably address some of this.

  26. Criss says:

    Hi Mat,

    I am facing TWO strange behaviours.

    1-I implemented more than 60 sprites varying in sizes, shapes and number of frames. The total size of all the PNG files used is less than 5MB. I only used XOML for this. All the images are loaded with the Preload parameter set to TRUE.
    Strangely, when I was implementing another 5 of them in one scene using the following XOML code:

    I only see the first actor. If I go ahead and comment out that line and run my scene, i will be able to see the rest of the 4. if I comment out the first two lines, I will only see the last actor. This happens regardless of which scene I place my actors in. Note that if I load every actor alone it will display correctly.

    I tried a bunch of things:
    -If I remove the TimeLine from all of those actors, only one of those actors displays.
    -I increased the memSize in my .icf file to 52428800
    -I called PoolsInit(4096,4096, 8192) thinking that I need more nodes etc..

    All lead to no solution. I need to draw your attention that I don’t have any of those issues when I run on the PC simulator, it behaves exactly how I tell it to.

    2-My second problem is a bit different but could be similar. I implemented the logic that you advised above regarding the monster generator that uses a period of time… It worked well on the PC simulator, but on the device, when I load my Scene, I start seeing some monsters on the screen and every monster start shooting at me etc.. This is great, this is what I am expecting… But when I run it on the Device, the monsters start spawning and suddendly they stop, and this happens randomly.
    What I am doing to kill a monster, I return FALSE on the its update() method and If I don’t shoot my monster, when it reaches the edge of the screen I return FALSE as well. Is this how we should clean up after creating too many Actors?

    Its been two days that I have been pulling my hair to figure out these two problems but in vain. I think I tried everything I know of.

    Thanks in advance for your feedback.

  27. drmop says:

    Hi Criss,

    It appears that WordPress has stripped your XOML code out of your post. Can you email me the XOML?


  28. Criss says:

    Hi Again Mat,

    I am narrowing down (I think) on Problem #1, but I need to know if there is a way to force calling Actor::Init() in case I am creating my Actor using XOML.


  29. drmop says:

    If you derived your actor from CIwGameActorImage then calling CIwGameActorImage::Init() will in turn call CIwGameActor::Init()

  30. Criss says:

    Hi Matt,

    I did derive it from CIwGameActorImage but if I place a breakpoint inside init() it won’t break inside :S

    I have a couple of quick questions:

    1-is returning False from the update() moethod of an Actor enough to perform a nice cleaning of the actor?

    2-In order to display text inside IwGame, I created the following method within the singlton of the Game:
    void Game::DrawText(float x, float y, CIwColour colour, CIwGameString str)

    // Set the current font

    // Set the color

    // Render the text into a 100×100 region
    CIwSVec2 region(100, 100);

    // Centred on the centre of the surface
    CIwSVec2 topLeft((int16)(Iw2DGetSurfaceWidth()/2 – region.x/2),
    (int16)(Iw2DGetSurfaceHeight()/2 – region.y/2));

    // Draw the string into the region
    Iw2DDrawString(str.c_str(), topLeft, region, IW_2D_FONT_ALIGN_CENTRE, IW_2D_FONT_ALIGN_CENTRE);

    My intention is to call it from any of my actors. the problem is that it is rendering the text below most of stuff that I am displaying, how can I force the text to render on the upper most surface?


  31. drmop says:

    Yes, when you return false from an actors update method, the actor is placed into a removal list. When the scene has finished all of its processing it will delete any actors in the removals list. This is to allow actors and other objects that are still referencing deleted actors to disconnect gracefully.

    The sprite manager handles the layering of actors visuals so the actor does not actually render anything. To get layered text rendering to work you would need to create a new type of visual based on CIwGameSprite, maybe a CIwGameTextSprite that performs the rendering. You would add new string, font properties to your new CIwGameTextSprite class and override Draw() to include your above drawing code.

    I may actually include this in the a future update as it could prove very useful.

  32. drmop says:

    Oh, you can derive you own scene from CIwGameScene and render your text after you call CIwGameScene::Draw(), but this will only display text top of everything in the current scene.

    I will separate IwGame:Draw() into two methods in the next update, so it allows post draw rendering to take place that will appear on top of everything in the scene.

  33. Criss says:

    Regarding Post #31: When does a scene finish processing? is it when it becomes invisible or not active? or is it when it loops around all its objects(actors) and updates them.
    Could this be related to one of my issues whene my Monster Generator stops generating monsters on the Device only but not on the Simulator?? do you think I running out of memory or somthing like that since I am generating more than 50 monsters?

    Regarding Post #32: if I am to derive my scene from CIwGameScene, will the font handling reside in my derived class?

    Thanks a lot Mat and have a great evening.

  34. drmop says:

    Its when the scene has finished processing all of its actors.

    Yes, if you want to render the text after the rest of the scene has been drawn then you could put the font rendering code in there, although you would need to do all of the text rendering after all other rendering for that scene has been done. This means that you will need store all your strings in the scene.

    Not sure that you should be running out of memory with only 50 actors. You could try printing out:


    To check to see how much memory you are using and how much is free

  35. Criss says:

    Thanks Mat for your tips.

    I am not saying that I am running out of memory, I am just trying to find an explanation to why the monster generator stops generating monster after it generates just a few.
    But since it works on the Simulator I need to know why it doesn’t work on the device. So my big question is : How do we debug on the Device?

    Another question: if I run my app on my latest Galaxy Nexus (4.0), it works fine but if i run it on an older Android device (2.3.x) or on an iPhone 3S, I only see the splash screen then the app shuts down. Any ideas how to get around this problem?

    Thanks a lot and I have to say this, I can’t wait to see the next version of IwGame.

    have a nice weekend.

  36. Criss says:


    What is your preference:

    Is it better to have one Big Image that holds most of the sprites with their animations?


    Is it better to have one image per Sprite?

    Does the latter produces more memory fragmentations?

    I am sure that many other developers are asking this question.


  37. drmop says:

    Hi Criiss,

    Those older devices usually have less memory / VRAM available which is usually the problem.

    To debug on iOS you can use the iPhone Configuration Tool and on Android you can use adb. Both of these tools display debug output from your app. You want to check out http://www.drmop.com/index.php/2011/09/27/marmalade-sdk-bitesize-tutorial-running-out-of-memory-and-how-to-fix-it/

    The best approach is to use one large image containing many sub-images (usually called an image atlas or sprite sheet). This minimises the number of texture changes that the hardware has to do during rendering. You should also try to keep your textures power of two sizes for optimal rendering and texture space.


  38. Criss says:

    Thanks a lot Mat for your tips.
    For a moment I thought that I was doing something wrong and caused those old devices to crash. Apparently you’ve been in my shoes before πŸ˜‰
    I will get on debugging them now πŸ˜‰

    On another note, how can I set a certain frame programmatically in order to create a Button Up/Down effect?

    In the old version of the IwGame, when the user used to click on a button, I used to call from the actor’s instance:


    How can I do this with while using XOML?
    Here’s what I am planning on doing:

    #Animation Name=”ButtonUp” Type=”rect” Duration=”0.0″ #
    #Frame Value=”0, 0, 204, 153″ Time=”0.0″ /#
    #Animation Name=”ButtonDown” Type=”rect” Duration=”0.0″ #
    #Frame Value=”0, 153, 204, 153″ Time=”0.0″ /#

    So basically, creating two animations each one consisting of one frame and flipping the animation using :

    CIwGameAnim* anim = (CIwGameAnim*)scene->getResourceManager()->findResource(“ButtonDown”, CIwGameXomlNames::Animation_Hash);


    CIwGameAnim* anim = (CIwGameAnim*)scene->getResourceManager()->findResource(“ButtonUp”, CIwGameXomlNames::Animation_Hash);

    is this a good approach?

    Thanks for your feedback

  39. drmop says:

    In XOML that would be the way to go, although in the next release XOMl has been extended to simplify stuff like this as it supports events and actions. For example, you can create an actions group that consists of multiple action commands such as play some music, start a timeline, remove a scene etc then have the OnTapped event of the actor call the action group. So in your example above you would have something like this:

    <MyActor Style="BaseActorStyle" Name="Bob" OnBeginTouch="ButtonDown" OnEndTouch="ButtonUp">
    <Actions Name="ButtonDown">
    <Action Method="SetTimeline" Params="ButtonDown" />
    <Actions Name="ButtonUp">
    <Action Method="SetTimeline" Params="ButtonUp" />

    Oh, the new Style attribute is the styling system that saves a bunch of typing πŸ™‚

    In code, it would appear we have a hole in the timeline class because its not currently possible to directly change the current time of a timeline, will sort that out for the next update.

  40. Criss says:

    WOW, when are you planning on releasing that?
    I can’t wait!!!!!
    If its in the coming two days, I will wait before coding all those buttons that I have all over the place πŸ™‚

    Do you have a quick method to flip actors horizontaly or vertically?

    I can’t thank you enough

  41. drmop says:

    The new update will be tomorrow / Monday.

    Yes, actors now have FlipX and FlipY attributes

    Also, another cool feature thats been added is the ability to load other XOML files into an existing files (kind of like include files):

    Or load a XOML file if a certain action takes place:

  42. Criss says:


    Thanks a lot for this beautiful news. Nothing more I could have asked for on a Sunday Morning πŸ˜€ πŸ˜€ πŸ˜€ πŸ˜‰

    I am facing an weird issue, but it could be that my understanding to this is totally wrong.

    I created a scene with a bunch of actors using XOML.
    Some actors are all the time visible cause they are part of the HUD for the player (weapons, etc…). Some others, such as the Dialogs for “Game Over” and “Congratulations” are hidden. These hidden actors, have been tagged with Visible=”false”.
    But when I switch to this scene by toggling the Visibility of the Scene to true, all the actors of the scene are now visible. I even went further and set the Visibility flag of the actor programatically to false and still my actor is visible. I used this code:
    CIwGameActor *MissionAccomplishedActor = scene->findActor(“ActorWinDialog”);
    if (MissionAccomplishedActor != NULL)

    Could this be a bug or is it something I overlooked?

    Another thing that I noticed missing is that the ability to get the Name of the scene using something like:

    CIwGameString CIwGameScene::scene->getName()

    Is there another way to extract that name that I declared in my XOML for the scene?
    Same thing applies to CIwGameActor.

    Please note that both the Scene and the Actor classes have the method SetName(str) so why not getName() πŸ˜‰

    Sorry to bother you on a Sunday, but if this has been attended in tomorrow’s release (so excited!!!!) please ignore my message.

    Now let me wish you a nice Sunday and needless to say that you are doing a great Job.


  43. drmop says:

    There is a bug at the moment that prevents visibility settings from working, fixed in next release.

    IwGame works on string hashes for names as they use less space, when you set the name it calculates a hash of the string and stores that instead.

  44. Criss says:

    Thanks for pointing that out. But I managed to have a workaround it, I placed those dialogs into scenes and since scene’s visibility is working, then I managed to hide/show them accordingly πŸ˜‰ πŸ™‚


  45. Keith says:


    That’s great news about the update. I feel like a kid waiting for Christmas morning!! Outstanding!


  46. Criss says:

    Hi Mat,

    I have a small suggestion for the future release of the engine: Can the Scenes have a “Type” just like the type that the Actors have? this will prove to be useful if someone wants to separate Scenes that are used for Main Menu Screens, Options Screens, Score Screens, etc.. and scenes that are used for Game Levels etc…???? I added it myself but I am sure many will benefit from this feature.

    Just a suggestions…

    PS: Waiting impatiently for the next release πŸ˜‰

  47. drmop says:

    v0.29 is available for download.

Leave a Reply