terça-feira, 16 de dezembro de 2014

Santa Kitten will join the jumping!

Just sent to the Google Play a new version of Kitten Hopper. In this update I've added Santa Kitten and Persian Kitten. Happy jumping!

sexta-feira, 12 de dezembro de 2014

Space fighters! Deploy!

Hello! I am one of the Drifter's Last Stand programmers. As Allan is making the design, visual and gameplay parts of the game, I am doing some random code here and there attempting to keep the development process smooth - and an ugly UI.

These past weeks we decided that we wanted to have light spaceships fighting around the player. It is cool, adds some life to the game, and it is really fun to watch. But programming their fighting behavior wasn't so triffling!

I took on the task to implement those flying light spaceships. First, I used a plain dumb steering algorithm where the spaceship would take on a target and keep on trying to move towards them. The results were... well... painfully awful. The fighters would just wander around as clouds of flies, slowly circling around towards somewhere outside the screen.

Then, I decided to throw all of it away and use a physics based approach. The spaceships are simply attracted to their targets. It should work! But it didn't! They would either fly in an interesting circular motion (emergent behaviors are always awesome!) or collapse in small groups with spaceships slingshotting in and out. It was clear then that the best solution would be a steering algorithm with some brains to know where the possible targets are and dynamically decide what to do. For those more into AI, what I meant is that I started to build an steering algorithm inspired on Boids.

Many attempts came after, but here's my final spaceships movement algorithm:

A spaceship has its own acceleration, deceleration, max and min movement speeds. The min speed is needed to avoid "docking" on a stationary target - this is an undesirable behavior. To make the battles smooth and convincing, a ship has two turning speeds. The 'maneuver turn speed' is used when the spaceship is slow enough, and the 'hi-speed turn speed' us used otherwise.

The different turn speeds are very important to give a good visual feeling to the player. They won't allow a fast spaceship to do a sharp U-Turn, resulting in taking some distance before turning to attack an stationary target, and also allowing ships to dodge their pursuers (they won't be able to keep on the spaceship tail because it, being slower, will turn faster. The pursuer will then need more time to adjust it's own speed to be able to turn back to their target).

To keep the battles more chaotic, the spaceships will search for a new target every x seconds of time (or fragments) - even if the previous target didn't die. The new target is decided by the 'Distance Then Cone Target Fetcher Behavior', which will try to find the best target within an ideal distance from the ship, and closest to straight forward direction. This allows the ships to give up on some dodging target to aim at a new target that just happens to be within range and weapons angle.

The final challenge was to not allow the battles to move too far away from the player. This was solved with a guard position and distance. If the ships go too far away, they'll abort all engagement and come back within an ideal distance again.

Finally, Allan then fine-tuned the parameter so we could see fun battles. Phew. It was some work to do. But the results are neat! Here's a Web Build. Use left and right mouse buttons to spawn fighters! May the force be with you.

Web Build!

sábado, 6 de dezembro de 2014

Finding your art style when you can’t draw

As the first post of our newest project, I wanted to talk a little about choices and choosing.

First some introductions. The game name is Drifter's Last Stand. In short terms, your ship is always going forward (you can’t control), you have two cannons you can aim with your mouse to shoot enemies, and you can build turrets in your ship that will shoot enemies for you. And enemies are always coming (always!).

We have two persons in the team, both programmers “by nature”. Although one of us can draw

(like this)

for the limited time we have (until the end of the year), we preferred a simple solution.
My mind was “drifting” between Desktop Tower Defense and Geometry Wars. Two simple art styles that I was sure we could reproduce in time. 
Desktop Tower Defense
Geometry Wars

However, we thought that a great part of the idea of this game was to really recreate a space feeling (as in outer space). You know, like in Space Battleship Yamato 2199, when they jump out of a dimensional portal and there are thousands of enemies surrounding them? That’s the game we want!

If you are a fan of space operas, go watch Space Battleship Yamato 2199.

So after some search, (roll the drums) we settle on…tchan tchan tchan tchannnnn…this! (Thanks a lot Skorpio)

A modular ship construction pack!


If you are an artist, check this tutorial by the author of the Space Construction kit http://opengameart.org/content/spaceship-tutorial

Anyway, with both packs it’s fast and easy to build your own space ship! So we did it, and so far these are the results:

This is the player's ship:

As commented before, the player will control two cannons, shooting with the left and right mouse buttons, and aiming with the mouse:

The best part about this modular art pack is that the pieces are fitting really easily and nicely. So, this is the ship, without and with the cannons highlighted:


 Now what we are missing are the turrets. The player will have 8 available turrets to build. These turrets will be placed over slots distributed in the ship. Slots and Turrets look like this:


In the ship, they will be positioned strategically (Slots have fixed position and you can only build Turrets on top of them). In this highlighted version, Slots are green and Turrets are blue, and we removed the main cannons:

Finally, putting everything together, the player ship will look like:

And now what? We still have to test this art style with players of course. 

Unfortunately we don't have a lot of time, so if this proves to be lame (through a few friends evaluation), will probably revert to triangles shooting squares. 

But if this gets approved, we already have some ideas for enemies (which we will improve depending on how fast we can complete our task list):

So far that's it. Again, many thanks to the author of this spaceship art pack, Skorpio http://opengameart.org/users/skorpio

Leave comments if you have them, and see ya next week