AngelHack & GGO12 Recap

The winners for GGO12 have just been announced - congratulations to the winners! There were some great entries and a lot of cool ideas, and the best thing is the games are open source so it’s good for other developers to read through.

I didn’t actually submit a playable game in the end. You could walk, jump and run over a grid, and that’s about it. As soon I had to import 3D models and make the scene I fell short of expertise and time! With more time and better 3d modelling capabilities the project would have been great, though I’m happy with what I’ve learnt about 3D web development and Three.js. You can see the (poor) finished article here.

Part of the time during GGO12 was also taken up with AngelHack London, which was an absolutely incredible experience with some fantastic people. There were some very good ideas created there with great teams backing them; hopefully we’ll see some successful new startups from this year’s competition.

3. A Basic Framework to Build From · #GGO12

Hi! Welcome back to number three in the Github Game-Off 2012 series. In this post we’re going to create a framework for our prototype of a Three.JS game, using RequireJS to organise our code into neat modules.

Why use RequireJS (and a very brief introduction)

RequireJS is a module loader for JS which, in short, means that you can split your code up into lots modules and have each file focus on one part of your game (or app). It might seem like nothing when you’ve not used it before but seriously – seriously – It’s a godsend and can save you so much time developing when you don’t have to hop around in the same file looking for things. Use it!

Why prototype?

The prototype is a critical step. We’re going to build a very basic prototype of our game initially so we can test the concepts without spending too much time on it… And testing just the concepts is something I can’t stress enough. It’s going to be super-low fidelity (think moving around some spheres) because the majority time spent will be coding these concepts – cloning a character, hopping back in time, remembering character paths and actions etc.

Continue reading

1. The Idea · #GGO12

The GGO12 page says the game has to be loosely based around the topic of Git. Branches, forks, clones, pushes, pulls… use the vocab to create your world, and there’s a lot of options out there for you.

Looking at it, the idea of branches, forks and clones instantly made me think of being able to control and manipulate time as if it were a network timeline. I’ve been playing about with the idea for the last hour and, so far, the concept is workable but the story needs tweaking.

Continue reading

#GGO12

With a trip to China and Germany and a bat#### insane amount of work it’s been a busy half a year, and the Magento import series didn’t make it from it’s half-screenshot, half-written state on my desktop. Neither did my pimp burgers from hamandburger.com. And seriously, those bad boys were pimp enough for any food connoisseur. Not ideal.
Not any more. With Github’s Game Off 2012 just under way (no more than a day old, in fact) I’m going to write up my entry from the initial idea to finished article. I fear it’s not going to be pretty and it’s not going to turn out how I see it right now but hey, that never stopped anyone, right?

So, good luck to everyone in the competition, and let the games begin!

Next up: 1. The Idea

Using Sphinx within Magento, plus optimising search result rankings, weights and relevancy

If you’ve used a Magento store’s search function or dabbled in Magento development you’ll know that the default Magento search is a steaming pile of abhorrent, frothy cack which produces search results as irrelevant as Ask Jeeves. It can’t even search by product name without serious pollution in the results.

Luckily, with the aid of the Sphinx open source search engine, it’s not difficult to fix, and I’ll walk you through start to finish in this post, ending with sphinx search in Magento that kicks serious ass.

This walkthrough builds upon this forum post, incorporating field weights and stemming to ensure your results are in prime condition.

Continue reading

Automatically importing products into Magento when your data is ****: Part 2

In this series of posts we’ll go over an example of an import plugin for magento that refines messy CSV data and automatically imports it, creating configurable products where necessary. Here’s the link to part 1, if you missed it.

Recap

In the last post we:

  1. Listed the categories in our Magento website
  2. Determined that we’d have faceted search and configurable products
  3. Defined every product attribute we need to extract from the data, and which ones were configurable.

Now we need to get cracking on creating the actual import plugin.

Magento import plugin features

Before development we need to summarise the objectives we need to achieve. Most of the time your import plugin will need the following:

  1. An admin panel listing all past imports. This panel should contain a grid showing:
    1. The starting time and date of the import
    2. The ending time and date of the import
    3. The number of products disabled, enabled, added and updated
    4. The number of products skipped due to errors in the data
  2. A form to load a new CSV and manually start an import
  3. A cron job to scan a directory for a fully-uploaded CSV file and automatically start an import
  4. The ability to extract product attributes from our messy CSV for importing

The first two points are fairly standard for a Magento plugin and we’ll walk over them briefly. Then we’ll talk over the cron job, extracting product attributes and the actual import process in more detail.

Magento import plugin architecture

Now we know what the plugin needs to achieve we need to know the overall import process. It’s incredibly important to plan this out in depth – by writing each stage in a diagram and by documenting exactly what happens in each stage you can be completely sure that you’ll start developing the right thing. As a side note I didn’t do this and I ended up writing this plugin 3 times; that’s a tonne of wasted time and I don’t want you to make that mistake!

That in mind, here’s our architecture:

You can see that we’ve got six different import stages:

  1. Importing data from the point-of-sale CSV export
  2. Refining the messy data the POS system produces
  3. Disabling indexing (doing this shortens the total import time by over 2 orders of magnitude)
  4. Disable products that no longer exist in the POS system (we don’t delete because of past orders)
  5. Add, update and enable all refined products
  6. Enable automatic re-indexing and re-index everything

This, along with the admin panel and cron checks makes up our import plugin.

In the next blog post we’ll go over the creation of the admin panel, form for manual imports and cron scheduling (the easy bits). It won’t be that in depth and will assume you’ve already got a knowledge of the XML that makes up a plugin, and if you don’t you should see here.

Until next time!

Automatically importing products into Magento when your data is ****: Part 1

In this series of posts we’ll go over an example of a plugin that refines messy CSV data and automatically imports it, creating configurable products where necessary.

Intro

Refining messy data. It’s a tough job, but it needs to be done. Maybe your client’s running an ancient point of sale system which they won’t leave because it will cost them too much money (and ironically you’re being paid to find a temporary workaround). Maybe they just can’t be bothered to trawl through thousands upon thousands of products, manually sorting data into a pretty awesome looking CSV.

Nightmare. It can be near on impossible. Nevertheless, it can be done. I won’t lie: it’s a complete pain in the ass, but you will get there.

The Situation

Lets say you’re running a website which has 3 completely different product types: carpets, sofas, and accessories to go with all this stuff. You’ve got to take one huge spreadsheet with data mixed all over, refine it so it actually makes sense, and get that in Magento as products.

The Data

Here’s a snippet of how the data might look:

Continue reading

A new blog!

While I’m busting out 16 hour workdays on Magento for the ad agency I work for I thought it’d be a good idea to get a blog going… Something to document the process and the lessons as it’s happening. God knows I’m too lazy to go back over work and write about it after!

Luckily, wordpress only takes a second to install, literally (much love, installatron). Unluckily it’s coming with wordpress’ default theme and the comment spam, which is a huge ballache. Still, better than the blank page that was sitting there for 2 years!

Time to start work…