Posts Tagged ‘development’

Multiple Android controls for Super Flying Thing

Tuesday, August 9th, 2011

Most people tell us that the game controls are not fine yet, at least for the Android version. Based on that, we are working on multiple control implementations to test and to let the user choose which controls fits best for him.

How we manage the controls internally

To control the Ship, we created a structure named ShipController with two methods:

  shouldReleaseShip() : boolean
  getMovementDirection() : float

The first one returns true if the Ship should be released from the planet, false otherwise. The second one returns a real number between [-1, 1] to determine the rotation direction of the Ship and the rotation speed.

That is just a structure with the values modified by the real controllers, explained next, and processed by the Ship behaviors.

Classic controller

The classic control is the current one, you have to press one half of the screen to rotate the Ship to the right and the other half to rotate the Ship to the left.

Classic Controller

This controller performs an acceleration from 0 to 1 internally to the returned movement direction. This allows the player to rotate in slower but after pressing the controls for a while start rotating faster.

Problems with this controls are that it is too sensitive on Android, it may be enough to find better values for acceleration but we couldn’t find the best solution yet.

Axis based controller

Determines the movement rotation based on a variable Axis and the current pressed position. The Axis could be horizontal or vertical its position is defined with the first pressed position.

Axis based controller

We are just testing and we have to play a bit with the controller values to know exactly if this controller will work or not.

Some options of the controller could be to make the Axis fixed, not dependent of the first pressed position.

Analog stick based controller

This controller behaves like an analog stick, you decide the desired Ship’s direction and the controller will do its magic to make the Ship points to that direction.

For now, the stick center is dynamic and defined with the first pressed position and the stick direction is defined with the current pressed position and the stick center.

Analog based controller

A problem with this controller is we are afraid it could change all the original game play of the game, but could be for the best if it let players control the Ship in an easy way.

We are just testing it also, for now it doesn’t feel easy to use, but again, we need to test more controller values to know that better.

Same as the previous controller, one option could be to have the stick center fixed in some part of the screen.

Tilt based controller

Finally, the Tilt based controller is just that (not implemented yet), control the Ship using device’s sensors, never worked with that before.

No image in this case, should be easy enough to imagine.

An interesting point of this controller is that it let us recover part of the screen and that could be very important for small resolution devices where your fingers could cover a great part of the screen.

Final notes

One interesting point in testing different controls is to understand that different players need different controls, some times they need the game to adapt to them and not vice versa. We are thinking in having a controls menu or something to select the Controller you want to use and maybe some internal values.

Also, some of the controls could work for Desktop version too, have to test them a bit there to see if they fit, could be great to play using only the mouse.

As always, hope you enjoy these kind of posts.

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)

Some funny stuff on Super Flying Thing

Monday, August 8th, 2011

I was testing some code about hierarchical structures for the game entities and I tried adding a laser gun to the ship to see how it looks like and here are the results:

Testing random stuff on the game to test code gives me some new gameplay ideas, for example, shooting lasers to some targets to destroy them while avoiding killing some good targets.

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)

Super Flying Thing – Update 05

Tuesday, August 2nd, 2011

We have a new update with new features, here is a video some of them:

As always, a change log:

  • Added levels 13 and 14.
  • Added a basic AI to control the ship on background game.
  • Added portals which teleports the ship from one point to another
  • Added lasers guns which shots lasers to destroy the ship
  • Added colors to visited planets, to know if the planet is the start planet or not.
  • Added played level status by showing a Tick over the levels on level selection screen.
  • Added time label to show current time on level, will be (probably) part of the game objectives later.
  • Incremented bounds of stars and sprites to make them easier to take.
  • Fixed a bug when finishing the random/practice modes and showing the select level button

(note: if you want, you can follow commit history here)

Remember, you can play it right now, just follow the next links:

PLAY ON PC or PLAY ON ANDROID:

Play on Android

Hope you enjoy it.

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)

Super Flying Thing – Update 04

Friday, July 22nd, 2011

More updates, yay!!, here is the magic list:

  • Added an animated background with the game playing on all menu screens.
  • Added nicer animation for the stars.
  • Added nicer level buttons (nicer than the white rectangle at least).
  • Added fonts for x-small resolution devices like Xperia X10 mini, for instructions screen mainly, thanks @deepinthewoods for reporting that (resizing current fonts didn’t work so well).
  • Changed a bit the Ship 3D animation.
  • Changed again, on Android, to touch the screen to release the ship, but you cannot release the ship while the camera is moving to the starting planet.
  • Fixed a bug on Android when the level started and the ship automatically collided with the obstacles, and when you release the next ship, the game explodes.
  • Fixed level list to start on level 1 not level 0, thanks @tom_orozco for reporting that.
  • Fixed some bugs when touching BACK key on Android devices, you could exit the game if you pressed it too quickly.

(note: if you want, you can follow commit history here)

Remember, you can play it right now, just follow the next links:

PLAY ON PC or PLAY ON ANDROID:

Play on Android

Hope
you
like it!

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)

Super Flying Thing – Update 03

Tuesday, July 19th, 2011

We are testing new controller stuff on SFT for android, new controls sensibility depends on the touch position distance to the center of the screen, that means, press near the center to rotate slower and vice versa.

Also, we have a bug with Box2D on Android version, some times the ship is not attached to the planet and starts to go each time more far away and then game explodes. We are not 100% sure how to reproduce it, we will fix it but for now if you test the game on Android, be aware that this bug could happen.

Finally, the classic update list:

  • New ship graphics based on a super 3d model rendered with Blender (more info on a next post)
  • New texture for the obstacles
  • Now items are a rotating star image
  • New controls for Android version
  • On Android, to release the ship from the planet, you have to touch over it
  • One new level
  • Removed thrust particle effects, at least for now (not sure about them)
  • Fixed a bug that prevent instructions screen to be shown

(note: if you want, you can follow commit history here)

Remember, you can play it right now, just follow the next links:

Play on PC or play it on Android:

Play on Android

As always, hope you like it.

VN:F [1.9.11_1134]
Rating: 5.0/5 (1 vote cast)

Super Flying Thing – Update 02

Friday, July 15th, 2011

Super Flying Thing has new features:

  • Moving obstacles
  • New levels (we have 10 levels now)
  • Cool level names (at least some of them)
  • Ship thrust particle effects
  • Explosion particle effects when hit an obstacle
  • Smooth camera movement when ship dies

Here are two videos showing some of the new stuff:

(note: dunno why both videos preview images looks so bad)

Remember, you can play it right now, just follow the next links:

Play on PC or play it on Android:

Play on Android

As always, hope you like it.

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)

Super Flying Thing – Update 01

Tuesday, July 12th, 2011

A new version of Super Flying Thing was released, here is a screenshot:

Super Flying Thing - Screenshot

And here a list of changes:

  • Improved a bit controls to be less sensible (keeps being a bit hard on Android though).
  • Added six simple levels on Challenge mode, created using Inkscape.
  • Changed the obstacles to be filled now, as you see on the screenshot, also the planets.
  • Added in game basic instructions.
  • Added a pause screen where you can restart level or ask to show instructions again
  • Added a game over screen shown when you die playing Challenge mode, not 100% sure about how it stops the gameplay

Some stuff for debugging purposes:

  • Toggle controls customization window by pressing 0, this window lets you customize ship’s movement values like acceleration, etc.
  • Take screenshots by pressing 9 (saved on your tmp folder).
  • Toggle FPS by pressing 8
  • Toggle Box2D debug renderer by pressing 7

Now, if you want to play it, links again:

Play on PC

or play it on Android:

Play on Android

We will be trying some new stuff on the next days like moving obstacles and others.

That’s all for now, hope you like the game and enjoy playing it.

VN:F [1.9.11_1134]
Rating: 5.0/5 (1 vote cast)

Super Flying Thing With No Name – New game prototype

Monday, July 4th, 2011

We are working on a prototype for a new game with no defined name, graphics and sounds yet. But, game mechanics are, and they are fun, at least for me (arielsan).

In a simple description, the game is about a flying thing (probably a ship) which should travel from one safe point to another through a series of difficult paths.

Super Flying Thing - Screenshot
(note: I wanted to post a video but I had problems recording it)

There are going to be two game objectives, a main objective of reaching the destination alive and a second objective of taking all the stuff (coins, stars, diamonds, box2d polygons, something) on the level.

Game mechanics are not fully decided yet, the idea is to make simple levels and don’t allow you to receive a single hit on the ship, else you die. However, one option is to have some kind of shield and if you reach the destination with full shields then you have a Perfect score.

Also, game controls are a bit too sensible for now, but game levels are not defined so we will improve control sensibility when we have some levels.

We have some ideas in mind like having a level editor and let players share levels and stuff, lets see what happens.

Finally, if you want to try the game, there is a Webstart and also an APK to download, it will be on Android market when we have a name decided, or maybe with Super Flying thing name.

Play on PC

Instructions:

  • LEFT key to rotate ship left
  • RIGHT key to rotate ship right
  • SPACE to release the ship
  • R to reset the level and generate a new one on random and practice modes

or play it on Android:

Play on Android

Instructions:

  • Touch LEFT half of the screen to rotate left
  • Touch RIGHT half of the screen to rotate right
  • Touch screen to release the ship
  • MENU key to reset the level on random and practice modes

That’s all for now, hope you like the game and enjoy playing it.

UPDATE: added the missing screenshot

VN:F [1.9.11_1134]
Rating: 4.0/5 (1 vote cast)

Second attempt at Highscores for games

Tuesday, June 14th, 2011

Some time ago we started a web application on github named datastore-server which allows us to store data for our games in a remote server hosted on Google App Engine. Since the first data we needed to store was game scores, and we required more specific queries for them, datastore-server end up being a high scores server, at least for now.

We made an introduction of some of the requirements we wanted for the scores server in a previous post, we made some modifications to the basic concepts.

Profile

First of all, we added a new structure which identifies the player and has the following fields:

Profile {
    privateKey : String - a unique private key owned by the player on the client application, used to submit scores
    publicKey : String - a unique public key used to identify scores
    name : String - the player name
    guest : Boolean - if the profile is guest or not
    }

Score

Score structure has been modified to have a profile reference, and also some extra data required for scores filtering improvement (filter by date range):

Score {
    .... (previous data)
    profilePublicKey : String - a reference to the profile owner of the score
    year : Integer - the year the score was submitted (calculated in the server)
    month : Integer - the month of the year the score was submitted (calculated in the server)
    week : Integer - the week of the year the score was submitted (calculated in the server)
    day : Integer - the day of the year the score was submitted (calculated in the server)
    }

The server now provides the following features:

  • create guest and non-guest profiles for score submission
  • submit a score for a game given a profile
  • request scores given a criteria

Creating and updating profiles

To create profiles datastore-server provides a query named /newProfile with two parameters:

  • name : String – represents the name of the profile
  • guest : Boolean – if the profile is guest or not

The query returns the profile structure as JSON so that the client can save the private and public keys that are generated on the server.

We also provide a way to change a guest profile name and to make it be non-guest using the /updateProfile query:

  • privateKey : String – identifies the profile
  • name : String – the new name we want for the profile

Submitting a new score

To submit a new score we now need a guest or non-guest profile, it still uses the same query /submit with the same parameters plus the profile privateKey.

Requesting scores

To ask for the scores of a game we have the /scores query with the addition now of two new parameters:

  • distincts : Boolean – if scores should be filtered to return only one score per player (optional, true by default)
  • range : enum { day, week, month, all } – filter best scores by today, this week or this month respectively (optional, all by default)

So, for example, if you want the 50 best scores of the week for a game, you will query /scores?gameKey=something&limit=50&range=week.

Datastore Java client

Finally, to communicate in an easy way with datastore-server we created a Java library named datastore, also on github, which abstracts all communication stuff using apache http-client and also provide classes for score and profile concepts.

If you want to see high scores in action, you could play Face Hunt on PC here or on Android here, also you could take a look at the source code here.

Both projects datastore and datastore-server will probably change in order to incorporate other data storage beside scores.

Hope you like it.

VN:F [1.9.11_1134]
Rating: 4.5/5 (2 votes cast)

Animation4j – Synchronizer

Friday, May 13th, 2011

In this post I will talk a bit more about animation4j project, particularly the Synchronizer class.

When working with transitions we could want to declare them in a seamlessly way. In a previous post I introduced the Transition class which lets you define a transition of an object from one state to another but it requires manual synchronization from transition object values to your own object values. In retrospective, that doesn’t seems the best way to achieve seamless usage.

Meet the Synchronizer

For this reason, animation4j provides a class named Synchronizer, which handles all the synchronization internally for you. To create a new transition you have to declare something like this:

	// create a synchronizer in some part of your initialization code
	Synchronizer synchronizer = new Synchronizer();

	// create a transition in some parte of your game logic, for example when the user press something
	Vector2f position = new Vector2f(100, 100);
	synchronizer.transition(position, Transitions.transitionBuilder().end(new Vector2f(200, 200)).time(500));

	// this will perform the synchronization, it will set to my object the current value of the transition.
	// normally this call will be on an update() method of your game
	synchronizer.synchronize(delta);

	// so now my object will be update with the new values
	System.out.prinln(position);

note: I used a Vector2f class in the example because it is a known class, all libraries have a Vector implementation.

In the previous example, I create a transition of a Vector2f class from (100,100) to (200, 200) in 500ms.

To register a new transition to be synchronized you call transition() method and each time synchronize(delta) method is called, Synchronizer will perform synchronization of all registered transitions. The registration method comes in to flavors, one will modify the object you pass but it only works if you are using a mutable object. The other one works over the field of an object using reflection and calling public set method to modify the internal field. It works for both mutable and immutable objects because it is setting a new value each time, however, one pending improvement is to modify current field value, instead creating a new one each time, when the field class is mutable.

Synchronizer class could be used in a static way using the Synchronizers class, which holds an internal singleton instance to do all the work. That is really useful when you want to use the synchronization stuff wherever you want. However a restriction is that it will updates all registered transitions and that could be a problem if you have different states for your game, for example, a pause game state which keeps rendering a playing game state, you don’t want the transitions started in that state to go on, so in that case could use different instances for each game state.

TransitionBuilder is your friend

Another interesting stuff added to the library is the TransitionBuilder class provided inside the Transitions class. In previous versions, there were different methods to create a Transition using the Transitions factory class, one only specifying speed, other specifying speed and end value, other specifying speed and the interpolation functions, and the list goes on and on. In order to improve this, the TransitionBuilder class was created. It lets you specify the parameters you want when building a Transition, for example:

	Transition transition = Transitions.transitionBuilder().start(v1)
		.end(v2)
		.time(5000)
		.functions(InterpolationFunctions.easeIn(), InterpolationFunctions.easeOut())
		.build();

The previous code will create a transition from value v1 to value v2 in 5000ms using the declared interpolation functions to interpolate between the internal values of v1 and v2 (as explained in a previous post).

These classes simplify a lot working with animation4j but there is still a lot of work to do in order to improve usage and internal performance.

VN:F [1.9.11_1134]
Rating: 0.0/5 (0 votes cast)