OpenGL Render to Texture

Render to texture is a very handy functionality. Imagine your game allows for some character customization. You have the body, some different hats, different clothes and other small stuff. Now the easiest way to render this is to just draw it piece by piece every frame. With the proper Z coordinates everything falls in place. But you now have like 4-5 draw calls for one single object. Worse, you might have different textures and swamping textures is expensive. ...

April 29, 2011 · 2 min · 238 words · David Amador

Tracking/Identifying individual touches on iPhone

I got this question the other day, how to track individual touches if you are using a couple of fingers for a game? Actually it’s pretty easy if you can access the touch previous position and it’s current position. Let’s start with a small class to store the information class Touch { public: Touch(); ~Touch(); void update_position(float x, float y){ _current_position.x = x; _current_position.x = y; } bool is_same_touch(float x, float y) { if(_current_position.x == x && _current_position.y == y) return true; return false; } protected: CGPoint _current_position; }; Let’s a assume the “move” movement ...

April 15, 2011 · 1 min · 185 words · David Amador

starlog 14042011

Hum…some stuff happened lately, some I can’t go into detail right now others I can. I was talking with Rita the other days and she had this nice idea for an iPhone game. It’s one of those small concepts that may or not work but I liked the general idea, at least enough to start a small prototype. If everything turns out the way I plan (never is) it should be a 2-3 weeks project. ...

April 14, 2011 · 4 min · 667 words · David Amador

A little on how to initialize and use GameCenter

Small side-note first, Vizati is now available for the Super Nintendo, more info. For my third idevblogaday post I’m going to talk about Game Center. Game Center was released only a couple months ago (September or so) but already tons of applications are using it and even more, players ask for it. It’s a way to track achievements, leader boards etc. Unfortunately It’s only available from iOS 4.1+, so some compatibility check has to be done. ...

April 1, 2011 · 3 min · 445 words · David Amador

Scripting week

This week I’ve been working on replacing my current scripting system. It worked great for Vizati but I need something with a little more flexibility. Instead of explaining what I’ve managed to get working I’ve made a screenshot with some notes. I think I’m going to make this my #ScreenshotSaturday

March 26, 2011 · 1 min · 50 words · David Amador

Blog new look

Spent a little time giving my blog a new look. It’s not that I didn’t like the old one but sometimes it was a bit of a mess, I’ve been getting many new readers so it was time for a cleaner look. My main concern was getting all code posts to be readable but I think they are class XPTO { public: XPTO(); }; Let me know if you find any errors, since I’m not going to dig up the whole blog finding errors =P Also feedback on the new layout is most appreciated. ...

March 22, 2011 · 2 min · 249 words · David Amador

Loading images into OpenGL in iPhone

So you can’t make a game without images, right? Well, actually you can but that’s another story. But how can you load a jpg or a png and use then on OpenGLES? First let’s make a simple class Texture2D class Texture2D { public: Texture2D(int id, int width, int height) { _textureId = id; _width = width; _height = height; } virtual ~Texture2D(void) { // Delete Texture from HGL Memory glDeleteTextures(1, ((GLuint*)&_textureId)); } int getTextureId() {return _textureId; } protected: int _textureId; // The reference ID of the texture in OpenGL memory int _width; int _height; }; Now for the code to actually load the image ...

March 18, 2011 · 2 min · 319 words · David Amador

So where is that motivation?

I follow a couple of dev blogs, some are game developers, others make websites or software. In the last couple of months I’ve been reading a lot of them complaining about lack of motivation to develop their idea of the lack of motivation for development in general. Happens to me too, heck it happens to everyone once in a while… It’s something that happens usually half way though or after you get the initial prototype running. Around one year ago (Feb 2010) when I started developing our first game it was all great, new stuff every day, things starting to work, replacing my crappy programmer art by Rita’s drawings. The real endurance was after we had a working demo, and the decision of actually finishing the game. ...

March 9, 2011 · 3 min · 527 words · David Amador

Bringing a game from PC to iOS

This is my first post to http://idevblogaday.com/, I’ve been waiting since November so I’m pretty excited about writing to a broader audience =P. Even though I only have one product on the App Store I have gathered some knowledge on how stuff works to get there. I’ll start by talking a bit about how we made our PC game Vizati to iPhone. When we started, this represented our chance of making games and putting ourselves into test. Without any pre determined rules and/or a major company dictating what to do we were able to have full creative control to try and do something a bit different. ...

March 4, 2011 · 3 min · 627 words · David Amador

Playtesting and Tech support, the other side of the coin

Something that has always been scary (well, it’ still is) before launching Vizati is tech support. No matter how much you tested your game, it’s bound to have bugs. Also what I’ve realized is that I don’t spend enough time testing the game, oh and you too, yes YOU (I’m assuming you’re a developer of course). The past year I gather around a few friends who never played it to test the game for 2 days. 6 people played it the first day, 4 played it on the second day. We gathered around all complaints and issues and addressed them. After that there was more play-testing but not as aggressive. There were 3 or 4 persons testing it regularly. ...

February 18, 2011 · 5 min · 989 words · David Amador