Final Push with Icon Hell

I am going to the gruesome phase of the final push towards the Apple App store.
It is fun to make a game, but it ain’t fun to get all the other assets in the game in order to get the approval of Apple to submit a review request.

That is what I call : Icon Hell!
And hell it was…..

When I started making this game I had the icon assets managed by Cocos2D. This is nice, because with a small number of icons you can get a releasable archive. This was always messy of course, but it worked. Then Apple started with a mechanism called Icon and Launch Assets. This is nice because dependending on the target version you can provide icons from iphone4 until the latest iphoneXS Max.

All is well, all icons and launch screens of various sizes dragged in.

Making icons is still fun
When you have pixelart it is better to make each icon look it’s best

But I knew I wasn’t done. You have to edit info.plist a number of times. Got this error first (did not expect a first time right).

So i scoured the internet and I tried to insert this into info.plist :

	
        <key>CFBundleIconFiles</key>
	<array>
		<string>Icon-60@2x</string>
		<string>Icon-76@1x</string>
		<string>Icon-76@2x</string>
	</array>

When I validated my project (Xcode 9.4.1), I got a valid archive message!? Was this my lucky day?
Nope, I sent the archive to apple for real now to let the validation happen on Apple’s servers.

Then I thought… Icon-76@2x is the correct icon size for that?
After validating a load of times, I discovered that CFBundleIconFiles does not help me at all providing the correct icons.
I removed these completely and started looking for answers on the big bad web….
After many hours and countless stackoverflow suggestions I found a stackoverflow post and it mentioned something about the Target Membership.

This is how my Icon Asset settings looked before I corrected it :

This can be found in the side panel of the Assets folder

This was some remnant of the Cocos2D setup ( I know I should move towards a new framework 🙂 ). So i selected the correct target membership (what’s this for anyway? ) And now it looks like this.

I was certain this was the correct format so this was definitely an improvement. But one validation gave me this :

This was a lot easier, because of the support of iOS 7 I needed to add the following xml to info.plist

	<key>UILaunchImages</key>
	<array>
		<dict>
			<key>UILaunchImageMinimumOSVersion</key>
			<string>7.0</string>
			<key>UILaunchImageName</key>
			<string>Default</string>
			<key>UILaunchImageOrientation</key>
			<string>Portrait</string>
			<key>UILaunchImageSize</key>
			<string>{320, 568}</string>
		</dict>
	</array>

Now the problems are completely gone and can make builds for testing etcetera.
One thing bugged me though :

	<key>CFBundleShortVersionString</key>
	<string>1.0.0</string>
	<key>CFBundleVersion</key>
	<string>3</string>

CFBundleShortVersionString corresponds with Version in the Xcode label and CFBundleVersion corresponds with the Build label. That was a head scratcher too! I think Apple will never name things as they appear in the GUI.

 

Archived: Uncategorised

Released Valleybomber into the App Store

As Cocos2D (for Objective C) is dead. I need to move on with another framework that will suit my needs. My eye has fallen on LibGDX and Godot engine. The first thing I had know is :

  • Does it run on iOS?
  • Does it support tiled tilemaps?
  • Does it have an ActionSequence framework like Cocos2D?

LibGdx does tick the boxes in all categories, but I needed to see it for myself.
I had to make a small game to see if it could be published on iOS…
And yes it does!

See the result here :

vb

It is in the App Store here :

Valleybomber in the App Store

Well.. Libgdx supports tilemaps and it has a form of Actionsequences.
The only thing is that it looks kinda slow. And that’s a bit disappointing coming from very fast Objective C.

Next Godot!

Archived: Uncategorised

LipSync in The Lost Adventures

A lot I invested in creating dialogues because it is one of the greatest gameplay features in Point and Click adventures alongside puzzles.

My characters lacked believable mouth movement and that bugged me. So after I found the right software to do this, I added lipsync to my point and click adventure engine. But I needed to invest a great deal in tooling to be able to support a quick pipeline of voice recording files to in game voice acting.

I have lip-syncing for over quite a few months, but I finally made it stable in the last weeks.

I recently started adding some youtube videos recording the progress of the game and ‘LipSync’ is the first episode…. Here it is :

 

 

Archived: Uncategorised

Added a funny dialog to ‘The Lost Adventures’

As the Lost Adventures is a very lengthy project (1yrs & and a few months now). I decided to make a special dialog, just for fun.

Everybody that codes nowadays have heard of a site called Stack overflow

Off course it’s bad practice to use this site too much, but it’s sometimes convenient to use when you are stuck with a problem. Especially when the error message are confusing and totally meaningless.



I made this after I had frustratingly looked at an error in my game and luckily stackoverflow helped me fix that.

Archived: Uncategorised

The Search for the holy Pixel Editor

During the making of my Adventure “The Lost Adventures” I downloaded some character sprites from the internet first and used some assets from archived projects.

I edited these with Gimp, my normal workhorse for doing stuff. But they looked horrible, and It looked really like developer art, and it took too much of my time.


Gimp-icon-scalable.svg

Gimp is good at graphics manipulation but not specifically doing well at the pixel level.

 

A good pixel art tool is all about zooming in out, you have to do this as often as you can.

It’s important that you can get direct feedback if your pixel you just painted looks good on the sprite as it will appear in your game this way.

AAEAAQAAAAAAAACFAAAAJDE0NDQzN2VlLTY0OGYtNGMxNC1iYWZkLTNiNGZmMmRkNmE2OQ

An ideal device to zoom in and out quickly is pinching and zooming pixel editor. Tablet has a few drawbacks too, like selecting portions of your sprite and moving them.

 

I have tried lots free and non free.

Lets list some of them here (ranked from best to worst, off course after writing this post, some apps can be improved in the meantime):

 

Non Free

Pixaki : (cons:resize canvas and magic wand are missing – pros:dropbox export, iCloud import, great pinching and zooming)

Pixels: (cons:awkward interface – pros:animation support and support for dropbox)

EDGE Touch : cons (only iPhone, but looks ok on iPad, no dropbox or iCloud support – pros : intuitive interface, layers)

PixArtist: (cons:no cloud support, not in european store – pros: great pinching and zooming)

Pixure:(cons:dropbox,iCloud?,selecting an action is a two way process – pros:watch app, iPhone and iPad support)

Pixel Dude:(cons:selecting colors is problematic – pros:dropbox support, iPhone and iPad support)

Sprite Something: (cons:non-intuitive editor,dropbox support is troublesome – pros:animation editor, iPhone and iPad support)

 

 

Free

Dottable

Make Pixel Art

Bitdraw

Repin Pixel Art Studio

 

Desktop Apps

AseSprite

Gimp

Pixen

Piskel

Archived: Uncategorised

WIP : Savegames screen

Making save games is one of the most critical parts of an adventure game. I had a simple ‘save the game when you exit the room’ procedure before I created this. This was sufficient for a while, but I needed more flexibility. The player will bIMG_2001e able to save the game at any time anyway. I have created a draft interface for making save-games. It will definitely be more polished in the future, but I wanted to get this thing coded. I need this badly for testing all the rooms, because it’s more convenient to load certain states by specially prepped save-games. As you can see it shows a small thumbnail scaled down but still pixelated when you click what I call a save-slot. A descriptive date will be shown on the thumbnail so the player knows exactly when he saved it. Players can add a title when they want to. This is not in the game right now. but these features will be in it. As you can see, I can play tic-tac-toe with this screen. So it’s now a game within a game!

 

Archived: Uncategorised

Work in Progress : Elevator to switch between rooms

I have a lot of rooms (about 10 rooms for each Act) There will be around 40 in total. I need to be able to switch really quick to test them. It’s a typical smorgasbord of buttons to do just that. Such a ‘switch’ screen will not be in the game because that would break the immersion of the game.

smorgasbord
Smorgasbord of rooms

I really wanted to make this ‘real’ transition room quickly, because it can be part of the game. It is a shown in a special way because it is projected from the side completely. The only thing Dave can do is press the buttons. Depending on the floor the speed of the transition is faster when the floor destination is farther from the current floor. Lang’s building is very futuristic, so such a turbo lift could be expected. The elevator is what I expected too be, I had made the art in pieces long before I made the movement so It was really coding all the movement. A lua script is driving the animation as all the other rooms.

darkelevator

 

Still, this is all not set in stone because I am not convinced the player should see the buttons all the time. I could centre the buttons when the player activates the panel and show some stuff buried in the concrete. The elevator created a new puzzle for the adventure, getting an elevator pass… elevatorCardThe elevator above is an animated gif so click the preview thumbnail to look at it. It’s quite hypnotic…!

Archived: Uncategorised

Animated Gif of the Angry Guard and status development

In anticipation of the animation function in Pixaki I discovered that the updated Pixely app has an animation function that can export to gif. I added the frames of the angry guard character (a small character in The Lost Adventures)  and create an animated gif.

Angry guard walking
Angry guard walking

It really looks if he is about to beat you up!

The Lost Adventures engine is almost feature complete and I am about to leave pre-production. There will probably missing some features, but they are not necessary for the main story and adventure gameplay.

The adventure engine has the following features :

  • Voice acting support in dialogs
  • Animation system controlled by Lua scripting
  • Game state saving (no saving interface yet!)
  • Follow and zoomcamera controllable with scripting
  • Dialog tree support
  • Scripted background music and sound
  • Inventory management
  • A star path finding for tilemaps
  • All kinds of scripting events , wait, walk to, move to etc..
  • System describing stuff in the world including voice support

Wish list :

  • Save interface
  • Loading screen
  • Character animation for seperate parts, mouth and arm gestures
Archived: Uncategorised

Created font rendering node for the dialogs

I had some serious trouble with my arcade true type font. Because ttf only have one color, I pondered about pre rendered fonts on a bitmap sprite sheet.

Initially I liked this idea, but I like the true type font because it’s quick and resizes really nicely. But the problem is that If I wanted multicolour characters this won’t do. So what did I do? Well, I made two CCLabelTTF nodes and drew them over each other. One node as an outline and one for the fill. This worked very well, except for multiple lines…. The truetype font node shifted a pixel or so on each row. This is because of the rounding errors in the “how many text can fit in a certain box” calculation in the True Type rendering. Look at the green coloured arcade text. Its the TTF version. Some of the characters are smeared across each other and that sucks big time. So what to do then? Wrestle with bitmaps and aliasing again? No not again!

screenieFonts

The orange coloured is drawn block for block by Cocos2D primitives rendered on a texture. A sprite for each character is created from those textures. But with this new approach I had to create the “how many text can fit in a certain box” algorithm for my solution too. Plus all the font input had to be made too, so it took me about 6 hours to make this. But this is a very important aspect of the game, so it deserves the quality it has now. On the plus side I can make lowercase characters, making the game even more authentic to the likes of Indiana Jones and the Fate of Atlantis. Another plus is memory consumption, my solution uses less memory than the TTF one. Another plus is that I also aligned every line of text in the dialogs, just because I was on it anyway.

 

 

Archived: Uncategorised

The Lost Gamestate…

Persisting state of things in an adventure is a really hard thing to crack. Is it coincidence that persisting and resisting sound the same?

I waited some time to implement this because I needed to find out first how the bridging between the Objective C and the Lua code sorted out. Maybe I needed to store the state in anoyher way? And I didn’t had any experience with a dynamic language like Lua. But as I gained more experience with Lua I thought I was ready to implement the save games routines.

But still… The choices you have to make are pretty hard because design mistakes like this will hunt you throughout the development of the game. I looked at various adventure projects currently in development and tried to find out how they had solved this or how they will solve this problem. Some of them solved this by serializing the state if the objects as they were loaded in memory. This is very commonly used in managed languages as Java and C#. In fact,every serious programming language has it’s own way of storing this. Objective C uses NSCoding to make the objects persist-able. I used this technique on earlier games I made but I hated the hard labour you had to put into it. You have to explicitly tell the system what to serialize and not to serialize. And with a complex hierarchy like adventure objects it can become a mess. So I tried to avoid this entirely.

I started this project with Objective C for the graphics and heavy lifting. Lua (a great embedded language)  is used to write the behaviour of my game and manages all the state present in the adventure.

objective-cfree-vector-lua_081531_lua

My first thought was storing each Lua call like versioning systems do. Every time something happens the Lua call will be stored and when the game needs reloading all Lua calls will be executed in the order they were executed before. The big problem with this is that the entire history of calls are getting longer and it can hurt performance in the long run.

The savegames in this scenario will mark several branching points.

This could be a viable solution but besides the pros there are a lot of cons

Pros:

  • Only one big Lua State to manage
  • Very accurate tracking of every possible state in the game
  • Not much coding to do except loading and replaying

Cons:

  • Increasing loading and execution time before starting room
  • Need to store the lua call immediately in memory or database
  • Stores stuff that might not be necessary to be stored.

Most of the solutions I encountered were storing the state of a subset of the Lua objects at specific intervals. This seemed a better approach to me as I had already chosen to make one Lua script per room. Lua fetches all object states when the room is entered and if it’s not present a template will be set.

Right now I can differentiate between 4 kinds of state objects:

  1. RoomState : Stores all the stuff that happens in the room the player is in.
  2. PlayerState : The player (Playable Character) moves between rooms and will be loaded beforehand (to see which room he is and will be his starting point).
  3. NpcState : Some Npc’s (Non Playable Characters) will and can move across different rooms, and they will be added and loaded according their currentroom property.
  4. GlobalState : All event data that needs to be accessible at any time. This will for example be events setting a state variabele that are triggered while having a dialog with a npc and some other dialog depends on that state

The next part of the solution is in which format I can store the lua state. That decision was easy: Json is superefficient because the way lua tables are initialized is json without quotes. I found a very basic json implementation that worked without much fuss. Look at the difference between Lua table creation and it’s Json format :

local room = {
    name="museum",
    objectElevatorDoor={
        standingLocation="{20,2}",
        buttonlocation="{21,3}"
    }
}
{
   "name":"museum",
   "objectElevatorDoor":{
      "standingLocation":"{20,2}",
      "buttonlocation":"{21,3}"
   }
}

It’s basically replacing the equal sign for an semicolon sign and wrap the props in quotes and you have the Json format basically.

jsonlogo

I used this Basic Json parser that parses json to tables and tables to json. The only problem I had was that the parser tried to serialize the functions too.  This could lead to crashes because I could not load the function back from the database.

I wondered if I could seperate the data from the functions. And yes, this can be done really nicely with the use of Lua metatables. A metatable can be seen as an extension point when set on a table. A very good tutorial on how this works can be found here. The structure I came up looks like this:

function common.EntityFactory.createRoom(roomName)
    local room={};
    room = {
        name=roomName
    }
    return room;
end

function common.makePersistable(tableToSetMetatableOn)
    setmetatable(tableToSetMetatableOn,
        {
            __index = function(table, key)
                if key == "persist" then
                    return function()
                        jsonToPrint = json.encode(table);
                        print("LUA JSON FOR room : " .. jsonToPrint);
                        luaController.persist_room(table.name,jsonToPrint);
                    end
                end
            end
        }
    )
end

The showed function is the ability for the object to persist itself.  The luaController is a user data object that calls the Objective C method to persist the Json string.

This defined metatable with the persist function can be set on the player at any time. That way I could create some ObjectOriented approach to handle these kind of things.

common.makePersistable(currentRoom);

The last thing I needed to figure out was how to store this. I chose SSLite because this is a well supported choice on different platforms (android needs to be supported too). I made a nice wrapper for crud operations.

SQLite370.svg

When a save-game is created by the player the intermediate and temporary json records are copied to a different table. It will get an additional timestamp, title and a save image that consist of a freeze frame screenshot. Well this is the plan, that part is not implemented yet. But I have to start somewhere don’t I?

Archived: Uncategorised