To build or not to build (a level editor)

Posted on : 17-03-2011 | By : franciscotufro | In : Uncategorized

0

For the last few weeks I’ve been working on Gravity Maze a game/prototype that uses the idea of gravitational forces moving an avatar to solve mazes.

The goal for this game was getting it done quickly and reusing as much code as possible to reach a deadline for a contest.

One of the problems that arose was the interaction between the avatar and the maze.

I had two ideas in my mind:

  1. Using a mask for the walls of the maze and detecting collision with a pixel-by-pixel technique.
  2. Using a physics engine.

I chose the physics engine for many reasons.

What did it mean? That each wall in the maze was part of a body, this way I could apply a rotation to the body and the whole maze would rotate. Also we got the avatar’s collisions and bouncing for free.

Then another problem arose: how to design levels.

There were a few options here too: creating the levels by hand, or developing a level editor.

I suddenly realized that both options would kill the project. Both were too complicated.

Constructing a level editor is a long development task, and doing the levels by hand was a lot of work. Both were so time consuming that conflicted with the main goal of getting things done quickly.

Then I recalled an old project I built in 2005. It was a regular polygon generator that used the n-th root of unity. The interesting thing about that project was that it generated an SVG using the vertices from the equations.

The idea came to my mind: we could use Inkscape to design the levels! We only had to parse the XML (SVG files are XML files) and bingo!

I started to work at once and, after three hours, we had successfully finished an XML parser that loaded all the walls into the physics engine.

I must say that this simple idea made the difference between finishing the project on time and losing it. I think it’s a great option when there is little time.

If you plan to use this on your next game, be careful! Read the generated XML all the time since Inkscape uses matrix transforms when you move or rotate objects and groups. Either have your parser handle this or design the levels carefully taking care that no transformations are applied.

Another cool detail to have in mind is that Inkscape allows you to add custom attributes to objects. I used them to define the maze’s start and finish.

I’ll be waiting for your comments and hope you still use FLOSS and let
your head innovate on new ways to use existing stuff!


Gravity Maze

Posted on : 17-02-2011 | By : Francisco Tufró | In : Uncategorized

0

YouTube Preview Image

Gravity Maze is the first game released by quov.is

Take a look at the gameplay on the video and if you like it, you can download it for windows from indiePub

Hope you like it! I’ll be waiting for your comments :)


Sobrevivir

Posted on : 02-12-2010 | By : Francisco Tufró | In : Uncategorized

0

YouTube Preview Image

Continous Integration Session @ UBA

Posted on : 07-09-2010 | By : Francisco Tufró | In : agile + scrum, ruby and rails

0

Here’s the video (in spanish) for my session on Continous Integration.

http://www.exactas.uba.ar/uti/?p=62


Extended Attributes

Posted on : 09-06-2010 | By : Francisco Tufró | In : computers

0

Today I’ve learned something new.
Trying to do a push on a git repository, I got this strange error:
arandela:gitosis-admin nictuku$ git push -f

Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 340 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpacker exited with error code
To git@quov.is:gitosis-admin.git
! master -> master (n/a (unpacker error))
error: failed to push some refs to 'git@quov.is:gitosis-admin.git'

Then I’ve started to see what was going on, with an ls I noted something strange:
That @ after the permission on marquete.pub

arandela:keydir nictuku$ ls -la
..
-rw-r--r-- 1 nictuku staff 403 Jun 9 19:12 arandela.pub
-rw-r--r-- 1 nictuku staff 398 Jun 9 19:12 ganchito.pub
-rw-r--r--@ 1 nictuku staff 394 Jun 9 19:16 marquete.pub
-rw-r--r-- 1 nictuku staff 404 Jun 9 19:12 tornillo.pub
..

That’s how I knew the existence of extended attributes, to see them, just type:

arandela:keydir nictuku$ ls -l@
total 64
-rw-r--r-- 1 nictuku staff 403 Jun 9 19:12 arandela.pub
-rw-r--r-- 1 nictuku staff 420 Jun 9 19:12 bob.pub
-rw-r--r-- 1 nictuku staff 405 Jun 9 19:12 fedemika.pub
-rw-r--r-- 1 nictuku staff 398 Jun 9 19:12 ganchito.pub
-rw-r--r-- 1 nictuku staff 395 Jun 9 19:12 hudson@quov.is.pub
-rw-r--r--@ 1 nictuku staff 394 Jun 9 19:16 marquete.pub
com.apple.metadata:kMDItemWhereFroms 234
com.apple.quarantine 85

To remove them:

arandela:keydir nictuku$ xattr -d com.apple.quarantine marquete.pub
arandela:keydir nictuku$ xattr -d com.apple.metadata:kMDItemWhereFroms

Removing them solved the problem, I pushed to my git repo happy as ever…
Shit happens.


Vector graphics with proper anti-aliasing

Posted on : 03-06-2010 | By : Francisco Tufró | In : Uncategorized

0

My friend Juan Vuletich has been working on a stunning project to render svg’s with a great antialiasing technique using DSP.
Check it his results at http://www.jvuletich.org/Morphic3/Morphic3-201006.html
Congrats Juan, this is amazing.


A few ideas for teams that want to become agile

Posted on : 13-05-2010 | By : Francisco Tufró | In : agile + scrum, computers

0

In the world of agile methodologies, we find ourselves facing a constantly-repeating scenario: teams that decide to become agile after more than 2 or 3 months of work.

Certain difficulties arise and need to be overcome in order to accomplish this goal. A few of them come to mind and I wanted to comment on these:

Understanding methodologies and their goals


The agile practices proposed by each methodology or process have a purpose: they attack particular problems and provide solutions to them.

It is vital toward correctly implementing an agile process that the team be accompanied by somebody with experience, who can interpret the needs of the project and its members.


If we talk about Scrum, the role of ScrumMaster is necessary for correctly implementing the process. Many teams that decide to use Scrum designate a person from the team to be ScrumMaster and all they do is read a book and get down to work.
This is not always enough, it is possible that the person designated as ScrumMaster does not interpret the texts properly or that they draw erroneous conclusions based on previous experiences with non-agile methodologies.


In order to ensure a correct implementation, I absolutely recommend hiring a coach for a few months to train the team to work in an agile manner, and having the person designated to be ScrumMaster work alongside the coach during that entire period. One possible alternative (if hiring is not an option) would be to contact people from the local agile communities in gatherings or through mailing lists and describe situations that could be of aid to the team. Agile communities are generally willing to help simply out of love for agile practices.


Many teams fail at implementing Scrum because they lack professional help, and not only that, when they fail they are left with a bitter taste of Scrum and agile methodologies and they end up falling into the old and inefficient project organization models.


In short: hiring or at least keeping close at hand an experienced coach to guide you through the implementation of agile methodologies can determine the team’s success or failure. It is always important to participate in local agile communities.


Implementing continuous integration

Continuous integration is a set of practices that help toward the team’s efficiency and solve frequently encountered problems in a simple way.


Continuous integration may prove difficult to implement correctly if the team lacks experience. The recommendations from point 1 also apply to continuous integration.


Some of the problems and fears that I detected while talking to development teams mostly have to do with automated testing.


NOTE: I am going to take the liberty to use testing and automated testing as synonyms, but bear in mind that they are not the same.


Automated testing of applications is unfortunately not taken into account when educating developers. They are generally used to manually verifying that a piece of code actually does what it should do, which becomes impossible in large projects, resulting in regression problems and a great deal of bugs.


Testing helps solve this problem and is a vital organ in implementing continuous integration and, at the same time, is perhaps the practice at which most teams fail and flush everything down the drain.


It is common for projects over 2 or 3 months old to find themselves facing the dilemma of incorporating automated testing because the work implied by testing the code already programmed would stop development for a long time, which is unacceptable.


My recommendation for this scenario is fairly simple and it is based on the idea that something is better than nothing.


I propose that teams do the following: starting today, all new code must be tested. This will allow us to at least begin trusting our new code.


So what happens to old code? It cannot be trusted, clearly. But we can do the following: let us assume that old code works well, and every time the need arises to make a modification, we write tests to verify that piece of old code. This way, you will see how in a short time you will have achieved a very high coverage on the old code.


The experiences I had using this technique made me see that 2 or 3 months after starting to implement it, the application’s coverage approaches 80%, which is not bad at all, and the best part is that there was no additional expenditure in order to reach this percentage.



I have a favor to ask: if anybody implements this, please send me your statistics. All I need to know is the initial coverage status and how long it took you to reach an acceptable percentage (75-90%).


Another issue that makes teams flush agile practices down the drain is the use of TDD. To TDD or not to TDD, that is the question.
TDD requires previous knowledge about test creation. Writing tests that verify the application (and satisfactorily at that) is not an easy task, not easy at all.
My recommendation to teams is that if you do not have experience in writing tests, then seek implementing TDD as an ultimate goal, undergoing an intermediate process in which you make it your business to learn how to write automated tests.


This process should not last longer than 2 months. Achieving familiarity with unit testing frameworks, understanding the use of mocks and stubs, implementing functional and integration tests is something that can take a long time. In fact, I am not too sure that you can ever learn it all, but it is not necessary to be an expert in testing in order to do TDD.


On the other hand, if we are not doing TDD, we have no way to make sure that ALL the important code in our application is being tested. In order to analyze this and detect possible lines of code that are not being tested, we can make use of coverage tools. Each language has its particular coverage tools, and it is up to the team to find one that they like and that suits their needs well.



Thanks marquete for the translation!

Continous Integration session in FCEN UBA

Posted on : 01-05-2010 | By : Francisco Tufró | In : agile + scrum, computers

1

Sorry, this entry is only available in Español.


Tobias Mayer en Argentina

Posted on : 21-12-2009 | By : Francisco Tufró | In : agile + scrum

0

Sorry, this entry is only available in Español.


Environmental Seeder – New Ruby on Rails Plugin by Me

Posted on : 19-11-2009 | By : Francisco Tufró | In : computers, ruby and rails

0

I’ve just released Environmental Seeder, a simple rails plugin to allow seeding databases according to the environment you’re in (for example filling testing, staging and production databases with different data). I’ll paste the README below for you to check out how it works

EnvironmentalSeeder
===================

EnvironmentalSeeder is a simple addition to db:seed to allow loading environment specific data through seeds.rb without
any programming.
Take in account that this task doesn't replace the existing one, just appends the environmental specific seed loading.

Installation
============
Install it just as any other rails plugin

$ script/plugin install git://github.com/franciscotufro/environmental_seeder.git

Example
=======

Just use seeds.rb to store the data that goes into every single environment and use db/seeds/[RAILS_ENV].rb for specific
environment data to be loaded.
For example, a default admin user that should be created on every environment should be put into seeds.rb

db/seeds.rb
--------
User.create(:login => 'admin', :password => 'secret', :password_confirmation => 'secret')

Then, if you want your staging environment to have one post written by admin

db/seeds/staging.rb
----------------
admin = User.find_by_login('admin')
Post.create(:title => "Some data to populate staging environment", :author => admin)

Now, if you run

$ RAILS_ENV=staging rake db:seed
Loading seeds_staging.rb

That's all, you'll have your staging database populated with the admin user and a post, hope you enjoy it!

UPDATE: The guys from rails envy commented my plugin in their 101 podcast.