Monthly Archives: February 2010

Progress in movement algorithm design

The album Bolero Gypsies: new flamenco is playing in my ears and the book iPhone cool projects from apress is spread open on my lap and I am typing a blog update on the iPod touch.

The chapter in the book I am reading is about the subject of networking. This may be getting ahead of myself, but it’s good to know for when the opportunity presents itself, and it will.

Yesterday, I created the movement of one of the principle game assets that will be moving constantly in the game. Let’s call this object a “bird” (it’s not in the game, neither is it in the air but it serves for this explanation).  The movement requires intelligence, not merely a simple movement like a rotation of some degrees on every game loop (eg. coins in Super Mario games or rings in Sonic the Hedgehog games). The game world may be large when the game is finished. The first draft for movement has become the following: a “home path” in the same style of the common footpath worn by animals in their native environments, when they travel the paths frequently. So it is with this movent. A path throughout any part of the game world.

This path is achieved by using a number of data variables.

The most important is the array of “checkpoints”. These are the same as checkpoints in a racetrack. In my first version of the movement system, the checkpoints are created as cubes in the world 3d model file, with special object names and serial number prefixes, such as “homepath001”. The name is searched and all the points are loaded into an array.

After the array, the most important variable is for storing the index serial number for the checkpoint the bird will be moving toward. Optionally, this destination may be interupted an replaced with any arbitrary location and the bird will move toward there instead.

Now, storing the index value of the next checkpoint allows us to determine the direction of movement whenever we want to. So now, this permits us to consider other random travel destinations.  If any arbitrary destination is chosen at anytime, another variable must store the yes/no status indicating if the object is moving toward the next checkpoint or not. So this possibility brings the necessity of another variable to store the actual destination location instead of only referencing the next checkpoint from the next-checkpoint-index. When the next checkpoint is reached, the index of the next checkpoint is updated, and the location for the new next-checkpoint is copied to this destination as the default destination.

This is just the tip of the iceberg.

Assuming movement toward some arbitrary location is part of the object’s life cycle, not only following a path forever, then it stands to reason to store not only the next destination separate to the next checkpoint as we’ve discussed, but also store the current home-path-location of the bird as soon as a new, arbitrary, destination is created. This will give the bird next-destination options to choose between, when it reaches the arbitrary location.  It may chose to return to it’s home path from where it left the path, somewhat tracing it’s path backward. Or, it may choose to continue to the next checkpoint directly.

In the case of the city pigeon bird, a home path might be the path around a large office building, and its checkpoints are lamp posts and parking lots (it may choose to walk in a parking lot).  When it is anywhere flying or walking, it may decide to go look at something away from its path, but it will try to keep its home building in sight, and if it decides to return, it can go onto wherever it wants, in the direction of its home!

Having more options is always a better thing than few options or only one.

Following this, I have implemented bezier curves for a smooth transition from approaching one checkpoint to the start of the next checkpoint’s path.  It doesn’t work well if a bird (or any other creature) is moving in a straight line and then instantly is moving in a separate direction..

Never before have I worked with bezier curve equations, so it’s brand new.  But I got the equation from Wikipedia’s page and plugged it in, and now it works.  This is a complicated issue, and not really part of algorithm design, but of implementation.

That will remain for some other day.

Posted in Technology | Tagged , , , , , , | Leave a comment

Late night development progress

Feb 17th, I have stayed awake almost all night. My iPhone app in development is coming along very well, in spite of the very painful lack of reference and learning materials for the main 3D engine.

There are many things to do yet, but today I have done more in a single day than I have any single day previously.

Posted in Activities & Adventures, Technology | Leave a comment

Today: learning and doing activities. Tomorrow: repeat.

Today has been a day of guitar-playing, reading, interpreting, typing, mouse-clicking, and dragging.

I built a 3D model of the Bahamas islands plus Turks & Caicos islands. I am using it as the sample of a 3D islands world in my iPhone game project. This is fun! Building in 3D is new to me, but things don’t go in one ear and out the other in this sort of subject. There are SO VERY MANY things to learn in Blender, because it’s not a user-friendly 3D modelling program. I didn’t know that when I started learning it, but now I do know it.

I got into using it from someone’s internet article of 3D and 2D graphic rendering engines for iPhone and iPod touch (and I suppose now, iPad). The person had SIO2 and Oolong as the top two ranked options, but in pros-and-cons, listed Blender as a con for SIO2.

But that’s probably because like me, that person had no experience with 3D art and modelling.  Anyway, I spent the latter half of January going through Blender 3D: Noob to Pro, and have progressed about 40-50% through it.  I should really finish, except SIO2 does not fully support everything, and I’m trying to catch up to the 40-50% full competency of SIO2  before going on with more complex Blender subjects (like animated armatures).

So anyway, going through the tutorials in the source code is what must be done, not reading step-by-step how-to documents.  This is a guerilla-style learning.  Gotta get my feet wet by jumping in 100% and swim with the sharks.  Not that anyone associated with SIO2 is a great white shark, more like very pleasant whale shark… that sounds really odd, but I’m tired now.

When complete, this project will be a lot of fun (I hope!).  A lot of ideas come to me when I’m in a lucid state, so immediately in the morning before I am out of bed and just sort of coming out of unconsiousness, I try to figure out what ideas are lurking.. at the edge of thought.  Collect them up!  They’re worth money in the right hands, my hands!

Posted in Activities & Adventures, Technology, Thoughts | Tagged , , , , , , , , , , , , | Leave a comment

Problems with iPhone device provisioning

Before working on the iPhone, I have only a day or two’s experience with secure certificates.  The SSL certificate I bought for a web site took a day to buy and another day to setup.

Now, I am dealing with these secure certificates again, and it’s a bit challenging because of my lack of experience!

The task at hand: get Xcode to properly upload one of my apps for testing on the iPod touch.  I think the provisioning is giving me troubles, or something else is.   When I tried to build an app I downloaded as a tutorial, it had someone else’s name in the configuration for the device, so I changed it to my own and also included the certificate, and it still kept telling me the other person’s name was in the configuration.

So I stopped trying to use that tutorial project, and went back to my own, and discovered that Xcode is bugged up.  I try to build and run, setting the device as the Active SDK.

And it uploads the app, but if I am running the debugger, and I click build and debug, it uploads, but gives me an error saying “Failed to upload the ___ app”

Then I look at the iPod touch, and the app is sitting there.  I delete the app, repeat the process, and it’s exactly the same as described.

I’ve checked every single Build-Debug configuration setting and they’re all proper, so I know the issue is not there.

I’ve just finished restarting the iPod touch, and the results:

Failure.

I’m really puzzled.  Possibly some other file is causing me grief.    I created a new test project to verify Xcode can still upload and debug, and yes, it can still upload and debug.  So, there’s something buggy with the app.  Cleaning the targets doesn’t help either.

And this issue has started since testing this other tutorial app out.

EDIT: I have solved this issue after checking google a second time.  First time searching for the problem did not give any success, but second time I found this: Failed to upload XXX.app

More information: The location of the name of this other person was in the Code signing area of the TARGET, but not of the PROJECT.    That’s solved now.

Posted in Technology | Tagged , , , , , , , , | Leave a comment

Buying some stuff from Amazon

I’m buying the Lonely Planet Planet 2010 calendar and the first season of Criminal Minds for my sister. I typed in the location where she is so the company can ship direct to her, and I found this interesting feature: it spell checks the address. and makes recommendations, and gives a selection to pick your original or the corrected entry. In my case, the spelling of the location is determined to be bad, so it has a suggestion for me, but I believe the spelling I have is correct. But anyway….

That’s really handy! It could have helped the christmas card that some friends sent me early december that took a month and a half to arrive: each of the street name, town, and canadian postal code had spelling mistakes.

Posted in Activities & Adventures | Tagged , , , , , , , , , | Leave a comment

Documentation and 3D game engines

I am progressing slowly but surely. The 3d rendering engine for the iPhone that I am using is called SIO2. I am finding it slow going because the documentation is not what I call good. There are no step by step procedures in the tutorials and the reference doc materials are very raw, with no clean summaries,except those on the front page of the website that describe, in point form, the most general capabilities. Those capabilities are great,but after putting in the time to download the engine and try out the tutorials, I am coming to a question: is a pre-existing system better than developing a system in-house, if the existing system is so time consuming that the learning curve is almost as long as the development process?

Here I am frustrated with the lack of good quality and complete learning materials, but the existence of the system is still better than developing my own system. That is because in the time it would still take to devlelop my own thing, the existing thing may (or may not) improve, and in other cases I may find some help that I had not found at first. So the learning of an existing system is better.

This experience is going into the heaping pile of experiences of bad documentation for products I have seen. There is a wiki, and I might start contributing to it.

Going forward in the future, the skill to produce good documentation may become a very valuable transferable skill in the workplace. It seems very boring in some product contexts, ie. Vacuum cleaner manuals, software application manuals, inflatable air matress instruction sheets. Yet this world needs a better, universal, written method of learning that appeals to the reader. Something like google’s API doumentation, and apple’s iPhone and iPad documentation.

Posted in Technology | Tagged , , , , , , , , , , | Leave a comment