Learning Diary #10: Lua, socket server, path finding, quaternions

 

12/Jul/2010

Using Lua and a Socket Server to test and debug iPhone Games

Damn, too many balloons. Ops, just change the Lua code real time!

Damn, too many balloons. Ops, just change the Lua code real time!

I already talked about #iDevBlogADay. But let’s say it again: I just love this “group”! The first thing I do when I wake up is checking the feed for the day’s articles. And how sad I get if an author hadn’t published his take yet.

Everyday we get 2 new nice articles from fellow indie (or established or beginners – like me)  game developers. One of these articles “Tweak Away” from Mystery Coconut brings Lua and socket servers into your iPhone game development.

Main points you’ll learn from the article:

  • How to open a debug server for your game.
  • How to integrate Lua into your game and how it can access your game elements.
  • Change your game behaviors and state via command line (e.g.: no more re-compiling to change the speed of a ball).
  • Scripting all of your game content and behavior.

And yes, Miguel makes everything that easy for us :)

Path Finding

  • Path finding class for a RTS game: ASIPathFinder. “ASIPathFinder is a complete implementation of a cooperative path finding algorithm, and will probably be most useful for writing Real Time Strategy games. It is written in Objective-C, and is compatible with Mac OS and iPhone OS.”
  • Cocos2D, Path finding and Tile maps – sample app: cool working code which I found on Cocos2D forums.

Cocos2D

  • RenderTexture: let’s explain via an example: for a shooter game which leaves bullet holes, we could use sprites for these holes, but a RenderTexture is memory saver.
    a) Sprites: 500 holes – 500 sprites – 1000 triangles – 2000 vertexes.
    b) RenderTexture: will draw only one sprite – it takes a picture and work in that picture.
  • EAGLView: create the OpenGL context.

Drawing with Quartz2D

  1. Save current context
  2. Perform a single combined matrix transformation
  3. Draw graphics to this transformation
  4. Restore context

Source: Beginning iPhone Games Development

Quaternion

  • Sum of a scalar and a vector
  • The quotient of two vectors
  • Imaginary number: i * i = -1
  • A quaterion is a complex number extension: 3 numbers all square roots of -1: i, j, k
  • j * j = -1, k * k  = -1
  • q = w + xi + yj + zk (w = real, x, y, z = complex).
  • or q = [w, v] (w = scalar, v = (x,y,z) – vector)

Source: http://www.gamedev.net/reference/articles/article1095.asp, http://www.paradeofrain.com/2010/07/lessons-learned-in-tilt-controls/

Leave a Reply