US vs Europe, Texas vs Italy – Episode 2

January 28th, 2016

Here we are, ready to do shopping. Jacket, keys, the phone, ready to do it.

“Gentleman start your engine”…

Few miles and here we are in front of one of the most diffuse supermarket in the Austin zone: Walmart, HEB, Target, Randalls. These are all good options: right price, right quality. But we are here to spot the differences between the two country, and here we go:

  •  Few miles, yes, few miles. Nothing except in Downtown (the center of the city) can be reached by walk. You have to take a car and drive but don’t worry the omnipresent traffic most of the time keep going, never stops, and you are able to reach every place in a couple of minute. Forget the Italian roads: here everything is huge and a mile of road usually is just a matter of 1 minute (really!)
  • And after driving at 50,55,65 Mph you have to stop, yes, you should stop. As I’ve seen in many European country people here have a wide respect for pedestrians. So when you drive in front of the main entrance of a mall often you’ve to stop 15 meters (50 feet) ahead of the crossing point. Don’t be surprised: I’ve seen many times vehicle brake and stop in presence of the stop sign, they really stop the vehicle, 0Mph, wait and then restart, also if no one is around. Keep calm, they are calm.
  •  Flavors inside a mall can vary and most of the time are different from any our previous experience: the Mexican food, their spicy receipts, the different kind of vegetables influence it. But don’t worry. Taste it and let’s go inside.
  • I’ve taken the wrong way? no, sometimes entrance and exit are just a matter of convention but there is no a real partitioning. In some mall you enter (and exit) directly in the middle of the shop without anyone (yes, no one!!) that look at you. The cash, the checkout, is not a tunnel 1mt wide you are supposed to take without any escape way but it is more a wide space with some cashier, 2mt one from each other. The sensation is that anyone trust anyone. It’s incredible. It’s amazing.
  • Take you cart man! No coin? no problem! the cart here are free to use, no coin, no lock, just use them. No limits? no, a limit is in place: usually marked with a yellow line on the sidewalk there is a magnetic field that lock the wheels of your cart, so pay attention to that. (As engineer I could say that the lock happens on the axle of the wheel, like if the magnetic field is able to “unount” the ball bearing seizing it up – no easy way to restore it, you’ll have to carry your bag by hands from now on)
  • Make your tour and keep a look to any kind of discount. Some place have a “fidelty” card, some others give you a discount in the form of a $5 gift card. One of the most common disclaimer is “buy one get one at 50%” that means: you can purchase the second with a 50% discount. Some times I’ve seen discount applied if you purchase 10 items of the same kind…
  • Pay attention to the “best is consumed before a date“, they do not have very strict regulation about this and some times products are already “expired”.
  • Sizes…ha…I won’t tell you anymore how everything here is huge. So don’t think to be able to find a liter of milk or a 4 wurstel package…be ready for a gallon instead and at least a 8 wurstel package. Welcome in Texas!
  • Employee. So often they ask you if you need some help, just say “just looking” or “no thanks”, they don’t want to do anything strange, they are really in there to help you: they use to smile and to be friendly. When you’ll have the chance to say “thanks” to one of them don’t be surprised if instead of a “you’re welcome” or a “no problem sir” they simple say “mhmh” or “ahah”: it’s a common behavior, just to be shorten. Don’t mind.
  • Well, now your cart is full. You’ve already computed the price..yes, about 100 dollars. Place the item on the conveyor belt for the checkout as usual and…wonderful…the cashier is placing the items in a bag for you! But…something happens…please, it does 108$…what?!?! Yes, in Texas as in most part of the US the taxes are not included in the exposed price. In Texas taxes are around 8% and…that is!
  • Credit card or debit card? do you want cash? (yes you can use the cash of the supermarket also as a “bankomat” or, more properly, as an ATM point) do you want to receive our credit card? (yes, supermarkets have their own credit card) Up to you! But please, please, take note of your zip code: some old shop still use the zip code instead of the PIN as the credit card with the chip here have begun to be used just a couple of years ago.
  • Argh, now you are able to see my fault: yes, I lied. The bags are not huge and heavy but smaller and cheaper. Tiny difference but not of any relevance.
No more surprise man! But it’s a little bit late to come back home and start cooking. What about a fast food? So let’s move and see what we’ll take!

US vs Europe, Texas vs Italy – Episode 1

January 26th, 2016

Welcome in U.S., that’s the sentence used by the policeman on the border after checking your documents. You walk outside the limited access zone reserved for internation flights arrival and you see the sun again walking on a sidewalk.

What’s the difference between Italy? you’ve still to recognize it as at the same time everything and nothing are different. Let me show you.

  • The clock. In US the time is not reported on a 24h scale but on a friendly 12 AM/PM scale. That’s ok, you can say, my father has an analog watch with a 12h display…can you imagine you take lunch at 12:30PM? as the 0:00 doesn’t exist you have to figure out that midnight is 12:00AM and the noon is at 12:00PM…easy!
  • Yes, you’re in time for your meeting at the closest hotel, no airplane lost, at least not now, and you can take the complimentary airport transportation in order to reach it, for free. Free? not really, better if you have a couple of dollars in your pocket to bill the younger boy that will bring you to your meeting. Welcome, US is the country of tips!
  • Tip, this is something that doesn’t exist in Italy. Well, when asked, what’s the right amount? between 12% and 20%, tip under 12% and you are behaving in a very bad way, around 15% is usualy the right one: no concern from both side, 20% means that you are grateful to your waiter for the amazing service.
  • “Morning” or “Hello” is a good way to begin an interaction, usually followed by an unexpected “how is it going?” or “How are you doing?” both “automatic” reactions to a greeting, sometimes these don’t imply an answer but “fine” as answer could be enough whatever is your real situation. You can reply with the same question without care about the answer.
  • Usually Texans are not angry people, they use to smile and they are relaxed, so…play the game, be happy, don’t hurry, don’t run, greet whoever interact with you.
Are you in the city for some days? so tomorrow could be the right time for going into a Mall, or a supermarket: Wallmart, Randalls, Target, HEB, up to you. See you tomorrow then!

The Ten Commandments of Egoless Programming

January 31st, 2014

In the life you must be happyAs far as you know in the last months I changed my work looking for answers about software craftmanship and looking for a new exciting working experience. I’m happy to say that all the goals have been reached.
One of my targets was to understand the phylosophy that permitted during the startup of Quest Rush project ( I was leading it in that period ) to work in a very funny and productive way. Everyone involved in my team was happy, proud of what we was doing, and proud of what we achieved.
I found strange that there was no a definition for a similar approach to the work.

At the end I found out: “Egoless programming”. Below the core of that phylosophy.

The Ten Commandments
The Ten Commandments of Egoless Programming, as originally established in Gerald M. Weinberg’s book The Psychology of Computer Programming:

  1. Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry, so we can, and should, learn, laugh, and move on.
  2. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered.
  3. No matter how much “karate” you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed.
  4. Don’t rewrite code without consultation. There’s a fine line between “fixing code” and “rewriting code.” Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.
  5. Treat people who know less than you with respect, deference, and patience. Nontechnical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don’t reinforce this stereotype with anger and impatience.
  6. The only constant in the world is change. Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, not as some serious inconvenience to be fought.
  7. The only true authority stems from knowledge, not from position. Knowledge engenders authority, and authority engenders respect – so if you want respect in an egoless environment, cultivate knowledge.
  8. Fight for what you believe, but gracefully accept defeat. Understand that sometimes your ideas will be overruled. Even if you do turn out to be right, don’t take revenge or say, “I told you so” more than a few times at most, and don’t make your dearly departed idea a martyr or rallying cry.
  9. Don’t be “the guy in the room.” Don’t be the guy coding in the dark office emerging only to buy cola. The guy in the room is out of touch, out of sight, and out of control and has no place in an open, collaborative environment.
  10. Critique code instead of people – be kind to the coder, not to the code. As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.

The human principles of software are truly timeless; The Psychology of Computer Programming was written way back in 1971 and it is still a must-read book. Personally I discovered myself an Egoless programmer since I left Milestone where I did my first years of experience as lead programmer: in that period I worked too much on code and must-to-do things instead of involve people and understand them. A lesson learned.

The daily egoless compare with others “egoless” programmers and people can make this job more productive and fun than you can imagine.

Ducati Challenge strikes again!

September 17th, 2013

@3:02 – what amazing work! Yeah!

After more than 2 years from the first release Ducati Challenge still remains a good product for its usability and its graphics on all iPhone and iPad devices. It has been a great challenge for the small team I was part of, and after 2 years I’m still proud to have worked with them and to have enjoyed more than 2mlns people.

A new huge spin: life is changing!

June 28th, 2013

After 5 years in Digital Tales is come the time to start a new work journey. I left a very good team of programmers and artists after a 5-years of professional time spent engineering and writing the Digital Tales Games Framework.

Why am I changing? for a lot of reasons and honestly it is hard to define which one is the most relevant. In every case, before any word spent or spent in the wrong manner I want to say a huge “thanks” to Digital Tales and to the people that was working in it during these 5 years.

In the last months I did some considerations:

  1. IT technologies are continuously evolving at high speed
  2. I’m really passionate by engineering problems ( in a lot of fields )
  3. I can drive a team keeping it compact and passionate about their work, making feasible reaching a milestone or complete a goals in time
  4. After 10+ years in game development and experiences in other IT fields I’ve got something to tell, experience to share.
  5. I’ve got 35 years and I want to run in the huge IT world, too early to sit down.
  6. I’ve got a beautiful family and I need to run in order to guarantee to them the best future available.
  7. I still want to learn on daily basis in order to keep my knowledge as wide as I can
  8. I want to look at a different kind of projects
  9. I want to know how other peoples manages their team
  10. I want to improve my ability in writing programmers activities planning looking at others application field.
  11. A change of work can boost my passion and making me able to do a new step in my professional career

Some of these consideration are needs, some other generates needs, that doesn’t fit with my recently daily activities in DTales.

As some mine ex-collegue said: “make no-sense to spent 8h at work of every day without be completely satisfied or involved, probably is better to change work”. I think he is right: believing in team and in the power hidden in everyone passions this is the more honest approach to your work, your team, your employer.

There are a lot of different kind of working solutions each one interesting each one with its amount of new knowledge, its magnitudo of involvement, its risks, its required effort. I’m happy to see that my vision of the work match greatly with a large number of studios and that my needs and skills well combine with employers needs.

But now is the time to wait that a door on a new fresh reality will open. It is the time to take a breath before a new journey will force me to (happily) run again.

Run for my family, wait with my family.

Know where my skills can drive me…can make of this one of the most important and exciting choice of my life.

Hoping to have news soon…good night, Stefano

Junior coding hit again: 8 lines are better than 5

June 26th, 2013

In my daily activities, as for every programmer, often happens to go down in the library stack into code written by another programmer, or into a really old piece of code in your base libraries. Sometimes simply happens that a function is labeled “getWidht” instead of “getWidth” and the correction is easy, safe, costs just 5 seconds ( a lot of time less than the amount of time needed by a series of programmers that in a search of “width” in the code base miss to find this function).

Some days ago my eyes, and my debug cursor, broke into a destructor of a tree node. I believe that is hard to write a worst destructor, more long, with the same waste of CPU cycle. ( Usually I accept waste of CPU cycle if that can improve readability, write a smaller function, more clear code, or if it can avoid some tricky code – e.g. hard to mantain – )

Here the code called by the destructor in order to erase its children nodes:

//Original version
void CTreeNode::deleteChildren() {
	if (m_pChild) {
		//s and d as var: source and destination? no, they are simple without meaning
		CTreeNode * s = m_pChild->m_pBrother;
		CTreeNode * d = NULL;
		while(s != NULL) {
			d = s;
			s = s->m_pBrother;
			//Safe delete check for null is surely != NULL
			SAFE_DELETE( d );
		//Why the code was written to destroy the head of the list in another way?
		//Safe delete again..the pointer is surely != NULL
		SAFE_DELETE( m_pChild );

What do you think about:

void CTreeNode::deleteChildren() {
	CTreeNode* pCurrent = m_pChild;
	while( pCurrent ) {
		CTreeNode* pTemp = pCurrent;
		pCurrent = pCurrent->m_pBrother;
		DELETE( pTemp );

Please remember that it is called in the destructor, so the object CTreeNode on wich the function is called will be deleted.

I think that senior programmers and junior programmers differ also in things like this. Be a senior programmer is like to be a mother tongue: you don’t need to think at each sentences you write, you will simply write them naturally and speedy in its best formulation. Writing code well isn’t an option; the waste of time that will be generated by this coding style is high: junior programmers can learn from bad code and they will duplicate it, senior one will be scared by it and in general discovering bad written function decrease the “trust” of programmer on their base code. Be a senior programmer means to be able to write naturally good code and have a more sense of care for it.

Have a good day,

Bravura: Quest Rush is incoming!

May 9th, 2013

The first of a series of early gameplay videos showcasing some core mechanics for our upcoming game “Bravura: Quest Rush”, a 2D time-driven action-RPG.

Some optimization for soft-particles

April 3rd, 2013

Hi all, Easter is just gone and this is my “gift”.

Looking inside your 3d engine particle system there is a special kind of particle: the soft-particle. They are used to draw clouds of tiny particles: smog, raised sand, exaust, fires.

I don’t want to copy here the Nth copy of an article about how to implement a soft-particles system: you can google the topic and you will found tons of different implementation for different shading language, 3D API and different level of knowledge.

The topic of this article is to cover the performance aspect of a soft-particle system. All implementations have in common:

  • Access to Z-Buffer ( wider as screen )
  • Access to the front buffer ( wider as screen – obviously )
  • Rewrite of a lot of pixels. “Soft” means: not hard, not totally opaque; so a large amount of pixels in the back-buffer are read and written  a large amount of times
  • All informations stored (depth) in the Z-Buffer need to be converted from camera space to world space for every pixel of particles
  • large particles or large amount of particles can easily break down your system performance

Keep in mind that we are speaking about soft-particle: clouds without well defined edges and usually without high contrast patterns ( such as black and white close lines, B/W checkered zone, etc ).

We can optimize the rendering process using following tricks:

  • reducing the memory band-width requirement for Z-Buffer acces using a 0,5x or a 0,25x size copy of the Depth buffer
  • Apply a single time the transform that convert the z from the camera space to world space ( you will loose something in precision but we are rendering clouds…with not well defined edges ) during the creation of the 0,5x ( or the 0,25x ) texture ( the Z-Buffer copy )
  • rendering all particles to a small texture and then blitting them to the back buffer. That will give a gain in terms of memory bandwitdh requirement and also the total amount of blending operation decreases ( obviously )
  • small particles ( select your threshold ) can be rendered directly on the front buffer ( to avoid them to completely disappear ) still using the reduced in size Z-Buffer.

Hoping that small trick can help someone, @next time, Ste.

For completeness, a pdf from NVidia:

Unity 4.0: directx-11-competition

February 2nd, 2013

Original blog post: Unity Blog

A very simple and funny way to recognize all the new opportunities provided by DirectX11.

Very little quiz…answer promptly!!!

January 31st, 2013

In C++, what is the result of the following operations?

2 + 2 = ?
2 * 2 = ?
2 ^ 2 = ?

I admit: yesterday I gave the wrong answer. Fortunately today I saw someone thinking enough in front of the last question.

The right answer is 4-4-0! The operator ^ is the XOR operator not an alias for Pow(). 

Hoping you enjoy. Goodnight, Stefano