Friday, 9 December 2016

Xmas betting second bet - PaddyPower

Despite what the title says, it's not really betting. There's no gamble - I've got every eventuality covered; there's no risk because whatever the outcome, either my back bet or my lay bet covers the cost of the other (all except a few pence, referred to as the qualifying loss). In fact, matched betting is actually pretty boring. To be successful, you need to know where all your money is - which means keeping meticulous records; it's like really, really boring accounting.

Anyway, having raised £14 from the first promotional offer, having chosen bets that completed within just a few hours, it wasn't long before I was ready to move onto the next offer.

This time, I chose Paddy Power. Paddy offers 3 x £10 free bets to (new) customers who place a £10 qualifying bet. At five-to-eight on a Thursday evening, there's not really much sporting action to choose from, and Paddy's odds aren't particularly great, but my first (qualifying) bet was:

PaddyPower: Inter Milan vs Sparta Prague, £10 for the draw result at 3.4
Betfair: Bet against the draw result £9.32 at 3.65

This immediately unlocked 3 x free £10 bets on the Paddy Power website.
While I should have been choosy about which sports to place these bets on, in order to maximise the profits, I'm not playing this game for the "long term". I've no interest in "protecting" these accounts; if the bookies don't like what I'm doing and ban me after taking the free bets, I'm not much bothered (some people spend a lot of time trying to make their betting accounts look like they're a "regular joe" to get repeat offers and thus the opportunity to make more money over the long term).



So with my three free bets, I went for:

PaddyPower: Southampton v Hapoel Beer Sheva, £10 on an away win at 6.50.
Betfair: Bet against Hapoel Beer Sheva, £8.15 at 6.8

PaddyPower: Partick v Celtic, £10 on the draw at 6.5
Betfair: Bet against the draw, £8.15 at 6.8

PaddyPower: £10 to win on OutSam at Cheltenham (next day) at 7.50
Betfair: Bet against OutSam, £10.20 at 7.4




As it turns out, Inter won 2-1 so I lost the initial £10 bet at Paddy Power, But over in Betfair, I won £9.32 (£8.85 after paying commission). So the free bets cost me £1.15 to unlock.

The Southampton game ended in a (surprising) draw. So that free bet at Paddy lost. But over in Betfair, the lay bet returned £8.15 (£7.74 after commission)

Celtic thumped Partick by 4 goals to 1, meaning another free bet was lost. Which in turn meant another win over at Betfair, to the tune of £8.15 (£7.74 after commisson).

OutSam fell in the 1.30 at Cheltenham, so PaddyPower were unlikely to pay out on that one - free bet or not. Which means that over in Betfair, I ended up with another £10.20 (£9.69 after commission).

So adding that little lot up, it comes out at 9.69 + 7.74 + 7.74 = £25.17
Let's not forget that it cost £1.15 to qualify for the free bets, so total made on this sign-up offer was 25.17 - 1.15 = £24.02

Out of a maximum possible £30 (the Paddy offer was for £30 in free bets) that's a 24.02/30 * 100 = 80% return. Really good matched bettors aim for a 75% - 80% return. To be honest, I'd be happy with 70% or less - after all, it's not like I'm spending any time looking for decent matches/returns; just to churn through them as quickly as possible.

So to date, I've had £14.51 from Coral and £24.02 from PaddyPower; that's £38.53 after just two sign-up offers. Not a bad start....






Thursday, 8 December 2016

Getting the bookies to pay for Xmas

A while back, a few of us did some matched betting. Mostly we've been dabbling with "reload" offers and free bets every now and again, but now it's time to get some proper money in (matched betters can pull in £1k a month or more, but it's a serious, almost full-time occupation). We just want a few hundred quid, quickly and easily, in time for Xmas.

The first time I had a go at this - spurred on by Matt - I managed to create about £700 over the course of six or seven weeks. Instead of taking the money out and going off on a holiday or buying something nice (and much to the chagrin of my partner) I re-cycled the cash, repeating the process for other people, friends and family. Matched betting paid for three or four Christmases in 2015. This year, there's only one I want it to pay for - mine!

So while everyone else benefited, I just ended up with a couple of betting exchange accounts. Today they're worth £643.50 (I had a go at "trading" the betting markets and after a promising start, I quickly lost the few hundred quid I made and realised that I was never going to make a gambler!) So between now and Xmas, I'll be doing some matched betting to turn free bets into cash. Here's how it started....

Firstly, my Betfair account had a starting balance of £436.80 (the remaining £206.70 sits in a Smarkets account, ready for use later on). You don't need this kind of balance to do simple matched betting - but a larger balance you can go for higher odds (and thus turn more of the free bet value into cash) or - as I intend to do - have multiple bets on the go at the same time.

I signed up for Coral and deposited a fiver, backing the horse Quaffal in the 17:55 at Chelmsford at 4.33


I then went to Betfair and stuck £4.87 against Quaffal at odds of 4.5


As it turns out, Quaffal lost the race. I lost my initial fiver, but won £4.87 on Betfair. So overall, I was 13p down (actually, it turned out I'm 24+13 = 37p down, because Betfair take 5% of all winnings as commission). Still, 37p down wasn't bad. From a £5 stake, that's 37/500*100 = 7.4% (ok, on reflection, maybe that's not brilliant - a qualifying bet should be around 5% maximum; more on this later).

Anyway, I lost 37p. But, as part of the Coral sign-up promotion, they give me 4 x free bets worth £20. So that's £20 worth of free bets for 37p. Not a bad result!

At this point, there are two ways I could go - stick the free bets on a horse and hope for the best. After all, there's plenty of cash to be won with just one lucky selection, and even if all further bets lose, I'd only be 37p down. Or - my preferred method - turn the free bets into guaranteed, risk-free cash. Obviously the rewards are much less - but there's no risk, it's guaranteed cash. And that sounds like a no-brainer to me! With the four free (£5 each) bets, I placed the following bets at both Coral and Betfair (each pair of bets placed pretty well at the same time):


Coral - £5 on Vimy Ridge at the 17:25 Chelmsford at 8.0
Betfair - £4.19 against Vimy Ridge at 8.4

Coral - £5 on Versant at the 17:55 Chelmsford at 7.0 (free bet)
Betfair - £4.03 against Versant at 7.8

Coral - £5 on Burning Heat at the 17:55 Chelmsford at 5.3 (free bet)
Betfair - £3.87 against Burning Heat at 5.6

Coral - £5 on Burning Heat at the 17:55 Chelmsford at 5.4 (free bet)
Betfair - £3.58 against Burning Heat at 6.05


It's just as well I went for the guaranteed free cash option, rather than hoping for a big win: not a single horse I chose won! On the plus side, I'd only spent a fiver at Coral, and my Betfair statement now reads:



That's 4.87 + 4.19 + 4.03 + 3.58 + 3.87 = £20.54 in winnings.
Which - after Betfair take their 5% commission - means £19.51 more cash in the Betfair account than when I started. Not forgetting I spent a fiver to place a (losing) bet at Coral in the first place, that's £14.51 more in total. And all for about ten minutes work!

If you're thinking of doing something similar, the trick is to have plenty of cash to hand. Trying to do this with limited funds is possible, but much more difficult. Having a decent starting balance in Betfair - and having the cash available to deposit into the bookies to claim the free bets - makes things much easier (and quicker, as you can do multiple sign-up offers at once).

Now, matched betters amongst you reading this might complain that I'm not getting the best value for my selections - but this is all about getting through the offers quickly; and by sticking to races that complete within an hour or two of placing the bets, means everything is settled and all the money is where it needs to end up, much more quickly. It also helps that the bets losing at the bookies means the money appears back in the Betfair account within minutes of the horse race finishing.

So that's where we're up to:
One bookies free bet offer down, £5 "staked" and we're £14.51 up after ten minutes.

On to the next offer.....

Thursday, 1 December 2016

Attaching armour to an armature rig in Blender

We're not entirely sure that this is the correct way to go about it. But here's how we managed to create our characters in Blender, and still maintain an object hierarchy after importing into Unity, allowing us to switch armour elements on and off at runtime.

Firstly, everything we wanted to be able to turn on and off is created in Blender as a separate model/mesh. We did this by creating the objects in one instance of Blender, and copy and paste them into the model containing our character.

This kept the UV mapping and so on, but allowed us to position armour over our soon-to-be-exported-to-Unity character.


After scaling and rotating the objects into position, we then parented each piece of armour to the rig, using automatic weights (we're using the Rigify meta-rig in this example rather than the generated rig, but the principle applies to any rig really). Sometimes, after parenting, the piece needs tweaking to get the rotation/location exactly right.

Then we select our single armour piece and enter weight-paint mode. The automatic weights mean that each piece of armour inherits all of the vertex groups from the model. We simply find the one that best matches the location of our armour, and delete all the others for the selected piece of armour.

Then, with just a single vertex group displaying influence over the armour piece, we paint it to the highest degree of red possible. In effect, a single bone (or vertex group controlled by one or more bones) moves the armour - this way it can't bend or deform as multiple bones fight for control over the armour.



To check everything's working, we saved the file and copied it into our Unity Assets folder, and dragged an instance of the character onto the stage.


Not only does the armour conform to the model/animation, but we still retain the entire object hierarchy, so that we can switch armour elements on and off for different character types/player positions in our game.


Coupled with being able to change textures at runtime, this should give our players plenty of scope for customising their own characters in the game!

Now the only thing really left to do is to create some custom animations for our orc characters. For some reason, applying humanoid animations to these particular characters ends up making them look a little bit... well, gormless.




Wednesday, 30 November 2016

Changing textures at runtime in Unity

One of the things we're keen to get working for our Unity game is the ability to customise Fantasy Football characters. As different characters have different amounts of armour, we're modelling the characters with every possible armour piece attached, and then disable them at runtime in Unity.

To be able to do that would be pretty cool.
What would be super-cool would be to have the player design their own team strip (perhaps using some kind of web editor) and then have their players clad in their own custom colours.

To do that would require generating and changing textures on-the-fly. Now we're pretty sure - with some PHP and GDI+ - we can generate the appropriate png at runtime. What we need is a routine to allow us to change the texture of an object at runtime in Unity.

Luckily, it's not that difficult:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class loadTexture : MonoBehaviour {

   public GameObject target;
   public string web;

   // Use this for initialization
   void Start () {
      if (web.Length > 0) {
         StartCoroutine (loadImage (target, web));
      }
   }

   private IEnumerator loadImage( GameObject page, string url ) {
      WWW www = new WWW( url );
      yield return www;
      page.GetComponent<Renderer>().material.mainTexture = www.texture;
   }


}

We set the script up by dragging the orc skin into the "target" field, and setting the URL to our (local) web server.


When the game engine runs, our orc appears with the default green skin:


But when the next texture has finished downloading, the skin colour changes immediately.


It's only a little thing, but it's pretty exciting for our game idea; we've potentially got the ability to allow players to create (and download) their own team colours - and in Unity it simply means loading a new (single) texture/png from the web server.

When playing against an opponent, the Unity app could download their team colours, thus allowing both players to completely customise their own teams - and have their team colours appear in other people's games.

The original (or, more accurately, the second edition) Blood Bowl boardgame came with a number of "endzone" markers, for different teams. The game was very much about customising the teams - creating your own team name, mascot, insignia, team colours etc. In the game, the endzones at the end of the playing surface were simple double-sided strips of card which could be swapped out depending on which team(s) were playing.



Not only could we provide players with the ability to create their own team colours, we could even have custom in-game end-zones by simply swapping out a texture or two.

Now that would be pretty cool.....


Tuesday, 29 November 2016

Blender and weight painting

So far we've managed to import an existing Unity Asset into Blender, create our own mesh, unwrap UVs, use existing UVs and add a custom rig.

In truth, the rigs that come with Unity Assets are almost impossible to use for animating in Blender - quite often the bones are disconnected and each faces upwards/outwards.


After doing some research into motion capture software (particularly using the Microsoft Kinect, but more on that later) we worked out why this might be - but it doesn't help us, when we want to create our own, custom animations from within Blender. We need to throw this set of bones away and use our own rig to animate the mesh.

And to do so isn't exactly trivial. It's not especially difficult either - at least, not to get a mesh moving to a skeleton. But it is tricky to get it working as well as the original Unity Asset. This is mostly because - it turns out - of weight-painting.

So far, whenever we've parented a mesh to a rig, we've used the with automatic weights option. Which makes it work. But not without problems. The most obvious example of this is around the hips; check out this walk animation.





Watch the bit at around 17 seconds in, where the character walks towards the camera. Notice the "trouser line" where the waist meets the hips. That moves around quite a bit. Which is fine for an organic shape (a humanoid shape covered in fur, for example) but if this character was indeed wearing a belt, things would look a little bit funky.

And that's because the hips - in this model - are weighted above the belt-line. Compare that to one of our imported models.


In order to display the weights on each bone, there are a couple of things to do first - obviously we need to be in weight-paint mode. But in this mode, there's no easy way to select a bone on the model - luckily we can use "vertex groups" to select the points on the model that are effected by each bone.

If we move the hip bone on the model above, there's a very definite "line" where the deformation stops acting - just below the "belt-line".


When we inspected the weights on our imported models, we noticed that where the effects of different bones start and end, the weight painting is the same for both bones.


Note how the lower leg bone affects the shin area mostly, and the knee area is green (affected quite a bit, but not any further up the leg). The upper leg bone affects the thigh area and the knee area is also green. The affect of the upper bone goes no further down the leg than the knee. This ensures that there is no "overlap" between the  two bones, so they do not "compete" for influence over the mesh.

Which means our next Blender project will be to rig a model, apply some custom UVs, and weight our custom rig to create a similar behaviour. Right now it's getting a bit late, so that will have to wait for a few days....

Sunday, 27 November 2016

Blender FBX import - where are the UVs?

In the last couple of years, we've racked up quite a bill on the Unity Asset Store. A good few hundred quid a last. Some of this has been for plug-ins or shaders, but the bulk of it has been for models.

Quite often the characters come with animations, which is great. But if they need altering slightly, or a new animation is required, or the model needs a bit adding/removing, things get a bit trickier.

Most often, Asset store characters are supplied with the models, in FBX format. And Blender likes FBX. But when you import the model into Blender, quite often, you don't quite get what you'd expect...


Here we imported one of the soldiers from the Toon Soliders pack (an amazing character set, btw, with some really nice animations thrown in, as well as a mecanim-ready rigged character). But even after setting the view to textured the model appears as a solid, blank canvas.

If we go into our UV editor....


... there's nothing there!


Even if we select the model, and the material that came with the FBX....


... nothing doing.  We tried to load the texture into the explorer panel on the right, but the model stubbornly refused to render with the material/texture we've set.


The way to do it, is to select the model, enter edit mode, select all faces (not edges or vertices)...


Then select UV view from the bottom-left option in the menubar.


Bingo! We've now got the UV shapes - but there's still no sign of the texture. To fix this, in UV view, load the appropriate texture/png from disk.


If you've selected the right texture, everything should line up just right. Go back to 3D view and, hey presto!


Now our imported character looks just like he should, when used in Unity. To prove this, save the entire .blend file into your Assets folder and flip over to Unity. Drag-n-drop the character into the scene (Unity automagically imports .blend files using the built-in FBX importer, so no need to export again) and apply an animation.


Choose the most appropriate shader for the model, by selecting the character in the explorer, expanding the list and selecting the mesh:


Hit play, and watch your (Blender modified) character come to life!


Friday, 25 November 2016

New press-n-peel printer

After a mis-hap with our Dell laser and some acetate (seriously, Steve, what did you think would happen, putting thin plastic through a thermo-nuclear-hot fuser?) it was time to get a replacement.

Just over a year ago we tested a few different printers for use with both genuine press-n-peel blue (which currently costs a staggering £5/sheet) and the cheap yellow chinese alternative we bought (10p per sheet)

Surprisingly, we were able to go into a shop - a real, physical shop made out of bricks and everything - and pick up a desktop Xerox Phaser for around £120.


(Another) Steve at Kings Printers in Brighton was incredibly knowledgeable about printers, feeder ports, toner components and so on. He also did a lot of research on our behalf, contacting toner manufacturers (and a fair few "compatible" providers) before returning the same conclusion we'd already come to: for press-n-peel, Xerox is best.

And after a quick test with our cheap alternative paper:


Good, strong, solid black. No scaling or broken traces. Although we forgot to photograph the final board (it was etched, lacquered and put into a final product before we thought to photograph it) you can see the quality of the Xerox print for press-n-peel use.

In short, if you're struggling with press-n-peel (a lot of people do, and we regularly get questions about how to get the best results from non-optimum papers) you could do a lot worse than upgrade your laser printer.

A genuine desktop Xerox is much less expensive than we were expecting - and the results speak for themselves!