Your Portfolio Gave Me Diarrhea

Friday, October 1, 2021

When we advertise for jobs we get a lot of applications. It can be frustrating to go through job applications and to be honest I really hate it, but I love finding new talented people to work with so I do it.

We don't have a job application email address now because they are frustrating to go through. It's easy to be flippant and annoyed, but each application is a person aspiring to move forward with their life, and then you get their resume and you can immediately see 5 things they're doing wrong. And the fact they're doing it wrong in this applcation probably means they're spending all day applying for jobs, getting it wrong all over the place.

Ideally we'd email each person back and let them know where they're going wrong. Ideally we'd at least email back to say hey thanks but your application was unsuccessful, here's some ways you can improve your application and please try again in 6 months. But we'd spend all day replying to emails if we did that. We probably need to hire someone to do it, but who is going to go through the applications for that?

So here's some of the biggest problems I've found when going through applications.

Accepting Applications?

Don't email asking if we're accepting applications. Just send your portfolio.

Include Nothing

You can't expect to apply for a job as a 3D Artist with a PDF containing just your home address and the name of your school. Show me what you can do. Show me your art.

Two Second Videos

Instead of linking me to thirty short videos can you put them all in one big video please.

Passwords

Please don't link to 10 videos and have a password on each one. Don't make me copy and paste a password to view a video.

I appreciate that some of the stuff you're linking to is confidential, but isn't an unlisted video just as good?

Zips

Why are you zipping up 4 pictures instead of just attaching them in the email. Why has the zip got a password on it. Why is the password in a pdf.

Game Saves

I'm not going to blindly download your game save files, put them in a game, load the game and walk around.

At least put screenshots of what you created, something to convince me to go to all that effort.

Done Nothing

If you're applying for a job as a modeller I'd expect your portfolio to be full of models. It's your job - you're going to have done it a lot. If you're only showing two models I'm going to wonder how much you like doing this.

If you're applying for a job as a concept artist you should have more than 2 drawings on your portfolio.

Maybe you're taking your older work down because you have evolved since then and think it looks bad. Keep it up. Make it obvious that it is historical. I like seeing people get better.

Photos

I don't need to know what you look like.

Vimeo

For some reason Vimeo takes 20 seconds to start a video for me. I've got 1gb internet and it takes 20 seconds to start a video. And even then it stops to buffer. I think this is more of a problem when videos are rarely viewed - like portfolio videos.

I'm sure there's a good reason people prefer uploading their videos to Vimeo over Youtube but I'm not convinced. Please upload your videos to YouTube.

School Grades

I don't need to know your school grades. I don't need to know that you worked at Aldi when you were 17.

If you're including a resume I'm only going to look at it to see what other game studio experience you have. If you don't have any then you're best off not including it and focusing me on your portfolio.

Broken Links

Make sure your links work! Click them before you send the email!

Copy and Paste

If you're copying and pasting your application to a bunch of different companies be careful. If you're mentioning the company name in the email you're probably going to mess up and forget to change it. Don't mention it.

Don't send the email to a ton of companies all together - it looks bad. If you have to just use BCC so it's at least less obvious.

In Engine

If you're applying as an animator or 3D artist then I want to see your work in a game engine.

Your renders are nice and show that you understand how to compose an image, but I also want to know you have a basic understanding of how game engines work - because that's the job.

Twitter Baby

Don't include a link to your twitter if it's just arguing with other twitter users over nothing.

Do link to your twitter if it's pages of you showing off your art and skills.

Out Of Date

Here's a link to my portfolio I have done a lot since then just ask if you want to see it.

LODs

If you're applying as a modeller I want to see your ability to made LODs.

At a minimum I want to know that you know what a LOD is.

Overboard

Please don't make a special personalised website or a personalised video for your application. It's really nice that you want to put that much effort into selling yourself.. but it's a job application - not a talent show. The way to sell yourself is to show what you can do.

It makes us feel terrible when we don't hire you.

Bad Fit

Are we a fit for you? Have you played our games? Do you understand what we do?

If your portfolio is full of cutesey 2D games but you're applying to work on Rust we're going to wonder why. Maybe get ahead of that and call it out.

Motivation

Friday, September 24, 2021

Someone asked me a while back where I get my motivation. It's spite.

Garry's Mod

I'd have probably lost interest in Garry's Mod within a couple of weeks. There was one thing that drove me forward.

It was called HL2World. It had a forum full of people that hated me and hated GMod. They were big fans of another mod called JBMod and were pretty militant about it.

So a lot of my motivation came from lurking their forums. They'd say Garry's Mod was shit because of some reason, then I'd spend a month fixing that thing. Then I'd stalk the person that made the post to see if they changed their mind.

The more they hated me the more motivation I'd get. People who hate you tell you the truth - they don't make the best of it - they attack you with every flaw they can find. That's useful if you want to fix things in a game.

The good thing about the HL2World guys was that even though JBMod pretty much immediately ceased development after it hit, they held onto the belief that one day there would be a big update and it'd stomp Garry's Mod.That wasn't likely to happen, but it was likely enough to drive me to work hard to make sure it didn't.

Just out of spite.

Rust

Rust launched in early access and got really popular really fast. Too fast for us. We realised it needed a total rewrite. Huge sections of the code were over-engineered, webs of dependancies for no reason. It was hurting development.

So we called that version Rust Legacy and I started making a new version along side it. From scratch.

A lot of people didn't like this. They saw what it was, not what it would become. They swore that we were killing Rust and that they'd never play new Rust and would stick with Rust Legacy forever.

So I'd stalk them on reddit and the forums. Any complaints they had I'd address in a way that not only solved their initial issue but was a million times better than how it worked in Legacy.

The biggest reward was watching them disband their impossible position and start playing the new version. They thought I was making the game better for money and career, but I was doing it because they pissed me off.

We got married

Thursday, September 16, 2021

Me and Sarah got married this year, finally, after 11 years together. I've sropped blogging as much as I used to, because it's hard to believe that anyone gives a fuck, but I've documented every other major relationship event here, so I should probably do this too.

I used to be militant against marriage. I find it hard to remember exactly why now. I think it was something about how everyone just does what everyone else does, mixed in with something about how much control over weddings the church and govt have.

As I've got older that all seems a bit stupid. Sarah never really asked to get married, even though it must be shit as fuck to have a different name to your kids. I'd planned to propose for a long time, but really wanted to wait until the kids were old enough to remember the day. We'd waited anyway, so why not wait on purpose.'

Covid

We were meant to get married last year. We'd booked a place, we had the date, I even went to a wedding exhibition.

We got an email offering refunds from them because of lockdown and stuff. I told them to keep the deposit and hold the date, if it falls though it falls though. Then the guy phoned me and said don't tell anyone buy they're going out of business so to definitely take the refund.

New Place

So we found a new place. And it was nicer. It didn't have a green carpet and we could get married outside. So we were happy that the first one got cancelled.

Sarah really took control of everything, she loved party planning. I've got no opinions.

Covid, again

Covid was still causing issues, so we changed our date even further back, to where it surely would be safe. A couple of months later the govt came out and said they were going to lift all restrictions on a certain date, and that date turned out to be a week before the wedding, so we couldn't believe our luck.

But when the time came, they decided to have another two weeks to decide what to do.

So we were looking at the wedding and thinking about cancelling again. We wouldn't be allowed to get married outside. Even though it's outside it has to be under some kind of structure. The structure was 2 meters wide. There had to be 2 registrars and they had to be 2 meters apart, and 2 meters away from us. We couldn't fit our dinner guests because each guest needs 2 square meters and there wasn't enough square meters. It was all so stupid.

So the wedding we were facing was indoors, in a smallish resturant, with half our guests outside because of limited numbers, and everyone wearing masks - including us. There was a tense call with the wedding planner where half way through Sarah cried and walked off and left me in stunned silence.

Marquee

So we started looking at solutions. If you got a marqee and had one side opened that counted as outside. So each guest only needed half a square meter.

Even the govt chipped in and made special exceptions for outside weddings, so that was all solved too. We were happy.

Weather

With Covid dealt with, we could start worrying about the weather. If it pissed down we'd be getting married indoors anyway, with half our guests, and all wearing masks.

As the wedding got closer I was checking the weather on 3 different apps. They all agreed that it was going to rain.

Big Day

The big day came and it didn't rain. It looked like it could, but it didn't. It was hot without being too hot. It all worked out great for us really.

We'd purposely kept it to just family.. so there weren't any nerves. Everything was nice and relaxed, lets get married, lets eat some food, lets go to sleep. The only thing that really hurt was the first dance. That was the worst 4 minutes of my life.

A few days after the wedding a bunch of the guests got covid, including Sarah and Alex. So we hadn't really escaped it at all.

Let me tell you something though, there's nothing that will ever beat that feeling of getting into bed on your wedding night, knowing that you don't have to think about getting married anymore, that it's done and out the way. Lying there defragging your brain, deleting all the stuff you no longer need to remember. The best feeling ever.

Unity Quiz

Sunday, September 6, 2020

You want to get the bounds of a mesh - which is best?

What would happen if you try to access the UnityEditor namespace in a build?

Which is called first?

If you're starting a new project, which UI system should you use?

Which Load Type should you choose for a footstep sound?

How do you exit out of a coroutine early?

Mathf.Lerp( 0, 100, 0.5 )

To move an object in a framerate independent way, multiply its velocity by

When destroying an object, which is called?

 

If you think you're done, press the button below to see your results

Everything We Watched In Lockdown

Thursday, September 3, 2020

Palm Spings

Like groundhog day. We liked it a lot.

Ted Lasso

American guy comes to England to coach a premier league football team. We like it a lot.

Future Man

Really enjoyed it. Wolf's love of cooking makes it.

Extra Ordinary

Enjoyed, especially when he morphed into his wife.

Flipped

Watched 3 episodes and had enough.

Police Academy

Bought to watch with the kids. Way more blowjobs than I remember.

Freaks and Geeks

Still watching it, but we enjoy it. We watch an episode when we have nothing else to do.

Nathan For You

I'd watched all of this except for the last episode where Bill Gates goes looking for his old girlfriend. So I watched that episode. Was alright. Didn't know how much was fake so didn't know how emotionally invested to be.

Homeland

We watched from something like season 3 to the end. Got worse and worse as time went on. By the end we were just pushing through to the end because we'd come so far.

They went from Carrie figuring out all this shit and being super smart and street wise, to looking shit up on 4chan, getting kidnapped in every episode and fucking up every decision.

Something that sticks in my memory was the bad guys were looking for Quinn for some reason, and had all this security system and soldiers everywere. Then out of nowhere a soldier runs up to the head soldier with a print out of a cctv of Quinn. He spotted the guy they were looking for, and then printed it, waited for it to print, then carried that to his boss. That out of everything else annoyed me the most because I can't get it out of my mind.

Dave

Awesome

Dead Pixels

We're still watching an episode every now and then. I like it, I don't think Sarah likes it as much.

What We Do In The Shadows

Hit and miss. The episode where Matt Berry became a bar owner was good.

Brave New World

Too much shagging. Watched one episode.

Stath Lets Flats

Good.

Best In Show

Mostly shit, but had some good bits. Whenever the kids are annoying me now I say STOP NAMING NUTS

Ant Man And The Wasp

Bought to watch with the kids. We watched the first one and enjoyed it, so we were confused when we started watching this one and he was under house arrest for some reason. Turns out we needed to watch another set of films to understand or something.

West World

This season changed a lot, but it's changed enough to be interesting. We enjoyed it.

Rick And Morty

The Vat Of Acid episode was good, none of the rest were.

Friday Night Dinner

The kids love watching this so we've seen every episode 3 times now. It's not a kids show, but they love Jim.

Devs

I really liked this but everyone I told about it ended up hating it.

Avenue 5

Mainly rubbish. It got better as the season went on, but mainly rubbish.

Space Force

Rubbish

The Morning Show

Really good. Something that bugs me about this though. In the show they have this apartment, and it's really recognisable because they have these black metal and glass stairs coming into the living room, and they always shoot the stairs head on. Well it's the same apartment that one of the characters has in Westworld. It's also in Homeland too.

This drove us both insane for a while.

Mythic Quest

Pretty good

Receiver Broken

Saturday, August 22, 2020

A couple of times we've been watching a movie in my cinema and the sound has cut out.

The first time this happened was during a pivotal scene in The Martian, when the sound was really loud. We kept watching because we thought it was an artistic decision in the movie, to just drop it to completely silent to ramp up the tension.

I set a PC up to play games in there a few weeks back. I noticed a couple of days ago that when I played sound just through the back right speaker the amp just turned itself off.

So I googled it, found nothing. Messed with the settings, found nothing. Messed with the connections, found nothing. I swapped the cables over and the sound for that channel played fine though another speaker, so I started to think that speaker was fucked.

I got my multimeter on the speaker wires from the amp. The resistance on all of the speaker was something like 0.5, but the resistance on the right back speaker was 0. So this made me think that the speaker had blew up or something.

So I managed to get it out of the wall and it looked fine. So I tested the wire with it disconnected and it still had continuity.. which could only mean one thing. It'd got fucked somewhere.

I could see the wire went up and to the right slightly instead of straight up. It had metal shielding but not until it'd reached a certain point. You an see the picture above the wooden plank that goes over the top, that had a couple of drill holes in it just aboive and to the right.

So I cut a hole. It didn't matter because it's all covered anyway. And sure enough..

The wire was actually stuck in the dot and dab adhesive they stick the plaster boards on with, but I managed to saw it out and pull it out a bit more. You can see the hole here that peirced it.

I got it all back connected. I'd have liked to have crimped these wires together properly instead of using a connector but I don't know how to do that properly yet.

At this point Sarah came home and walked in on me. She saw the wall all off, the speaker off, plasterboard dust all over the floor and extra holes in the wall. She bought her hands up to her head and said "Oh god, what are you doing now?".

The problem was fixed though, and the wall went back on and you could hardly tell I'd fucked around.

So who's fault was this? You can't really blame the guy who put the wall panels on because he'd done what you would do, which is assume the wires go straight up or straight down. Sure he could have tested.. would a stud finder have found the cable with no voltage going through it?

The speaker cable was obviously going to the wrong spot and they'd had to move the hole a foot to the left. You can see how it would have been impossible to protect the cable from there, because it was stuck in the adhesive.

So I'm going to give a verdict of no blame. One of those things. It gave me the opportunity to fuck around and fix something so no big harm.

My Feet Are Fucked

Friday, July 31, 2020

They hurt when I stand up after sitting down for a while or when I get out of bed. After a minute they stretched out and are like normal feet.

I only realised recently how fucked they are, before that I thought it was something that affected everyone. I think they've slowly got worse over the last few years and now they're to the point where the doorbell goes and I'm struggling to get to the door in time. I think it's a snowball effect too, like I'll ask one of the kids to fetch me the remote so I don't have to get up and have my feet hurt.

I'm guessing it's a combination of being a fat prick and sitting on my arse all day. I've been trying to stretch them out whenever I remember about it, but I think it's doing more harm than good and should probably be freezing them or heating them instead.

What Unity Is Getting Wrong

Friday, May 22, 2020

Developer QOL

When I added Lua to Garry's Mod my intention wasn't primarily to make things moddable. I wanted to make things easier for myself. By wrapping a few functions and coding in Lua I could iterate a million times faster. I didn't have to close, compile and re-open every time, while also hiding all the bullshit and hard stuff.

Unity was about that when we first started with it. They hid all the hard stuff in c++ so we didn't have to think about it. The more time has gone on, the more bullshit has crept to the forefront. The've gone from hiding the hard stuff to moving more and more stuff into C#.

So while other engines have been trying to catch Unity up in terms of developer friendliness, Unity has been going the other way by making itself more unfriendly.

Render Pipeline

Switch to one of the new render pipelines they'll tell you. They're faster, they've got more features. The old pipeline won't be updated any more.

So you've got two choices URP or HDRP. Both are incompatible with each other. Switching is a one way destructive operation. You can't press a button and try it and decide you want to change back a month later. You're converting every material in your project.

This is a good example of something that could have been hidden in the backend. Choose one pipeline and make it the default. Don't have an unsupported render pipeline as your main, default pipeline for 2 years. Sure have low and high pipelines, have low as the default, but come up with a pipeline/shader agnostic material system first so we can switch between them - or even ship both.

UI

There's nothing fundementally wrong with the Unity UI system. Sure it uses transforms so it uses more memory than it should.

But no improvements, no new controls, because they're planning to replace it with UIElements (in a couple of years).

There's a lot they could have done to improve Unity UI. It has bugs. It has a lot of problems with Layouts performing badly (lots of GetComponents in the layouts). It could be rendering faster. It could have a stylesheet system. It could have been gradually improved.

The font system that Unity UI uses could have been improved. But they bought TextMeshPro, packaged it up and you're advised to use that instead. The nice thing would have been to have improved the font system in the backend so everyone automatically benefitted from it. As it is, if you want to use TMP you need to manually update every UI prefab in your game - which again, is one way and destructive.

Multiplayer

I don't even know what's happening with multiplayer. UNet has been deprecated for 4 years. Every page in the multiplayer documentation has this warning. They had a HLAPI and LLAPI being developed a couple of years ago - has that been released, should people be using it?

My nagging feeling is that they're working on something else. Something to lock you into paying for their multiplay services.

They point to the FPSSample to see an example of how to use the network code. The glaring thing about this is that it uses Unity 2018.3.8f1.. and this:

The first time you open the project you need patience! It takes a while to import all the assets.

NOTE: Due to a bug in Unity 2018.3, you have to take the following step right after the initial import: 1 Search for Firstperson_Projection in the Project search field. Select the 4 shaders, right click and reimport them. 2 If you have script compile errors related to entities, you need to remove and re-install the entities package.

Which brings us to another point..

Update: These are apparently also deprecated.

the HLAPI and LLAPI are the old, deprecated things. The replacement they're working on is at least 6 months late, still in alpha, unnecessarily tied to DOTS, and performs badly.

Demos

Unity's demos have always been fire and forget. I'm sure this is hell for anyone coming to the engine fresh, trying to Run a demo that is 2 years old and being in upgrade hell.

This FPSSample should be running on the latest non beta version of Unity. It shouldn't have warnings about import times because they should have solved that. It shouldn't have instructions for working around editor bugs, because they should be fixed. It shouldn't warn you that the multiplayer component shouldn't be used in production environments - because that's what your demo should be selling.

The short movie demos aren't impressive. It's embarassing when half your keynote is a group of artists explaining how they spent 6 months re-writing half the engine to render something that they could made in Maya in a week.

Show me a 100 player PUBG type game running at solid 60fps on a current gen console or mobile. We already know you can render a GTA3 cutscene.

DOTS

Want your game to run better? Recode the entire thing using DOTS. Another one way destructive change.

I can see the benefits of DOTS from a data point of view. I get why it uses less memory, I get that if you're starting a game from scratch you might consider it, I get that it's a work in progress.

I don't get why it speeds rendering up. I don't get why those improvements to rendering couldn't happen in the engine code.

I don't understand why it's being pushed as a solution to everything when it's a solution to such a specific problem and robs Unity of its simplicity and user friendliness. It gets to a point where you just might as well use UE.

Instability

The instability leads to wider problems. Five years ago when you searched for a problem you found someone with the same problem and underneath a solution.

With the fragmentation and the 60 versions of Unity available that's a lot less likely. If you're searching how to do something, the first 5 answers you find are going to be out of date - and they're usually from Unity's own documentation.

Services

So they have a bunch of services. Analytics, crash reporting, cloud build, live ops stuff. They need to make money, that's fair enough.

There's an issue with all the services though - they're all dog shit.

In Summary

An engine works best when it's used as a foundation that can be improved without all the houses built on top of it having to be rebuilt.

There's no doubt that Unity are improving things, but it's like living in a house that is continually being renovated. You've got comfortable in a room, installed all your fitted furniture, decorated all the walls, and then Unity come in and tell you they need to take the floor up again.

Hopefully this is just a bad period for Unity and there will come a time where they stop ripping the floors up.

Lockdown Kicks Ass

Sunday, April 12, 2020

It's weird seeing people struggle with being home all the time. Climbing the walls, bored out of their head, willing to risk the lives of their loved ones just to be in the presence of other humans.

This is my dream existence. I don't have to go anywhere, I don't have to see anyone, delivery guys leave stuff on the doorstep and walk away.

Cancellations

Every few days something pops up in my calendar. A party, a meal, a meeting, Sarah's nails appointment, Sarah's hair appointment. Every time I get a little ping of relief that it isn't happening, I've got out of it without doing anything.

Our wedding got cancelled. We were getting married in mid-August. Even that getting cancelled is a good thing. We don't have to worry that it's going to get cancelled - we already know. We have more time to prepare for next year. I was having stress dreams about the horrible green carpet at the venue.

We were lucky. It got cancelled and we got our deposit back. I'm sure there's thousands of people that were getting married around now that have got really fucked over by it. We didn't lose much apart from the time planning, but even that's a plus because we can treat it as a test run.

Facepunch

Even wierder is how it affects tech companies. You make all your staff go to the same place every day? When the internet exists?

This is how we've always worked. There's only a handful of us that regularly work from the office - and everyone is capable of working remotely (apart from cleaners, receptionist).

I told people that obviously their safety and the safety of their families comes first - so not to sacrafice those things for work - they're going to get paid either way - but that's always been the case.

Charmed

I understand I live a charmed existence. I have a nice house with a nice garden, I have an air conditioned office, I have an alive spose who takes care of our kids and cooks our meals. Not everyone is so lucky.

But I also understand that this could all turn to shit at any time.

My point is that if I've got a computer with the internet, the air is a reasonable temperature, and I am left alone for long periods of time - I am the happiest man on earth.

Half-Life:Alyx is a Masterpiece

Wednesday, March 25, 2020

So I haven't finished HLA yet. According to Steam I've played it for 6 hours so far, so here's what I think.

Fan Boy

Despite making Garry's Mod and knowing pretty much everything about Half-Life 2, I wouldn't consider myself a Half-Life universe fanboy. I enjoyed the story less as it went on. There are things that interest me, mostly the human side, the displaced and downtrodden people. The holocausty aspect of it. The grim discoveries, like the piles of burn corpses on the coast.

Alyx as a character is totally flawless - and that's a bad thing. You like Kleiner because he's dizzy and he has a pet. You like Mossman because she's a slut. You even like Breen because even though he's getting it wrong, he's doing what he thinks is the right thing.

I didn't really enjoy the Half-Life Episodes, I put that down to being too close to the Engine. I was running around looking for new entities and models to exploit in GMod. I didn't care about the story progression, I barely remember what happened at the end of Half-Life 2.

Summary

Alyx blows me away. I just think like, how the fuck can humans make something like this. The detail, the physics, the framerate, the graphics, the gameplay, it's just insanity.

It's a legit work of art.

It reminds me of when we were knocked out by the Source 2, from the scans of magazine HL2 screenshots. Not being able to believe it could be a computer game.

Detail

The detail is immense. You really can tell that every room had people slave over it, they thought about how it was used, the kind of person that lived there, what happened to make them leave.

It's the kind of detail where after a while you stop looking, because you know it's there. Like in real life. You don't pick up and read everything you come across because you know it's a bullshit waste of your time.

The infested areas are amazing. When we saw Xen in HL1 it was just angled blocks with different textures. Now it's a living thing, they've thought about how it consumed its surroundings. There are bits that light up, bits that pulsate, drippy bits, bits that look like balls, bits that look like crossed vaginas. It's total art.

When I first saw the detail I thought to myself.. okay, this is going to be a short game. But it keeps going. There's some obvious prop repetition but you find that in every new area there's new props and textures that you didn't see in the last one. I saw a hairbrush in a bathroom and I've made a conscious effort to see if it was used somewhere else - so far it hasn't.

Lighting

What the fuck is going on with the lighting. How does it look so amazing. Is it just VR thing that makes it look so good?

There's some volumetrics going on here - is that what's making it look so real? They really nailed the lighting.

The normals and reflections on objects when you hold them to the light is insane. I can't really work out whether that's an amazing Valve Art Guys thing or if it's because it's in VR.. because the Rust guns look unexpectedly good in Rust VR too.

I really can't emphasise this enough. They really nailed the fuck out of the lighting.

Gameplay

I'm playing the game on Normal and it seems really well balanced. It's challenging but not impossible. I have enough ammo but always feel like I don't.

I started off feeling like the zombies took too many hits. One bullet through the headcrab should surely be enough. I think it's like this to warrant using the later weapons though.

There's no cheap shots. I always expect something to trigger something else to give a jump scare. Like okay - I'm going to open this door and something is gonna jump at me. I'm gonna pull this switch and that door will open and 10 zombies will charge though. There's going to be a headcrab in this cupboard. None of that though.

The game progresses enough that once you start getting bored of doing a certain thing, it'll introduce something new. The old Valve rules of 3 (see, practice, do) isn't so plainly obvious as it was in the episodic stuff.

It feels a lot less hand-holdy than the episodes.

VR

So what does this do to VR gaming? Are we excited for more VR titles?

Well, it's worth playing standing up and having your face sweat and ache for a couple of hours at a time, and that's a big step to get over. It's an experience that any PC gamer should be getting if they don't already have a VR system.

It's a shame Valve aren't on the catching end of that though. That they don't have their own VR console and that their VR hardware isn't readily available. It's a shame people are going to end up giving all their money to Facebook to be able to play.

It almost feels like it was made out of VR philanthropy, like they know they're not going to make money from it - but it doesn't matter. When everyone said they were finished as game developers, they've once again proven that they can cement their place at the top of the industry for another 10 years.

Open a 30gb Unity Log on Windows

Wednesday, March 11, 2020

We're having a problem with our Rust HDRP branch where it imports forever. We had log files on our build server that were 30gb.

The problem comes when you want to find out why they're so massive. You can search for an app to install to do it, but surely Windows should be able to do this itself? It's 2020.

Log Folder

Your editor log folder is probably in %appdata%/Local/Unity/Editor

Powershell

I've never properly used powershell. I don't know what it is, I don't know how to use it, I don't know why it appear instead of the regular Command Prompt.

But I did find a useful command for this situation.

Get-Content Editor.log -tail 5000

This will print out the last 5000 lines of the file. So we can redirect that to another file like so:

Get-Content Editor.log -tail 5000 > tail.log

This is the first PowerShell command that I am committing to memory because it seems like it'll come in useful in the future.

Done

Now you've got a smaller file that you can open and see what's up.

Now you can send this bug to Unity. They'll ask you to send your 80gb project file. You'll say it's 80gb and that's crazy. They'll ask you to create a small reproduction project. Over 8 long emails they'll accept that this is impossible.

Years later your grand-kids will get an email saying the bug is fixed in the next release. But the next release brings many new incompatibilities with your project and you died a long time ago.

Alex The Gamer

Thursday, March 5, 2020

Alex is 6 years old. His birth (which I documented here) feels way longer ago than 6 years. He's old enough now that he has his own special interests.

He loves video games. Any time he comes in my office to tell me something, he stops mid-sentence and gawps with his mouth open at my monitor before asking me what I'm doing.

Recently he's got into Minecraft. Hugely into it. To the point where we're worried that it's making him autistic. The first thing out of his mouth when he wakes up in the morning is a Minecraft fact. At night he watches Stampy, plays Minecraft on his iPad and then goes to sleep thinking about both of them.

We are sick to death of hearing about how awesome Stampy is. How funny he is, how good he is at Minecraft. Stampy said, Stampy said, Stampy said.

He even makes posters for Stampy

Sarah would prefer to limit it. I know from experience when I was a kid that by limiting it you're making it more precious. So I prefer to give him full access and let him get bored of it - because he's got to eventually - right?

Plus it's got its benefits. Since he's starting playing his reading has got immensely better. He's gained the ability to quickly see, recognise and read words within a fraction of a second, down from about 3 seconds a word.

Alex The Streamer

We've got a cinema in our house (big woop). One day I let him play Minecraft on it. When he saw it on the big screen he said it was perfect because then he could record it with a camera like Stampy. This made me laugh, the idea that streamers need a huge screen to be able to record while they play, but I explained to him how they do it.

So then I showed him how to record the screen on his iPad. When he saw it work he did that dance that kids do, where it's like they really need the toilet.

Here's the result of the first time he did it. I wasn't involved in this at all - I just took it off his iPad and uploaded it to my youtube.

It's so funny to me how he mimics a Stampy's inflection. The phrases he wouldn't say in real life - like "welcome" or "this episode". The fake upbeatness of it all. There must be millions of young kids around the world right now that are stream-capable without even thinking about it.

The day after I uploaded it I told him it'd had 6 views. He was blown away - it had exploded and gone viral on him. He's a superstar. He wanted to get right to work on a new video. I told him that real streamers only make one video a week.

Blazor Ain't Ready

Tuesday, March 3, 2020

I love the idea of Blazor. Getting rid of Javascript and using C# for everything, what's not to love.

Well after trying it for a couple of projects, here's everything that is wrong right now.

1. Google

Google doesn't index Blazor sites. It doesn't load the webassembly. It only parses what's on the page before the webassembly loads.

You could liken this to sites running VueJs - but you shouldn't because Google parses Javascript and indexes those fine.

The suggested solution to this is to also generate the page serverside as a placeholder. If you're doing that you might as well make the whole site serverside imo.

I'm sure if enough sites go webassembly that Google will have to eventually start loading them up and indexing them properly - but it ain't happening yet.

2. Javascript

Unfortunately you still can't escape Javascript.

First of all there's the startup javascript. I'd have thought loading a webassembly would be like including an image, but it's apparently more complicated than that, requiring just under 100kb of javascript before it loads its first wasm.

Then apparently it can't do certain things, like set the page title, or search the page and manipulate certain elements, or draw to a canvas, or play a sound, or get the window size. So you end up having to write shitty javascript interop functions to be able to do what you want. So now you're not only writing javascript, you're writing shitty javascript. You can't help but feel that any performance benefits of using web assembly are flushed down the bog because everything goes though a layer of javascript anyway.

3. Source Code

You'd think since you're compiling to webassembly your code would all be jumbled up assembly that no-one can download and understand? Right?

Nope. It's legit c# dlls. You can download them and decompile to view the contents like any other .net dll.

4. Download Size

Maybe since they're all common Dlls they're versioned and downloaded and cached from a microsoft cdn, so once you've visited a blazor site you already have 90% of the content cached?

Nope. Hope you like downloading 5mb to view a single page with the words "Hello World"

Summary

I love c#, I love doing web stuff, I don't love javascript. Blazor is the answer to my prayers in a lot of ways.

This is all new, so I'm sure all this stuff will get better over time, but for me right now it isn't ready to replace anything that needs indexing that gets casual viewers.

Jailbreaking Control4

Thursday, January 2, 2020

In a previous post I talked about Control4 and mentioned that you can jailbreak it. This lets you do things like add/delete/rename rooms and add/delete/rename devices. Things you'd probably expect to be able to do anyway.

That process was kind of hard and there was a lot of misinformation when you searched, which made it even harder.

So I took a few hours to find out how it all worked, then a few more to write a tool to make it all much easier.

The Old Way

This post describes the old way to do it.

The New Way

I put the tool on github, you can find it here. I feel like it's pretty self explanatory and tries to explain what's happening so you don't get too scared when using it.

For those that are confused, you start it up and press this button

It works on v3.1.0 right now - I haven't updated to v3.1.1 yet (which has made jailbreaking a tad harder).

How it works

The director has a list of public keys that are allowed to connect to it. We generate one and add it to the list.

On the composer side the normal thing is that when a dealer logs in it connects to Control4's servers and downloads a certificate that matches up with an existing one on the server. We're skipping that step by generating matching certificates ourselves.

The composer has some restrictions on the key, the password needs to be "R8lvpqtgYiAeyO8j8Pyd" and the subject needs to start with "Composer_". Once those conditions are satisfied you're free.

Restrictions

You can do everything a dealer can do now.. apart from spend money buying hardware and buying thirdparty drivers. If you want to give Control4 more money you need to do it via a dealer.

Benchmarking Rust

Sunday, December 15, 2019

We have a pretty neat system for Benchmarking Rust.

  • Every commit triggers an automated build
  • The build is uploaded to Steam
  • Our benchmark PCs constantly update from Steam
  • ..and run a bunch of benchmark tests

This means that for most changesets in our source control we have a benchmark that ran. The big idea being that we can track performance between changesets automatically.

Results View

I made a front end for displaying the results in Blazor. The TLDR on Blazor is VueJs in C#. The site is at stats.facepunch.com.

You can select the test in the panel on the bottom left, the graph shows the results per changeset. If you click on a column you can see the changeset comment along with the previous ones.

This lets us see historically where performance was affected. For example, using this tool diogo noticed a frame drop from this commit, and fixed it in this commit.

Data Interpretation

It isn't as straight forward as see a spike and reverse that commit. There's other factors.

For example, some hardware might have fucked up on the test machine and we had to replace it. There might have been some other Windows bullshit taking resources, or somehow two versions of Rust were running. We might have fucked up a commit where nothing was renderered - so performance would be super high but obviously irrelevant.

So what I'm saying is it needs to be taken with a pinch of salt. Adding events/comments to it would probably be a good idea.

Improvements

We should probably add more test machines, and they should be near identical. This would mean more runs per changeset.

Our Low machine is so slow at loading that they can miss running changesets. In an ideal world we'd queue up each changeset for 10 runs or something, to make sure everything gets a turn.

I haven't put that much work into the running procedure here. It's just a bat file in a loop that downloads and runs as much as it can. It would be ideal if steamcmd let us download a specific version based on the changeset number, right now we only grab the latest version.

Our Medium machine keeps freezing up, so there's really limit data there.

Blazor

I love Blazor. It's so much nicer to be able to use Linq and all the .net string manipulation functions instead of trying to re-remember javascript for it all.

For the graph I started looking at the existing solutions. I tried syncfusion's stuff but it was way too slow. It seems that almost every chart solution interops to an existing javascript charting library. It seemed like a waste of time using Blazor and Webassembly if we were going to do that.

Making charts is pretty easy with the svg elements so I made a custom thing. This worked out especially good because I could be really specific in what I wanted to happen.

But it was still kind of slow. When there's a callback Blazor's default behaviour is to re-render the whole component. So doing MouseOver on the bars on the chart was recreating the chart every mouseover. I'm guessing this isn't usually a problem but with 300 changesets it performed terribly.

Luckily I found that Blazor components have a ShouldRender method you can override. So I made a new component for everything I didn't want to redraw on events and made ShouldRender only return true if it was really dirty.

£600 Remote

Friday, December 13, 2019

Control4 came out with a new modern looking remote..

Compared

Compared to the older one it's much lighter and smaller. It feels nice to hold, lot more modern.

I didn't really realise how massive the old one was until I got this one. I remember feeling that way the first time I got it - like what is this big black 80s brick. But I'd got used to it.

Setup

You don't need a dealer to install it for you. You just take it out of the package and log into your wifi network, it finds the controller and you assign it to a room.

There are some more advanced settings in composer though. I'm guessing you can tweak these with Composer HE too.

Screen

The touch screen isn't an iPhone. It isn't nice to use. It misses presses, you have to be deliberate with it. It runs at about 20fps.

You can adjust the layout of the touchscreen tiles - but not on the control itself. You need to do it via the phone app or a touchscreen.

Usage

I'd say if all you do is watch something like Apple TV where you just need the arrows you're going to get along fine.

If you use Freeview/Cable/Sky, where you remember the channel numbers and want to pop the TV guide up - it can get a bit exhausting. The numpad and the guide button are on the touchscreen, you can't really develop muscle memory and automatically press them while looking at the TV. The guide and numpad are on different screens so you have to swipe around to try to find the button you want to press.

As ugly as the default Control4 remote is you learn to love the number of buttons on it. Especially once you start programming them.

My living room remote is programmed so a single button press can open/close the curtains, toggle the lights, switch to appletv/freeview/cameras. You learn where these are and can press them without looking. You lose all that with the new remote

That said - if you have a partner who doesn't really know how to do all that then the touch screen might be a bit easier for them.

Price

£600. For a remote control.

To be fair to them, it feels premium. The charger is really heavy and magnetic so the remote just snaps to it really nicely.

Worth It?

I find myself reaching for the regular remote more than this one. It sucks, but it's just much more straight forward to use.

Maybe the next version will have more physical buttons or voice controls - but for now don't bother.

Rusty Legs

Wednesday, November 20, 2019

I added legs to Rust last week. We've always wanted to do it but it's always had a barrier. A couple of weeks ago I realised that barrier didn't exist..

We have a skeleton with the player model on it (which is what casts the localplayer shadow). We want to show it, but we also want to manipulate the bones in a way that they don't conflict with the player's view.

But if we do that the shadow would be all fucked. We could shrink the top of the spine bone to 0,0,0, but the shadow would be fucked. This can't work.

But then we were talking and I realised.. why don't we just render a different model. Then we could do whatever we wanted. I can't figure out why it took 6 years to think past that limitation.

So what we do is basically copy the third person model (which creates the shadows) and manipulate the bones. The manipulation isn't anything complicated, it's just a case of tucking shit behind the camera.

Here you can see how the upper torso is tucked behind the camera.

There's a couple of extra things we have to do. When you're crouched and look down, we pull the viewmodel back so it doesn't clip through your knees.

We also pull the view upwards a bit when you're crouching and looking down so you don't put your knee through your head.

It's possible to show the arms too, but they look ridiculous

Control4

Monday, November 18, 2019

I got Control4 in my new house. It's home automation stuff.

Why

Almost everything in the house is on the control4 system. Lights, Curtains, Blinds, TV, Sound, Heating Cooling, Doorbells, Cameras.

Instead of light switches in your house you have Control4 keypads. Unlike regular light switches that are directly wired to the lights they control, these keypads are wireless and just talk to the Director.

This means that you can make any of the buttons do anything. Like turn the TV on and off, close the curtains or even turn the lights on and off.

But Why

I'm a nerd. This stuff is interesting to me. Being able to reconfigure the house without knocking holes in walls seems like a simple no brainer if you have that choice.

Having almost every device in my house be able to have inputs and outputs and making them talk to each other is totally what I want to do.

The Bad Stuff

Control4 are kind of old fashioned. They operate a dealer network. You can't just hop on amazon and buy a new switch. No-one is allowed to sell stuff but dealers.

Even worse - they lock the system down and no-one is allowed to add or rename devices apart from dealers. Imagine buying all this future technology shit and then having to phone someone up to ask them to rename a light for you. Fucked.

It's something that is constantly bitched about on their forums, and of course the dealers all come to the defense. "It's high end stuff - rich people don't want to program it", "They can't be trusted".

The obvious truth is that the dealers push Control4 because they know that reliance on them is created - which is good for business.

Jailbreaking

The good news is that while it's kind of locked down, it's totally possible to jailbreak.

I've got the feeling that this is done on purpose. If you have the technical ability to jailbreak it, you can probbaly deal with the programming.

Information is pretty scarce so I'll probably do another blog on how to jailbreak and share a tool/code to get it done. There are patches out there already but they have some questionable stuff in them so I wouldn't recommend using them.

Nerd Stuff

There's a few different components to Control4:

Director - Runs on a server you'd have in a server rack somewhere. Looks to be coded in C, runs under Linux. You can log into the server with root/t0talc0ntr0l4! and have full control.

Composer - This is the house editor. There's two versions. Home Edition - which is sometimes given to the home owner, can do some simple programming. The Pro Edition is given to dealers - can do everything (this is what you want for full control). It's written in C# so you can decompile explore.

Drivers - Written in Lua - can do anything Lua can do - network requests etc. There's limited ability to update UI etc.

Yep. Shitty Lua.

It could be worse.

Examples

So here's an example for you. This is using their logic block shit.

So when the doorbell is pressed, set a variable WatchCameras to true, make an announcement (this plays a doorbell sound through all the speakers in the house), then after 40 seconds call another function.

The Variable WatchCameras does this

Which turns all the TVs onto the CCTV view when someone presses the doorbell.

Here's another one..

I got a bit carried away with this one. It flashes the lights and plays a sound if there's motion detected upstairs. The variable is toggled by pressing a button in the basement.

It's a child alarm, so we can be in the basement, arm it, and it'll flash the lights and make a noise if the kids get out of bed :D

Android: Best & Worst

Tuesday, September 17, 2019

Hey guys I've had an iPhone since they first came out and five days I switched to a Google Pixel. It took a couple of days to get used to it, but I did some migration prep beforehand.

The Worst

  • Scrolling feels weird after coming from iOS. Less consistent, more drag somehow.
  • No visual voicemail (built in)
  • One app I used regularly isn't available (Breaker podcast app)
  • Everyone else has an iPhone, so to get a Find My Friends equivalent you need to get your friends/family to install the google version (Trusted Contacts)
  • Notifications are weird enough that I'm not totally used to them yet.
  • Copying old whatsapp messages seemed like a pain in the ass so I didn't bother
  • Text input is okay, but text editing isn't great. It might be because I'm inexperienced but I really miss double clicking a word to select it and moving the caret by dragging the space bar.

The Best

  • It came with a cable and copies everything from your old phone (messages, photos, contacts, calendars etc)
  • Google Photos is way faster/slicker than Apple's photos.
  • You can copy all your photos/videos to Google Photos using the iOS app beforehand
  • Photo + Video storage is free if you let Google compress them (which makes no difference)
  • Read and send SMS messages from your PC - this is massive for me because I spend most of my time at the PC
  • Read phone notifications on your PC. They appear just like the regular window notifications.
  • Can set safe zones so your phone doesn't lock in certain locations (like in your house)
  • App layout WAY more customisation. It has a drawer with all the apps in but you can put them wherever you want on the "desktop". That's way nicer than iOS's 10 horizontal pages and a web of drawers layout. You can put apps at the bottom of the screen and leave the top empty.
  • You can add shortcuts to the desktop too, not just webpages, I added one to open whatsapp to Sarah, so it jumps straight there.
  • It tells you what time the battery is going to run out.
  • Double press power button to open camera, volume button does the shutter.
  • Every iPhone app I use apart from one is available and works.
  • Some apps open even faster (Control4, nxWitness pop up instantly, where on iOS there was always a delay)
  • Shows you what song is playing on the TV right on the lock screen
  • Google can understand my accent way better than Siri. I don't have to clean it up at all.
  • All your passwords are stored and autofilled on one platform, no fucking around with third party password managers, syncs seamlessly between mobile and desktop.
  • You get to tell everyone you're using Android like a prick

Verdict

I don't really use my phone for anything more than text messages, twitter and news - so my requirements aren't that high. I switched because I hate big heavy phones. The pixel is about as tall as my old iPhone but it's thinner and way lighter.

I can't imagine that I'd switch back to an iPhone again now. The switch is the hardest part, so it'd take a lot to convince me to move back now I've broken free.

Robot Lawnmower

Thursday, May 9, 2019

I was on Amazon and saw a robot lawnmower and it was like "get it tomorrow if you order within the next 7 minutes". I like mowing grass and these lawnmowers have always seemed more trouble than they're worth, but they got me and I ordered it.

Setup

I had heard that you have to bury wire to define boundaries, but I thought that was optional, I thought I could just let it bounce off the fences and find its way around. I was wrong. so when it came I lazily laid the wire around the boundary of the garden.

Day 1

So here's what the garden looked like before I switched it on

And here's what it looked like after a couple of hours

So not a brilliant start. Kind of like someone had been riding a motorbike around.

I was surprised by how quiet it is, so I let it work all night. It seems to work for an hour and then charge for an hour.

Day 2

When I got up the next morning it had killed itself. It had cut through the boundary cable and then stopped working. My fault because I hadn't pegged it down or buried it properly.

So me and the kids buried it where I could and let the kids peg it down where I couldn't, and set it back to work.

More motorbike lines. I think I set it to cut too short. You're meant to cut it manually and have it maintain that level by going around and trimming the little bits off the top.

It at least gives a good indication of how well it works, so I thought I'd leave it to see how it goes.

Day 3

By the end of day 3 it was working on its own, I'd only had to intervene once because it had a stick stuck in its blades.

More motorbike lines, but definitely starting to blend together.

Day 4

Even fewer lines. Nearly ran over the window cleaner's hose pipe.

Day 5

Lines even less visible, nice and even now. A nice side effect I've found is that it has been incrementally moving all the sticks and rocks off the grass and towards the boundaries.

Day 6

I moved the camera big woop. The trails show a lot more in the rain, but it's cool that it's working in the rain.

Security

It's got an alarm on it. If you try to pick it up without entering the pin the alarm will go off. It's loud.

Emptying

It's cutting the ends of the grass off and it's falling off and mulching. You don't need to empty it.

Conclusion

It works a lot better than I thought, especially given the size of the garden.

I'm still going to have to go out and strim around the edges, at least until we get some borders, so it's not made the grass maintenance free.

Since it's only cutting the very tips of the grass to keep it all a consistent level, I would have thought the grass will start to grow really evenly and thick, so I'm going to keep it going for as long as I can to see it it ends up any different to the front garden grass.

In terms of price, this was about £400. If I was paying someone to cut the grass I'd expect to pay something like £40 a time, and I'd guess we'd need it done every couple of weeks in the summer.

Robot (£400)A Man (£40)
Sometimes Needs HelpSometimes Needs Drinks
Works All NightWorks For One Hour
QuietMight Want To Talk
Upfront CostsPer Cut Costs
Doesn't StrimStrims
No CuttingsWould probably fill your bin up
Blade replacementsMight have BO

Red Dead 2

Friday, November 2, 2018

I'm loving Red Dead right now. Here's everything I hate about it.

Dutch

Dutch is the guy from Deadwood. I haven't got to the part where they actually tell you what happened on the boat, but it's alluded to that he killed a woman. This is why we're all hiding in the snow and can't go to Blackwater.

This seems pretty stupid considering the amount of women I've killed. I killed 50 people breaking some prick out of jail.

I think the story would have made more sense if he was a paedophile, and had molested a kid on the boat. Something more terrible, something that we don't do every 30 seconds in the game.

Icons

I'm sitting 5 feet away from a 65 inch TV. The icons on the minimap are so tiny. How are people playing on smaller TVs? Does it make the icons bigger? Does the £90 version come with sofa binoculars?

Eating

Any kind of eating or drinking is really punishing. You have a few choices.

The real world stuff. Waiting for the stew at the camp, eating in a saloon, making a camp fire and cooking something. All a load of shit that you'll do once because a mission made you and never do it again. Too much trouble.

The pie menu. Open it, switch right with one of the trigger buttons (your muscle memory will kick in after 6 hours), then press the direction that you want, them contort your fingers into switching between them with whatever trigger you're not holding. Stare blankly at the icons waiting for something to happen. Try to figure out why it didn't do what you wanted it to (horse moving? was doing something else?), try again until it does it.

The satchel. Press right on the dpad, choose what you want to eat. Automatically closes the satchel menu and does an action for 5 seconds. Doesn't re-open the satchel menu. Would be a much nicer experience if you could go into this menu and instantly apply stuff here without closing the menu - at the cost of seeing Arthur lift his hand to his mouth.

Honour

I'm a bad guy. At my best I only kill police and other gang members. If spend my days off doing chores for people and giving money to blind guys that'll make me a good guy.

Fuck that. If you flag me down and ask me for help I'm going to stab you to death and loot the $2 you were going to give me for spending 25 minutes doing something for you. I'm going to kick every chicken and dog to death.

I'm not going to do anything unless it benefits me.

Rules

Some kids in Saint Denis called me an old prick or something, so I chased them and started getting robbed. So I ran away and the three guys with guns chased me. I figured I'd like the police handle it, so lead them to the nearest police guy, who tried to shoot them but they killed him.

So I lead them to a police station, and they killed all the police there too.

So I threw a knife at one of them. Four different witnesses saw this and reported the crime. Within 30 seconds I had red dots on the minimap coming at me from every direction, which ended in me cowering behind a boat for 15 minutes and eventually drowning.

This is a reoccurring theme. The game doesn't tell you if it's going to be okay to kill people, there's no way to test that condition. You'll either be fucked or not fucked. Then they throw in a trigger control to help you accidentally fire a shot at random.

Poker

Playing poker is still horribly slow. Make skip instantly skip, not slowly fade out while playing the thing you're skipping in the background. I just want to play cards.

Controls

The game keeps taking the controller off me. Forcing me to walk, forcing me off my horse, changing what guns I'm carrying.

I want to ride my horse through the camp and knock people over and kill them. Yeah you can say game over - and it'll be my fault, but I want to be able to do it. I don't want to walk outside an invisible trigger so I can run to get my horse.

If running at this part of the missions will cause someone to notice me and fuck the mission up, I want walking to avoid that to be my choice.

If I stumble into a woman in the middle of town I want to pick her up and say sorry. I don't want to automatically start choking her to death.

Unity FPSSample

Wednesday, October 24, 2018

I did one of these for the 3D Game Kit, so figured I'd do one for this too. I'm going to take a look at the sample and write about anything of note. Stuff we can steal for our own projects, horrible hacks, solutions I didn't know existed.

Repo

The first thing to note is that the repo is on github and is 18gb. A lot of people will tell you that git(hub) isn't feasible for larger repos like this. Before LFS they'd be right.



It took me 25 minutes to download the whole thing on my 350mb connection, that puts the download speed at about 100mbps.

So although they obviously haven't been using GitHub to develop this it shows that this isn't something that cripples Git or the GitHub Desktop client.

Import

Something that has always been a huge burden for us on Rust is the import time. This project is no different, with a 40 minute import time.



The huge majority of the time seems to be spent importing textures. When you're looking at the filenames being imported you have a lot of time to think. Why does it need to do this? Why can't it do it the first time the asset is accessed? Hasn't it already saved all the important stuff in the meta file, like max size, actual size? Couldn't it store an average colour to show and then async load them in the background when they're actually required?

Couldn't you do the same with shaders? With audio files? With models and animations?

I get that we're meant to use the cache server to try to sidestep this, and that might ease things slightly if everyone accessing the repo is in the same office and on the same network.

Packages

The packages are using the staging packages repo by default. This probably isn't a surprise because the project requires the Unity 2018.3 beta anyway.

They seem to have taken some of the packages and dumped them into the packages folder instead of using them from the repository.



I can only imagine this is because they've had to make some changes to them. Hopefully that's because they were improving/developing the packages along-side this project - so are more up to date/bleeding edge than what is on the package manager.

The alternative is that they had to hack them around to make them do what they wanted.

Audio

They wrap their audioclips in a ScriptableObject with some more configurable stuff. Seems like everyone making a Unity game still has to write their own system for this.



The way they play sounds is nice



The Play function itself is interesting



It uses a recycled list of AudioSource's. It returns a handle in case you need to terminate the sound early. This is pretty nice and it's really a shame that this like this isn't built into Unity. I'm guessing they'll do something like this eventually as a package.

Viewmodel

The viewmodel has aim sway. The arms and weapon are separate meshes and separate animators - although seem to be sharing the same animation controller. So there doesn't seem to be any re-targeting happening here.

The shaders used on the materials on the first person weapons/arms use a special shader setting. I don't know whether this is built into the HDRP shader or if it's something they crowbarred in for this.



We had something like this in Rust legacy, but it was a clusterfuck. The only reason it really existed was to stop weapons sticking through the wall. This seems to also alter the FOV of the weapon (in Rust we scale it on the Z axis to change the FOV). It also seems to prevent the first person stuff from casting shadows into the world. The weapon doesn't seem to have any self shadowing.

This shader flag doesn't seem to affect depth, I was able to get it to clip through the world by resizing the weapon, so I can only really imagine that it exists to change the FOV.

I'd class all of this shader stuff a hack. The more elegant solution, if you were writing it in C++ in your own engine, would probably be to clear the depth and render the camera last.

Viewmodel Animation

The animation controller for the viewmodels is way more thorough than we have for Rust. In Rust we apply movements things like jumping and running using code. But we have like 20 viewmodels - so it's hard to justify adding stuff like this on everything.



The animation system has a load of ECS modules and uses Playable Graph, so probably seems more complicated than it is.



I really struggle with this stuff. Doesn't seem to be a way to zoom around, so can't read any of the nodes. So I dunno, it's obvious a lot of work has gone into it, maybe I'm just too dumb to see why all this exists instead of inside the animation controller.

Maybe it's like the SoundDef stuff for animations? A way to programatically choose the right clip? But wrapped in the ECS system to guarantee that no-one will ever use it.

Console

There's a console built in on the F1 key.



Convars are exposed via an attribute



Nothing special used to collect them though. Just reflection at startup.



Console commands are added via a function at startup.



Again a console is something that a lot of people seem to make themselves, would be nice if Unity supported them by default. Especially if they did it properly and integrated it with the multiplayer stuff to get replicated and client vars.

The console system is such a huge part of the source engine. You have convar settings replicated from the server, and you have client vars replicated from the client that the server can read. GMod is pretty much built on replicated vars.

Multiplayer Builds

One of the things that depresses us about Rust is we have an #ifdef SERVER system. So when we build a server we define SERVER and undefine CLIENT. When we build client we define CLIENT and undefine SERVER. That doesn't sound like a big deal but it's the same code, with #ifdefs everywhere. When you commit code you need to make sure it works in client mode and sever mode.

This seems to operate in a one for all type scenario. Your build can be a client or a server.

It has a terminal/console system - which works in Windows and Linux. This is something a lot of people seek out when making dedicated servers (I wrote a little blog about it once) - so this would probably be a good thing to steal.



In Rust we attempt to cull all of the stuff the dedicated server won't need, like sounds and textures. I don't see any of that happening here. We found that running in batchmode and shipping some assets lead to some significant memory leaks, so might want to keep an eye on that.

Being able to start a headless server and join it with one button is a pretty cool feature. I know it's pretty standard but you can definitely see influences from UE here.

It would be great if this stuff wasn't hidden away in these editor windows and you could add new buttons to the top play, pause, next frame buttons.

Networking

There's a ton of networking stuff. It's hard to tell whether the network stuff here is the standard medium level network stuff that Unity are going to release, or if it's just a bunch of custom stuff just for this. I'd guess it's probably both, chopped together, as an RD experiment.

They have a class for getting a server list. It's accessing a URL, but the URL currently replies with some json with no servers.



It's nice to know server-lists are a consideration though - they're commonly ignored in favour of matchmaking etc.

Entities are generally serialized using two functions.



I do like this method. It is obviously error prone being order dependant, but I can see how it's more agile than adding attributes to member variables. I tend to think that the ideal system would use a combination - but it's really easy to get bogged down in this stuff instead of just getting shit done.

The network system appears to be tick based, has prediction/rollback etc. I haven't tried it online but it would be pretty interesting to see what it's capable of.

EditorHistoryWindow

Kind of useful thing to rip out and customise. Shows a list of the objects you selected so you can quickly switch back to them.



If you tick the box is makes it a favourite so it won't be removed when you select more objects. Works on both scene and disk objects.

Summary

I didn't have time to really look into how everything worked, so this is from a quick scan.

The ECS stuff I could live without. That might be my ignorance of it speaking, but to me it feels like I'd like to see the performance of 16 player models with it vs without it before I add 30 new classes to seemingly just animate the model.

While I'm always going to find stuff to bitch about, this is the closest I've seen Unity get to creating a proper PC game.

Forum Downtime

Thursday, October 18, 2018

Last week I flippantly posted on the forums that I was thinking of shutting them down. People obviously didn't like this news.



My reasons are probably obvious. I'm not sure small forums are still needed. I'm not sure whether something like reddit makes them redundant for things like discussing a specific subject, and things like discord make them redundant for things like idle chatting.

Maybe not right now, but is that the way things are going? In 5 years, in 10 years?

Do I get anything from maintaining them? Does the company? Why are we paying to run and maintain a forum that brings us nothing but issues?

I get that there's a community of people there who know each other and have been communicating this way for 15 years, and that's a precious thing, are you still going to be there in 5 years? 10 years?

Hand it over to someone who wants to manage it?

I don't know if this is wise from an ethical or legal point of view. We have 15 years of forum activity - 32 million posts. Can you hand that over just willy nilly? Do we need to pay a bunch of money to a lawyer to find out?

Plus what's the benefit? Why do you need all of the old posts to relocate?

Downtime

So what a coincidence that with all that spinning around on the forums they go down. I woke up on Saturday morning to a ton of pingdom emails. I got to my computer to find the database wasn't responding.

Discord was blowing up with everyone talking about how unfair it was to just turn the forums off with only a few days warning, how Garry is a selfish childish arsehole.

I checked Azure's status page and they'd had an issue with the storage system. Relieved that it wasn't something I'd done, I left it for a while, it'd come back up on its own.

Support

It didn't come back after a few hours so I put up a "Sorry" page explaining that the database was down - as a way to inform everyone that it hadn't just been deleted. And I fired off a support request.

Support informed me that they were working with the team in the US. Saturday turned into Sunday and still nothing. Support let me know that the ticket was moderate severity so they were working business hours. I asked them if business hours meant "not weekends" but didn't get a reply.

No Backups

Thinking through the worst case I came to realise I had no backups of the forum's data. If it was fucked, it was fucked. The forums would close down for real because there wouldn't be a way to bring it back. I'd purposely chosen to use an azure mssql database because they backed themselves up - I didn't need to do anything. But if some fuck up and fucked up the data - we were fucked.

So I opened a new ticket with the top severity level. They phoned me within 5 minutes with a logmein link and watched me try some stuff, then more random phone calls during the day. At about 6pm they phoned and let me know that the problem should be fixed.

Later on they emailed me a post mortum:

The database first went through a reconfiguration around 13th Oct 3:26 am UTC due to a known xstore outage in the EastUS region. This outage caused the storage on this database to become unavailable and consequently caused the compute to go down. As the compute was going through recovery, one of the replicas got stuck in its transition to primary state. Due to a bug in the failure path caused by xstore outage, the transition was stuck. Restart of the compute replica mitigated the issue.


The following updateSLO/Maxsize operations were stalled behind the unhealthy compute and completed once the compute became healthy.


The bug in the failure path has been fixed and will be deployed in production in next few weeks


Future

I'm still considering what to do with the forums. Whatever I decide won't happen overnight. I'm not just going to switch them off. It'll happen early next year.

If the forums exist they need to be agile and evolving. I can't be the chokepoint there, so there needs to be a way to let the developers in the community improve it themselves.

I'm leaning towards making the front-end site a SPA with a websocket connection and accepting pull requests to it. We could COORS localhost so people can develop locally but with the live data, and any legit community alternatives could also be COORS'd.

That'd make the backend the only chokepoint - which is a tiny part of it.

Fatty

Wednesday, October 17, 2018

I've got fatter every year for the past 5 years. I've has spurts of trying to lose weight every 6 months or so, and they last about a month and then I'm back on the fat train.



Looking at this graph made me realise what a useless cunt I am. Every dip that goes back up soon afterwards represents a failure. If I'd stuck to it we wouldn't be having this conversation.

Here's what I learned from my failures..

  1. Stop eating as much

  2. Eat whatever you want and do exercise doesn't work

  3. Don't eat after 7pm

  4. Sugar makes you hungry

  5. Microwave meals

  6. No snacks

  7. Enjoy feeling hungry

  8. Weigh yourself every day


I understand this all sounds like eating disorder shit, but I think it's important to understand why you're fat. I'm fat because given the choice I sit at a desk for 10 hours a day, I eat jacket potato, beans and cheese for lunch, and then eat 6 bags of crisps and a tub of ice-cream in front of the TV at night. It's about breaking those habits.

I feel like in 100 years people will look back at how much sugar we consume and be shocked and appalled in the same way that we look back at the heroin usage in the 1800s.

You need to keep #8 under control. When you're weighing yourself every day you need to understand that you're creating a weekly/monthly average. What you ate yesterday isn't going to show up on the scales the next day. If you ran around the park yesterday, don't expect to have lost weight today.

A nice thing the withings app does is show you how much weight you gained in a month/year. I've found that this is the best metric when evaluating your weight.

Instead of trying to lose weight every day you're just making sure you're not gaining month on month, year on year.

Blogging & Twitter

Saturday, October 13, 2018

I used to blog all the time. A lot of people did. It's how you got to know what they were up to, it's how you followed them. That's changed over the years. It feels stupid to spend 20 minutes writing a blog when I can spend 20 seconds writing a tweet and get a bigger reaction.

Using twitter for 10 years has rewired my brain. This is part of the reason I want to start blogging more. Twitter is using 5% of my brain constantly in the background, processing everything I experience for potentially popular tweets. It's dumb.

I can't completely blame twitter. Back then I spent most of my time alone in my flat/bedroom. I had no-one to inflict my thoughts on. Now I'm in my mid-thirties with two kids and a partner. I'm not playing Counter-Strike until 4am. I'm in bed by 8pm and up by 6am.

So I'm aware I make this post every year, but I intend to blog more and use twitter less.

Unity's Staging Packages

Monday, April 16, 2018

Ya'll know what Unity's Package Manager is right? It's an awesome way Unity is making itself more modular, being able to add functionality and update that feature in an isolated way instead of the whole editor.

If you open the package manager you might see 5 or 10 packages. But you can jump on the bleeding edge and get access to a few other hidden packages.

Open up your packages/Manifest.json file and add




to the bottom, before the closing "}".



You'll now have access to a few more packages that you probably shouldn't be using in production.

Even More

A ton of packages aren't listed. You can see a list of them here. (I found this link via google by searching for com.unity.progrids).


I think some of them have been discussed before, but I've never heard of some of them. Here's a few I looked into.

com.unity.progrids

Was already using Probuilder as a package - now you can use progrids as a package too!

com.unity.properties

Seems to be a way to use reflection without using reflection. My impression is that you mark an class with a special interface, and it'll generate code to be able to traverse those properties. For doing stuff like serialisation. My guess is that this is an effort to move away from the SerializedProperty shit in the editor, and share that code with the runtime.

com.unity.localization

Localization - finally. Didn't actually get it to work because I'm using 2018.1 and it requires 2018.2, but the documentation shows editor windows that you'd kind of expect.




Doesn't indicate how you use the locales or anything. I was hoping to see integration with UI elements that accepted strings, but didn't see any indication of that when I flicked though the code.

com.unity.collections

Seems to be generic collections (List, HashMap, Queue) coded for performance. Specifically they seem to be heavy on pooling and manually managing the memory allocation.

com.unity.tiny.editor

Not sure if it's another editor, or named wrong, but the contents seem to suggest that it's used for creating really tiny builds. Unity touched on this at GDC I think, something about making annoying HTML5 ads more annoying by integrating games into them.

com.unity.addressables

Apparently enables the ability to give an asset an "address" (which seems to just be a unique name), and then "load" it via that address, no matter whether it's in an asset bundle, resources folder or anywhere else.


The idea seems to be that you can add new resource providers, so loading assets "by name" would happen via a single interface, and you can make resource providers for resources, asset bundles and whatever.

Other Stuff

I only really looked into stuff that peaked my interest, so there might be other interesting stuff there. Let me know in the comments if you see anything cool.

Playtest Recording

Friday, February 23, 2018

Every Friday we try to get something ready to test out. I've found that it's a good idea to record the playtest, even if you're just just doing a quick test, or testing something specific.

Here's a recording I made today of my Tub prototype.

https://www.youtube.com/watch?v=Y15kttLqbkk

Before I started doing this I'd write bugs down during gameplay. That might cause you to not see other bugs, but more likely you're not going to want to stop playing and write down little things, so you'll tell yourself you'll remember them, but you don't.

Sometimes you'll get bugs that you don't understand. Being able to play it back frame by frame can help you understand what went on. If you're seeing bad performance at a particular stage you can take a look around and try to work out what may have caused it.

From a game design point of view, being able to watch yourself play gives you a whole different take on the game. You can spot areas of the game that fall flat when they should be giving positive feedback. You're not watching what you're doing so much, so you can track other players and work out why they were getting confused.

From a historical point of view, it's nice to keep hold of these recordings. Being able to look back on the development of something you're working on is always nice, but you could also use it to see if a bug you're seeing was around x weeks ago too.

Game Bar

If you have Windows 10 recording your shit is easy. Just press Windows key and G and the game bar will pop up. In the settings you can set a key to start/stop recording, this is probably what you want to do.

Steamworks and IL2CPP

Thursday, February 15, 2018

Unity 2018 supports IL2CPP on windows standalone. But when you run Facepunch.Steamworks with it, you get errors, like.
NotSupportedException: IL2CPP does not support marshaling 
delegates that point to instance methods to native code. 

So yesterday I set out to fix that. I'm guessing a lot of people are going to be doing the same, so here's some info.

The Problem

Pretty clear, you can't turn a instance method (a class function) into a function pointer and pass it to c++ with il2cpp. But you can pass static functions.

So the solution is to convert all of the functions you pass to c++ into static functions and use those instead. How hard that is depends on your implementation.

The Next Problem

Your next problem is going to be
NotSupportedException: To marshal a manged method, please add 
an attribute named 'MonoPInvokeCallback' to the method definition

This seems to be a little bit of il2cpp black magic. I don't know where the MonoPInvokeCallbackAttribute is defined, but we don't want to be including unity or mono dlls in Facepunch.Steamworks.

Thankfully, where it's defined doesn't matter. You can define your own version. in FPSW I did it like this.

internal class MonoPInvokeCallbackAttribute : Attribute
{
public MonoPInvokeCallbackAttribute() { }
}


Then add that to any function you're gonna be marshalling as a function pointer.

[MonoPInvokeCallback]
internal static void OnResult( IntPtr param )
{
OnResultWithInfo( param, false, 0 );
}


I've seen implementations of MonoPInvokeCallback taking a System.Type in the constructor, with people passing in a delegate type. That doesn't seem to be needed in my experience (but fair warning, I've only tested it on 64bit windows builds).

 

Monitor Upgrade

Monday, February 5, 2018

I've had 3 monitors for a while. I've got three of these on my desk at the office.

Ultra Wide Screen

So seduced by the potential for simplicity I got one of these for at home. Figured it'd be a lot nicer than three monitors and it wasn't horrible gamer looking angular crap.

It's a nice monitor. And if I'd never had a monitor before I'd probably be okay with it. But the difference between 1080 and 1440 feels huge. You really need to install a third party app to split the desktop to use it properly outside of games.

It doesn't really work properly in games either. Here's what it looks like in the menu of PubG.



PubG itself is kind of weird with it. The field of view is restricted so everything is more zoomed in when you're in third person, you end up running around in first person. One advantage I saw though was that when you're scoped, the scope only covers the middle of the screen.. so you have large areas visible either side.

This obviously isn't the monitors fault.. or even particularly the game developer's fault. It's a totally unexpected situation. (although it's made me think of shit like this in the future).

It also feels like it's not curvy enough. When you have 3 monitors you naturally curl them around yourself in a semi circle. Since this doesn't curve that much each end feels too far away.

Plan C

One thing I felt I really liked is the wide screen. Maybe just not that wide. So I decided to get two of these, instead of three normal sized monitors. 1440 high, normal-ish aspect ratio and putting them together makes a nice V around me. The 100hz isn't the 144hz that the other monitor provided, but it isn't 60hz either.

The extra wideness especially is really welcome in Unity.



So I'm happy with this situation right now. I'm going to sit with it for a couple of weeks before I get the same setup for the office.

I've measured the samsung monitor and I think that once the bins are emptied I'll be able to fit it in there - so there's no real harm done.

Steamworks Libraries

Wednesday, January 31, 2018

Something people always seem to have trouble with in Facepunch.Steamworks is where to put the steam libraries. Here's what we do in Rust.

Windows 32


Put steam_api.dll next to the exe.

Windows 64


Put steam_api64.dll next to the exe.

MacOS


Put libsteam_api.dylib next to the app.

Linux


We don't officially support 32 bit versions of linux, but there's a bit of a gotcha here. Both the 32bit and 64 libraries are called libsteam_api.so. So in Facepunch.Steamworks we rename the 64bit version to libsteam_api64.so.

So just rename and put libsteam_api64.so next to the exe.

Dedicated Servers


The dedicated servers need a bunch of other shit because they don't have Steam. I use this to download them: Steam Dedicated Server. Basically download and run Update.bat and Steam will download the latest dlls.



You can ignore the steamapps folder. If you're shipping a windows 64 bit version of your app, grab the files with 64 in their name and ship with them. If you're shipping 32bit, then do the other files.

The OSX folder is empty, so I'm assuming they don't support dedicated servers (which probably makes sense).



Linux has the steamclient.so in the root, that's the 32bit version. The 64bit is in linux64, stick that next to your exe (don't rename this one).

Procedural Generation

Saturday, January 27, 2018

When we remade Rust we switched to a procedurally generated terrain. We generate an island based on a seed. So every server gets a different island.

In theory this is cool. But I've decided it's not, and it's something that artists and level designers should be doing.

It's my fault. I pitched the idea of Procgen maps in Rust. But without procgen maps would load faster. Players would be able to learn their map. We'd be able to do optimisations like lightmaps and baked occlusion culling. We'd be able to profile every part of the map. The map would look and play nicer. We'd have saved hundreds of hours of devtime. We could have released multiple islands that were significantly different.

The counter argument is that it would be boring, playing the same map over and over. My argument is that procedural generated maps are boring. I don't want to explore a procedurally generated map in a game. It's not fun to explore, you're not discovering stuff, it's the same stuff over and over. You become accustomed to, and are bored by the algorithms the procgen uses in exactly the same way you get bored by an artist made map.

I want to explore a map that was made by an artist, with secrets and gameplay considerations built in. Not just computer generated noise. In my opinion this is where the maps of PUBG and DayZ beat Rust every time.

It's a situation we talk ourselves into easily as game developers. We're working away and decide we need a level to test our game on. The decision is either spend a day making a level, or a month making a generator, then a year maintaining it. There's an element of wanting to work on anything but the game here, and an element of programmer masturbation. Programmers want to program, not make levels.

This isn't to say that procedural generation doesn't ever work. But don't underestimate the time required and overestimate the end results.

Unity 2018.1

Friday, January 19, 2018

I bitch about Unity a lot, so it seems fair that I should give them a shout out when they're doing good shit. Here's some of the stuff in 2018 that I am looking forward to making my gamedev experience better.

IL2CPP for Standalone

This only works on Windows at the moment, but that's enough really. The short version is that it converts c# into c++. That's meant to be faster (in my tests I saw no difference but I didn't test it in Rust, just a simple prototype).

When you compile normal Unity builds you get these dlls (76 dlls)



When you compile il2cpp you get this.



How is that better? Well, you can easily open any of the C# dlls in ILSpy and it'll decompile the code.



And while decompiling isn't perfect, it's enough to make things like cheating really really stupidly easy. You can obfuscate and try to protect it in any number of ways, but then you're making a rod for your own back in terms of error reports and callstacks and virus detectors.

With IL2CPP you're compiling to a big dll. C++ can be decompiled, but not easily. And to be fair even if you handed them the source code they wouldn't get on that great. Unity's compiler actually makes a folder with all the converted c++ source code, here's the "Die" function that was decompiled above. Keep in mind that this is what it looks like before it's compiled so while you can see the basic layout of the function here, I doubt you'd even be able to find it after it's compiled and decompiled.



The other big benefit, for me, is that if you're compiling your game to work on il2cpp for Windows, it's less of a hurdle to make it work on consoles at a later date (which all require compiling to il2cpp afaik). I'll do another blog some time on some of the hurdles you need to jump to get your shit working on il2cpp.

Assembly Definitions

I'm pretty sure this is in one of the later 2017 versions too, but it's worth mentioning. In Rust we have a folder outside of the Assets folder with shit like this.



We tried to move a lot of our code into Dlls so that Unity doesn't have to recompile it all. In 2018 they have Assembly Definitions, which mean that you can mark a folder in Assets as a separate assembly.



You can choose what platforms it should run on - which instantly makes things clean as fuck if you have platform specific code. (Please let us define our own platforms Unity, having a Server platform instead of using defines would make things so much cleaner).

The nice thing about this (and splitting into libraries in general) is that you can manage the references manually, so you can come up with a nice hierarchy of assemblies.

Package Manager

Using C# is awesome. A big part of that is nuget packages. The unity package manager seems to be an attempt to move towards that. So instead of downloading packages from the asset store you'll use the package manager.

This is nicer because you don't have to include the asset in your project, so you don't have to commit that code. It's a json file with a bunch of packages and when you open the project it downloads them, and includes them with your project.

It's not opened up yet, so all it's got is a few Unity packages. But I imagine in the future I'll be able to stick Facepunch.Steamworks on there and it'll just work. And when you want to update it you just press update and it updates and uses that version.

Allocation Callstacks

Again, don't know whether this is new in 2018, but something I noticed that is useful. On the profiler you get these pink blocks - which is when memory is allocated.



Which is nice - because I remember in Rust wrapping everything in Profiler.Start's to try to isolate where they were happening. But even nicer is that when you click on it you get a big dirty call stack showing exactly what's allocating memory.



This would have saved us day, maybe even weeks of effort in Rust. Very very useful. (Although can we stop allocating shit in the editor unless it's gonna allocate in the player please, or maybe just highlight that it won't be a problem in release)

TimeSince

Tuesday, January 16, 2018

Here's a little utility script for Unity. Since I made it I've used it a few times in my prototype, so thought I'd share.

It's basically a way to get the time since something happened, made to be a member of a class/component. It's so simple that I'm guessing it already exists in a form that I've missed.

using UnityEngine; public struct TimeSince { float time; public static implicit operator float(TimeSince ts) { return Time.time - ts.time; } public static implicit operator TimeSince(float ts) { return new TimeSince { time = Time.time - ts }; } }

It'll act like a float, but it'll change over time.

TimeSince ts; void Start() { ts = 0; } void Update() { if ( ts > 10 ) { DoSomethingAfterTenSeconds(); } }

It's a struct so it doesn't create garbage.

Kitchen Wank

Saturday, January 13, 2018

A friend told me this story a couple of years ago. I've never really doubted the authenticity of it because he's not a nerd, and barely knows how to turn a computer on.

He was living with his wife, kids, brother in law and his in-laws at the time. So it was a full house. He'd had a few drinks so when he woke up at 3am he was thirsty. He went downstairs.

When he got to the kitchen he saw the laptop there, and thought he'd knock one out. It was risky, but he'd be quick and quiet, no harm done.

So he turned it on, put the headphones on and found some porn. It was quiet so he turned the volume up. After he jizzed he took the headphones off to start the cleanup and realised. The porn sound was coming from the laptop speakers. The headphones weren't plugged in.

Same guy told me after having sex with his wife one night he'd took the condom off and put it on the bedside table. In the morning he saw he'd put it in his glass of water and realised he had been sipping his diluted spunk all night.

Prototyping

Thursday, January 11, 2018

I don't think I've ever made a game. It's something that makes me feel like a fraud when I see real video game developers. I mean, sure, I made Garry's Mod and it got huge, but it's not strictly a game. It's a sandbox. It's a collection of tools.

One of my biggest issues is trying to see a move in front. The logic that by working on something else I'll make it easier when I come to create properly. This worked in my advantage with GMod, because my "two moved in front" was to implement Lua - which opened up the door for it to be modded so greatly.

For the last few years it's been a bit of a disability. Libraries, wrappers, websites, editor tools - it's been a long distraction from the job of making games. I can't even remember the last time I tried to make a something playable.

I do a ~30 min drive to and from the office every day. Have done for just over a year now. So I listen to a lot of podcasts. They make me pretty contemplative. How we spend our lives, are we wasting our time, should I be sitting on a beach somewhere. It makes me realise that enjoying the time you spend creating something is as important, if not more important than the creation.

So late last year I decided I'm gonna spend more time prototyping. Smaller, contained projects. Not writing tools, not writing reusable components, not getting sucked into huge projects. But writing games. Manageable, finishable, polishable games. Less of a programmer and more of a game developer.

And so far I've been having lots of fun. It feels good.

Displaying an Avatar

Wednesday, January 10, 2018

Most people that use my Steamworks library only want to do a few basic things. One of those is showing an avatar.

Easy Way

The simple answer is:



If you want to set the SteamID dynamically you need to do something like:

Manual Way

The manual way is basically just looking at the above component and seeing what it does.

Request The Avatar



Callback



What's in the Image



  • Width + Height- size of the image in pixels

  • Id - Steam's internal image id (not Steam Id)

  • Data - array of bytes, 0-255 representing the colours.

  • GetPixel( x, y ) - convenience function, lets you get the Color of a pixel at x, y


Data


You can manually read from Data if the convenience class is too dumb for you and you want to do something smarter.

The data is laid out RGBA. Here's how GetPixel reads a pixel.

Player Name Overlay

Tuesday, January 9, 2018

I'm prototyping shit at the moment, and since I'm wanting to blog more this year I figure I'd post some tutorials if I do anything that seems useful. Fair warning, I'm trying to get out of the habit of trying to write clever reusable code. I feel like it's a trap I fall into a lot, and it's more important to get shit done and realise that you'd never want to reuse that code anyway.

Today I'm gonna show how to easily position player names on a 2D canvas in Unity UI.

It looks like this, and can obviously be things like health bars and stuff too.

List Of Objects

You need a list of objects that want to show text. You can do this however you want. My list is a list of players, so I'm going to stick a static list on my player class.



Then add/remove from the just in OnEnable/OnDisable.



Now our list of players are available in Player.All.

Canvas Layout

So, do this:

  1. Create a Canvas (GameObject > UI > Canvas)

  2. Add a new Panel, name it PlayerNames (Right click Canvas, UI > Panel )

  3. Make the panel full screen (Click, shift click and alt click on this button)

  4. Change the pivot on the PlayerNames panel to be 0 and 0 (will explain this later)

  5. Add a child Text to the panel, called Name.


So what you have now is



PlayerNames is the panel that is going to contain and control the names.

Name is the template for the name.

Coding

So all we need to do now is create a script on PlayerNames. I called it PlayerNames.

So first of all we need an array to store all our "Name"s.



Then in Start, we'll copy the Name text component.



Note that here we've copied the Text game object 9 times. We do this because we don't want to be creating and destroying them every frame (because Unity hates that shit).

So in our Update function, lets do this. We get the list of players, ordered by the distance from the camera, closest first.



I've commented the rest inline, it's pretty self explanatory.

Pivot Point

So as mentioned in the comments, the localPosition of our child RectTransforms are relative to the pivot position of the parent. The long and short of that is that if the pivot position is 0, 0 then we're just doing the pixel position from the top left.



If the pivot point is 0.5, 0.5, then you're doing the pixel position from the center of the  parent panel (in this case, the same size as the screen).



You don't particularly need to know that shit, it's just useful to know when trying to get rectTransforms to do what you want.

Shakes

If you've got a critical eye, you might notice that it's got the very slight shakes.

https://files.facepunch.com/garry/2018/01/09/%202018-01-09%2022-32-51-710.mp4

Rounding down helps



https://files.facepunch.com/garry/2018/01/09/%202018-01-09%2022-36-58-864.mp4

But there's still something weird.

Script Order

What you're seeing is a common thing with using the Update function. The problem is that our Update function is running before the Camera moves. So we're a frame behind every time.

So open Edit > Project Settings > Script Execution Order

Then add your script under the Default Time. This means that this script's Update will be called after every other Update in the project.



If your text is still kind of wobbly, you might need to think more about your script order.

Summary

So there you go. Health bars are kind of just as easy, just replace the Text component with a custom component (although using Unity's built in UI > Slider component works easily enough).

There are a few more math challenges if you're scaling your canvas, but it should just be multiplication.

Something to note also is that this will show player names even if you can't see them, like if they're the other side of a wall. you'll probably want to do a ray test or something from the camera to the world point where the player name is going to be if that's a problem.

 

Tesla Model X

Sunday, September 3, 2017

Hey bros, I traded in my Range Rover Sport 4.4l for a Model X 75D a few weeks ago. I've been wanted to write down my thoughts somewhere. So here we go.

Why

I don't give much of a shit about the environment. If the car creates less pollution than my RRS, great. Primarily I'm a nerd and I love the idea of the car being 90% computer.

I've been considering a Tesla for ages, and planned to order a custom designed one. In the end I decided to order a showroom one, because it was 2 week delivery.. and I didn't want to wait for 3 months for delivery and then hate it. So I got the cheapest, slowest one I could.

Awesome Stuff

I'm gonna be doing a far bit of nitpicking in this blog.. but let me preface that by saying this is the best car I've ever owned. Even the 75D's acceleration pisses all over my RRS. Driving it is simple, smooth, fun.

The touch screen is awesome. The satnav is awesome. The amount of settings is awesome. The mobile app is awesome.

The boot is HUGE, and you can put stuff in the frunk too.

Charging

I didn't bother getting a proper charger, so I'm just plugging it into the normal wall socket. This is a slower charge but it makes no real difference to me. I drive about 1.5 hours a day total, so it's more than enough. One week I didn't bother charging it at all, and the battery only got down to 40%.

After about a week you stop thinking about charging. I haven't done any big roadtrips yet - but I don't envisage those being a problem.. there's superchargers everywhere and they give a full charge in minutes. The satnav also shows how much battery you'll have when you get to the destination.

Computer

The computer is pretty fast. It's not megafast and megasmooth, like an ipad. It's more fast like an off brand tablet. It's got always on internet.

The web browser is junk. No idea what it is, but it doesn't always render webpages properly and doesn't support video. It works in a jam, but I would have loved to be able to stream youtube or bbcnews while I'm driving.

The satnav is first class. Can't fault it.

The car doesn't come with a manual, you can browse it in the car. I'm guessing this uses their browser though, because it can be a bit slow and akward to navigate.

The settings and controls are great. Feels like an iphone. Always kind of worried though, because I have accidentally opened the doors twice. And if you open the front trunk you have to get out and close it manually.. a bit embarrassing in a queue of traffic.

The music app is great, but not perfect. Having spotify on there is really really awesome, but there's a few things missing.. like the 'daily mixes'. There's also their internet radio app.. which seems to have a ton of shit I haven't explored. One disappointing thing is that it has a ton of podcasts here that don't play (like athletico mince).. so don't throw your phone away yet. I haven't used the actual radio.

Cameras

The car has a shitload of cameras surrounding it.. but the only camera you can pull up is the reversing camera. The reversing camera is the best quality I've ever seen, but it's disappointing that you can't see through the others. Although I get the point that you'd never use them anyway.. it'd just be cool as fuck.

You'd expect with all this tech and shit that it'd have a dashboard cam built in. It hasn't. Musk has alluded that it might be coming.. but I wouldn't count that chicken yet.

Updates

The car gets software updates over the air every few weeks. The latest one added auto high beams. This was one of the big selling points for me.

I see parallels with the iPhone. When it first came out it was nothing. Then they updated the OS for free, for everyone. This was in an ecosystem where the OS upgrade was why people were buying a new phone. This is the same with cars. If you design it right you don't need to keep selling new ones, you can update the old ones.

It's a terrible business idea until people start buying your product because of that.

In Car Purchases

When I ordered my Tesla I didn't get one with the self driving and autopilot shit. I wanted the shittest car. I assumed this was all extra hardware.

So I was surprised afterwards when looking at my account on the website to find that I could enable that shit by clicking a button and paying £5,000.. cuz it's all just software.

You could make the argument that this is shitty, and the car is capable and it's your car so it should all be enabled by default. I understand that argument. But I also understand how regular car makers charge extra for features, so if you remove the logic that it's literally paying thousands of pounds for them to change one bit from a 0 to a 1, then it's not so bad.

Autopilot

Autopilot is nice. It's easy to switch on, although you do end up pulling the wrong stalk and flashing people for the first couple of weeks.,

They've kind of done the apple thing of giving something a name and pretended it's something special. It's basically traffic aware cruise control. It speeds up if nothing is in front, and slows down if something is. It's meant for queues of traffic and motorway.. I tried it down some normal roads and it copes okay, until it comes up to parked cars on the side of the road.. then it breaks suddenly.

They also have autosteer, which is a bit more impressive. It seems to need well lined roads.

Both of these features have a fundamental problem for me. You really need to sit there and watch them, ready to grab the wheel or break. You can't sit there and read the newspaper while the car is driving along. Well you can, but you probably wouldn't want to.

So for that reason I feel like if you're sitting there, watching the road, holding the wheel, hovering the break pedal.. you might as well just drive. Maybe it's just me but I'd rather be doing something than sitting there watching it be done.

Summon

You can move the car forward and backwards from outside the car. It can open the garage door too.

People hear about summon and think you press a button and it drives from a parking space and comes and picks you up. Not yet.

You're meant to be able to use the fob to move the car, but apparently you can't do that in the UK.. so you have to get your phone out, unlock it, open the app, wait for it to connect to the car, then hold the button down to move it.

Full Self Driving

The people on reddit quote like the bible that it's coming before the end of 2017. It's not. It's 5-10 years away and it will need a hardware upgrade.

Annoyances

There's no auto window wipers. It's coming in a future software update apparently.

The big front window is really nice, but the sun visors are junk. Get some sunglasses. Get something to clean it too - because it's so annoying seeing how filthy it is where the wipers don't get it.

Summary

I love this car. I love Tesla. I'm excited for the future. I'm going to order the best, fastest model X when our new house is built.

Naming Stuff

Friday, July 21, 2017

I've named a few things in my life. Games, websites, children. Here's a few tips. These are general tips, don't bother posting in the comments about how this game or that game are successful so this is all bullshit. Cuz you're bullshit.

Thesaurus

The first place you're gonna go is the thesaurus. Everyone does. You're gonna find 10 words that mean the same thing and you're gonna like 3 of them. You're gonna google them and find out they're already iPhone games.

Everyone does it. It's great for ideas but maybe use the word combined with another word. Find a new angle on it.

Mythology

You're a nerd, so why not get a mythological name. There's tons of them.  Well, because made up, uncommon words are hard to remember, hard to spell and are uninteresting. It makes your audience feel like the game isn't for them, because it's a world they're not already involved in.

Gimmicks

Full capitals, full lowercase, double spaces, upside down letters, emoticons. They're a good idea at the time and make you feel cool. They're not gonna win any points.

Inventing Words

Nope. Nope. Nope. With some exceptions. If the word is a slightly changed real word, slightly shortened real word, okay.

Definitely avoid hard to say, hard to type words.

Short or Long

Short. Max 3 words, ideally 1-2 words.

If your name is long, make sure it has nice initials that people can shorthand it to.

Initials

Want a long name but don't want a long name? Initials are the way to go. I don't mind initials, but I would avoid having it spell a word. Unless it's a cute, completely unrelated word.

Also be sure you're not gonna conflict with anything else - Even if you don't use initials.

X and Z

X and Z are nerd letters. They broadcast to everyone that your game is for nerds.

There was a stage where putting Z at the end of the name was used to signify that your game was cool, but people cottoned onto that pretty quickly.

The one exception is when used in the word "Zombie", but using Zombie or the letter Z in your zombie game is so cliche now that I would avoid that too.

Inclusion

Something I think about a lot of inclusion. I don't really get into games like Dota or WoW with orcs and elves and all that shite. It's not something that interests me, it turns me the opposite way. But if a Dota like game came out and it was just men running around beating each other to fuck I'd be more interested.

When I first made the Rust Trailer Helk hated it. It was jolly, it was happy. It didn't really reflect the vision of the game as the hardcore murder simulator. It didn't make you go "whoa cool explosions". What it did do was invite people who weren't into those types of games. It didn't take itself too seriously, it didn't suggest to people that they had to be a certain level of hardcore to play.

This is something I think of a lot when I'm doing stuff. You've already got your audience, they'll buy your game anyway.. so target the audience you want - the 99% of people who don't play your game.

This is obviously not just name related, but it definitely applies. Don't be afraid to give your game a name that your hardcore audience will laugh at.

Copying

It'd be tempting to name your game a bit like another game. We saw this a lot with Rust, but the ones that come to mind are people adding "Tycoon" to the end of their names, or "Clash of" at the start of their names.

While this can be useful to describe what your game is, to let Tycoon game fans that this is a Tycoon game, I think you're setting yourself in a bad position by doing this. You're leading them to believe that your game is as good as, if not better than those Tycoon games they played. That it's the same experience. You're tying yourself to that.

On The Nose

Here's some names that Mario could have been called.

  • Coin Grab

  • Plumber Problems

  • Block Dash

  • Pipe Cleaner

  • Shell Hell

  • Side Runner Plumber Coin Grab


It's tempting to say, okay this is a game about pushing blocks around - lets call it Block Pusher. This is a game about matching 3 colors, lets call it Match3.

Unrelated

Just chose a word. Any word. But be different. There were 4,200 games release on Steam in 2016.

I've, for a long time been a fan of using girls names. There's ton of them, they're evocative, they're unrelated. Gwen could have been called GGUI, EasyUI, CPlusUI, SimpleUI. I'm guessing if you see that list and then you see Gwen, or Beth, or Sophie - you're going to click on the girl's name.. just out of pure curiosity.

Also a fan of looking at lists of adjectives. Even though most of them are already iphone games, or web services. You can usually think about the thing you're doing, think about how it is meant to make the user feel, or how you feel about the thing you're making. It's unrelated and vague but it can quickly feel like the name.

The Game

A lot of naming difficulty comes from the games not having anything past a game. Something I think about is Darwinia. What would that be called if they hadn't got the lore, if the land and the people didn't have a name. Something generic as fuck like DigiWar, Virus Smiter, AI Attack.

So maybe invent a bit of lore to your game. Name the world, name the city, name the companies, name the people, name the characters, and name it after something related to that.

 

Fuck It

Ultimately if you have a great game it doesn't matter what you call it. We've proven that twice.

You have to go quite wrong to turn people off clicking on your game because of its name - so fuck it.

Facepunch Api

Friday, June 16, 2017

I've been coding a backend site for us to use to manage our projects. Not a project management site, but a central location for the shit we're doing.

If you follow the Rust sites you've already seen this. It's what powers the new Rust website. Here's a look at what it does right now.

Front Page

The front page lists all the projects on the left. Anyone in the company can create a project. We also have a list of commits. The idea is to eventually make this front page that useful that we'll be compelled to have it open all the time - instead of filling up slack with notification after notification (but that's a long term goal).



The commit log pulls info from both PlasticScm and Git, so we get the best of both worlds.

Project Page

The project's front page gives stats about the game. If the game has our analytics system installed it shows historic player counts. I want this page to show financial info and stuff too eventually (long term goal is that everyone in the company can see how much each game makes, and maybe even show that info on the website).

Project Settings

The project settings page allows us to set up common fields and enable/disable features. Since not all projects need all features it makes sense to start with them all disabled and let users discover them by turning them on (instead of getting overwhelmed).

Project Information

This page generates the presskit page on the website. This aims to make it easy for people to make a useful informative website for their project by filling out a form.

Blogs

The way we write blogs for Rust has shaped the blog editor. Every post has a big headline image, a summary, and then a bunch of sections.



We don't have to be safe here, so the sections are all written in Html, with help for the newbs.



Blogs are also how we add changelists.

Website Styles

Our website uses Bulma. Which is like Bootstrap but feels a bit more modern. The styles are defined using scss. This means the styles can be changed pretty dramatically by changing a few variables. This is kind of hard for people to do right now though, so I might make it more form based, and add a live preview.

Servers

Projects can use the Api to keep track of their official servers.



Clicking on a server name takes us to the web rcon page for that server.



Web rcon is a source style rcon service we made for Rust which uses websockets, so you can connect to it from a browser.

We have a Broadcast facility in the api, so that we can run a command on every server at the same time. This is all clientside javascript.



This makes patch day a lot easier, because we can literally go here and run the restart command. Each server shuts down, updates from Steam to the latest version, then comes back up.

We also maintain a list of servers banned from showing up on the server list. This is used to help fight against people being assholes, creating servers with fake player counts etc.

Benefits

This whole thing is obviously full of benefits. As our team grows we're all less and less aware of what everyone is working on. If someone made a project and wanted to let people outside know about it, they had to create their own wordpress site and take time kitting that out. This system aims to make that process really low friction.. to the point where we can create information sites for projects we know won't have a long life time - just to document their rise and fall.

The intention is that the main Facepunch site will act as a root, showing all our active projects and all of their current states.

Allowing people to get involved with the development of projects they're interested in, letting us all see which projects are being worked on, what they are, how long they've been in development. All stuff that we've failed to achieve at Facepunch so far.

The long term goal for Facepunch is to hire more self starter game developers to contribute to this madness, and to release the games we're really proud of.

Aggregation

Thursday, June 8, 2017

I've had a fun week. What started off as a bit of a side project exploded into a big thing and I learned a bunch of stuff. So here's a blog.

What is Aggregation

Taking a bunch of smaller stuff and putting into bigger chunks.

Like what

So imagine you want to track visits to your website. You store each visit in a database, with page, time etc. So now you want to show visits to a page in a certain week. That's pretty easy if you have a moderate amount of hits.

But what if you have a million hits a day? Storing all that information in a database is going to be a bit of a nightmare. Particularly when you consider you're never particularly interested in the data being that granular (ie, you don't care who visited between 10:04:04 and 10:04:06 on a certain day).

Big woop, so what do you do

You aggregate it. Break it into chunks that you might possibly be interested in. You probably don't care about hits in a second, or hits in a minute, but hits in an hour, day, month, year? Yeah - probably.

So even if you think of the most granular of those blocks, hours. You're going to be storing 24 hours for each day, 356 a year. So like 9,000 database entries for a years worth of hours. That's pretty sweet.

Big Data

I originally started storing hits in a database. It became obvious that while this was working for the couple of days of experimenting I was doing, it wasn't going to be feasible to store that shit indefinitely.

I could have wiped old entries on a cycle. That would have kept things nice and clean. But I don't really like destroying data like that. I want to be able to change stuff and re-aggregate the whole history if I want to.

So I settled on using Azure blob storage. Appending to a file for each minute. This is basically like writing to a file, but any of our servers can do it into a central location instead of a local disk.

Input

So the input is to basically get some data (page name, date, country of origin etc) then write it to a file named "/pageview/{year}/{month}/{day}/{hour}/{minute}.txt".

This makes things nice a scale-able, stops files getting too big while making them accessible in a logical way.

Processing

So every hour or so a webjob runs that grabs every in "/pageview/{year}/{month}/{day}/{hour-1}/{0-60}.txt", deserializes all of the entries and sticks them in a List.

Then with all that raw data, for this hour we can work out simple things like total user count and total page views.

agg.TotalViews = data.Count();
agg.TotalUsers = data.GroupBy( x => x.Uid ).Count();


Then we can create Facets.

agg.Facets["Browser"] = data.FacetBy( x => x.Browser.ToString(), 50 );
agg.Facets["Os"] = data.FacetBy( x => x.Os.ToString(), 50 );
agg.Facets["Pages"] = data.FacetBy( x => $"{x.Url}", 50 );


What are facets? They're basically the top x of each entry. My FacetBy function is pretty specific to this task, but looks like this.

    public static Dictionary FacetBy( this IEnumerable seq, Func map, int TopCount = 10000 )
{
return seq.GroupBy( map )
.Where( x => !string.IsNullOrEmpty( x.Key ) )
.ToDictionary( x => x.Key, x => (long)x.Count() )
.OrderByDescending( x => x.Value )
.Take( TopCount )
.ToDictionary( x => x.Key, x => x.Value );
}


So then we end up with something like this

{
"Updated": "2017-06-05T21:36:51.7460534Z",
"StartTime": "2017-06-02T18:00:00Z",
"EndTime": "2017-06-02T19:00:00Z",
"Period": "Hour",
"TotalViews": 2601,
"TotalUsers": 1128,
"Facets": {
"Country": {
"United States": 263,
"Russia": 95,
"United Kingdom": 78,
"Germany": 58,
"France": 54,
"Canada": 51,
"Poland": 51,
"Sweden": 44,
},
"City": {
"Moscow": 20,
"Istanbul": 10,
"Vienna": 7,
"Saint Petersburg": 5,
"Prague": 5,
"Frankfurt am Main": 4,
"Toronto": 4,
"Barcelona": 4,
"Johannesburg": 4,
},
"Browser": {
"Chrome": 2147,
"Firefox": 309,
"Safari": 125,
"Other": 18,
"IE": 2
},
"Os": {
"Windows64": 2070,
"Phone": 220,
"ApplePhone": 116,
"Osx": 74,
"Windows32": 67,
"Linux": 30,
"AppleTablet": 12,
},
"RefererHost": {
"(google)": 345,
"(twitter)": 149,
"(yandex)": 22,
"(facebook)": 20,
"www.rustafied.com": 15,
"(vk)": 15,
"mydailylikes.com": 11,
"chiphell.com": 8,
},
"Pages": {
"rust.facepunch.com/blog/devblog-162": 715,
"rust.facepunch.com/blog": 571,
"rust.facepunch.com/": 378,
"rust.facepunch.com/home": 373,
"rust.facepunch.com/changes": 132,
"rust.facepunch.com/presskit": 74,
"rust.facepunch.com/blog/devblog-161": 58,
"rust.facepunch.com/commits": 55,
}
},
}

Day, Month, Year

Now to generate Day, Month and Year we don't need to touch the raw data files. That'd be dumb, we already got the data from them that we need.

So instead, for the day we grab the 24 aggregated hours from the database, and aggregate them together. For the Month, we grab the days and aggregate those together. For the year, we aggregate the Month.

If you planned this out properly you don't need different tables for each period (and nosql is perfect for this stuff).

Buckets

So what if you want to see the views of a certain page in a certain period? You bucket that shit up.

        foreach ( var grouping in data.GroupBy( x => x.Url ) )
{
CreateSlice( $"Page:{grouping.Key}", grouping.ToArray() );
};


So you basically do the whole process, but you do it for each url. So you end up with entries for each page view.

End result

The end result is that in one database query you can show all the information you need, for any page, for any period in time, super super fast.



Like Google Analytics or something.

Use Google Analytics

The obvious answer is.. why do all this shit when Google Analytics does the same thing. And you are 100% correct. Don't do this unless you're a nerd.

I wanted to make our own analytics service for our games. We were using Google Analytics for Rust but there's a 10 million hit a month limit, and we're at 120 million hits, so we're losing data.

But not only that.. this kind of data manipulation is something that really interests me. Being able to take this scale of information, organise it and display it in a useful way gets me as hard as a diamond.

The curse of Early Access

Monday, May 22, 2017

We know the positives of Early Access. You can release your game early, you can get regular feedback, you can iterate and improve the game with the community.

We're three years in with Rust's Early Access. We've put out updates every week for over 150 weeks, and the community have come to expect them. The updates have become part of a weekly routine for tens of thousands of people around the world.

STILL in EA??

Occasionally we get complaints that we're still in early access. It's hard for us to comprehend what they're actually complaining about, but they do make us realise that we've forgotten that we are in Early Access.



Early Access means different things to different people.

Do you want us to come out of early access and never update it again? Do you feel like we've just been fixing bugs for 3 years, and should be done by now? Do you think that pressing the button on Steam's backend that takes us out of Early Access will change the game in some way?

Avoiding The Cycle

We've been in a feature creep cycle of bullshit for a while. We'll ask ourselves the question "what needs to happen before we leave EA" and the more we think about it the bigger the list of ambitions gets.

In the old days feature creep was finite because game developers had a deadline. They had to print the game onto a tape, or disk or disc and send it out into the world, at that point it was done. We don't have that luxury now.

The temptation is to think of leaving Early Access as a declaration that the game is finished, but I don't believe that's what it means.

Ready To Leave

To me it comes down to a single question:

"If early access didn't exist - would we release this game?"

Once you put it in these simple terms, it's easy to answer. We definitely would have released it by now. We obviously wouldn't have stopped updating it yet (and we don't plan to stop updating it after we leave EA), but it would have been on Steam by now.

So our plan is to add a bit more help to the game (so first time players can actually open the inventory menu without reading guides on the internet), and then quietly slip out of Early Access.

Jenkins Library

Sunday, May 14, 2017

Jesus fuck I hope this is the last Jenkins blog I do. As part of our switch to Jenkins I wanted to define a bunch of common function that all of our scripts could use - without copy and pasting them.

To do this I defined a global Jenkins library. Everything you read about this makes it seem a million times harder than it is. So here's the easy way.

Create a Github Repository

You know how to do this right?

Create a Global Library

Go to "Manage Jenkins > Configure System > Global Pipeline Libraries". Add one. Mark it as local implicitly (removes a bunch of manual library loading bullshit), then use the source code management and point it to your repository you just made.

Defining Classes

Create a file in your repo called src/fuckhole/jizz.groovy
package fuckhole;

def PrintHello()
{
echo 'hello'
}


So commit that and in any Jenkins scripts you use you'll be able to do
def j = new fuckhole.jizz()
j.PrintHello()


You probably worked out, the file name determines what the class is named. The folder determines the package name.

Here's a real example, our Unity script, which wraps our UnityBatch tool, and is in
/src/facepunch/Unity.groovy
.

package facepunch;

def unityVersion = '5.6.0f3'

def Setup( v )
{
unityVersion = v
}

//
// UnityBatch wraps Unity in a way that outputs the log file to jenkins
//
def Batch( String projectFolder, String methodName, String otherCommandLine = "" )
{
bat "Facepunch.UnityBatch.exe ${otherCommandLine} -unityVersion \"${unityVersion}\" -projectPath \"${projectFolder}\" -executeMethod \"${methodName}\""
}

//
// UnityBatch with a BuildTo
//
def BatchTo( String projectFolder, String methodName, String outFolder, String otherCommandLine = "" )
{
bat "Facepunch.UnityBatch.exe ${otherCommandLine} -unityVersion \"${unityVersion}\" -projectPath \"${projectFolder}\" -executeMethod \"${methodName}\" -buildTo \"${projectFolder}/${outFolder}\""
}

Global Functions

You probably just want to add a global function and not fuck around with classes and shit, right? So here functions are defined per file. So create
vars/PrintFuckYou.groovy
.

def call( String name ) 
{
echo "fuck you " + name
}


Pretty simple eh. The function name needs to always be called "call", but it can take arguments and return shit. Now in your scripts you'll be able to call..

PrintFuckYou( 'Dave' )


And a real world example in
/vars/SignTool.groovy


def call( String pattern ) 
{
def batFile = "";

def files = findFiles( glob: pattern )
def c = 0;

for ( int i =0; i 32 )
{
batFile += "\n"
c = 0;
}
}

bat batFile
}


Something to be aware of is that you can run into problems when calling these functions from other similarly created functions. After a bit of a struggle I found that it was better to create classes with "expert level" functionality, then create these "easy mode" functions which just wrapped the classes.

Jenkinsfile

Saturday, May 6, 2017

I wanted to explain how to write Jenkinsfiles in my last post but I blurted on too much. So here we go.

Pipeline vs Scripted

When you read the official docs about writing Jenkinsfiles you get confused because there's two versions. The newer version starts with "pipeline". This is the one they want you to use, and it's also the one that is quite hard to find any information on so I'm not going to be using it here.

The tldr of it is that the scripted way isn't going anywhere, it's the "advanced" way, and the "pipeline" mode is built on top of it.

Basic

Your basic jenkinsfile looks like this.


node
{
stage( 'Stage Name' )
{
// do stuff here
}
}


So generally you do your work inside of stages.

Working Example 1 (UE4)

Non working examples are bullshit, so here's a look at some of our real world examples.

node( 'ue4 && vs2017' )
{
stage ( 'Checkout' )
{
checkout scm
}

stage ( 'Build' )
{
bat 'Build.bat'
}

stage ( 'Upload' )
{
def vdf = 'Steamworks/app.' + env.BRANCH_NAME + '.vdf'
if ( fileExists( vdf ) )
{
SteamUpload( "$WORKSPACE/" + vdf )
}
}
}


So in this you notice the node has arguments. This is telling Jenkins to build this on a node (a build server) which has the ue4 and vs2017 tags. When we set our build servers up we tag them with what's on them, so it doesn't try to build this project on a linux server with nothing on it.

The checkout stage calls "checkout scm", which downloads everything from git into the workspace folder on the target build server.

The next stage runs a bat file. In this UE4 project we build using a bat file, so that developers can test a standalone build easily by just running the bat file.

The upload section uploads it to Steam. SteamUpload is a function we defined in our own library (I'll do another post about defining your own libraries if anyone gives a shit). This stage has a bit more logic. The Steamworks vdf file "app.master.vdf" uploads to the master branch on Steam. Using this logic we could make the git branch "experimental" upload to the "experimental" branch by adding a app.experimental.vdf.

Working Example 2 (Facepunch.Steamworks)

node ( 'vs2017' )
{
stage 'Checkout'
checkout scm

stage 'Restore'
bat 'nuget restore Facepunch.Steamworks.sln'

stage 'Build Release'
bat "\"${tool 'MSBuild'}\" Facepunch.Steamworks/Facepunch.Steamworks.csproj /p:Configuration=Release /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}"

stage 'Build Debug'
bat "\"${tool 'MSBuild'}\" Facepunch.Steamworks/Facepunch.Steamworks.csproj /p:Configuration=Debug /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}"

stage 'Build Release NetCore'
bat "dotnet restore Facepunch.Steamworks/Facepunch.Steamworks.NetCore.csproj"

stage 'Build Release NetCore'
bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.NetCore.csproj --configuration Release"

stage 'Build Debug NetCore'
bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.NetCore.csproj --configuration Debug"

stage 'Archive'
archiveArtifacts artifacts: 'Facepunch.Steamworks/bin/**/*'
}


So kind of the same routine. You can see we checkout, we call nuget restore to restore packages.

In the build section you see we do ${tool 'MSBuild'}, this returns a string location of the MSBuild tool (which is set on the build server). You can also see we set the product version to the build number.

Strings in groovy can take some getting used to, here's a cheatsheet.


def name = 'Mike'
def GetName() { return 'Dave' }

def str = "Hello"
def str = 'Hello'
def str = "Hello " + "Mike"
def str = "Hello " + 'Mike'
def str = "Hello " + name
def str = "Hello $name" // Hello Mike
def str = 'Hello $name' // Hello $name
def str = "Hello ${name}" // Hello Mike
def str = "Hello ${GetName()}" // Hello Dave
def str = "Hello $GetName()" // Error
def str = "Hello ${ 10 * 5 }" // Hello 50


So that's all standard, then you see at the bottom, we do archiveArtifacts. This collects all the files defined in the path and stores them.

Working Example 3 Unity3d

node( 'unity' )
{
def unity = new facepunch.Unity()
unity.Setup( '5.6.0f3' )

stage( 'Checkout' )
{
checkout scm
}

stage( 'BuildInfo.json' )
{
dir ( "Assets/Resources" )
{
writeFile file:'BuildInfo.json', text: GetBuildJson()
}
}

stage( 'Facepunch.Build.Win32' )
{
unity.Batch( "$WORKSPACE", "Facepunch.Build.Win32" )
}

stage( 'Facepunch.Build.Win64' )
{
unity.Batch( "$WORKSPACE", "Facepunch.Build.Win64" )
}

stage( 'Facepunch.Build.Osx' )
{
unity.Batch( "$WORKSPACE", "Facepunch.Build.Osx" )
}

stage( 'Facepunch.Build.Linux' )
{
unity.Batch( "$WORKSPACE", "Facepunch.Build.Linux" )
}

stage( 'Steam Upload' )
{
dir( 'dev/steamworks' )
{
if ( env.BRANCH_NAME == "master" )
{
SteamUpload( "$WORKSPACE/dev/steamworks/steamworks.app.vdf" )
}
}
}
}


So, node should have Unity, then we create a Unity class. This is a class I made which basically holds onto the Unity version and launches Unity for us. Again - if anyone wants a tutorial for libraries, hit up the comments and I'll make one.

Next we create build info.. again this is a library I made that spews a json file about the build. This means we can show scm and build into in the game when it's on Steam.



Then we build the different unity platforms. Unity can only build one at a time, so we build the one by one. This uses the Facepunch.UnityBatch.exe - which wraps Unity.exe (because unity.exe doesn't print to stdout, we read the log file and manually print it out so it all shows in the jenkins logs).

Then in the Steam Upload section we change the directory (the dir command changes the directory for everything in the block), then we upload it to Steam.

Rust

I'll let you figure out this one for yourself

parallel(

"client" :
{
node( "unity && steam && heavy" )
{
echo "Starting Client Build"

def unity = new facepunch.Unity()
unity.Setup( '5.6.0f3' )

def plastic = new facepunch.Plastic()

def PlasticWorkspace = 'RustMain'
def SteamBranch = 'staging'
def ProjectFolder = "$WORKSPACE/${PlasticWorkspace}"

stage ( 'Checkout' ) { plastic.Checkout( "rust_reboot", PlasticWorkspace )}

stage ( 'Revert' ) { plastic.RevertChanges() }

stage( 'BuildInfo.json' )
{
dir ( PlasticWorkspace + "/Assets/Resources" )
{
writeFile file:'BuildInfo.json', text: GetBuildJson()
}
}

stage ( 'GameManifest' ){ unity.BatchTo( "${ProjectFolder}", "GameManifest.DoGenerate", "build/client/${SteamBranch}/StandaloneWindows64" ) }

stage ( 'CL_Win64' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_Win64", "build/client/${SteamBranch}/StandaloneWindows64" ) }
stage ( 'CL_Win64d' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_Win64", "build/client/${SteamBranch}/StandaloneWindows64Debug", "-compileDebugMode" ) }

stage ( 'CL_Win32' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_Win32", "build/client/${SteamBranch}/StandaloneWindows" ) }
stage ( 'CL_Win32d' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_Win32", "build/client/${SteamBranch}/StandaloneWindowsDebug", "-compileDebugMode" ) }

stage ( 'CL_OSX' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_OSX64", "build/client/${SteamBranch}/StandaloneOSXIntel64" )}
stage ( 'CL_OSXd' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_OSX64", "build/client/${SteamBranch}/StandaloneOSXIntel64Debug", "-compileDebugMode" ) }

stage ( 'CL_Linux' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_Linux64", "build/client/${SteamBranch}/StandaloneLinux64" ) }
stage ( 'CL_Linuxd' ){ unity.BatchTo( "${ProjectFolder}", "Build.Client_Linux64", "build/client/${SteamBranch}/StandaloneLinux64Debug", "-compileDebugMode" ) }

stage ( 'CL_Bundles' ) { unity.BatchTo( "${ProjectFolder}", "BuildAssetBundles.BuildForClient", "build/client/${SteamBranch}/Common/Bundles" ) }

stage ( 'Signing' )
{
SignTool( PlasticWorkspace + '/build/client/**/*.dll' )
SignTool( PlasticWorkspace + '/build/client/**/*.exe' )
}

stage ( 'Eac Hashing' )
{
parallel(
"Win64": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneWindows64" ) },
"Win64d": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneWindows64Debug" ) },

"Win32": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneWindows" ) },
"Win32d": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneWindowsDebug" ) },

"Linux": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneLinux64" ) },
"Linuxd": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneLinux64Debug" ) },

"Osx": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneOSXIntel64" ) },
"Osxd": { DoEacHashing( ProjectFolder + "/Prerequisites/EasyAntiCheat.HashTool", ProjectFolder + "/build/client/${SteamBranch}/StandaloneOSXIntel64Debug" ) },
)
}

dir( PlasticWorkspace )
{
stage( 'Upload Client' )
{
SteamUpload( ProjectFolder + "/Steamworks/rust_cl_staging.vdf" )
}

stage( 'Upload Client Debug' )
{
SteamUpload( ProjectFolder + "/Steamworks/rust_cl_staging-debug.vdf" )
}
}
}
},

"server" :
{
node( "unity && steam && heavy" )
{
echo "Starting Server Build"

def unity = new facepunch.Unity()
unity.Setup( '5.6.0f3' )

def plastic = new facepunch.Plastic()

def PlasticWorkspace = 'RustServer'
def SteamBranch = 'staging'
def ProjectFolder = "$WORKSPACE/${PlasticWorkspace}"

stage ('SV Checkout') { plastic.Checkout( "rust_reboot", PlasticWorkspace ) }

stage ('Revert') { plastic.RevertChanges() }

stage( 'BuildInfo.json' )
{
dir ( PlasticWorkspace + "/Assets/Resources" )
{
writeFile file:'BuildInfo.json', text: GetBuildJson()
}
}

stage ( 'GameManifest' ) { unity.BatchTo( "${ProjectFolder}", "GameManifest.DoGenerate", "build/server/${SteamBranch}/StandaloneWindows64" ) }
stage ( 'SV_Bundles' ) { unity.BatchTo( "${ProjectFolder}", "BuildAssetBundles.BuildForServer", "build/server/${SteamBranch}/Common/Bundles" ) }

stage ( 'SV_Win64' ){ unity.BatchTo( "${ProjectFolder}", "Build.Server_Win64", "build/server/${SteamBranch}/StandaloneWindows64" ) }
stage ( 'SV_Win64d' ){ unity.BatchTo( "${ProjectFolder}", "Build.Server_Win64", "build/server/${SteamBranch}/StandaloneWindows64Debug", "-compileDebugMode" ) }
stage ( 'SV_Osx' ){ unity.BatchTo( "${ProjectFolder}", "Build.Server_OSX64", "build/server/${SteamBranch}/StandaloneOSXIntel64" ) }
stage ( 'SV_Osxd' ){ unity.BatchTo( "${ProjectFolder}", "Build.Server_OSX64", "build/server/${SteamBranch}/StandaloneOSXIntel64Debug", "-compileDebugMode" ) }
stage ( 'SV_Linux' ){ unity.BatchTo( "${ProjectFolder}", "Build.Server_Linux64", "build/server/${SteamBranch}/StandaloneLinux64" ) }
stage ( 'SV_Linuxd' ){ unity.BatchTo( "${ProjectFolder}", "Build.Server_Linux64", "build/server/${SteamBranch}/StandaloneLinux64Debug", "-compileDebugMode" ) }

dir( PlasticWorkspace )
{
stage( 'Upload Server' )
{
SteamUpload( ProjectFolder + "/Steamworks/rust_ds_staging.vdf" )
}

stage( 'Upload Server Debug' )
{
SteamUpload( ProjectFolder + "/Steamworks/rust_ds_staging-debug.vdf" )
}
}
}
}
)

Jenkins

Saturday, April 29, 2017

A long long time ago we used Jenkins. Then we switched to Bamboo because the Jenkins interface was feeling a bit 1990s.

So now it's like 5 years later and we're in the process of moving back to it. Here's why.

It's Free

Bamboo isn't free. Want to host it on a server and build on that same server? $10. Want to use a single remote build server? $800. Want to use up to 5? $2,200. Want to upgrade next year? $1,100.

Money isn't so much the deciding factor for us. If Bamboo was outright the best product, we'd pay happily. More of an issue is the fact that pretty much every atlassian product has overcomplicated year 2002 enterprise style pricing.

Jenkins is free. Open source.

Updating

It's 2017. Updating software shouldn't involve all this bullshit.

To update Jenkins you press a button and it updates and restarts. There's updates every few days.

Addons

Our wiki uses Confluence (also by atlassian). It got 1000 comments on a page made by spam bots. There's no bulk delete comments option. If you search you find multiple instances of customers with this problem. So what's the solution? Obviously not to add that basic functionality. Let someone else add it and sell it for $10 a year. Or buy a script to run scripts for $100 a month.

Again, I'm not totally against paying for addons, but not for basic functionality. Not to clean up messes that the inadequate captcha software let happen.

Jenkins addons are free, one click install, update automatically and very very regularly.

The Interface

The one huge thing Bamboo had over Jenkins is that it didn't look like shit. Jenkins has changed in a few ways since I last used it - which closes that gap slightly.

Ocean Blue is a plugin they made that seems to specifically solve this problem. It replaces the functional engineer view with something more simple.



It's all modern and appy. Which makes people more appy.



It's made in a way so that non coders can put together build steps. But that's for idiots, so don't worry about that.

Fuck The Interface

Wouldn't it be cool if instead of bullshitting around creating jobs, then creating build steps in the interface, you could just drop a file in your project's repository that told it what to do.

Wouldn't it be even cooler if Jenkins could scan though all the repositories on your SCM for repositories with these special files, and automatically create a job for them all. Maybe it could do branches too. Maybe it could build pull requests too.

Well you just described the Jenkinsfile.

Github Integration

If you use Github you're gonna love it. Add a Jenkinsfile, it adds a project. It automatically registers hooks with Github so it gets notified on pushes.



For each commit it'll do a build and report the status back to Github. Which'll then do little ticks or crosses next to the commits.



It'll also test pull requests and report the status back - so you know if they're actually going to compile and pass tests before you bother with them.

PlasticSCM

Like pretty much everything like this, the PlasticSCM plugin for Jenkins is as basic as you can get. It works to do the basic stuff, move outside of that and you're probably gonna hit bugs. It's something they may improve over time, but at the moment it's got a few issues.


  • No organisation scanning like Github - all manual set up
  • SCM polling is temperamental, manually set up web triggers
  • Interface errors (set pipeline to use script from plasticscm then save, you get this)
  • No lightweight checkout, jenkins host has to pull the entire repo down to read single file


Like most people, if GitHub handled 20GB repositories better we'd have probably already moved everything to it already. PlasticSCM's strategy seems to be to create a wrapper so Plastic acts like Git - allowing everyone to use the good plugins. That's a neat idea, but I've always felt that 90% of Git's adoption is down to how great GitHub is, so unless they can wrap Plastic in Github I don't see much advancement here.

So with PlasticSCM you can limp along, manually adding jobs and it works. And I assume that's the case with every other SCM.

Unity 2017 Changelist

Tuesday, January 3, 2017

We do a thing in Rust's subreddit where we get people to post their ideal changelog.

I find these threads a lot more useful than reading people's dissertations on what they want changed. They're brief, skimmable, and they're not full of justifications, speculation and predictions.

So here's my changelist for Unity in 2017.

  • Removed deprecated component accessors on Component

  • Reduced standalone memory usage

  • Added ComponentRef (automatically fills with the sibling component)

  • Allowed resources folder to be over 2GB without using bundles

  • Editor Dark Skin is the only skin

  • Steam is treated as a platform (includes Steam SDK)

  • Cloudbuild can upload to Steam

  • Added GameObject.Spawn which spawns a prefab but doesn't call Awake/Start/OnEnable until you call go.Instantiate() (allows setting up before actual creation)

  • Added PrefabPool

  • Added ParticleSystem.AutomaticallyRecycle bool (deletes gameobject when particle finishes)

  • Layer renamed to RenderLayer

  • Added PhysicsLayer

  • RenderLayer/PhysicsLayers are a bitfield, objects can be in multiple layers

  • Up to 64 RenderLayer/PhysicsLayers

  • Tags are bitfields, objects can have multiple tags

  • Added Sound.Play( clip, position, volume, pitch, etc )

  • Built in components aren't sealed, are derivable, default editor still works

  • Up to 64 tags

  • Changing platforms no longer requires reimporting every asset

  • Added search/filter to console

  • Console uses monospaced font

  • Can click on stack trace in console to jump to that file/line

  • Added back/forward buttons to project folder

  • Pressing mouse 4/5 navigates project folder history (like a browser)

  • Common functions are now thread safe

  • Editor will detect and break out of infinite loops

  • Profiler shows breakdown of visible meshes, vertices per mesh

  • ParticleSystem can be placed on overlay canvas

  • Replaced Mono with NETCore

  • Getting Object.name no longer allocates memory

  • Added dynamic occlusion culling

  • Special hook functions like Update, Awake, Start are virtuals instead of magic

  • Folders can be marked to compile to dll (compile times, modularity)

  • Removed Javascript support

  • Editor no longer freezes when changing files in a huge project

  • Added Physics.OverlapFrustum

  • Can serialize components/scriptable objects at runtime (saving, loading, configs)

  • Can load models, animations, shaders at runtime

  • Added loopback mode to UNet for singleplayer games

  • UNet Loopback mode can be used to record/save/play demos

  • UNet Loopback can be used for saving, loading

  • Added VoIP support to UNet

  • UNet transform sync interpolation works (without rigidbody)

  • Added CSS like styles to UnityUI elements (allowing you to change your games entire UI style from one place)

  • Headless/Console/Server is treated as a platform

  • Added automatic LOD generation

  • Editor child windows don't disappear when alt tabbed

  • Terrain.Max Mesh Trees works again

  • Added version number on editor icon

Binding Steamworks SDK

Tuesday, November 1, 2016

I've been working on Facepunch.Steamworks in the background while doing Rust's workshop integration. Just Prerelease branch is shipping with it now.

The challenge was to make a c# library that works under Unity (and not) without recompiling, and on a bunch of platforms.

Here's everything that sucked about it.

Pack Size

All the structs in the sdk are packed, like this.

#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
#elif defined( VALVE_CALLBACK_PACK_LARGE )
#pragma pack( push, 8 )
#else
#error isteamclient.h must be included
#endif


This creates a split between windows and osx/linux. Structs are 8 byte aligned on Windows, 4 byte aligned on osx/linux. This causes drama when you come to marshal them.

CSteamID

It also seems that on Windows CSteamID stops structs getting packed at all. So you'll find that any structs that have a CSteamID member (which is a lot of them) need to be treated as unpacked.

Callback

A lot of stuff uses callbacks in the Steamworks SDK. The callback system expects a c++ class. This sucks for c#. Getting it to work means you need to create a class to emulate this:

class CCallbackBase
{
public:
CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; }
// don't add a virtual destructor because we export this binary interface across dll's virtual void Run( void *pvParam ) = 0;
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0;
int GetICallback() { return m_iCallback; }
virtual int GetCallbackSizeBytes() = 0;

protected:
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
uint8 m_nCallbackFlags;
int m_iCallback;
friend class CCallbackMgr;

private:
CCallbackBase( const CCallbackBase& );
CCallbackBase& operator=( const CCallbackBase& );
};


Which ends up looking something like this.

[StructLayout( LayoutKind.Sequential )]
internal class Callback
{
public IntPtr vTablePtr;
public byte CallbackFlags;
public int CallbackId;
}


vTablePtr is a pointer to the vtable - which is implementing the virtual functions.

[StructLayout( LayoutKind.Sequential )]
public class VTable
{
public IntPtr ResultA;
public IntPtr ResultB;
public IntPtr GetSize;
}


The awesome confusing part of the VTable is that the first two functions swap positions on windows.

steam_api_interop.cs

For a long time I was trying to use the steam_api_interop.cs file included with the SDK. Don't use this. It's non functional out of the box, it's using the wrong parameters for a bunch of functions and it's not packing structs.

Because of this I ended up writing my own generator (which I'm sure is getting a few things wrong, but I'm unit testing as much as I can).

For this I'm using the steam_api.json file and some source code regexes for missing stuff. So as much as steam_api_interop.cs sucks, I'm sure it's only there to serve as an example of how to use steam_api.json and steam_api_flat.h - which makes this all a million times easier.

Things That Suck

Callbacks can return with "IO Failure" if you call them too soon after Steam Init. This sucks for Unit Tests.

Steam thinks your game is still running until you close the exe. This sucks when working in Unity Editor etc.

Facepunch.Steamworks

Monday, October 3, 2016

 

Like everyone else, I started making my own C# Steamworks wrapper. The idea is to wrap everything up in a way that makes it easy to use, and less like the c++ interface.

I could write more shit about it here, but I'd just be repeating what I wrote on its readme, so I won't bother.

I was very much inspired and helped by Riley's hard work on Steamworks.net, so huge huge thanks to him.

It's a work in progress, and it's going into Rust - so let me know if you find any issues etc.

Politics

Friday, September 23, 2016

I have a big problem with big politics. I have a problem aligning myself with a party. It's messy.

Issues aren't black and white. I feel like by aligning myself to a particular party because I agree with them the most, I'm betraying my opinions on all the stuff I don't agree with them on.

I feel like there's longer term problems with choosing a side. You find yourself blindly defending your party out of loyalty. Even if you didn't initially agree with their views on certain issues you're more receptive to their point of view. You want to be convinced by them. While you end up being militant to any idea put forward by opposing parties - even if it's a good one. So you end up getting entrenched in your views, and the views of the party. You can't pick and choose what you believe in.

Then you have the problem of being lumped in with the rest of the party. As a member of that party you have to defend those opinions that you might not necessarily agree with. And the people you're defending them to aren't listening, they're towing their own line, you're never going to convince them, they're never going to convince you.

It always seems like a weird way to do things. Voting for one party to be in charge of everything because you disagree with the least of their policies. You might agree with Party A on education but disagree with them on taxes. Would it make more sense to vote for who handles each area?

I don't know. That's why I'm a political atheist. Fuck it.

Unreal Engine

Wednesday, September 14, 2016

I've had my first taste of Unreal Engine over the last few months. I haven't touched unreal engine before, so this is deep water to me.

I've been working with Unity for the last 2-3 years. I've hardly used c++ since then. Jesus christ you forget what a total fucking nightmare it is. You look at something like Unreal where they have 3 layers of bullshit on top of everything, and you think.. shouldn't the language be doing this? Should your code be covered in macros to the extent that you can barely tell what language you're programming in? Should you be pre-processing and generating code? Should precompiled headers ever be a thing?

To be clear, I'm not blaming UE for this. It's what it needs to do. The issue is that c++ is a bunch of shit. Trying to use intellisense is an ordeal. I'm guessing this is mainly on Microsoft - since they seem to have more sense than to try to code stuff in c++ anymore, the intellisense has always been pretty junky compared to c#.

The engine itself is a lot more bare basics than I thought it was. For some reason I was under the impression that it was kind of like Source, in as much that it had the main menu, server joining, all the basic deathmatch stuff built in. But it's a lot closer to Unity than that. It has barely anything, and you add the rest. No main menu system, no player weapon system, no health + dying system. This kind of took me by surprise at first, but I can see why it makes sense.

Another thing that took me by surprise was the client/server split. In Source it's clearly defined. Client stuff in the client dll, Server stuff in the server dll, completely separate client and server entity definitions. In Unreal it's different. Instead of checking that you're a server, you check to see if you have authority on that entity. If you do, you do authoritative stuff. And then it all just works. This seems to be a lot simpler.

Networking in Unreal has a bunch of gotchas. There isn't any interpolation - apart from players. So if you make a physics object on the server, on the client it's going to stutter around unless you add your own solution. Any kind of latency causes the default player controller to really suffer when interacting with physics objects, dragging back and teleporting out of its way. The default bandwidth targets are quite low, so what you think are bugs turn out to be the network system trying to prioritise what to send.

If you're not using Blueprints you're going to struggle. The whole engine is angled to use blueprints, so when you're doing stuff via c++ you find yourself reading tutorials on how to do stuff using blueprints then backwards engineering that into c++.

It has a weird plugin system. Some things, like shader includes, have to be copied to the engine folder in your program files. This means when you're adding your game to source control you need to tell everyone to install specific plugins instead of just including files in the project folder.

But on the plus sides, fuck me, how gorgeous is this engine. You can throw anything at it and it renders it so beautifully. And it's so open. Instead of wrapping physx up in a layer of their own shit, it's right there, exposed, so you can tweak all the internal settings to improve the quality of the physics for your engine. It performs really well for me so far. And full source code access is always a big draw.

You're probably thinking.. fuck me dude, why are you using this engine if you hate it so much. The thing is, it's all irrelevant. I'm wrapping it in c#. Once that's done we shouldn't have to open the editor or the c++ that often ;)

I got suspended from twitter

Tuesday, August 9, 2016

I got suspended from twitter yesterday. I didn't know until I tried to send a tweet and this popped up.



There was lots of speculation on why this could have happened.

Maybe the Muslim Mafia had seen my tweet about muslims.



Not racist or offensive when you read the whole context, but could have easily been taken out of context. But surely twitter wouldn't suspend an account for something so stupid?

Maybe hackers had hacked into my account and got it suspended by doing something invisible to the outside world?

Another widely discussed theory was that Notch had used his great wealth to influence twitter into suspending my account. A pretty flawless theory, and surely the most likely.

So I emailed them and asked why, then this morning I got this email.



Oh, so it turned out to be this.



The Rust guy's ass that had been on my profile cover for a year. Rules are rules I guess.

PlasticSCM Speed Tip

Wednesday, July 13, 2016

We use PlasticSCM for Rust. If the repository wasn't 30gb and I didn't have to teach people how to use it, I'd probably use GitHub instead.

Downloading 30GB from our PlasticSCM server was slow. Really slow. So here's a protip.

Find your client.conf file - usually in C:\Users\username\AppData\Local\plastic4. Open it, scroll down to

<DownloadPoolSize>1</DownloadPoolSize>


and change it to

<DownloadPoolSize>16</DownloadPoolSize>


Now you're downloadING at 200mbps. Cya.

Becoming A Gamedev

Saturday, June 18, 2016

I pretty regularly get asked for general game development advice. Usually from students, sometimes from older people considering a career change. So here's my best advice in a single blog post.

How Do I Learn To Make Games?

There's no single answer to this question. People learn in different ways. Some can only learn if they're taught and lectured. Personally I only learn if I can see why I need to know something, so modding was the ideal way to learn for me. To download someones code and see it working, change stuff, see what changes.

The good news is that it's never been more accessible. Engines like Unity has made what used to be 6 months work take less than 6 minutes.

Should I make my own engine?

The short answer is no.

The long answer is.. it's a waste of your time and energy. Your engine won't be as efficient or compatible as the preexisting engines. Engine development isn't game development, so you don't need to, but never let that stop you from experimenting.

The Game Idea

The initial game idea doesn't matter. My general rules are to make something you want to play. If you're making a game because you think it's going to be financially successful you're doomed to fail. Making a game for other people doesn't work.

Design Document

Fuck design documents.

Concept Art

Fuck concept art.

Prototyping

You're not going to spend months making design documents and drawings, laying out your vision. Games are games, you play them. Your first step is to make prototypes.

  • Don't make any art, use blocks or asset store placeholders

  • Spend up to a month making a prototype

  • Get people to play your prototype

  • Decide if it works

  • Either abandon the project or pivot to something that does work


This is where a lot of people fall down. They don't put gameplay first.

If your game looks great but plays shit you end up in a media loop. You get feedback from fans on your screenshots and movies. You get scared to release because the gameplay is shit. But you've invested so much in the art that you end up releasing and everyone hates it.

If your game looks like shit and plays great no-one minds, and art is easy to improve after everything else is done. It's the pudding. You don't eat your pudding if you haven't eaten your dinner.

Media

Websites, screenshots, trailers, media. Don't worry until you're going to release. As much as building up a community for 2 years before you release your game is fun, this kind of release schedule is always going to lead to them being disappointed when you actually release. Until your game is ready it's a waste of time and energy that is better focused on the game.

Financials

How many games a day have you got to sell to be self sufficient? What's the bare minimum you need to do to live? That's your aim.

When working this value out you need to keep all the cuts in mind. If you're selling on Steam expect them to take 30%. Then on that you'll need to pay income tax, or corporation tax. The tax situation all depends on what country you're living in. If I was in the UK now selling a game for $10 on Steam, I'd rough sum that I'd end up with $4 of that in my pocket after Valve's fees and income tax.

If you're in the UK and it's your first year self employed then you need to keep in mind that you pay your taxes on account. Which kind of means that you pay next years taxes as well. So keep twice as much back.

All the obvious things should be obvious. Don't piss all your money on fast cars and big houses. Try to think of yourself in 6 months as a different person, a person that you might be fucking over with every decision you make. Imagine the worst situation he might be in. If you games stopped selling tomorrow, what would he do? Start a rainy day fund so you can keep working for 1 year+ without any income. Enough time to make a game or two to get you back on your feet if it all goes tits up.

Early Access

Release as early as you can. This can be for free at first, to a small group of friends. If that goes well start looking at Steam.

You might feel like with Steam there's a lot of pressure. What if your game fails and you want to stop developing it? What about the greenlight process?

You have options. We felt like this with Rust. We didn't know if we were going to carry on with it. We didn't want too many people buying it and swamping our servers. So we started selling a limited amount of keys using Paypal, and made the game web-based so we didn't have to worry about distribution. This brings up its own problems. You need to collect the right amount of tax from everyone. The issue is that every country has their own tax laws, so you need to code a system to collect the right amount. Then you need to put these thousands of entries on your tax return.

With something like Steam things are a lot easier. You set your prices and your royalties get wired to you every month. Twelve transactions a month to add up. Easy.

There is a new alternative distribution system. Itch.io refinery aims to work like a detached Steam, with the emphasis on developer control. It's what Steam aims to be. So it's well worth consideration, at least before adding your game to Steam.

Support

Something that is often overlooked is Support. Do you set up a forum and let users talk to each other? How do people report bugs?

Hiring people to do this for you is a really good idea. Having someone else look into reported bugs, reproducing, and then confirming fixes is a real time saver during development.

In a lot of ways this is a sign of success, so by the time this becomes a problem you should be able to afford to hire someone to do this. Hiring and Firing is probably worthy of its whole own blog, especially if you're doing it over the internet, with people in different countries.

Public Relations

A lot of the time it's not about who likes you, it's about who hates you. This defines what you're about. Don't be afraid to take a stand against stuff. If you try to please everyone you end up with the blandest, characterless boring crap. I'd rather something that I do is loved by 3 people and hated by 7 than have 100 people be completely indifferent.

Feel free to be treat people who they're treating you. You're making games. People who are abusive deserve abuse back - they don't deserve help. They can suck our cocks until they learn how to be civil.

Advertising

No advertising works. Don't waste your money on advertising. Don't waste your money on booths at conventions.

Advertising and marketing are different things. You can make your game immediately interesting to stand out visually, or give it a surprising name, or have it cover a controversial subject. Give interviews where you say dumb stuff that gives them a dumb clickbait headline and makes people hate you. People don't have to like you to like your game, and rather that hate you than don't know who you are.

That's marketing, that works.

Refunds

Steam refunds is a concern to a lot of people. When you get your royalty report and you see that you've had 20% of your sales refunded you're going to feel like this is a shitty system and people are robbing you.

It's important to keep a balanced view of this. If the refund system didn't exist and they'd emailed you asking for a refund because they didn't enjoy it, it wasn't what they thought, it doesn't work, would you have told them to fuck off, it's your money now?

Also consider the psychology behind it. How many people bought your game to try, purely because they knew they could get a refund if they didn't like it? Without the refund system would your sales have just been 20% lower anyway? Did the safety net convince people to buy it, and they didn't refund?

My opinion is that it reduces support requests, and makes customers happier. So fuck it.

Exit Plan

When we release a game our long term plan is to update it and improve it. This works because our games are all multiplayer or sandbox games. And so far it's turned out to be a financially sound strategy, with our games eventually selling more and more each year.

I don't know if this would work for, for instance, a single player linear mission based game. I don't know how you early access something like that,  or whether you should. It is something that I think I would enjoy to do. To work on a game for 6 months in secret, have a few months of limited testing, then release and pretty much forget it, get working on the next game.

Either way you should consider what your exit plan is.

I don't know anything

 

If you've never made games before you have a huge advantage. If I'd have had any industry experience before making GMod I probably would have never made it. Your naivety is a huge advantage, it's your edge.

Don't try to emulate people who are in the industry - do your own thing, make your own mistakes, find your own way. It'll lead you down a bunch of paths that no-one will ever take because they know the 'right way'. The world needs those paths explored.

Jessica

Monday, May 16, 2016

Sarah had the shits all night. Apparently that's a sign that the baby is due - but we didn't know that. At about 6AM she got pains. So we calmly started timing them and writing them down in a notepad, like they tell you to. The pains were about 5 minutes apart, which is kind of near once they've just started, so we didn't believe they were real contractions. Her waters hadn't even broken.

She phoned the MLU and they told us to come in. She was stooped over crying, Alex was behind rubbing her back, saying sorry - because he's that used to it being his fault. I told her we've got 5 minutes until the next one, so get as much shit together and I'm going in the shower.

So I went in the shower. I was just getting dry when I heard her yell my name at the top of her voice. Her waters had broken on the stairs, and Alex wouldn't come down. And she was stuck. So I guided her down, dragged Alex down, and started throwing shit in carrier bags.

When your waters break the hospital like to see your sanitary towel and knickers, so we threw them in a bag for life. Alex was going to my Mom and Dad's house, so I threw a bunch of his shit in a carrier bag. Then we rushed out into the car without taking either of them.

I dropped Alex off at my mom's and jumped back in the car. Sarah was screaming about the urgency so I tried to make her laugh by giving way to people and telling her I was going to stop by the new house to pick up some letters. She phoned her mom, who was meeting us at the office, and told her she needed a wheelchair.

Arrival

All in all the trip only took about 20 minutes. Which is good for driving from Bloxwich to New Cross on a weekday morning. When we got there her mom was waiting with the wheelchair. I lifted her out of the car and put her in it, trying to ignore the mess her dripping womb had made of my front passenger seat. They headed up while I parked the car and got her bags.

When I got to the room she was just moving from the wheelchair to the bed. She was screaming. A lot. She told the nurses that the baby was coming, and to take her knickers off. They looked bemused, like wtf, and tried to calm her down. But she wasn't exaggerating. When they took her knickers off the head was sticking out.

One of the nurses held the head in, while calming Sarah down and telling her not to push yet. Then she told her to push, and the head was out. Then she said to do it again, and the body was out. Jessica was born. We checked to make sure it was a girl, it was, phew.



7lbs 3, at 7:33am, May the 4th. All nice and memorable.

It's a weird thing. We went though so much trouble with Alex's birth. Sarah's bleed, her operation, wiping her ass for 3 months. Jessica was born within an hour, and we were home by mid afternoon. It feels like we cheated, but I guess this is how straight forward most births are.

Alex

I'd told my Mom that Alex's clothes were in a carrier bag in our house, and left her Sarah's keys. What I failed to tell her was that there were two carrier bags, and one of them contained a dirty sanitary towel and a pair of Sarah's soiled knickers.

Alex feels huge now. When I hug him it's like hugging a man. When I change his nappy I feel like he's too old to be wearing a nappy. It's weird, something I'd never appreciated before. A month ago he was still baby to us, Jessica has normalized our frame of reference so that we can see him for what he is now.

He's adapted to Jessica really well. He still thinks of her more as a pet than a person. When he wakes up he wants to go and have a look at her. He isn't as jealous as I thought he'd be. When Sarah was breastfeeding he asked if he could have a go on the other tit.

Living Room Vive

Saturday, April 23, 2016

I've had a vive in my office for a while. Not a new Vive, but the old kryten looking devkit. So when the preorder started for the proper version I decided I wanted to order one to put in the living room, with a computer in a drawer, that I could just close with it all inside when I'm not using it.

I thought I'd make a blog on how my setup went in the hopes that it helps other people's setups go better.

Lighthouses

I put the lighthouses on the ceiling. I live in a bungalow so above the living room is loft. It was a simple 30 minute task to crawl around the loft, drill some holes for the wires, then attach the mounts to the ceiling.



This meant all the wires were nice and hidden. Just a shame they don't make them in white - but they're not that noticeable really.

One problem I ran into was that the TV remote didn't work with them on. Well, it worked but I had to aim right at the sensor on the TV. With any other method you could probably manually walk over and switch them off, but because they're plugged into a socket in the loft I couldn't do that (without a wireless switcher).

Luckily if you enable bluetooth in the settings on the Vive it starts switching them off and on automatically when you start/stop steamvr. This could probably be made a little more obvious - since the only real way to learn about this is to switch it on for shits and gigs.

 

Mac Pro

I had a 2013 mac pro lying around that I planned to install Windows on and use as my living room VR computer. This worked, but ended up failing for two reasons.

It's got an AMD Firepro D700. Which as far as I can tell doesn't accept the latest generic amd drivers. The games that worked did work, and ran well. Some games, which I think were trying to go full screen, had trouble.

I think it was because the computer itself prioritized the hdmi slots wrong. Windows by default were opening on the Vive desktop. So games that were going full screen automatically were doing it on the vive screen - instead of the desktop screen - so the compositor or whatever couldn't go full screen on the vive screen.

Also the displayport to HDMI I was using to connect it to the TV didn't seem to carry sound. And I wanted to be able to have sound without earphones.

I decided that it wasn't worth it, so I moved onto plan 2.

Alienware Steam Machine

For Christmas Facepunch gave everyone an alienware steam machine. I hadn't really used mine up until now because I couldn't be bothered to install windows on it, and the 10 games that ran on linux ran like shit. So this was an opportunity to use it.

It seemed like a perfect candidate. Decent performance, two hdmi slots (one for my tv, one for the vive), and small enough to fit in a drawer under the TV.

It was only after installing windows on it, updating all the graphics drivers and installing Steam that I realised that the second HDMI out was actually an HDMI in. So I'd totally wasted my time. So onto plan 3.

Laptop

I had a pretty powerful gaming laptop lying around, so I decided to use that. And it worked out quite well. I did run into some issues with SteamVR itself though.

When I first started playing with it the SteamVR complained that it couldn't find the vive headset. The headset had a red light on the side. After about 30 minutes of plugging, unplugging, swapping hdmi cables, driver updates, I realised that the desktop size on the hdmi output was smaller than the max. After setting it to the max size it connected straight away.

I was happy to find out later that Direct Mode worked. I think it's an nvidia thing, I couldn't get it to work on the mac pro, but it gets rid of the second desktop so it's just sending the pictures to the headset.. so it removes the possibility of a bunch of different fuckups.

After I got it working the headset kept losing tracking. I readjusted the lighthouses, cleaned their fronts, closed curtains. It had me thinking that the lasers were bouncing off the tv and fucking shit up, and I would have been throwing sheets over stuff if I hadn't already had it tracking perfectly on the mac pro earlier. This is maybe the most frustrating thing with the vive right now. If it's not tracking there's no real way to find out why. You assume it's something in the room - but it might not be that.

I found that it worked fine if I just sat in the grey liney room, but as soon as I pressed the steam menu button, when the overlay popped up it lost tracking and went into a connect, disconnect loop. I found some advice online that suggested disabling the camera - and that fixed it. I guess the 60fps camera overloads the usb bandwidth or something. I'm still not totally clear what limitation my laptop has that the mac pro hasn't got, but while it's working I don't really want to fuck with it.

Summary

The biggest problem with the Vive right now is setting it up. Without any doubt at all. So its appeal is really going to be limited to people that know what they're doing. That's probably not a great surprise though.

The really great thing is that every time I use it I see that Valve have added a new option, or made it better in some other way. It's very software orientated, so a lot of major stuff can be updated - so I imagine that most major gripes are in the process of being taken care of already.

It would be great if you didn't need a monitor. If I could just plug it into a steam machine and press the button on the side of the hmd to open SteamVR.. and even if it's not tracking there'd some kind of menu that I can somehow navigate to fix something, or diagnose something. I guess the market for that stuff is pretty limited because right now you're showing it to people and want to see what you can see on the TV or something.

GDC 2016

Monday, March 21, 2016

Every time I go to one of these things I always remember how much they don't do anything for me. I see everyone enjoying it and genuinely gaining knowledge and skills. But to me it always feels like I'm waiting to go home.

Talks

Going to talks is a waste of time. The online versions have the following special features:


  • You can't smell other people's BO
  • You can stop it as soon as you realise the speaker is an idiot
  • You're not sitting next to a nerd live tweeting it to their 40 followers
  • You can rewind if you don't understand
  • You can fast forward if you do understand
  • It doesn't matter if you fall asleep


The only thing you can't do is line up at the end to ask questions. But that's ok because the questions asked at the end of these things are usually made by people who misunderstood something, or by people who try to outsmart and second guess the talker, or by people who don't speak english.. but embarrass themselves and the speaker by trying to ask a question anyway. The good news is that all the speakers are on twitter - so you can just tweet a question to them if you really have one.

VR Invasion

So many VR games. So many VR peripherals. Really VR'd out already.

We went to the Rift VR party on the off chance they'd give us a free one. They didn't. It was opposite a strip club. The girl on the front asked me to spell my name, I had to type it for her because when I say "a" it sounds like an american "i". I think it was mainly for journalists to play games. It kind of backfired when they started being sick because of tracking issues.

We got approached by a guy while we were there. He asked us what Rift games we were working on then he knocked a tray of food out of a waitresses hand. We told him we made Rust and Garry's Mod. He didn't know what they were. His company buys profitable games to fool the stock market into thinking they're profitable. We shook his hand when he left, but he walked off when Helk put his hand out to shake. I hate everything about him.

Notch was making drinks there. I asked for vodka sour but he made me vodka soda. I tried to drink it but it was disgusting.

Crazy People

There's a lot of homeless people in SF. There also seems to be quite a few people on hallucinogenic drugs.

The first day we were there some guy threw a milkshake at a bin and shouted "WHY DIDN'T YOU TELL ME IT WAS ILLEGAL". He then started shouting at people asking why they wouldn't talk to him. He jumped in front of Alex, who confusedly smiled at him. Then he ran off screaming and shouting.

On the last day we had a couple of hours to kill so we went to the science museum. There was a guy there ranting and raving on the steps. There were a ton of kids around. He chased after a bus and then ran into the forest. He looked like data from the goonies.

It's confusing. These guys have clean clothes on. They don't seem to be homeless. Have they just taken drugs and escaped the safety of their homes? Are they mentally ill?

Flight

We flew Virgin Atlantic. They lost Tom's suitcase. Later on in the week it emerged that they'd sent it to Ghana. They gave him a phone number to call to check the status of it. He got the concierge to call it in the hotel, and it turned out to be a sex chat line. He only got it back on the last day when we went to the airport to leave.

On the way there I got the flight attendant to change my chair into a bed. When Paul saw this he thought he'd to the same thing, so asked someone and they said sure and started doing it. Half way through he realised it was the pilot.

Outcome

We took 20 people - half of whom we'd never even met face to face before. So it was nice to get everyone together and meet. I think for the most part the team did get enjoyment from attending the talks. It was also a nice surprise that none of the team were massive weirdos either.

It was also nice for me to take a bunch of meetings that I'd been putting off for years. But ultimately it was all stuff that could have been discussed over email, or not just not discussed at all.

Ultimately I find I prefer to sit in my boxers making games rather than getting dressed and talking/hearing about them. I still don't understand why people skint themselves out to attend these things. Maybe the illusion of being a successful game developer is more important than actually being one?

Rust's Networking

Thursday, February 18, 2016

I sometimes get asked how we do the networking system in Rust + Unity. Do we use Unity's networking system? Do we use uLink? Do we use two different projects, one for server, one for client? So here's how we do.

Networking

Networking uses Raknet. Raknet is a tried and tested networking solution. It was bought by Oculus for some reason and made open source. This is great except that it hasn't been updated in forever - and there's some bugs in the repository version. The fact that these bugs exist, yet it was so widely used make me think that the open source version had to have a bunch of shit ripped out, so it hasn't really been that tried and tested.

Raknet is coded in c++, and Rust is in C# - so I made a little wrapper library for it. The wrapper doesn't really have to be that complicated, pretty high level. Pretty much just creating and closing a server, connecting and disconnecting, sending and receiving packets. Easy.

The Split

Something that maybe confuses a lot of people is the split between server and client. Creating two projects would have worked, but it would have been pretty complicated. I was raised on the Source engine, so sharing code and ifdef'ing it makes the most sense to me. So that's what we do. The server is compiled with SERVER defined, the client is compiled with CLIENT defined. Then the code is peppered with this kind of stuff.





And we have one of these if we need to switch between them in the editor.


Listen Server

This works fine when releasing stuff but you really want to test shit in the editor. In legacy we had the ridiculous situation where if you wanted to test something you'd written you'd have to compile a server and start it up in the background, then run the client in the editor and join it. This was a fucking nightmare. The problem was that this was so ingrained in how the game was made that it was pretty much impossible to change - and was one of the big arguments for restarting.

With experimental it was a high priority to get listen servers working. How it works is it defines SERVER and CLIENT both. So the code has to be written in a way to account for this.

The game needs to include client and server entities separately. I started off making it so they'd try to share an entity and this lead to problems when releasing builds. It wasn't showing the same behaviour because all the entity variables were automatically shared - instead of being networked. This is really important - it should try to emulate the networking 100%.

Including both sets of entities needs a bunch of care and hacks. For example, if you have a physics object you need to be careful because there'll be 2 physics objects occupying the same space, the client and server version. You need to make it so they don't interact with each other.

But once you get it working



And then it's just a case of being mindful of maintaining it. Which isn't too hard considering that if you don't it breaks.

Server Console Window

I've talked about this somewhere before. How do we make our server console actually show up in a window. Unity fucks with the standard output so that when running in -batchmode the output all gets redirected, so you can't print to the screen.

Well, through trial and error I found a way to make it work. Here's a class that makes it work for Rust. After running that you should be able to use the System.Console commands as normal.

Any questions?

If you want to know how we make something else happen in Rust + Unity abuse me on twitter and I might do a blog about it.

Crash Log Tags

Sunday, January 31, 2016

So in my last blog I talked about how I set up a system to auto-report crashes from Unity to our servers. How to grab the stack trace and group them all up.

It was working great but it was missing a couple of things.

Say I get a crash that gets reported 10,000 times.. I want to break that down to find out what OS it's happening on, what GPU, how much memory etc etc. This is useful when debugging crashes because if a crash is only happening on Windows XP it really narrows shit down for creating a repro.

Also, say I fix a crash. I want to be able to tell I fixed it. What's useful here is a graph of the number of types of report over time.



So we already use Sentry for out exception reporting. It's incredibly useful and I can't recommend it enough.



And this is the exact system we want to use for our crash reporting. So instead of coding a whole new web system and working out the database layout and all that shit, I just fire our crashes into it.

I parse the output log to work out the graphics card and stuff. And it works great.



We have a list of crashes here, organised however we want.



A graph with how often the crash has occurred, segmented by hour and day.



The tag page shows how many reports per crash. Here you can see it's picking up older crash logs too (which tells us that this crash has been happening for a while).



This tag shows us that this crash pretty much is DX11 exclusive.


So this has done everything we wanted and took less than 30 minutes to set up. Sometimes coding is less about what you do, and more about what you don't do.

Automated Crash Processor

Monday, January 25, 2016

I've written an automated crash processer about 4 times. Every time I've had to google how exactly to do it. Every time I've thought to myself "fuck me, I wish I'd written this down".

We're getting a bunch of crashes in Rust. When unity crashes it drops a folder in the game root with a dump and a log.

Uploading the crash log

We have no control over the engine, once it crashes we're done. So we can't just upload crashes from there. So the first time the game starts up, the very first thing it does is looks at all of the folders in the game root.

It looks inside each one and if it sees a error.log, it zips it up and sends it to our website, which then stores it in the database.

Processing the crash log

So we have the log. Something to be considerate of is that the stack trace in the output log that unity generates is probably bullshit, depending on whether it could find the right symbols when it generated it.

So we need to process the mdmp ourselves. Which involves running cdb.exe - the command line version of windbg. The format I use is:
cdb.exe -z "crashlog.mdmp" -c "!analyze -v; q"

I'm calling this from a quick c# program I wrote, so inside I capture the results and save it to the database.

Symbols

Unity has a symbol server. Which is great.
http://symbolserver.unity3d.com/

So on the command line to cdb we can provide them too.
-y "Srv*c:/symbols*http://msdl.microsoft.com/download/symbols;Srv*c:/symbols*http://symbolserver.unity3d.com/"

If you don't have the symbols you won't see shit. It would be cool of AMD/Nvidia had symbol servers too.

Grouping

The stack trace you get from cdb.exe will look a bit like this.
00000000`0a3be610 00007ff7`ea14aa8a : 00000000`08718e64 00000000`0a3be6c9 00000000`083e7a00 00000001`28a066d0 : d3d11!CContext::TID3D11DeviceContext_Map_+0x1a
00000000`0a3be660 00007ff7`ea16509b : 00000000`0000000c 00000000`083e7a00 00000000`548215a0 00000000`052ead20 : RustClient!StreamOutSkinPoseBuffer::Update+0x10a
00000000`0a3be730 00007ff7`ea165baf : 00000000`052ead20 00000000`083e7a00 00000000`0021fdd4 00000000`000000f8 : RustClient!GfxDeviceWorker::RunCommand+0x558b
00000000`0a3bf820 00007ff7`ea15f38a : 00000000`00001000 00007ff7`ea9e8c38 00000000`00001528 00000000`00000000 : RustClient!GfxDeviceWorker::Run+0x2f
00000000`0a3bf850 00007ff7`e9d38ec6 : 00000000`044ade40 00000000`00000000 00000000`044ade40 00000000`00000000 : RustClient!GfxDeviceWorker::RunGfxDeviceWorker+0x3a
00000000`0a3bf880 00007ff9`52972d92 : 00007ff7`e9d38e90 00000000`00000000 00000000`00000000 00000000`00000000 : RustClient!Thread::RunThreadWrapper+0x36
00000000`0a3bf8b0 00007ff9`53479f64 : 00007ff9`52972d70 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x22
00000000`0a3bf8e0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x34

You could generate a hash from this to group similar stack traces together but the memory locations create too much fragmentation. So I trim my stacks to look more like this.
d3d11!CContext::TID3D11DeviceContext_Map_
RustClient!StreamOutSkinPoseBuffer::Update
RustClient!GfxDeviceWorker::RunCommand
RustClient!GfxDeviceWorker::Run
RustClient!GfxDeviceWorker::RunGfxDeviceWorker
RustClient!Thread::RunThreadWrapper
kernel32!BaseThreadInitThunk
ntdll!RtlUserThreadStart

Then create a hash from that to group them together. So far it seems to work well where symbols are present.

Visualization

So with all that done, just a quick website to visualize the database and download zip files of interesting crashes.

Uses

As you can see, most of our crashes are caused by steam_api. I suspect we're shipping the wrong version of this file to 32bit windows users, so I've updated them all to the latest to see if the crashes stop coming in after the next update.

This gives us the ability to prioritize fixes like this, and to raise them with Unity. It would be awesome from our point of view if Unity did this automatically and really made their engine bullet proof, but I guess it's unfair to suggest that most of these crashes are Unity's fault when they could be hardware specific.

Footnotes

cdb.exe doesn't seem to download symbols when running in a service. So I had to make an app that just runs indefinitely, querying the database for new dumps to process. I remember something like this from the first couple of times I made this.

Is there a service that does this? I know we have things like sentry for exceptions, but is there anywhere we can send minidumps, provide with a list of symbol servers and then have everything processed and organised for us?

The closest thing is the error stuff Steamworks has built in, but that doesn't let you provide symbols, doesn't let you manually upload mdmps and hasn't really changed in 10 years.

Microtransactions

Wednesday, November 4, 2015

We've been selling items in Rust for a while. People get angry when they hear the word microtransactions. I understand why. They've been fucked over. Why would an early access game have microtransactions?



If you'd have asked me if I'd ever have a game with microtransactions in 5 years ago, I'd have probably laughed in your face, but the way Valve does it is different. The idea is that no-one loses out. Everyone wins with every transactions.

Money Guy

You've got the guys with money, who don't mind microtransactions. They like to dress their character up, have nice weapon skins. All that. Generally more money than time, instant gratification guys.



They're happy because the stuff they buy makes them happier than having an extra $2 in a jar in their house.
They're making people happy because when they get killed people can loot their purchased items.


Poor Guy

So you've got the poor guys with no money. They hate traditional microtransactions because it's a paywall. But on Steam they play the game and get random drop items, and can then sell and trade those items on the marketplace. It's not unfeasible that a player will make more money selling items than the game itself cost.



They're happy because they can sell the stuff they get randomly for free, buy games from Steam.
They're making people happy because they can buy stuff from them.

Modding Community

Then you've got the modders. The unappreciated guys who tinker around and make stuff in their bedroom which is in their parents house, because no-one will give them any money because paying people for their creations is terrible.

They're happy because they get to see their work in a game that they love while getting paid for it
They're making people happy because they're creating more game content for them

Developers

Then you've got the developers.

They're happy because they give players more reasons to play their game
They're happy because they link their game with a thriving virtual economy
They're happy because they get more money to make more games



When you see the system up close and far away, it's a total no-brainer. In fact I would go as far as to say that by not being involved in the marketplace we're screwing our community.

Unity Tips 2

Thursday, June 18, 2015

OnValidate

You know when you make a component, then you add it to 35 prefabs, then you add another value to it and it needs to be initialized or something. That sucks eh?



Well OnValidate gets called (only in the editor) every time you save or edit your component. What's cool is that if you edit your component (like when you change this function) all the prefabs get this called on them. So you can use it to validate and correct your prefabs.

void OnValidate()
{
myvalue = 5;

if ( GetComponent() == null ) Debug.LogWarning( "MISSING COMPONENT!", gameObject );

ForceLabel( gameObject, "MyComponentLabel" );
ForceBundle( gameObject, "shared/entity.bundle" );
}


You might want to set up some nice little functions, so you can automatically tag prefabs containing a component.

internal static void ForceLabel( UnityEngine.Object obj, string label )
{
if ( UnityEditor.PrefabUtility.GetPrefabType( obj ) != UnityEditor.PrefabType.Prefab )
return;

var labels = UnityEditor.AssetDatabase.GetLabels( obj );
if ( !labels.Contains( label ) )
{
var labelList = labels.ToList();
labelList.Add( label );
UnityEditor.AssetDatabase.SetLabels( obj, labelList.ToArray() );
UnityEditor.EditorUtility.SetDirty( obj );
UnityEngine.Debug.LogWarning( "Forcing Label On Object: " + label + " - " + obj );
}
}


Or maybe force the asset into a specific bundle.

internal static void ForceBundle( UnityEngine.Object obj, string label )
{
if ( UnityEditor.PrefabUtility.GetPrefabType( obj ) != UnityEditor.PrefabType.Prefab )
return;

var path = UnityEditor.AssetDatabase.GetAssetPath( obj );
var importer = UnityEditor.AssetImporter.GetAtPath( path );
if ( importer && importer.assetBundleName != label )
{
importer.assetBundleName = label;
}
}

Duplicate With References

I ran into a problem recently. I had all the info for a specific entity in a folder a Pumpkin. It had its entity prefab, which referenced some ScriptableObject properties, an icon and some other related prefabs. All in one folder.

So then I wanted to make another version of this entity, some Corn. This was pretty much set up the same so all I had to do was copy the folder and edit the filenames. Then I realised that all the prefabs and stuff in the duplicated folder were still referencing the other files in the Pumpkin folder. Well that sucked.

So I made this tool which duplicates a folder then goes through all the objects in the new folder, and if they point to anything in the old folder we change the reference to point to the file in our folder.

Source code is here (right click folder, tools > duplicate with references)

FindAndReplace

So after I did that I had my Corn folder, but all the files inside were all named "pumpkin.icon.png". So I made FindAndReplace, which not only renames the files but also can replace text in any strings in the prefab's components and ScriptableObjects.



Source code is here

Unity Tips

Sunday, June 14, 2015

Here's a few generic programming things we use in Unity to make our lives easier. These might be useful to other people.

Singleton Component

GameManager, SteamClient, yadda yadda. You probably have a component somewhere where you only want one of them and you probably want to get access to it from everywhere for some reason. So we added SingletonComponent.

public class MainCamera : SingletonComponent
{
public void DoStuff()
{
}

public static Vector3 position { get { return Instance.transform.position; } }
}


Now you can access the component via MainCamera.Instance

MainCamera.Instance.DoStuff()


Source here.

List Component

You probably have a bunch of components that you want to keep a constantly updated list of too. Maybe all your enemies, or maybe all your bullets.

public class EnemyBullet : ListComponent
{
public void Explode()
{
}
}


You can access the list via EnemyBullet.InstanceList (be aware of destroying while iterating etc)

foreach ( var bullet in EnemyBullet.InstanceList )
{
bullet.Explode();
}


Source Here.

Interfaces

Components can implement interfaces and now Interfaces can be grabbed using the GetComponent methods.

We use this in Rust to tag components with functionality and to mark them as cullable on the client/server (which means our build system will remove that component from all prefabs when targeting specific platforms).

public interface INeedsToStartDisabled { }
public interface IEditorComponent { }
public interface IServerComponent { }
public interface IClientComponent { }
public interface IServerComponentEx { void PreServerComponentCull( IPrefabProcessor p ); }
public interface IClientComponentEx { void PreClientComponentCull( IPrefabProcessor p ); }


public class Decal : MonoBehaviour, IClientComponent
{

Extensions

Not many people know that you can add extended class functionality in c#.

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

namespace UnityEngine
{
public static class TransformEx
{
public static string Log( this Transform transform, string strText )
{
Debug.Log( transform.name + ": " + strText );
}
}
}


This lets you do

transform.Log( "Testing testing" );


More info.

Prefab Attribute

In Rust we have a problem with memory usage because of the pure number of GameObjects we have. We noticed early on that the more components the more memory.

It's also pretty common that when you have a component it's usually identical and unchanged on every prefab, being used only to hold variables that go unchanged. So we added prefab attributes. These are like regular components except they get removed before the prefab is spawned.

Our doorway prefab looks like this:



But everything selected here is an attribute



In this example, the sockets relate to the building system. They are snap points, they define where this building piece can attach to, and where other pieces can attach to it. Each socket has rules, more gameobjects, more components. All of which are static, they hold no variables specific to an in-game object.

So we delete them all on the first spawn of the prefab but keep them all around. Even though they're deleted we can still access the functions and the variables. We store their local positions and rotations and can then transform them to the real in-game objects to be able to run tests etc based on their in-game locations.

This all means that when 5,000 doorway entities are spawned on a server, we're spawning ~20,000 components instead of 300,000+

Godus

Friday, June 5, 2015

Positivity

To be a successful at anything you need to be blind to a certain level of negativity. You need to be forward looking, positive, confident in your own opinions.. and most of all you need to be excited about what you're working on.



This is what Peter Molyneux's special ability is. It isn't a bad thing at all. It's a awesome trait and it should never be lost.

Publishers

It's is a hugely powerful tool when talking to publishers and investors. It gets you funding. Gets your project green lit.

The game is going to take 12 months longer than expected? Let me explain why we want 10 million dollars more to really nail it and make you money. It's not even about a game in that situation - it's about selling the idea, the pitch, the situation.

Traditional Press

They're selling magazines that no-one buys. We have the internet. So the best way to get sales is to get exclusives. Missed exclusives are missed sales. If a magazine comes out next week that has Half-Life 3 exclusive info you're gonna go buy it. They probably wouldn't get that exclusive if they'd previously dug up a bunch of dirt on Gabe.

So of course they're going to eat up anything Peter says. They're not going to question it. They're not going to stop and say "hang on, remember that last interview you did with the cube thing - that ended a bit shit didn't it? I don't think we want to print any more of your bullshit - we'll wait until the game comes out and review it.".

Backers

Replace publishers with kickstarter backers, the traditional press with social media. Release on Early Access. Now the old rules don't work.

The game is going to take 12 months longer than expected? Fuck you scamming pricks - finish it right now.

Your backers understand your game. They can see your game. They can see what it has, what it doesn't have. They can see your work rate. They have long memories and will use everything you say against you. Everything is about what you produce. If you're producing more bullshit than content you're going to be in trouble down the line.

But backers are also stupid, petty, shortsighted, self-centered, volatile and pedantic. They don't understand the process. They're not going to understand that a feature you talked about 8 months ago not being in the game is a casualty of game design - not a broken promise. So it's best to not talk about it until it's done.

The Online Press

The online gaming press consists of pasting stuff from the traditional presses websites and pasting stuff from the front page of reddit. There's no investigation, no checking up, no journalism.

So if you piss enough of your backers off that they get onto the reddit front page - you're going to have to answer some tough questions. Once one website publishes a news articles they all publish it. Suddenly people who had backed your game on a whim 2 years ago and have never even redeemed the steam key are going to be outraged of your abandonment of the original vision.

Now it's an airing of grievances. Everyone you accidentally stumbled into. Everyone who has worked for you. Every promise you've broken. Every idea that you haven't implemented. Your massive house.

Had a 30 year career? Shaped the industry? Made some of our favourite games? We don't care - we want you to strip off, crawl around on broken glass and beg for our forgiveness. And even then, even if you admit that you fucked up - we're still not going to forgive you. We're going to force you out of the industry. Because our increasingly irrelevant website needs more pageviews.

Lessons For Developers


  • Under-promise on everything
  • Don't bullshit
  • Hype, faked demos, faked trailers hurt you in the long run
  • Don't talk about stuff until it's done, in game, and you're happy with it
  • Be in the community
  • Don't abandon your PC backers for mobile/console money

Lessons For Backers


  • You paid $20. It's still their game, you're not the head designer.
  • Opt out of hype - believe only gameplay
  • Be understanding - but never stand for being purposely deceived
  • You're making the industry better
  • Vote with your wallet

Lessons for Peter Molyneux

Get excited in private. Fund your own games. Never retire.

Steam

Sunday, April 26, 2015

























Paying for Mods

Friday, April 24, 2015

There's a lot of craziness about paid mods, a lot of people who don't know how they feel. It's probably no big suprise that I'm all for it. I sold a mod once and everyone was angry that it was happening, until it happened and they got a much better product than they'd have gotten when it was released for free, then they seemed to calm down a bit. It has given me a carreer for 10 years. It's bought me two houses, a bunch of cars. It's created a company that has hired 30+ people.



So here's some important points:

There are still free mods

A lot of the craziness seems to come from the thought that no-one will ever release their mods for free. That makes no sense.

Some stuff won't be worth charging for. Some people won't want paying for their stuff. If a mod takes 10 seconds to make and someone wants to charge $10 for it then they won't sell any copies because it's not worth it. This is how the market balances itself. They'll either have to lower their price or make it worth the price.

You don't have to buy anything

No-one is holding a gun to your head. You don't need these mods, you just want them. Are they worth more to you than whatever else you're going to spend the money on? No? Well don't buy them, do without.

You're a kid and you don't have any money

So find a way to pirate them. That's what we all did when we were kids with no money. Valve's job is to make it more convenient for you to not pirate stuff.

People will upload stolen stuff

I've said it a million times - If "people are assholes on the internet" was a reason not to do something then we'd never do anything

Stuff is going to happen. There was a time where they'd almost completely stopped making PC games because of piracy. Should we really let the fact that sometimes people are assholes dictate what we do? Or should we just deal with it when it happens?

Who is winning

So lets take a look at what is in this for everyone. Who wins out of this.

Users




  • More choice

  • Better supported mods

  • Some stuff costs money


Modders




  • Money

  • Career

  • Actual mod support from game devs (because they directly profit from it)

  • 25% revenue sucks

  • Resistance to new things


Game Developers




  • Money

  • Longevity

  • Resistance to new things


Valve




  • Money

  • Support

  • Chargebacks

  • Babysitting

  • Resistance to new things


So obviously Valve and Game Devs are the biggest winners right now. That's the wrong way around in my opinion. The modders should be getting the majority share of the revenue from this - that just seems like common sense.

It's obvious that Valve and the game developer need to make money here too, enough to cover costs at least - but it's the modder's work that is making the money. I don't know whose choice that is though, but it feels like someone is being a greedy asshole. This is something that will get better with time.

It's a choice

It's most important to remember that this is a choice. You don't have to charge for your mod. You don't have to buy a mod. In the same way that there's hundreds of free games on Steam right now that you've never played, and there's hundreds of paid games on Steam right now that you've never bought.

If you don't like it then don't use it, but don't take the opportunity away from people that do.

What about Garry's Mod

It's something we're interested in for sure. It's something I wanted to do when Workshop was first integrated into GMod in 2012, but the system wasn't ready for it.

People already sell their mods for Garry's Mod privately. Doesn't it make sense that we bring that into Steam so those transactions can be trusted by both parties? Obviously it's going to be hard to convince those guys to move their mods to Steam and lose 75% of their profits, but we'll see what wiggle room we have on that.

We'll wait to see what it looks like once the Skyrim system has stabilized and see what we can learn from it before pushing forward, but opportunity is never a bad thing to give people.

Leafblower

Wednesday, January 7, 2015

A while back I received a parcel. Inside was a leafblower, a steam cleaner and an extension cord.



I hadn't ordered any of these things, but the box was addressed to me. So I assumed someone on the internet sent them me as a joke. A leafblower - because there's a leafblower hidden in GMod. A steam cleaner, because GMod is on Steam. And an extension cord because GMod is an extension of Half-Life 2.

So obviously I set the leafblower up and piss arsed about with it around the house. Then I packed it all away and thought nothing of it.. until a couple of months later when I got a note through the door from a guy down the road. Apparently he'd ordered this stuff and the parcel company didn't know who it was for, they just had the post code, but they'd delivered something to me before so they'd put my name and address on it.

So I taped the leafblower back up and made it look like I hadn't been running around the house blowing shit over with it and put it all back in the box. I bullshitted the neighbour, telling him we assumed it was a Christmas present we'd ordered so just put the box away without opening it. This went down well, but I could tell he didn't believe me. Even as I was speaking I could tell he was imagining me blowing frozen peas around in the bath with his new leaf blower.

Garry's Mod is 10 years old

Tuesday, December 23, 2014

10 years ago I was 22. I was living with my parents. I made a mod for Half-Life 2.





It's funny because I had no idea what I was doing. I didn't use any source control. If I did something that resulted in a crash and my undo buffer didn't fix it I ended up in extracting the SDK again and starting from scratch. It wasn't up until version 7 or 8 that SVN was used and I actually understood all of the changes I was making.



When Erik@Valve asked if I'd be interested in selling GMod on Steam I thought he was crazy. Who the hell would buy it when it's available for free? Luckily - he asked me again. This time I'd given it some thought, I'd thought about all the things I could do to it. And I said yes.

Coincidentally Valve held the first Steam Dev Days a couple of months later and flew us out there. I had a meeting with some of the Valve guys to discuss the plans for GMod. It was hard to concentrate because Barney from Half-Life 2 was there. I'm also pretty sure Doug Lombardi wanted to kill me.



We didn't know whether people would buy Garry's Mod. Whether anyone would care. Neither did Valve. So it was pretty impressive that it took down Steam temporarily when it was released (Steam was in its infancy at this time). That first day peak was about 5,800 sales, then dropped off to averaging around 300 sales a day. I was over the moon, how long would this last! For perpective, in 2014 our peak was 152,000 sales in one day, and our daily average was 7,500.



The next few years were spent updating and improving the game. I rented an apartment. I was spending more and more of my time doing paperwork so I enlisted Craig, my best friend from school, to take care of all the bullshit stuff. We created a company called Facepunch and got an office which was not far from my apartment. (Then I bought a house, so we got a new office which is not far from my house)

So I guess what I'm saying is.. Happy Birthday Garry's Mod, thanks to everyone who contributed to it, thanks to everyone that bought it and thanks to Valve for creating Steam and giving me a career and letting me bring people along for the ride.

Selling Out

Monday, September 15, 2014

The whole Minecraft being bought by Microsoft thing is stirring up a lot of anger and stupidity towards pretty much everyone involved. The things that matter on the internet and the things that matter in reality are completely different.

Once you start hiring people your whole attitude changes. You're not just fucking about with your life anymore.. you're fucking about with other people's lives - and the lives of their families. You can't just sell out and fuck everyone over. Companies like Blitz that go bust, don't pay people what they were owed, let 175 staff go, then started up under another name almost straight away. Those are the guys you don't want to be. I am sure more than the top guys at Mojang became very financially rich due to this deal and that's something that should be admired - not seen as a bad thing.

Whether or not Minecraft itself is "fucked" because it's owned by Microsoft is debatable. I'm sure Microsoft didn't just buy it because they're struggling desperately to stay relevant and some of their kids play it a lot. But even if they did it really isn't in their favour to pay a shitload of money for it and then completely fuck it up. That wouldn't make any sense. Time will be the judge on that, I guess.

Long story short. I'd have done the same thing. The money is enough to very much take care of all the staff. The game is in relatively safe hands. Mojang's legacy is as a huge success story instead of a one hit wonder. Everyone wins. Can you seriously say you'd have done it differently?

One Year On

Sunday, September 14, 2014

A year tomorrow Alex was born. You can read more about that here and here.



In a lot of ways it seems a lot longer than a year. It's hard to believe there was a time that he didn't exist. Looking back it's incredible to see how much he's changed. He went from a dark haired boy to a big fat baldie, to a blonde haired boy.





He's changed that much to the point where we see photos of him and it's hard to believe it's him. This is apparently the same route that I took though, I was born with dark hair, it went blonde, and now I've got the sexiest thick dark hair you've ever seen.

So, how is it being a parent? It's exhausting. We get up earlier, we go to bed earlier. I used to wake up naturally between 9-10am, eat my breakfast in front of my computer, answer some emails, work until 11-12 then watch TV in bed for an hour. Now I literally can't even remember the last time I was asleep past 9AM, and I think I've gone bed after 11pm just once in the last 6 months. On Fathers Day I got to have an afternoon nap for about 3 hours, and it was awesome.

But it's worth it. Sneaking in to his room to wake him up. Learning to roll over. Hearing him laugh. Learning to crawl. Splashing in the bath. Climbing on the sofa and lying down to watch TV. Rolling around in a blanket on the floor. Climbing on the dog and using him as a pillow. Dancing to adverts on the TV. Learning to walk. Crying when you leave the house.

If you're a self centered work-aholic like me it can be really tough to adjust, so it's important that you have a supportive partner that understands how you work. Sarah has turned out to be an even more loving and caring mom than I knew she would be. It's a huge interruption to our lives, but he is definitely his own reward. We loved him to bits when he was born, and we love him more and more each day.

Happy Birthday Alex

Love from Dad

I fell out of love with Lua

Saturday, August 16, 2014

I used to like Lua a lot and now I don't. I think anyone intending to add a scripting language to their game/engine should seriously consider using Javascript instead.

This opinion isn't based on anything logical like speed or implementation. Lua has served us really well in Garry's Mod in terms of both speed and speed of implementation. It's worked pretty much flawlessly.

Syntax

My real issue with Lua is the syntax. It's different for the sake of being different. A claim is always made that the language is made to be easy to understand. There's a lot of places where this falls to bits. Want to add two strings together?

mystring = front + back;


No, that's too hard to understand right? Lets do this instead.

mystring = front .. back;


Why is that easier for people to learn? Why are // comments harder to understand than -- comments?

How do we test if something is not equal to something? Which one of these makes the most sense?

one ~= two
one != two


The ! isn't used anywhere else on Lua, so there's no real reason for them to use ~ other than to be contrary.

Bad Habits

By using Lua you're teaching a bunch of people the wrong way to program. You're teaching them a language that isn't going to help them in the future. You're teaching them that arrays start at 1 not 0.

Missing Features

Lua doesn't have unicode support. This is a pretty big deal in a modern day scripting language, you shouldn't have to treat strings like binary data and you shouldn't have to install addons to support unicode.

No "var++" or "var += blah". The whole point of scripting languages is to make it easier to code.

No continue keyword.

Javascript is the future

Javascript is used all over the web. It's only going to end up getting used more and more. Google, Mozilla and Microsoft are all working to make it faster and faster.

Ultimately if we have to teach people a scripting language, lets teach them a language that will serve them in the future. Sure the jump from Lua to Javascript isn't that great, but if you skip Lua there's no need to make a jump at all.

Update: 25/5/2018

Javascript sucks, c# is the future.

Rust Screenshots

Tuesday, July 29, 2014

Thought it would be fun to put together a bunch of Rust screenshots I have lying around.. Starting with the original browser version all the way up until the modern day experimental version.






















Depression

Thursday, July 10, 2014

I heard about a friend being depressed the other day. It got me wondering whether I'd ever been really depressed, depressed enough to consider suicide. I don't think I have, but I think I can understand the feeling.

Jobless Loser



The most depressed I've been was when I was about 17-18. I'd left school and failed out of college. I lived with my parents. I had no job. I remember waking up about about 5:30 one morning and looking out my bedroom window. My dad was loading his car ready for work. I had a sudden realisation that he did this every morning. He leaves the house, he goes to work, he works his balls off, and he comes home. And he had done that all my life, and before I was even born. And I was lying in a bed that his hard work paid for, in a house that his hard work pays for. Doing nothing to make his life easier.

Mental Crisis


There was a crisis in my mind. On the one hand I knew I was a worker, and I wanted to support myself, I didn't want my parents to have to support me. On the other hand everything seemed fucked. The whole world is fucked. You get a job you hate, you work it for 50 years to pay for 10 years off at the end, then you die. What's the point? To buy a house? A car? It's completely futile. And millions of people are taking part in it. Ants on an ant-hill. Who would even notice if I didn't take part? In 200 years I'm not going to be remembered, my existence doesn't matter.

Why did everyone else?



There's a few realisations that I had over the years that helped me get over this feeling. When you think of your ancestors you tend to think back 50, 100, 200 years. But when you think about it you have ancestors going back to the very start of time. Millions of years. Hundreds of thousands of ancestors. Each one of those lived long enough to create the next - from the first cells 2,000 million years ago, to primates 100 million years ago, to you. You have a blood line all the way back there.

This might make you feel even more meaningless. But it couldn't be more the opposite if it tried. Imagine if one of those guys 100 million years ago just thought fuck it, unsubscribed. None of their ancestors would have been created. My maths isn't great but I would guess that there would be about 10,000,000 less people on the planet right now (assuming avg breeding age is 20, and avg children is 3). That seems like it would have had a pretty significant effect. This could be interpreted as meaning that if you're not a breeder you're useless. But that's not the case, nature wouldn't create non-breeders if that was true.

The Meaning Of Life



Which brings me to the real meaning of life. To protect and nurture your family, friends, the human race, animals and plants - in that order. This is why people get jobs and go to work every day. It's why my dad got up at 5AM every morning. If you don't like the system try to find a cheat-code, but don't completely discount getting a job in the meantime. Your current job doesn't define you and it isn't for life.

The more people you help in your life the more meaningful you have been. It works the other way around, if you kill someone you have probably killed hundreds of thousands of future generations of people.

I'm being extreme. It's more granular. Maybe by being a programmer I have got 3 kids into programming. Maybe one of those grows up and becomes a teacher and teaches 100,000 kids to program. Maybe one of those kids uses his new logical brain function to cure malaria, leading to millions of lives being saved. That's millions of people that would be dead if it wasn't for you.

Nowadays



I get down sometimes. I probably wouldn't even describe it as depression, it's more of a grey feeling. But it always seems to be that it happens in waves. One month I'll feel awesome for a week, the next I'll feel shit for a week. I think the realisation that it happens in waves helps me. It's like realising you're dreaming in a dream, you take control.

So now if I feel down I try to apply logic to that. I'm feeling down, why is that? Has someone been mean about me on the internet? Fuck them, no-one's talking about them. Is Sarah being a bitch? Hug her. Is some code I wrote bad? Sleep on it, it'll be better tomorrow. Does it feel like a mood wave? Doing some exercise cures this pretty much instantly.

How I Upload Stuff

Saturday, May 17, 2014

A lot of people ask what I use to capture the videos and images I post in my weekly Rust devblog. The short answer is that I use ShareX. Here's a longer answer.

1. Install ShareX



Go to the website, download, install.

2. Configure Uploaders



There's a shitload of different uploaders you can use. I used dropbox until I used all my bandwidth and then they closed my public links off and refused to open then for a month. Now I use Amazon S3.. which has the benefit of being faster than dropbox, I get my own domain name. The only downside is that we have to pay for bandwidth. Bandwidth is cheap though.

3. Capture Video



ShareX is a bit bloated. Instead of adding things optionally, via plugins, they seem to have added everything you could possibly want. Which is cool but it kind of makes things hard to find. So to capture videos do this.



Then you will get this



Then it will download the file and put it in the right place. Now you can capture and upload mp4 videos really really easily. I think the default key bind is Shift and F11.

The default settings are terrible though, it defaults to 20fps and 3 seconds of video. So you probably want to go into Task Settings > Capture > Screen Recorder and set your settings like this..



This will make it so it records in 30fps, and it will only stop recording when you press the key combo again (Shift + F11).

MP4? Why not WebM?



I use mp4 because it seems the best supported. The only thing that doesn't support it is firefox as far as I am aware.

Why wouldn't I just use Fraps?



Because you can't record desktop rects with Fraps. Fraps doesn't encode automatically. It doesn't upload automatically. This makes things really fast and easy to share. Just press shift and f11, drag a rect, record, upload, paste link somewhere. Easy.

Example



9 reasons why I LOVE C#

Friday, April 18, 2014

I always enjoyed coding in c++. But coding in C# makes coding in c++ feel like coding in assembly. Here's 9 reasons why I love it.

No Headers

It's not until you stop using headers until you realise how stupidly archaic they are.

Var

Using var means you don't have to actually declare the type. The compiler can work that shit out for itself! This is one of those things that you don't appreciate when you hear about it.. but when you start using it you really do.

// c++
int myvariable = GetHealth();

// c#
var myvariable = GetHealth();


You can still use int in the c# version if you like, and I'm sure there's purists that say that you shouldn't even use var for some reason.

LINQ

I haven't even scratched the surface of knowing what Linq is all about.. but I know this is cool. Imagine you need to find a player by playerID in a list of players. I appreciate that you'd have probably wrapped all your ugly c++ with macro's or you'll be using some super complicated Boost library in c++.. but for arguments sake

// c++
MyPlayer player = null;
for (std::list::const_iterator it = playerList.begin(), end = playerList.end(); it!= end; ++it )
{
if ( (*iterator)->PlayerID == FindID )
{
player = *iterator;
break;
}
}

// c#
var player = PlayerList.Find( x => x.PlayerID == FindID );


Yep that's right. It's like writing an inline function. It feels like cheating.


var notPlayers = PlayerList.FindAll( x => x.PlayerID != FindID );
var banPlayer = PlayerList.Find( x => x.Username!= BanName );

Attributes

If you've ever written a class factory in C++ you will appreciate attributes. So you make this function..


public class ConVar: Attribute
{
public string help = "";

public ConVar( string help )
{
this.help = help;
}
}


Now in any class in your code you can do this..


[ConVar( "Start health of player" )]
static public float health = 4.5f;

[ConVar( "Player's name" )]
static public string name = "Unnammed";


Now on startup you can make your program find every ConVar attribute and set them up in a dictionary by field name. Then you can add functions to get and change their values. You just made a convar system.

It's kind of an excited feature once you start digging into it, there are tons of possible uses.

No Macros, templates

Like headers, a lot of c#'s strengths come from the things it doesn't provide. It's simple and easy. It doesn't encourage you to change the language. Sometimes coding in c++ is like writing your own language for things and fooling the compiler into working for you.

Named Arguments

You ever had a function with tons of arguments, or even worse - a ton of optional arguments?


int MyFunction( string shirt = "", string shoes = "", int numEyes = 2, float time = 5.0f )
{
// Do Something
}

MyFunction( shoes: "Trainers" );
MyFunction( time : 2.0f, shirt: "white" );


It's another one of those things that seems useless, but is really nice.

Interface, Abstract

In C++ you can kind of make an interface but it's never really proper. With Interface and Abtsract classes in c# you know exactly where you are.

64 Bit

Converting c++ code to work in 64bit is a bit of a mine field. You might get it compiling.. but you never really know whether your code is actually going to be doing bad things unless you have either designed it from scratch for 64bit, or you have gone line by line and verified.

In C# chances are your code is going to just work. Unless you're doing some really really specific things. To me this sums up C#. It shows how abandoned and old fashioned c++ is.

Mono

Thanks to Mono all this stuff isn't bound to Windows. It kind of makes your investment in learning c# less useless.

Summary

C++ is never going to go away. It's probably always going to be the bedrock of everything. But maybe it's time to re-evaluate whether everything should be coded in C++ by default. Maybe it's time to think about the future. Writing less error-prone, more future-proof code.

Serializing Shit

Thursday, April 10, 2014

So I was looking at serialization yesterday. Here's what I have found out.

What Is Serialization

Saving your classes to some format that you can rebuild them from. So, say for example in Rust you have a box filled with stuff and you want to save your game.. you need some way to save that information to disk. Or if you have an item and its health has changed, you need some way to send that data from the server to the client.

Because we're talking about a game, we're not talking XML or JSON. We're talking binary.

The Lowest Level, Simplest Way

I don't know that you can get any simpler than this in C# - I'd be surprised if you can.



I think it's safe to assume that you can't really get any faster than this.

Reflection

Reflection is slow. We all know this.. right? So yep. Iterating fields, checking for attributes, and using GetValue( obj ) is about 4-5x slower than the above method. Which isn't crazy slow (because above is quite fast).

There's ways to make this faster. By caching the fields and only calling GetValue( obj ) I got it to about 2x slower.

I found some code that created a function on the fly to GetValue.. and then it was only about 1.5x slower. Which was acceptable.

At this point I decided that even though this worked, and the speed was acceptable.. the amount of code wasn't. The fact that it didn't handle compatibility properly, all that had to be custom coded. That was a turn off.

Google Proto Buffers

So then there's Protocol Buffers. We use this c# flavour. Protocol buffers solve a lot of problems we're likely going to come up against. They are future compatible, so we can add new fields to them and old saves will still be compatible.

So now the process is to create a proto file, which looks like this..



Which, when we run our batch file.. generates a bunch of c# classes.. which allow us to make our new save/load to this:



And.. they're fast. Obviously not as fast as the low level mode but not far off - certainly faster than anything I could make happen with reflection.

I experimented with a few things that did make them faster. For example, using the ProtoBuffer itself to store the variables, rather than creating a builder every time. I couldn't justify the code mess it made, and speed increases by doing this were minimal.

It's not made obvious in the code, but the item returned by Save can be used to create a byte[] array, or a json string, or an xml string. This is another great reason to use Protobuffers.. because at any time you can call Save() and save that item to JSON.. to find out what's going on.

Also - the same proto files can be used to generate code in c++ and PHP. So you can share the data between pretty much anything and it becomes loadable and usable instantly.

Conclusion

Use Proto buffers if you're saving/loading/sending network messages.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Unity Viewmodels

Monday, April 7, 2014

We have some nasty hacks in Rust. One of the nastiest, most intrusive hacks is the viewmodel system.

The Usual Way

The common sense way to render a viewmodel would be how games have pretty much always rendered viewmodels. Right before rendering them, clear the depth buffer then render.

You clear the depth buffer so that your viewmodel doesn't poke through stuff that you're too close to.

The Unity Way

You can do this in Unity by using a second camera. You set the layer of the viewmodel to a layer that only the second camera renders. You can change the FOV and make it clear the depth. You're a happy chappy.

This works perfectly apart from one thing. It's not affected by the lights of the first camera. It doesn't receive shadows.

The Alternative Unity Way

People on the Unity forums suggest just parenting the viewmodel to the main camera, and moving it back when you get too close to walls. This works I guess, I'm not convinced it makes much sense though. And you can't change the FOV.

Plus there's crazy floating point inaccuracy issues with meshes in Unity if you stray far away from (0,0,0) - which we do in Rust.



The Rust Way

So here's what Rust does.

  • Custom Shaders for all viewmodel meshes

    • Use only the projection matrix with modified znear/zfar (custom projection, no inaccuracy issues)

    • Pass 1 - clear the depth buffer (renders the mesh, but only clears the depth)

    • Pass 2 - render (renders the mesh as normal, depth isn't an issue)




This all solves the issues we were seeing. We have a viewmodel that doesn't clip into stuff, that receives shadows properly from the world, we can change the FOV and we have no more floating point inaccuracy issues.

But this brings a new issue. Any particle effects or whatever on the viewmodel don't really work anymore, because the viewmodel is being projected differently, and has been written to the depth buffer differently. So I guess we need to write a whole new set of shaders for them to use too.

This works, but it hurts my heart. I hate having to have custom shaders for viewmodels, that do the exact same job as the normal shaders but with a couple of hacks. It's one of those areas of Unity where you are forced to make compromises. Sometimes this turns out to be kind of a great thing because you end up finding new solutions to these problems that enhance the gameplay and give you a USP.

Other times it turns into a huge viral mess. Everything you try to add needs more and more hacks. You get to a point where you think fuck it, lets just use a second camera, render all the viewmodel effects in that - and manually work out the light of the viewmodel based on ray traces - like Half-Life 1 did.

How this could work

Anyone do this any different? Anyone found an elegant solution to it?

 

Baby Gadgets

Friday, January 24, 2014

Before Alex I had no idea what kind of stuff we had to buy for him. Now I'm a well educated expert. Here's what to spend your money on.

 



Get this book. I'm not gonna link to it because I don't want people to think it's an affiliate scam. But basically this book will tell you what to do, when to do it. It'll tell you when to get up, when to feed the baby, when to eat, when to sleep.

 

A lot of the midwives and the health workers told us that you should let the baby call the shots. He'll tell you when he wants to sleep, he'll tell you when he wants to eat. That's bollocks. He's a baby. You tell him when he sleeps, you tell him when he eats.

 

The hardest thing in the early days was the night feeds. Within two weeks of following this book Alex was sleeping through the night.. he was 9 weeks old.

 



Don't get a bottle steriliser that you put in the microwave, or one that you have to fill with water and then put tablets in. A steamer like this takes 5 minutes to sterilise. You only have to put water in.

 



Throw away your stupid bottle warmer. Forget about getting a second kettle. These bottle makers exist. You just put the powder in the bottle, press the button, it fills it with sterile water which is exactly the right temperature. You shake it. It's done. As a bonus you can also use the water that it dispenses as water.

 



 

The Withings Baby Monitor shows video on your iPad or iPhone or website. When we put Alex in bed we watch TV with the iPad next to it, showing him. So we can always keep an eye on him. It had a night light and can play tunes. You can talk to him via the app too. The night vision is pretty awesome. To the point where Sarah will be in bed in the pitch black watching the video stream of him 2 feet away.

 



 

The video manages to kick out of the firewall too. You can access it anywhere in the world. When I was in Seattle I regularly logged on during the day to watch him sleep.

 



Withings make scales too. Your girlfriend or wife will want to go to the doctors to have your baby weighed every week. Tell them they're idiots. Get some withings scales, weigh your baby every day before their bath. Get a graph going. The top of the baby scales come off too, so you can carry on using them when he's older.

 



Inflatable bath. There's not much else that needs to be said. It's like a bath but inflatable. Not as electric as other the other stuff, but one of those things that has made our lives more enjoyable.

Valve VR Demo

Thursday, January 23, 2014

A lot of people asked me to post about what happened in the VR demo. Valve say it's cool to talk about.. so here we go.

I was initially under the impression that the demo took place in a wardrobe because they had a black curtained off area about that size with VR ROOM written on it. But when Atman took me inside there was a door that lead to a slightly bigger room with barcodes all over the wall, and a carpet in the middle. He told me I was OK as long as I stayed on the carpet. The carpet was about the size of a full sized snooker table. The barcodes all over the wall are just something the headset uses to track its position. They use it because it works, but don't expect that the actual units will use them.

The headset looked a bit like the rift, but had exposed circuit boards. I was kind of dreading the demo because the Rift makes me feel sick. To the point where even thinking of putting it on my head makes me nauseous. Atman said a lot of people who get motion sickness on the rift don't get it on this one (better response, head movement etc).

So the first demo started up. It was like a grid of textured cubes going for as far as you could see. The texture was an out of date webpage. The cubes were about a foot in size. I could move my head up close to the cubes and almost read the text. I could walk around the cubes and look at the other side. I asked if the screen was higher resolution than the Rift. It was higher resolution, but not by much, apparently it seems clearer because there was a lot less ghosting.

The second demo was a cube with a platform. I think you're meant to be scared of heights and be scared to step off it. I think my brain had kind of learned to know the difference, because even though I could appreciate the height it didn't really bother me to be floating about. Although I always felt the need to get return to the playform after I'd gotten off.

For the next demo some headphones were placed on my head. There was a cube bouncing around, when it hit a wall it made a beep. It's hard to explain but it really did sound and feel like it was bouncing around me. I don't know whether this is some kind of special 3D sound, but I have had 5.1 headphones and speakers and I have never before felt the ability to pinpoint where a sound was coming from. Maybe it's because you can turn your head while the sound is playing and kind of triangulate it.

There was a demo where a smaller ball was rotating around a larger ball. The larger ball was kind of a mirror. I felt the need to move out of the way when the smaller ball came around.

There was a demo where there was a mirror cube, and you could see your own face. Not actually your own face, it was like a cube based face. But even though it wasn't my real face, it was kind of instantly identifiable as my own face. I felt myself closing my eyes to see if the reflection's eyes closed too. I couldn't see if they did because my eyes were closed.

There were a few of modelled scene demos. Some kind of basement, some Portal robots of differing sizes, the portal turret building animation (which actually made me feel a bit sick (which was the first and only time in the entire demo)). There was a portal office scene which I mentioned in my last blog. There was a scene with a hole in the floor that looked like you could jump down it. The kind of hole that you'd normally jump down in a game like HL2, like a 8 foot drop. But there was no way I was jumping down there in VR. It felt dangerous.

There was a demo in a spaceship, you could look around and see all the controls, and peer out of the windows.

The last demo was a scene demo where you were floating around the world, with a bunch of stuff changing shape. It was the only demo where you moved around not under your own control, so I expected to feel a bit sick. But I didn't.

I was really impressed with how well it all worked. It's hard to kind of shout about it because you're basically just saying "it was like being in a different room" over and over again. I can only imagine the work involved in getting it to feel authentic, in making it fit on your head. I mean, our brains are smart. There's probably a hundred different things that you have to get perfect for it to feel like this. It made the Rift we've got at the office feel like a torture device.

It seemed like the only missing link is some kind of input. Luckily the last 10 years have kind of already bought us all the input technology we need, with the kinect, the move and the wii. It felt a lot like a couple of move controllers would have been great to interact with the world.

I can imagine having a virtual room in my house. Putting on a wireless headset, putting on some kind of game claw and shooting some pool against abusive children on the internet. A month ago I would have said this idea was a couple of decades from happening. Now I'd say it's less than 3 years away.

Steam Dev Days : Day 2

Sunday, January 19, 2014

Here's what I learned in the second day of Steam Dev Days.

Trading is something we need to do for Rust. This is something we really need to think about exactly how we go about it.. but trading adds an infinite amount of value to the games it's added to.. and that value is multiplied by the amount of games using trading. So this is something we need to look at in Rust. Whether that be trading blueprints, or items we don't know. Don't take this to mean that you'll have to pay out of game for items and blueprints.. because that's not what we're talking about here. We're saying that maybe you obtain two of the same blueprints.. maybe you could trade that spare blueprint in Steam's marketplace for another blueprint.. or a TF2 hat.. or even a game(!).

We need to find a way to let the community help us make the game. In the same way that the TF2 community builds hats and weapons for TF2.. I'm sure we can find a way to empower the community to help us build the game a million times faster than we do already. The obvious way is to get the community working on items. In the minimum they only need a name, description and icon. Then we could link items.. and the community could help with that too. [blood] + [cooked in fire] = [black pudding]. This needs more planning.. but at the same time even if we don't have the community working on the items it'd be pretty awesome just for us.

Virtual reality doesn't work for most modern games. We need to make games designed for it. Attaching a camera to an FPS guy and driving him around doesn't really make a good experience. Sitting in a car does, sitting in a helicopter does. One of the Valve demos had a table you could walk around with an office containing lots of the portal people on top. That got me excited.. because they were all going above their business. I love god games. I could instantly imagine playing a game like that with the headset on. All it was missing was some way to interact and I would have happily stood and played.

UI doesn't work in virtual reality. The UI should be in the world, not stuck to your eyes. That's probably something that is glaringly obvious as soon as you try it.

There was a talk on Unity that I didn't attend, but they showed a bunch of games on Steam that are built using Unity. They called Rust 'one of the bigger ones'! I heard the talk described as a car crash.

There was also an Alienware talk. I heard it described sarcastically as "kick ass".

There was a party on the night so I decided to have a powernap.. and ended up missing a talk on VAC that I really should have attended. So I'll have to wait until it comes out on dvd :)

The talk on "The Corporate Anthropology of Valve" was cancelled, so we never found out what Gabe's most important professional failure was, or how Valve employees get fired.

Steam Dev Days Day 1

Thursday, January 16, 2014

I'm gonna make a summary of things that I feel like I've learned from SDD, day 1. I don't know how much I'm allowed to say, so I'm only really going to reveal shit that I've seen elsewhere (mainly on twitter).

The steam controller is going to be a thing. I'd kind of dismissed it as a bit of a gimmick to try to justify people buying a Steambox. But it's something.. and it's gonna be something. So it's probably worth supporting it in your game right now. Even though you don't really have to because it's awesome and will work whatever you do. But it's a nicer experience if the UI in your game says "press [a]" instead of "press space" etc.

Collect as much information as you can. When people are dying, when they're attacking, when they're running. Collect it all. Ask questions, work out what data you need, then capture it and answer those questions. If you're testing something.. only test it on half your clients. That's the fairest, most black and white way to prove a theory.

Virtual reality is something. After playing with the rift for a couple of days and occasionally getting it out to impress friends and family, it hasn't been out of the box. It makes me very sick. Valve showed me their VR stuff (I don't think the fact that this exists is a secret, because it's on twitter, and in the dev days sessions listing, and will probably be announced this morning). Somehow it doesn't make me sick. I was wearing it for a good 20 minutes. One of the last demos they showed had the player flying through the world.. and I would expect that to make me sick (something about the movement not matching with what you're really feeling).. but for some reason it didn't. And it was really immersive. It's hard to explain just how immersive it felt. Imagine being in a room and looking around and seeing and hearing things in that room. That's what it was like.

Steam has got 75 million accounts. Eight of them are mine though. So really it's only got 74,999,993 active users.

Don't try to port anything to Linux. Not because Linux isn't worth porting to.. but because it's 2014 and we're game developers. If you can get away with it, use something like Unity so it's all done for you.

Explain patches better. Make them an event. Pre-patch leaks. This is something we have been guilty of. You work on a patch, add two new weapons and a bunch of new features. And the only horn blowing you do is a changelist on a website. That's great for existing players because they're going to see that stuff anyway. But it's missing an opportunity to suck more new players into the game. Valve basically do this with TF2. Instead of releasing 3 patches a week, they save it up for a huge cumshot every month or so.. with lots of speculation in between. I think this is something we can apply to rust later on. We still want to kick out regular, weekly updates. But maybe we can make more of a spectacle of the bigger additions etc.

In TF2 Valve sometimes do something that will make people on forums and reddit speculate about what's coming in the next patch.. and then read through all the posts and find new stuff to implement before the patch is released.

Alienware's Steambox is going to apparently be 'kick ass'. The CPU in the box is 'kick ass'. The GPU in the box is also 'kick ass'. I think the general take-away from the Alienware presentation is that only complete cunts buy Alienware stuff.

Intel is kind of awesome. Not just because they gave us a bunch of free Steamboxes. Maybe it's my age. They're unpatronising, they're honest, they're humble. Their Steambox doesn't have coloured lighting all over it.

Chet from Valve always kind of looks like someone has pissed him off by waking him up. He mentioned Rust in one of the talks, high 5!

There was a talk on Marketing your game that I didn't attend, but some of Facepunch did. It was hosted by a bunch of indie dudes. Some of talk was of advertising your game via banner ads and attending trade shows. Which seems like bad advice (maybe it's just us, because we're kind of established). It's 2014. Youtube, twitch, twitter, facebook, blogs. Those are your weapons. In that order. Rust and GMod aren't typical.. but GMod has sold over 4 million units, rust has sold over half a million in just over a month.. and we've never attended a trade show and never advertised either of them anywhere.

So I guess the final bit of take-away would be take advice on board.. but what might be right for you, might not be right for some. So try different shit until it makes you rich.

2013 Goals - in review

Tuesday, December 31, 2013

Last year I made a post about my goals for 2013. I didn't have very grand plans.

Lose More Weight

Failed. Not even close. I have gained weight. I could try to blame this on having a baby and staying up until 4 in the morning eating frazzles and watching TV. But ultimately it boils down to the fact that I have been eating too much and not exercising enough.



Increase the Bus Factor

I'm gonna say we succeeded on this. Facepunch has gone from employing two people in office, and two subcontractors.. to employing 12 in office, and 5 sub contractors. We've released another game, Rust.. which to date has made over $5 million dollars. We've got at 4+ other projects in the works - all of which can survive without me.

Play More Games

I still don't play enough games. I'm gonna call this a failure.

Go to a proper conference

We did go to a conference. The name of which I can't even remember. It was alright.. but ultimately probably wasn't worth the travel time. We are going to the Steam Dev Days in January though. That's probably proper enough.

Enter Ludum Dare

Failed. Didn't enter. I did think about it at one point - but ultimately real life took priority and I couldn't.

Unlisted

I did do some things that weren't on the list. I bought another house, and became a father. So despite being a fat lazy game developer that doesn't play many games, everything balances out.

Catchup

Saturday, November 30, 2013

I haven't blogged for a while because I've been a busy bugger. People have started to email, text, tweet and comment asking me to make a post. So here it is.

Alex

Alex is awesome. He's 11 weeks old tomorrow. He's been sleeping through the night from 9 weeks. This is all thanks to my dentist who recommended this book. It's basically about putting the baby in a routine. The heath workers and midwives hate it. Their advice is for the baby to tell you when it wants to feed, or wants to go to sleep. To basically let it do what it wants. That's bullshit. This book will tell you hour by hour what to do. When to sleep, when to eat, when to shit. Alex is very very happy and I can only imagine it would have been all over the place without this book.

New House

Did I mention that I'd bought a new house? I think I did. Well I did. We were planning to renovate it. So I met with an architect. 30 minutes later I found myself explaining to Sarah that I had been convinced to demolish it and start again from scratch. We're planning it out now.. but it's gonna be pretty cool. One of the big reasons for the decision was that when you new build a house you don't pay any VAT (20%). So even though you're probably paying more to build it.. you're getting 20% off - and everything is brand new and exactly how you want it.

Rust

Rust is going to be going on Steam in the next couple of weeks. I made a trailer for it last week. There was a lot of debate about the trailer not being moody, not having explosions and stuff. I am a strong believer in being different. I would rather be different than anything else.. because if you're going to be the same as everyone else why bother. That was one of the reasons for making the trailer how it is. Kind of light hearted. Making people laugh is a lot easier than making them feel anything else. That's why the trailer isn't a boring predictable zombie horror movie.

Next gen consoles

I find it hard to get excited about the next gen consoles. Slightly better GPU, slightly better CPU, slightly more memory. Now consoles can do what PCs have been capable of for 5+ years.

My big want for a console is an app store like on iOS. Games that don't cost a fortune, lots of variety, easy to submit new games. What I don't want is 7 games, all £50+. That is not what I want at all.

I'm not dying to play any of the new games. They're not platform sellers for me. But maybe that's because I'm a PC gamer at heart and feel that console games are kind of dumb.

Facepunch

Facepunch is going well. We are 12 strong in office now (13 next week). There's lots of experimentation going on. Lots of tea being drunk (and a lot of monster energy drink).

We're kind of outgrowing the office already. We're going to be partitioning the downstairs this year and setting up some offices down there. But if we carry on at this rate we might be looking for a new bigger office quite soon.

The first batch of bonuses went out this week - and everyone is happy. We have decided to not reveal bonus percentages, and to pay them out quarterly. The bonus system is definitely motivating people.. just like we expected it to do. And on a personal level it really feels like the right thing to do.

We're doing the Christmas Card thing again. Our receptionist Sam has been really busy writing cards.. and we're going to be closing it off soon.. so if you want one you betta hury up!

We're also looking forward to going to the Steam Dev Days next year!

Is that it?

I think that's it. Cya next year!

Is Paypal Slow

Monday, October 21, 2013

Ever since I can remember Paypal has been the slowest website in the world. Is it just my account that's tainted with this, or is it the case for everyone?

Loading the front page:



Clicking on Find a transaction



Searching for a transaction by last name:



Viewing that transaction:



And it actually seems faster today than normal. These numbers don't sound massive but when you're used to websites reacting under under 200ms it seems insane.

This seems to have been the case forever, it makes me dread having to go in there to do stuff.

Stop Programming

Thursday, October 17, 2013

Last week I had to tell one of our coders to be more lazy and to work less. This probably sounds like a crazy thing for a boss to be saying.

Here's a good quote from Bill Gates

"I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it."

A while back I sat in a talk at Valve about their employment process. Someone in the audience put their hand up and asked whether they hired junior programmers. The speaker said they didn't. The audience member asked why not? Who does the shit, boring programming tasks? The speaker said this attitude was backwards, there were no shit or boring programming tasks. If you give that task to a good programmer he will code it in a way that means no-one has to ever deal with that problem again. A junior programmer will solve the problem over and over again. Adding more and more code to maintain, more and more things that could go wrong.

So by telling our programmer to calm down, to be more lazy - I wasn't reducing productivity, I was increasing it. The less code the less chance that you're fixing a problem that doesn't exist. The less chance you're optimizing stuff that doesn't need optimizing. The less code, the less possible bugs, the less time it takes to maintain it. The happier everyone is.

Grand Design

Thursday, October 10, 2013

Some point before Alex was born I decided that my current house isn't big enough. It's three bedrooms, but the master bedroom is upstairs. That is fine but with a new born baby we didn't want to keep walking up and down. So we moved our bedroom downstairs. But then we realised that if we ever have any more kids this won't work.

So I went and bought a new much bigger house. The new house is kind of old. 1890's we were told. It's a decent size, 5 bedrooms, swimming pool, on half an acre. It's half way between my family in Walsall and Sarah's family in Wolverhampton. So it ticks a lot of boxes. It's kind of run down which is fine because I would rather buy a house and renovate and get it how we want than move into a brand new house and have to put up with how it was. This time I wanted to get all the work done before moving in.. instead of living in a house that is half a building site. Especially with a new baby.

So I got an architect around, told him what I wanted to spend, what I wanted to do. And the obvious answer that he came up with was to tear it down and build a new house. This would be faster, everything would be brand new, we'd get more for our money because there's no VAT charged on new builds.. and most importantly we'd get what we want.

So now we're in a position where we can make the house we want. Which is a really awesome position to be in. We're thinking about what we want the house to be, what we want to use it for, planning for the future. I came up with this document for the architect describing what I think we need.

So the question is.. if you were doing this what would your house be like, what special features would you have?

Next Gen Console

Tuesday, October 8, 2013

Ask yourself this. If you were to design a next gen console from scratch, what would it be like?

When you ask yourself this question it's kind of funny to compare it to the real next gen consoles. The most glaring out of date feature is DVD/bluray drives.

It seems like you'd look at the iPhone, iPad, steam, android and it would be obvious that physical media is not next gen. The only reason you would continue to sell games like this would be because you are already selling games this way and are scared to rock the boat. We want revolution, not evolution.

This general attitude is ultimately why the next gen consoles are going to be out of date before they're even released. It's not hard to trump this, and either Steam or Apple will be the people that do it.

Parenting

Friday, October 4, 2013

Everything is starting to calm down now. The huge array of visitors is coming to an end. This week we actually had a day where we were the only people in the house all day.



Having a baby is both easier and harder than I thought. I expected constant crying. Every time I'm aware of a baby it is crying constantly. But Alex hardly ever cries unless he's really hungry. And even then you can just calm him down by putting his fist in his mouth. It's kind of like playing a video game you don't know the controls to. You just try stuff until he falls asleep, then you know what works for next time.

The hardest part is the lack of sleep. He is waking for a feed every 3-4 hours. So if you feed him at 12PM you're gonna be getting up at 3-4AM, then at 6-7AM. This knocked us on our arses for the first couple of days. Before Alex we'd go to bed at 8PM every night.

We've found a routine that works now. I am good at staying up late and shit at getting up early. Sarah is shit at staying up late and good at getting up early. So I do the late shift. I stay up watching TV, eating and posting blogs.. and try to feed him at about 2AM. That way I get to bed at 3AM and Sarah gets a decent sleep and gets woken up at 6-7AM. Then I get to sleep in until 9-10AM.

We've been told to sleep when he sleeps. During the day. But that's kind of impossible because of all the visitors, having to eat, shower, parcels being delivered and hospital appointments. Plus I can't really sleep during the day.. it tends to make me even more tired.

Childbirth II

Monday, September 23, 2013

Sarah had taken two bags of blood over night. When I got to the hospital she was looking much, MUCH better. I took a photo to compare the difference to the previous night, using my own skin colour as the control.




Alex was still in neonatal. Sarah was feeling stronger so we headed down to see him. The nurse told us that they had spoken to Birmingham Children's Hospital and they were ready to take him some time today. We were happy that something was finally happening and hung around the ward until it was time. Even though Sarah was feeling better her guts were still acting strange. There were multiple visits to the toilet with no success. Until the flood gate opened. She went to the toilet and filled it with what looked like chocolate rice crispie cakes. Unflushable chocolate rice crispie cakes. They floated on the top of the water. In the end we had to stuff a bunch of toilet paper down with them to get them to shift.

She was in a bad way. Could walk but only small steps, and very slowly. Sitting down or getting up was slow and agonising. But the light headedness was gone and she could stay on her feet for longer. We went for a walk to the lobby and bought some hair bands.

We were eventually alerted that it was time for Alex to go and we could go and say goodbye and talk to the doctors that were taking him. When we got there they were loading him to an even scarier looking travel incubator.



We watched him helplessly for a few minutes, chatted to the doctors - who all sounded really up-beat about it. He looked safe and he was in the right hands. Eventually we were told it was time for him to go and he was wheeled out of the neonatal unit. We followed - mostly on accident because it was the way out. They were moving faster than us and we entered a big corridor to see them in the distance wheeling him out of an emergency exit. Sarah sobbed as we waited for the elevator - which triggered me off. When we were exiting the elevator a few people were waiting on the other side of the door. They looked at us concerned and awkward. They must have thought something terrible had happened to us.. when in reality our baby was just being moved from one hospital to another.

We didn't feel like being around people so we sat in the corridor holding hands. I told Sarah about some of the Google'ing I'd done the night before. The nurses and doctors will never tell you the real bad stuff. Like what's the real worst case scenario. I like to know these things, I like to be prepared for everything. So I'd done some research. I'd found an Australian nurses manual explaining the procedure on what to do if a baby is vomiting green bile. The first point it made was to assume there's a bowel obstruction until you can prove that there's not one. It said to fit a pipe through the babies nose into his stomach to drain off the bile. To set the baby nil by mouth. To give him anti-biotics. To send the baby to a specialist centre that can look into it more. This was everything that had happened.

This all rang true with me. Alex was fine until they took him off us. He had done a poo when he was born. He was happy, he was awake, he was responding to light and sound. He wasn't in pain. The only symptom was the green bile - which had triggered this whole escapade off. They weren't going to tell us it was probably nothing though, in-case it was. Nothing had been proved - it was just all a check to make sure. This cheered Sarah up. We decided to get strong and get discharged and head over there together.

It was 2PM when he left. It was suggested that we'd get discharged at about 4PM. So we headed to the ward and no-one really bothered with us that much until about 5PM. The midwife on duty said she was working on discharging us but she needed to wait for the doctor to give us all Sarah's pills. Around half 6 Sarah got her pills. We phoned about Alex and were told he hadn't been seen yet. We decided that time was ticking on, we were both completely exhausted so we told them we'd be there first thing in the morning after a much needed sleep. This wasn't a decision we took lightly and our brains had to override our hearts. Then there was a shift change, and a while later the midwife from the previous night who kicked ass with the transfusion turned up. Once again she kicked ass, she told us all about the pills, took a bunch of needles we didn't need from us - and asked if I'd like to pick Sarah up at the emergency exit to save her being out in the cold too much. She lead me there and told me to come back here with the car.

I started walking to the car. I got excited. We were leaving, finally. Sarah was coming home. So I started to run. I was about 10 feet away from the car when I realized that I hadn't paid my parking ticket and wouldn't be able to get out of the car park. I changed my direction immediately towards the payment machine - even though it would look ridiculous to anyone that was watching. I paid the ticked, ran back to the car and got to the exit just as the nurse was wheeling Sarah out. She carefully climbed into the car and we were off.

We were tired when we got home. Past tired. It was 11PM and we wanted to get up early to head over to Alex. We were both still feeling really shit that we hadn't headed straight there. We just wanted to roll into bed and sleep it all off. Then Sarah's phone started ringing. She couldn't move so I ran to get it. It was a blocked number. She answered it and I pushed my ear to the back of it so we could both hear it. It was them. This was the news we were waiting for. I didn't breathe. It was an upbeat woman on the other end. She explained that they'd given him some dye or something and xray'd him again and there was definitely no obstruction. He was fine and we could take him home tomorrow. I had tried to stay strong and not cry in-front of Sarah when there was bad news. I knew it was upset her and make things worse, so I was being strong for her. But now he was safe. So I cried, and we hugged. All the tiredness disappeared. I felt like I could run a marathon.

Child Birth

Tuesday, September 17, 2013

Here's a story about a couple of days that have changed me forever.

It was 9AM. I woke up in bed as usual next to my girlfriend Sarah. Her pregnant belly was a weird shape. She moaned as she turned onto her side - and crack. I told her it sounded like his leg snapping in half. She needed a wee and went to the toilet - and said it's weird it's coming out without pushing. We debated whether her waters had broken until it was confirmed by a rush of water down her legs. It wasn't long until there were trails of water all over the house. We called the MLU - and because there wasn't any pain (contractions) we were sent to the main hospital to get checked out. About 5 seconds later the contractions started. We had our showers and headed to the hospital.

At about 11:00AM Sarah was strapped into a machine that recorded the babies pulse and the contractions. She was having contractions but in no kind of uniform pattern. They were really strong too. The nurse eventually turned the screen away because I was jumping up and down with excitement announcing that the contraction had scored an 80! After a while on the machine the nurse had a feel about and told us that stuff was happening, she was 2cm dilated and to get to the MLU. After a stupidly long wait in the waiting room, we headed off. It soon became obvious that Sarah was unable to walk, and would never make it to the car. Doubled over in the corridor an old man asked if we wanted a wheel chair and ran off. We waited for a while and as the contraction had stopped, I said fuck this, lets not bother waiting, and we started to walk on. Just then a shout from behind as he came bounding down with the wheelchair. This guy didn't work there, I don't know who he was, but huge thanks to him. Because the next thing we knew we were at the car. Sarah was screaming at me that we should have stayed there, I told her it was less than 2 minutes away. I wondered what to do with the wheelchair - and assumed that would understand that it was an emergency so just abandoned it on the car park.

The time was 12:30 when we arrived at the MLU. Sarah decided she needed a poo. So she got on the toilet and didn't have one. Her Mom came in soon afterwards. Sarah was scared to push incase the baby came out. We assured her that he was hours away and just to have a shit if she needed one. After a lot of crying and screaming she was coaxed on the bed. A new midwife came in, she didn't have a Walsall accent - so she obviously was in charge. She examined Sarah and determined that this baby was coming RIGHT NOW. Sarah was under a huge amount of pain. She started hitting the gas and air. She still needed a poo - and told us a lot. At one point even explaining that it was her bum that needed the poo. With two pushes the baby's scalp was visible. Another couple of pushes got the top of his head out. Another push got his face out. The umbilical cord was around his neck.. which scared the shit out of me, but I tried to hide it for Sarah's sake. The midwife called something to someone outside, and after receiving a response told Sarah to push, untangled the cord and his lifeless ragdoll body flopped out behind the head. The body seemed to come alive, he was towelled off and passed to Sarah. She looked panicked. I was about to tell her he was fine and healthy when he made a little cry sound and she burst into tears. He was gorgeous and healthy. Born at 1:35.



There was blood and shit everywhere. When the baby was passed to Sarah he also did a really black shit all over the place. He had also tore her a bit. So we all had a hold of him and a relax. We all fell in love with him. Sarah gave birth to the placenta and I cut the cord. Sarah started to feel pain again. We all assured her that her body had gone through a big change, and is now changing back. The baby was breast fed, he slept, he got held by many more family members, and slept some more. The one thing that surprised me about all of this is that he hardly every cried. I thought they were meant to cry non stop? I dressed the new, still unnamed baby. The midwife came and sewed her tear up. She had a local anaesthetic but the pain was really bad so she had to hit the gas and air hard again. She settled for a while but the feeling of needing a poo came again. We tried her on the toilet, we tried her walking around, we tried her on the toilet. Eventually it was determined that she needed to go to the hospital.

An ambulance was called and arrived before we even knew about it. Sarah couldn't do anything so it was left to me to pack all the bags and get the baby in his car chair. I was way out of my depth. I convinced a nurse to put him in his chair for me, and to make sure it was all safe in the car. I headed over. I didn't know where we were going so we went to the same place I'd been that morning. Luckily Sarah was already there, in a room, with midwives laughing and joking around her. It was determined that she had a hematoma, which to my understanding is a big balloon of blood. Her bladder was drained - giving her a lot of relief. She was given an epidural and was taken to surgery. I was all alone with our new son. He was being nice and chilled though, just looking around. It was still a huge relief when Sarah's Mom turned up a few minutes later.

We sat and chatted, kept family members informed. I tried to find any kind of distraction to take the negative thoughts out of my mind, to stop my eyes filling up with tears. After what felt like forever but was probably more like an hour, we were moved to the recovery room to wait for her. A good while later she was rolled in. Looking like a completely different person. No longer strained, no longer stoned, no longer a red twisted face. Instead a white, smiling, pretty face. The kind of face you get after having a huge shit. She couldn't feel her legs and would have to stay in overnight. She was given her own room and we all gathered around happy. At about 11:30PM I headed home. Jackass had been alone all day and needed feeding. I wouldn't be able to sleep properly there anyway, it'd be like sleeping on a plane. The baby would be well looked after. Everyone wins.

The next morning I woke up refreshed and happy. So I decided to text Sarah. As I started to type the indication came up showing that she'd started typing too. She had bad news for me, the baby had to have an x-ray. Over night the nurses had been looking after him and noticed he was throwing up bile. This is usually determined to be a bowel obstruction. This didn't sound like a big issue. Bowel obstruction.. it'll work through his system or they'll be able to fetch it out or something right? When I got to the hospital I was pleased to see Sarah looking much better. She had got feeling back in her lower half and was holding the baby. That morning in the shower I had decided we were calling him Alex. So I let her know. Then we let everyone else know.



The nurse told us that the baby will have to go to the neonatal unit and asked if I'd like to follow her so I knew where it was. The neonatal unit is the scariest fucking place I have ever been in my life. Lots of ill babies in little tanks with wires and tubes coming off them, with their worried desperate parents looking on. We're those parents now. I said hello to everyone and one of the doctors explained to me what was going to happen. They were going to get him in a tank and stick lots of wires and tubes in him. Then they were gonna try to get him to the Birmingham Children's Hospital to investigate the obstruction - and maybe cut him open and fix it. I am not thrown by many things in life, I can approach most things level headed without any kind of emotional reaction. This isn't one of them. The nurses explained the visiting hours and made it clear that me and Sarah can come and see him at any time. Because of Sarah's problems she'd have to stay in the hospital while I followed the baby to Birmingham to sign any consent forms.

I explained the situation to Sarah and we went and visited him. Sarah in a wheelchair because after losing a litre of blood she was still quite swollen and queezy. He was in the tank now. The nurse explained that the tube in his nose is to take away the bile in his stomach - because it isn't passing through his body. He isn't allowed to eat anything but the nurse assures us that he won't mind for a day. Sarah wept as she held his hand through one of the holes on the side of the tank. He seemed happy enough. As if he was sunbathing. Basking in the heat. Asleep by occasionally stretching out.

We were moved from the private room to a ward with three beds in. The bed opposite was occupied by a young girl. She was being discharged with her baby and was filling out a form. She argued with her boyfriend on how to spell "nothing". The midwife told her it would be a good idea for her to take notes of which pills she takes at home. she asked whether the midwife could do that. The midwife explained that she wouldn't be there when she was taking them. These wards are the number one reason I would consider going for private healthcare. I trust the doctors and nurses 100%. Just give us our own room. Don't make us listen to shitmuchers talk about their shitmucher friends buying a shitmuncher phone from a shitmuncher. Eventually the room was empty except for Sarah, which was great. They allowed us a lot of family to visit which I think really cheered Sarah up. But she was really cold, shivering visibly. She was really pale, almost yellow. But she was happy enough.



At about 8PM there was a shift change and the new midwife on duty told us she was waiting for results of a test and if they're good she will discharge Sarah. The shift change was like black and white. We'd gone from not seemingly being cared for at all to being cared for completely. The midwife explained that because Sarah's iron levels are so low she could do with a blood transfusion. The aim was to give her the blood transfusion and discharge her tomorrow.

And what is where we are at the time of writing. What started off as a very straight forward birth turned into a rollercoaster ride of our worst fears. Our love for Alex was instantaneous and total. It breaks our hearts to be away from him but he's in the best place he can be right now. In a lot of ways we were quite lucky. If Sarah didn't get the hematoma we wouldn't have gone to the hospital. We'd have taken Alex home and would be wondering why he wasn't working properly. Things could have got a lot worse. All we can do now is put our faith in the doctors and nurses.

Read Child Birth II

Resuable Tools

Wednesday, August 28, 2013

Someone in the forums decided to make a GUI editor for their engine a couple of days ago. It got me wondering about something that I've been wondering since I was working on GWEN.

Why isn't there a GUI editor that has plugins that let you export to 'your' format. One editor, many formats. When you think about it most GUI systems are the same. They're a bunch of controls that sit on and next to each other. A few things might differ like texture format, or font size/positioning, support for docking or control anchoring. But the majority is the same. Panels, buttons, text inputs, checkboxes, dropdowns, sliders, drag zones.

It seems like people are re-coding the whole thing over and over - when they only really need to code the exporter.

Design by Committee

Thursday, August 22, 2013

Are any decent fiction books written by multiple people? I'm not a great reader but I don't think they are. Is there a good reason for that - other than the actual technicalities of two people writing one book?

"a camel is a horse designed by committee"

It seems to me that when writing a book it's important to keep true to a particular vision. To always be pulling in the same direction. To keep it pure.

Purity exists for me in Game Design too. Fez, Thomas Was Alone, Darwinia, Hotline Miami, Minecraft, Super Meat Boy, Spelunky. These are all very pure visions in my opinion. They wouldn't have the same personality if they weren't created by a minimal amount of people following their vision.

This is something that I've started to think about a lot as we try to expand Facepunch. Do we want the whole company working on one big game designed by everyone, or do we want to have games designed by a single person. To answer this we have to ask ourselves why we're designing games. Are we doing it purely for profit? Do we care about what we're pumping out.

I want Facepunch to be something different. If we can release a few games we're proud of and break even I'll be much happier than if we released one game we're not very proud of (like a puzzle game that has lots of in game purchases) and make lots of profit. Profit shouldn't be our prize. Our prize is the process. We're doing this because we love making games. If the we sell the game and it makes more money than we spent making it then we are even happier.

This is what draws me to the idea that we should be designing horses, not camels. We don't need to play it safe. We don't need to please everyone. The gamedev world is full of people working on games they don't believe in. If this is the game I design, I want to play, my vision, then someone somewhere will enjoy it. If not - fuck it, I like it.

The Columbo

Friday, August 16, 2013

Since coming up with GMod and making lots of money, buying a house and starting a company - I've been out of my depth in a lot of situations.

Going from being refused a £5,000 5-year car loan to having the manager of the same bank send you beer every Christmas takes some getting used to. The problem is - you don't know anything about investments, are they scamming you, are they giving you the wrong advice? The same with accountants and solicitors. Are they legit, are they giving you bad advice because they know you'll get in trouble and it will be more work for them? Do they have your best interests at heart - or can they just smell the money?

The temptation is to act like you know what you're doing so they think they can't get anything past you. This is a bad move. If they want to shaft you they will - your bullshit will be like a red rag to a bull.

What I did was The Columbo. Just pretend you know a lot less than you know. Ask questions that you know the answers to. If that doesn't line up you know they're trying to fuck you in the ass.

This Old House

Friday, August 2, 2013

Remember This Old House?

It's been running for like 30 years. I remember watching it all the time when I was sick off school. It's a TV show where they take a house and do it up. There's been a lot of shows that sound like that.. But they're all rushed, they don't teach you anything, they don't show you the process. They do stupid things like renovate a house in 4 hours.

This Old House is different. It takes its time. It talks you through what they're doing and explains why, it gives you a bit of history on old old building techniques they're replacing. All the people on it are real tradesmen.

There's really long single camera shots, 5 minutes on a single camera with no edits. It's a breath of fresh after watching modern TV where they change the camera angle every 4 seconds in-case you get bored of actually looking at stuff. There was a scene where the guy was digging a hole.. and they actually showed him just digging the hole for about a minute. A lesser TV show would have edited that up or made a dumb musical montage of it.

The coolest thing is that all the episodes are on youtube.

Clustered

Wednesday, July 31, 2013

I forgot to post to the blog again. For nearly a month.

I have been seriously poop-socking with Rust. I've been establishing a better way to handle the server, inventory and save data. The way it works right now is that user data like the inventory etc is sent to our webserver in a json form, where it's stored and retrieved the next time you play. But we want multiple servers. So I started making the web system so it could partition that stuff based on server. I got about three days into that before I realised that it was stupid as fuck. We don't need that data, why store it on our servers - as a single point of failure? It's not a very good gameplan.

The simple solution would be to make the server just save all this stuff to disk, and load it whenever it wants to. But our long term plan involves multiple servers (and be able to travel between them with your persistent character). So saving to disk on a single server was out.

So I made a sockets library and made a cluster server. When the rust server starts it connects to the cluster server. When someone joins the rust server it contacts the cluster server to ask if they're allowed to join etc and retrieves their inventory. This works in the shortterm because we can automatically spawn a cluster server when the rust server is started. So for our single server situation we don't have to change anything.. and we gain the fact that people don't lose their inventory - because it's saved near instantly and doesn't rely on a website 5,000 miles away being only. And in the long term all we have to do is add a command line to connect to an independent cluster server.. and we have multiple servers in a cluster!

This also allowed us to get rid of JSON. I love JSON, it's awesome for a lot of things.. but in a single threaded Unity3D server it is not. We moved to protobuffers. They're small, fast and have a hard format. They can be generated and read for c# and c++ too - which has huge advantages for us.

In other rust news, Helk is still fighting Unity. Tom is still working on the player model.. and Bill is working on some awesome grass stuff.

We're hoping to open up access a bit wider soon - as soon as my server stuff is tested and verified we will be going at it hard.

In other news I got a dog, buying another house and having a baby. bye!

The Rust backend

Sunday, July 7, 2013

After Rust took off we spent a week improving the back-end. Previously, deploying new versions was slow and bug ridden. It was compiled on some cunt's computer. The whole thing was an ordeal.

So, improvements were needed. Here's what happens when we change something now.

Something Is Committed

Someone commits something to SVN. This can be code, or a model/texture/material/sound/etc change.

A build is triggered

Jenkins polls the SVN every minute. If a change is detected it tells the Windows build server to download the changes and build.



We have different jobs for the server and client. This means that the server and client can be built at the same time - halving the time it takes. Building was taking 40 minutes before on some cunt's PC. On our windows build server it's taking less than 10.

A lot of this time is spent constructing bundles. We don't want the player to have to download 300mb each time. So we create 60+ bundles - and try to keep the size under 5mb. We have found that if the size is under 5mb the browser will cache them - like it would an image - so the client doesn't have to download them. These bundles are created and a manifest file is created - to signify which bundles are needed, and which order they should be loaded.

When it builds it commits the binaries to a different SVN.

Upload Client

Another Jenkins job. When it detects changes on the client SVN, it runs a php script. This script loads the manifest file and turns the renames the bundles to be crc hashes. Then it uploads the files to Amazon S3, so we can serve them nice and fast. We use CRC hashes because sometimes the bundles don't change - so the client can keep using that bundle. But if it does change we want to be sure as shit that the client is getting the updated version. This was a fault we had previously - and causes a whole bunch of problems.

Once the bundles are uploaded, the PHP script sends the manifest file to our playrust server - and playrust creates a new version.

Testing New Version

Admins can test the new version immediately on the website. They have this box visible under the webplayer.



It shows the current 'live' version (green flag) and clicking on one of the versions allows them to switch to that version.

Make It Live

Once that's done we can make it live in the admin section on the website.

The Future

Hopefully this whole system will mostly become redundant. It's our hope to get on Steam eventually - and what I'm doing here pretty much re-creates the steampipe system. We don't have a system for updating servers yet - we just use SVN - which has worked OK so far.. but probably won't work so great once we let other people host servers.

With the Steam stuff - I think we're going to go through the greenlight system. This is for two reasons. First of all I'd feel kinda like I was stepping on all the other people on greenlight if we went around it, and second of all - if it doesn't get greenlit then it shouldn't be on Steam in the first place.

Alpha Papa

The demand for alpha keys has been immense. Totally totally immense. We want to start selling access as soon as possible.. but we obviously can't open that up for everyone or we will be swamped. So we will probably be putting a limit on it, so only so many keys a day will be available.. Hopefully that limit will increase over time as we optimize and make the servers support more people, get more regional servers of our own online, and start supporting third party servers.

Server Downloads

Thursday, July 4, 2013

We plan to have a gamemode contest some time soon. So I've got a list of things I want to get ready before then.

One of those things is to do with how we get files from servers. When I switched over to Steampipe I lowered the downloads table from ~8000+ entries to ~4000. What this means is that when you join a server they can only make you download 4,000 files now. Which to any sane person would seem more than enough. Who wants to force their clients to download more than 4,000 files when joining their server?

It's a problem that has long plagued joining a Garry's Mod server. Downloading thousands of files is not fun. But you would not believe the amount of emails I received about it. They can't possibly run their gamemode any longer without being able to fastdl 6,000 files to the clients! It is impossible!

So now, this:

[youtube http://www.youtube.com/watch?v=430qLp8md0A&w=560&h=315]

Server owners can specify addons that their servers need. These addons are downloaded from the workshop. This is much faster than the old way. Here's a list of stuff:


  • Current Gamemode and Current Map is automatically added to the download list

  • Can use resource.AddWorkshop to add other addons

  • The old way isn't going away - this is offered as a better alternative

  • Addons aren't subscribed to - and are only mounted when the server needs them

  • Addons aren't downloaded every time you join the server

  • Addons are updated when the workshop version is updated

  • We added a special tag for server owners to add their content



One other thing about Workshop while we're on it. Every time I talk about Workshop someone mentions that the license means that Valve owns all of your stuff and so they won't upload any of their addons to it. This all started with Wiremod. They won't upload to it because they say the GPL license is incompatible with Workshop. Well duh - GPL license is incompatible with everything. It's an awful viral license. The Workshop license gives Valve the proper permissions to distribute your files - that's what it is for. It has to cover a huge range of subjects so it's as over-reaching as possible. No-one really cares about these licenses. Valve is just covering itself here. It's standard stuff. Do you really think that Valve is going to take your addon and turn it into a game and sell it? Is that really what you're worried about? Valve are good guys. Just put your stuff on Workshop and stop being a fucking arm chair GPL lawyer baby.

If you're a server owner and you're not using the workshop to do stuff yet - take a look at this. It will show you how to set up a server that:


  • Connects to Steamworks

  • Downloads a collection of addons, gamemodes or maps

  • Mounts those files

  • Runs the gamemode

  • Starts one of the downloaded maps

  • ALL WITH NO MANUALLY DOWNLOADING AND INSTALLING OF ANYTHING



The Story of Rust

Friday, June 21, 2013

[youtube http://www.youtube.com/watch?v=FmZYPMsq5m4&w=560&h=315]

So Rust has got pretty popular with lots of news sites reporting on it. It took us by surprise. I mean - Helk (who is the project lead) has been working on it for 6 months. He casually put the alpha out then went on vacation for a week - and hasn't been heard from since.

Rust started off as a DayZ clone. But then we decided that we are sick of fighting zombies. And can't compete with the Arma island in terms of landmarks and towns. So it's in more of a STALKER kind of world where you build your own buildings. This also opens the way up for non zombie enemies, like mutants, wolves and whatever. But your biggest enemy is always going to be other players.

Freedom


One of our main aims with Rust is to not control how people behave directly. For example some people want us to implement something to discourage people killing each other.  Some kind of rating. Or turn killers red to warm you they can't be trusted.

I hate that. It's not giving the players freedom. The players should decide how they play the game. You should be fearful of others. That is the whole point. This is a game where the player makes their own story.. and emotion plays into it a lot. If you see another guy in game.. - you're going to be scared of him at first. But then you sniff around each other and decide to go on an adventure together. You begin to trust each other. That means so much more if you both had the ability to kill the other at any time and didn't. And you weren't just doing it for a green +1.

So what's to stop you from going around killing anyone you want and taking their shit and becoming more powerful? Nothing. What's stopping it from becoming a PVP killfest? You. Our job should be to give the players the tools they need. If you're sick of getting killed - start a town. Build town walls. Give all the town members red clothes. Put warning signs up outside the town. Set up trip wires and alarms. Watch each others back.

Our job is to give you the tools to allow you to protect yourself.

What's stopping someone from dressing up in red, sneaking into your town and stealing form you? Nothing. That's emergent gameplay. Find a solution. A secret handshake. Traps that the town-people know not to trigger.

What's to stop one town invading and killing everyone in another town? Nothing. Build stronger defences. Don't let them get powerful enough to take you down.

 Plans


We haven't planned much beyond bug fixes. It's time to start getting our own assets in - so we're going to start looking into player models, clothing, better weapon/tool models.

One of the things I want to do is make it so you start naked, like a caveman. This should reduce PVP - because who wouldn't run from a naked guy with an axe.

People have asked whether we're going to be on Steam - or whether there'll be a downloadable client. Our preference would be to be on Steam - the early release stuff gives me a boner and I've already had a taste of Steampipe and love it. But I think it might be a bit too early for that. We're going to stick with the webplayer for now - because we can update any time we want, it works on multiple platforms (except linux), and it's easy access.

We're also asked a lot whether we're going to let people host their own servers. This is still up in the air. At the moment I'm leaning towards renting servers via a few chosen trusted GSP's - like battlefield. This is just so that we can have the centralized character stuff - but you could still host your own community server with PVP damage disabled etc. Basically to stop chumps starting a server with some server-side cheat to get a million guns, then taking them into other servers. Either way I don't think we want to be hosting 100's of servers.

I also want a 100 foot giant that will come and smash your buildings up - forcing you to work together to take him down. But I'll have to sneak that past Helk.

The Conversion

Sunday, June 9, 2013

The switch to Steampipe last week went pretty smoothly. Except that the windows dedicated server crashed on startup. And the OSX version crashed on startup. And the Linux DS crashed on startup.

But because Steampipe is so awesome those problems were all fixed within an hour.

The biggest challenge facing people is that it doesn't always seem to convert automatically. I don't know whether you need to restart your PC first or something. But verifying it forces the conversion. For some people it doesn't move it to the Common folder either.. I don't know why that is but uninstalling and installing again seems to clear it up.

Some people are having problems with CS content being missing too. This is because the CS:S install hasn't been converted to Steam Pipe. Try running it. If that doesn't work read more here.

People are also wondering why HL2/EP1/EP2 aren't mounting. You need to opt into the beta so they will convert to Steam Pipe. This is done in the properties of each of the games

Like a Rolling Stone

Sunday, June 2, 2013

My life is going through some big changes right now.

As many of you probably know Sarah and I are expecting our first baby in September. We found out it's going to be a boy. Which has left us in the shit because the only names we've agreed on are girls names.. so we're looking for a name. And it's hard.

So with the baby on the way we realised that the house I bought 3 years ago and then ripped to bits and then rebuilt, isn't going to be totally suitable for us. The main problem is that the main bedroom (our bedroom) consumes the entire top floor. And the other bedrooms are downstairs. So when the baby is old enough to be in its own room it's gonna be a bit weird if we're sleeping on different floors. Plus hopefully this won't be the only baby we have – so we're gonna have to move eventually anyway.

I have always wanted a farm. I hate having neighbours. I like the idea of having a house where the neighbours are a mile away. But this scares Sarah. Plus houses like that have terrible internet connection. So that's out.

But we have been looking at a house. Much bigger than the one we're in now. And a bit expensive. And needs quite a bit of work. It ticks a lot of boxes – but if we buy it I'd make sure that we move in AFTER ripping it to bits and rebuilding it. Plus it's got a swimming pool(!)

My old house wouldn't go to waste. It's ideal for people without kids. Or with grown up kids. So my ideal plan is for my mom and dad to move into my old house, and live happily ever after from the sale of their old house. My dad complains and wants to leave his house to us kids.. but my opinions is that they worked every day of their lives to pay for that house, they've already given us every advantage they could have – so they should use that money to enjoy themselves.

And finally – Facepunch! The guys in the office have been experimenting with game ideas.. and we're prototyping a game right now. It's something that I don't think has ever been done before.. but we haven't finished prototyping yet so there's probably a good reason for it.

I'm really happy with how the office is turning out. It's something we should have had the balls to do earlier. It's taking the company to a whole other level.. and the fate of the company no longer totally rests on my head.

This post is a massive wall of text. So here's a drawing our awesome artist Meg made for the Steam Trading Cards stuff.

m0r3 gmod beta

Thursday, May 30, 2013

I've been plodding away at the beta over the last few couple of days. I'm hoping to initiate the switch over next week.

People running servers should make themselves familiar with this page.. because once we switch over this will be the only way to update and run dedicated servers.

The Linux version has progressed. I am able to get to the menu now – but it quits when I try to join a game. That might be because I'm running it in a virtual machine though – let me know if you're having more luck.

The rift support (apparently) doesn't work at all. I think I need to compile my own rift head tracking dll – because the one Valve provide is (apparently) crashing. They haven't given me access to the head tracking code – so I don't know what's happening there.

It's been a lot of fun pushing updates out via Steam Pipe. It means I can say to people "hang on – try now" – and they try and stuff is fixed. Instead of "try after the next update in 2 weeks".

Steampipe Beta

Tuesday, May 28, 2013

Ok this is gonna get confusing. We converted the GMod beta to use Steampipe. This all went fine. So now we added a beta branch to the normal non beta GMod .

So forget about the GMod Beta. Get rid of it. Uninstall it. We don't need it anymore. It's not gonna be updated. On the normal Garry's Mod you have this option now.

Selecting this branch will convert you current Garry's Mod to the Steampipe Beta. There's a couple of reasons you won't want to opt into the new beta.

  • It will convert your install to Steampipe
  • Switching back is messy and might not work at all
  • You might lose your addons and stuff
  • You won't be able to join non-beta multiplayer servers

There's a couple of reasons you might want to convert to the new beta

  • Updates every hour
  • Want to test your mods and addons with the new version
  • Like being on the latest version
  • Faster load times
  • Install on a different drive
  • All the lua files are loose and visible instead of being in a gcf
  • Rift support
  • Experimental Linux client support

To join the new beta you'll have to guess the beta access code. It's the same as the secret word in game.

Piss Shake

Saturday, May 25, 2013

I used to have a problem with my urination technique. The problem was that I always had some left in the tubes when I started putting it away. This would lead to me either peeing myself a little bit or spraying wildly as I struggled to put it back in its cage.

The spray got that wild on a couple of occasions that I ended up with piss on the floor BEHIND me. I still can't totally figure out how I managed that - but I assume that it flopped around and I peed between my own legs.

So I started to observe other men in public urinals and I think I figured out where I was going wrong. When I'd finished I shook my knob from side to side and up and down. Kind of like casting a fishing rod. A bit of a flicking action.

I noticed other men did more of a masturbation action. Some even opting for over 15 pumps. Pumping it for longer than the urination itself had taken. Which seemed weird to me - but it seems that everyone does it that way.

So I have since adopted this `milking` method and everything has been fine up until now. These are things that you have to figure out for yourselves. No-one tells you the best way to shake your dick after you've had a piss. Until now.

The Pipe Beta!

Tuesday, May 21, 2013

Today I had my first lick of the Steam Pipe today.

I managed to convert Garry's Mod Beta over to the new Steampipe format. It was pretty straight forward. And now with the run of a .bat file I can send an update to Steam and have it live around the world within a couple of minutes!

You can make branches too. This means I can make a special development branch and potentially integrate with our build servers so that the Steampipe version is always using the latest version. This will allow people asking for bug fixes to receive them within 10 minutes of reporting, being able to test and verify the fix – and then have the fix pushed out whenever we think the world is ready.

So if you were lucky enough to have access to the Garry's Mod Beta back in the day it might be a good idea to reinstall it and check it out :)

Oculus Rift

Sunday, May 19, 2013

We got our devkit on Thursday.. and spent a lot of Friday in the office finding fun things to do with it.

We found that the reactions are best from people who don't really play video games, or use computers. The best reaction was from our friend Simon. We decided to play a joke on him. Everyone left the office, and I showed him the mask, and got him to wear it. Then while he had it on everyone came in and stood around him, so that when he took it off he'd be all suprised.

This didn't really work because he's kind of slow and hardly realised that 6 people had appeared out of nowhere. And he wasn't that impressed with the rift because one of the lenses wasn't in (something he failed to realise/mention).

But then we got him on the rollercoaster demo. And he went insane. Short hard breaths. Repeatedly squatting. Hands shaking uncontrollably. It was both hilarious and scary. Even afterwards, an hour later, he was still shaking.

This probably less of an indication of how real the Rift feels, and more an indication of how badly wired Simon's brain is.

My personal experience is sickness. I tried it for about 20 minutes and felt very very sick. I think there's two things that make me feel sick. Firstly and most obviously is movement. If I'm standing still and looking around I'm fine, but any movement is awful for me. Another related thing is how it doesn't move when you move your head. For example, when moving your head closer to an object. This is probably expected – but it must confuse my brain and make me sick.

The sickness is that bad that even the thought of putting the mask on makes me feel sick. My brain has learned to avoid it. I've been told to ease myself in slowly.. but I don't really know how to do that.

Beyond that I've got nothing else to say that hasn't already been said. The resolution is an issue – but it's something you can overlook (especially considering it's a devkit). It gives a spectacular sense of scale. In Half-Life 2 when an NPC looks at me – I feel something deep in my chest that I feel in real life when strangers look at me – that I've never felt in a video game before. Like a prompt to react, to smile back or say hello.

This is the future of gaming. And I wouldn't be surprised to see movies that we can look around in too in the near future.

Linux and The Pipe

Saturday, May 18, 2013

You know how I've been going on for months about switching Garry's Mod over to the Steam Pipe. Well, that is about to become a reality. This week I merged with Valve's latest code. There's still a few issues to overcome – but I'm hoping that we'll make the switch in the next couple of weeks.

This is going to present some issues for dedicated server hosting. It's my understanding that it uses a completely different system to download and install the dedicated server. This is something that you might want to look at now if you run a server, but we'll try to get an in depth guide on the wiki before release.

GMod Linux is kind of working. I have been told by people that they have got it working with a bit of fudging around. One of the few things I like about the Linux community is that they will go ahead and figure out stuff like this for themselves (the downside being that a lot of the time you're kind of expected to). I'm not going to release a version before the Steam Pipe update – because that will fix a lot of Linux issues. Plus I'll be able to iterate more quickly when we're on the pipe.

Office downstairs

Tuesday, May 14, 2013

We haven't really decided what we're going to use the downstairs of the office for. But we know we want to use it for something. Whether that's throwing desks down here. Or dividing it into offices. Or just leaving the pool table here for people to shoot the shit around.

We decided we didn't want to go crazy with it. So didn't have the walls plastered, or have fancy new radiators. But we built big green columns to hide the wires and pipes. Just to tidy it up.

Old and newz:


Unity Wordpress Plugin

Sunday, May 12, 2013

I made my first wordpress plugin today. It makes it so you can upload unity3d files to wordpress and and embed them in your posts!

[unity src="609"]

It solves a lot of problems that seem to exist in current plugins. One of the issues was that they all kind of wanted you to upload your unity3d files via ftp to get them to work. That is terrible. So I made it so you can upload them via the media player, and insert them via the media player.. and it just works.

They play together nice too. So when you play one, it stops the others. I'll probably make that optional though.. cuz there's nothing stopping multiple unity players playing at the same time.

[unity src="615"]

Another thing is a lot of web servers can't serve unity3d files.. because they don't have the mime type and permissions set. So when you upload a unity3d file it just adds .zip to the end. The unity player can still play it - and you don't have to mess with your config. All good!

I'm gonna play around with it and clean it up then I'll see about getting it in the searchable wordpress plugin install thing.

Linuxxx

Saturday, May 11, 2013

So I've been working on getting Linux Garry's Mod working this week. And it's gone well.

I've got it all compiling nicely, all packaged. But I haven't been able to test it.

We built a Linux testing PC but it doesn't want to cooperate. When I start Team Fortress up it just shows a black window. I've messed with the drivers – changing them popups up an OpenGL error about a lack of scissorgl or something. The PC is running Ubuntu (the latest one – 13?) and has a Geforce GTX 240 (I think).

So that's what I'll be doing next week. Trying different graphics cards. Trying to build a computer on which TF2 for Linux actually works. Then I'll be able to test whether Garry's Mod actually works.

For now, if you want to have a fiddle you can download the latest SVN from here.

The Beach

Friday, May 10, 2013

We went to the beach on Monday. It was a bank holiday. It was sunny too. I'm sure a lot of you American guys are surprised to hear that we have beaches in the UK. And even more surprised to find out that it's sometimes sunny.

The beach we went to was in Wales, in a little place called Rhyl. So it was a long drive for us. 100 miles, about 2 hours. It looks something like this.

But the beach was cool. And the sun was out. And I of course got sunburnt because I'm a huge nerd.

The sea was miles out. Like, scary miles out. We built a dam and redirected a stream that was going out to sea. It got pretty awesome.

Further out, some of the sand was more mud than sand. There's probably a good explanation for that.

Trees have leaves

Thursday, May 9, 2013

We had a week of sun last week. And now all the trees have booted up! The first image here is a week ago. The second is 10 seconds ago.

So yeah. Just to confirm. The sun and rain makes trees grow their leaves and stuff.

OBS

Friday, May 3, 2013

Open Broadcaster Software is an open source live streaming/recording program. This is going to sound like an advert – but it isn't. I just really really like it and want it to succeed.

If anyone has tried streaming their desktop they probably know about xsplit. It's about as good as it gets. It works, you can do stuff. But it's far, far, far, far, far from perfect. It's pretty slow. And as far as I know it doesn't have any plugin support.

OBS is like black magic. It records and you don't even notice. Maybe it is magic, or maybe it's just coded really really well, or maybe it's taking advantage of some Windows 8 desktop recording thing I've been hearing about.

But check this video out. This is me, recording 3 huge monitors (all 2560x1440) and 3 HD webcams, downscaling them to 720p and saving them to a mp4. This is all done on the fly. It isn't saving to some huge format and then processing it afterwards. BLACK MAGIC.

The best thing is it's open source. So you can go in there and see what's making it work. Or mod it. One of the things I wanted in XSplit was to have it follow my cursor around. No plugins meant that wasn't gonna happen unless the guy who makes it decided to add it. With this I don't have to wait – I can just make it happen. Or maybe if it's done right (to work with the licensing) I could add lagless twitch streaming/mp4 recording right in GMod using it.

Even though it is awesome it is still in early beta. Version 0.51 right now. So it has some way to come. But it's a horse you should back.

Privacy Thing

Friday, April 19, 2013

We had a privacy film thing added to the windows in the office. We love it. Photos don't really show it properly.

How ya'll doing anyway?

Office Progress

Saturday, April 13, 2013

Our toilets got finished this week. This makes me happy because the toilet we were using downstairs was totally horrible to use. And now we can get rid of it!

Weirdly, the upstairs toilets were the first thing we designed, back in September 2012. Here's the sketchup.

We've made a few changes since then. We added a urinal.. (which is probably wrong for unisex toilets – but it's done now!). And we added a bunch of lockers on the right to fill out that space. And lime green is our favourite colour.

Our kitchen is almost finished too. We just need skirting board and carpet.. and some tables.. and chairs.. and a TV.

There's seven of us in the office now - and there's two more people starting soon!

It's getting exciting!

Learning Unity

Wednesday, April 10, 2013

Our new project is going to be coded in Unity. Why? Well, as game developers we should be making games, not engines. This engine is done. It works. It works better than anything we could code. It works on more platforms than we could ever hope to support. It has more third party addons/plugins that you could ever hope for. That's why.

There was only one problem. I was a Unity virgin. I have never coded in it. Ever.

So on Sunday I printed a bunch of crap out. Pretty much anything that was a PDF I could find – that mentioned coding using c# in unity.

http://download.unity3d.com/support/...Essentials.pdf
http://docs.unity3d.com/Documentatio...ngTutorial.pdf
http://www.rebelplanetcreations.com/...eInUnity3D.pdf
http://www.csit.carleton.ca/~arya/ds...y_Toturial.pdf

Now, I'm a good enough coder to know that some of the stuff they do in the last two tutorials is dubious. But they explain the basics of the update loop, collisions, entity queries etc. So now I know how to code in Unity.

It all clicked into place.. and now I'm pretty sure I could make anything in it. It surprised me how easy it was.. like – that's it? And the more I thought about it the more I realised yes, that's all we need.

So between all the other junk that's happening I've been plugging away at it and come up with stuff for the new project. Here's what I made yesterday.



I am having lots of fun!

New Project

Saturday, April 6, 2013

So we started working on the new project in the office. It's very much planning right now.. which I am enjoying a lot more than I thought I would. I'm enjoying coming up with back stories and characters – which I previously thought of as a distraction from the actual game creation process.

It's one of those things where we're talking about it – then looking at each other confused.. like.. "why hasn't anyone every done this before? Are we crazy? Has it been done?". That makes me think we're on the right track.

I hate to get all Peter Molydeux about it.. but this game is more of a strategy than a game. If it works out perfectly you won't ever play it.

Nextbot & Coroutines

Thursday, March 28, 2013

I've made a bit of progress binding the Nextbot stuff.. despite not talking about it.

When I was designing how it should interface with Lua I started off mimicing how it worked in the engine. After a few good sleeps I decided that it wasn't the way to go. It's coded like that in the engine because of the limitations of C++. We don't have these limitations in Lua – so lets try to use that to our advantage.

So I decided to use coroutines. First of all let me get this out of the way. Coroutines aren't threads. They don't really offer any speed benefits. A more accurate way to imagine them is as a function that you can pause and resume at any time. So imagine you're writing a script that prints text.. you could do something like this.

So where before you would use timers or whatever to achieve this.. your code is instantly a lot simpler to follow.

This is good for a lot of stuff in AI because a lot of the actions happen in a timed order. You do one thing, then you do another, then another.

[youtube=http://www.youtube.com/watch?v=6IGgt3YuXp8&w=448&h=252&hd=1]

Here's one I made earlier. This guy is very simple. He tries to walk somewhere. Then he sits down. Then he gets up and tries to run to a good hiding place. The code is just as simple.

Obviously I don't expect people will code their AI in one function, but this gives you an idea of the simplicity of this. I imagine in reality you'll have functions like TryToFindPlayer(), AttackPlayer() and Flee(). Or more realistically a single function called ThrowMonitorAtPlayer().

Airplay To Room

Wednesday, March 27, 2013

When I go in the shower I like to listen to music. All my music is on my phone. So I tend to listen to it via the phone speaker – which is shit. I bought a dock that charged via USB – and it was pretty good – but you have to charge it so fuck that.

So ideally I'd have speakers in the wall or ceiling and be able to airplay to that room from my phone. That shouldn't be too hard – right?

So for about £150 the room (give or take because you gotta buy a couple of cables) the shower room should play music for me. That's probably about what you'd pay for a half decent dock – but it's more awesome because you're building it yourself!

I set up a test to make sure it all worked. It couldn't be much simpler. First set the airplay up to get on the wifi network and give it a name (I named it "Upstairs Shower". Then plug it into the amp using a 3.5mm jack. Then wire the speaker to the amp. I'm using big grey mains electric cables just because it's what I have lying around – and cable is cable.

Then send some music to it via the iPhone/iPad/Mac/PC!

And bam! Music!

The speakers are decent. I've only tried it with a single speaker so far, and the volume is great – but there's not much bass. Turning the bass up too much on the amp gives some popping. But I'm having a shower – I'm not opening a nightclub in there.

I haven't totally decided yet – but I think I want a volume control on the wall. You can adjust the volume with the phone but I don't want to have to do that every time (I haven't tested it – each airplay device might remember its own volume so you might not have to).

So wiring the volume control up is easy. It doesn't need any power – you just put it between the speakers and the amp.

The intention is to hide the amp and the airplay in the loft and never have to mess with it every again, then have the volume control on the wall.

This amp is probably overkill for what I'm using it for – but it does what I need it to do, the price is right and it's a nice size too.

So now all I have to do is actually cut our holes and put it where I want it!

Resellers

Wednesday, March 27, 2013

There's something I don't understand about the sale of software. Why do companies have resellers? Why do they want you to buy through their resellers?

It's usually the case with expensive software aimed at businesses. Like 3D Studio Max, Photoshop, Unity3D or XProtect.

Why would we want to buy it via a reseller? Why would we go to their website to buy the software – then decide that we want to buy it through another company who is probably going to charge us more for the same thing?

Is it some out-dated thing that hasn't properly died yet but will quite soon?

Steampipe Looming

Friday, March 22, 2013

So Valve are converting all their games over to Steampipe. The word on the street is that DoD:S is going to be converted for proper on Monday. I am not sure whether this is just DoD:S or CS:S etc too.

So for GMod players this means that the content will become unmountable. You won't be able to play with DoD:S maps or models in GMod.. until I release an update that makes it compatible. I have got that patch ready but I don't really want to push it out until it all goes live on Valve's end so I can make sure it works before I flush it.

As for GMod's move to Steampipe.. I think it's a bit of a sore-point a Valve. The licensee code server hasn't been updated for a few months. But they're working on that. Once that's updated I'm sure I will have a lot of merging to do to move to the new gcf free system – then I will try to get converted to Steampipe asap.

On a related note I had emailed Mike Durand about a month ago about the code not being updated (I think licensee's were mainly his responsibility). It turns out that he was fired (or quit) in the Q1 cull. Like everyone else, I don't know why all these people got fired from Valve – it's none of my business, but I'd like to say that I was sad to hear that Mike had been fired – he had helped me out a lot over the years with Source engine and licensee server problems. His absence isn't going unnoticed :(

Coroutines

Thursday, March 21, 2013

This week I have managed to get coroutines working properly in Garry's Mod. I am almost positive that no-one cares about coroutines but maybe that's because they've never worked properly?

The problem was that coroutines create a new lua_State. But my main Lua class stores the main Lua state and almost all of the bound engine functions use that state. So when you call them from a coroutine it uses the wrong state and the world explodes.

So I made it so that each bound function creates a LuaStateBlock class, which sets the state when its constructed but then sets it back when it's destructed. This worked great except for one huge thing. If you error out in a coroutine the world explodes.

This is because when you error in Lua it jumps to another point in code – and doesn't call the constructors! You can get around this by compiling it as c++ instead of c apparently. But I'm using LuaJIT and I didn't want to fuck shit up that much.

So my solution is to just never set the state back. Then any call to lua_call/lua_pcall I store the state before and restore it afterwards. Job done, coroutines work fine!

tl;dr; fixed something no-one cares about

Recruiters

Wednesday, March 20, 2013

We signed on with a couple of recruiters to try to find decent programmers.

It feels a lot like a dating service. They send us an email with the candidates vital statistics and try to explain why they think it will work between us. If we tell them it won't – they try to convince us that it will.

It's working out alright so far. We've had a couple of good leads.. It helps that the recruiter doesn't get paid unless we hire someone I guess.

All that said – we don't have to pay the recruiters at all if they don't introduce us. So if you're a decent programmer, live in or want to move to the West Midlands (England) and want to work for us then shoot me an email to jobs@facepunchstudios.com

Writing a Wiki Bot

Monday, March 18, 2013

As part of the wiki re-fuckulation process a month back I had to move and reformat a bunch of pages. So I went about writing a wiki bot.

If you already have good knowledge of PHP this is about a billion times easier than it sounds due to a useful little library called wikimate. Its github page speaks for itself, it's incredibly painless to read page text, set page text, delete pages etc.

So as an example.. one of the fucked up things about the old wiki is that it didn't use categories. All of the functions were painstakingly listed on a page. So if you removed or added a function you had to edit this index page too. That's not how a wiki is meant to be indexed. So I went about getting all the listings on those pages and converting them to a new template, so they would be categorised properly and also be editable via a form.

When I'm posting this code I'm now showing you great coding – I'm showing you code that got shit done.

So this function looks on the Libraries page and splits it by newlines – so that $lines is an array of lines. Then if a line contains "{{Lib" it trims shit off, splits it by | and calls ConvertLib.

ConvertLib does pretty much the same thing. It gets the library's index page, goes line by line looking for LibraryFunc. Then it splits by | and calls Process.

Process is kind of a big boring function, so I'm splitting it into sections here. This part gets the target page. If it already exists then we already did our work, so it bails. If not it get the source page. This is the page we're gonna be reading and converting to the target page.

It reads the page contents into $text

Then it tries to find the information we need for the new page. This looks more complicated than it is. It's basically trying to find text between two other pieces of text. There's a bit of fucking about to get this to work properly.. This is probably where regex works well – but who wants to learn how to use regex – right?

Once we have the info we can build $out – in the format that we want.

The arguments were stored in a really shitty way under a single template (Arg1Name, Arg2Name, Arg1Type, Arg2Type blah blah). In the new system we store the arguments unnumbered under the Arg template – and fuck about adding numbers in javascript after the page is rendered.

The final thing is to set the text of the new page, and delete the old one. We set the delete reason on the old page so future generations can figure out why we did what we did.

How was I running this? Well you just install PHP and then you can open a command line and run "php.exe convert_libraries.php". You don't need to go through the trouble of uploading to a host and running it in the browser.

I had lots of fun playing with this stuff and I think it has made the wiki much friendlier to edit! So everyone wins!

Oil your brain

Friday, March 15, 2013

In my house I am renowned for obscenely long showers. I can sometimes be in the shower for an hour and half. That's not always because I'm having a difficult shit, or playing candy crush, or masturbating. The shower is where I oil my brain.

I saw something on TV. They did a test. They got 3 subjects and gave them a creativity test. They had to come up with as many uses for a brick as possible. Then they stopped them. One was told to sit and do nothing for two minutes, one was told to do a demanding task for two minutes, and one was told to do a brainless task for two minutes. Then they did the test again.

They found that the guy who sat doing nothing couldn't really come up with any more uses for the brick – despite having lots of time to think about it. The guy doing the demanding task didn't do too well either. But the guy who did the menial task came up with a shitload more uses.

This confirmed something I've thought about for a long time. When I get out of bed I code for a bit and read all my emails. I fill my brain with problems. Then I have a shower and my brain works out all the problems. I find myself planning stuff really clearly. My brain is still working, but it's not using it's full capacity. So when I get to work it's all ready to go.

There's lots of these 'working shit out' activities you can do throughout the day. Here's some that I do.

  • Wash the dishes
  • Mow the lawn
  • Do some DIY
  • Wash your car
  • Vacuum
  • Make a coffee

Keep your brain well oiled.

Tax Investigation

Thursday, March 14, 2013

Yesterday we had a woman from the tax office here having a nose around.

Facepunch doesn't really pay a lot of VAT because we don't sell GMod straight to the end user – we get a royalties cheque from Valve every month. The only VAT we charge is on the forum upgrade system.. so when people buy titles or upgrade to gold membership etc.

So every we always get a VAT refund from them for all the shit we buy, our accountancy/legal fees and our rent. So it's routine for them to check into people like us – because they'd kind of be idiots if they didn't.

But there's a problem. No-one can agree what the rules are for these forum upgrades. Should we be charging VAT at all? Should we be charging VAT to people only in the EU? Should we be charging it to everyone in the world? Even the tax woman didn't really know, and kept flip flopping between different answers. Our accountants have told us to charge people in the EU – so that's what we've been doing.

It seems kind of crazy that something that should be so simple would have so many different rules, that are so ambiguous that you can bend them whatever way you want. If the people running it don't know the rules – what chance does anyone else stand?

Lua Bindings

Wednesday, March 13, 2013

I've been updating how my Lua binding system works over the last few days. My original system was getting me in the shit with co-routines because I short sightedly stored a global Lua instance and accessed it from everything.

While this has worked, and is accessible, it does fuck me about in a lot of ways. Like I can only really have one Lua instance in each dll realm (menu, client, server). I've got no need to have more right now – but that's not the point.

My old bindings looked like this..

The calls to Get_Entity  and Get_Float are what are bumming me. They're accessing globals.

So now my bindings are looking like this.

The 'lua' variable is passed to the function from a function that the LC_Function macro creates. It's no longer retrieved from a global – it's retrieved from the lua_state that is passed by Lua to all function calls.

I also started documenting the functions in a way that I can parse with a PHP script, turn to JSON and automatically throw at the wiki. Something I really really wish I had done over the years for the 2,000 other functions.

Office Progress

Tuesday, March 12, 2013

The mailbag post I made a few days ago got a lot of attention. Lots of speculation about my game idea. I get why, but I fucking hate it. Nothing we ever make will live up to the success of GMod. I don't want to be a AAA studio making massive budget AAA games. I want us to make small indie games. I want to be like introversion – not gearbox. So when people hype themselves up it's only setting everyone up for a fall.

So anyway. We're still in the process of renovating the office and hiring a team. We've pretty much hired two really promising artists so far – hopefully to be starting in April.. and our new receptionist started today. I'm struggling to find programmers though. It seems good programmers are few and far between.

We advertised on monster for a UI/graphic artist and a programmer. There have been about 10 times more applicants for the artist position than the programmer position. A lot of people applying for the programmer job have very little actual experience. One guy applied with no computer experience at all.. his only work experience was running a pub. He listed one of his hobbies as reading the holy bible.

Maybe monster is the wrong place to be hiring programmers. Where should I be advertising? Do you know anyone that's looking?

We've been concentrating on getting our reception area and meeting room finished over the last couple of weeks. Here's some photos!

Paths

Monday, March 11, 2013

So, part of the NextBot stuff is the idea of Paths. They're pretty cool. You give it a target position and it will try to create a path to that place. Not just a simple path – but they can include jumping over gaps, and climbing up ladders.

They're stupidly easy to use too. I'm trying to code them in a way so that they can be used independently of NextBot stuff, but this is the general idea.

So, in this code every second it's re-computing a path to Entity #1. This is obviously just a test.. in single player Entity #1 is the player.

Here's the result..

[youtube=http://www.youtube.com/watch?v=ohuag5KLmUw&w=660&h=370&hd=1]

As you can see, they follow the player pretty religiously.. although they do seem to get stuck on each other when they're colliding. I'm not sure whether that's something I should handle in-engine.. or just expect the Lua coder to detect and protect against the AI getting stuck.

Next Bot

Thursday, March 7, 2013

I laid the groundwork for the nextbot bindings today. The NextBot stuff is what the AI in TF2 and L4D use. It's kinda the reason I have slacked binding any decent AI stuff up.. because I think this system will replace all the old AI stuff.. just because it's much much simpler, cleaner and more powerful than the old stuff.

[youtube=http://www.youtube.com/watch?v=ZWuv7J-Vmr0&w=640&h=350&hd=1]


I've only exposed 3 functions so far, and I'm already loving playing with it. The video above was created with this little bit of code below.



There's a lot of cool stuff to be exposed so the hope is that soon it will be a simple task to make NPCs and Bot AI in GMod!

The Sign

Wednesday, March 6, 2013

We got a sign on the front of our office today! We're all proper!

VPK Search Paths

Tuesday, March 5, 2013

Today I fixed the VPK search paths issue.

The issue was that when you were opening folders to show the game content in the spawnmenu.. previously all VPK content showed in each folder. That was obviously wrong.

This was happening because the VPK stuff internally has no sense of search paths. They get searched all the time no matter what search path we're specifying.

So we add this code to the VPK class..

Then we can set what search path it's meant to be on. In GMod we set up a new search path for each mounted content ( called "tf", "dods", "portal2" etc) so we can search only that mounted content. But the path is also added to "GAME" so that the content will actually get loaded. The code above isn't really flexible but it serves our purposes.

The anywhere that VPK files are actually accessed we do a quick check using the provided PathID.

And now we have searchable VPKs working properly!

Portal 2 content is back and all working. Although there are some crashes due to them all being a newer model format and me having hacked the shit out of stuff to get them working in the first place.. but I've fixed a couple of crashes so hopefully 99% of them will work without crashing.

Mailbag

Tuesday, March 5, 2013

What direction do you ultimately want Dust to go in? Gah, RUST. I mean't Rust.

We really don't know. We have a bunch of ideas we want to try. Zombies are done – we are sick of zombies.. so we wanna get rid of those and add other NPCs. We also want to add building elements and stuff. Really – it's just an experiment, and we're gonna see where it leads.

What brought you into programming? What was your first computer? What was your first 'application' you ever created?

I think I'd played all the games on our Sinclair Spectrum, so started reading the manual and exploring the menu. I'm curious by nature – so if there's a menu option I'm gonna have to look at what it does. My first application that I can think of was called quick flicks or something. It flashed the screen and a circle slowly drew itself over the screen. I didn't know what I was doing really, but I managed to save it to a tape so I could load it at any time. I was about 10 I think.

Do u ever get noticed jn public or have crazy ass fans.

Nope! Never been recognised in public. I have had weird stuff left at my front door – like flowers and stuff. But nothing really really insanely crazy since the Andy stuff in 2009.

do you look at your poop after you're done pooping?

No, I'm pretty lazy, I wipe and flush without getting off the toilet.

What's next for Garry's mod?

Hopefully we're gonna get the Linux version out. Then hopefully we'll move to SteamPipe, and I'll get the NextBot stuff hooked up.. then I want to do another Gamemode Contest. But I want to knock out a bunch of gamemode creating tutorials first to help people get their foot in the door.

How much money have u made from gmod if u dnt wanna be specific r u atleast a millionaire

Over 7 years GMod has made about 22 million dollars. We get less than half of that though. Then the tax man gets a bunch of that. Then when we take money out of the company the tax man gets a bunch of that too.

Besides Rust and Garry's Mod, what is Facepunch Studios LTD working on?

We are starting work on a new PC game. It's a game I've wanted to start work on for ages. I'm trying to get a team together in office to build it this time.. I don't really want to talk about it until we've got something more solid though.

Can you see a future for apple in the mobile space, or will the iphone go out of fashion some day?

I think Apple would really have to fuck up to lose their position right now.

Wat does ur family think of gmod

They know of it – and they tell me when they're browsing youtube and they see Gmod on there.. but I don't think they've ever played it.

Will you make playable TF2 character skins? I would love to see them :D

It's something I've talked about with max – but he reckons it's pretty much impossible

Do you see linux support for gmod happening in the short term or the long term? Or not at all?

Yeah it's definitely gonna happen. I'm just waiting on Awesomium to release their Linux version so I can ship!

does ur girlfriend understand garrys mod and what it is?

I think so. She hates how much time I spend on it though. She's a yoko.

blocco is a shit hole agreeed?

I don't think the place itself is a shit hole. There's a lot of people that seem like they've given up all hope.

Will export to hammer ever come back? If not, Why?

I did add Lua bindings that let people do this – but no-one has. I'll make an addon for it one day.

How many steam friend invitations do you receive on a daily basis?

I'd say about 10.

Do you like your community at Facepunch?

Which one? There's like 20 different sub communities.

The question I have is are you still planning to implement native shader support into garrysmod, the most recent talk of this that I can remember was between you and Tobba in his thread.

Tobba's shader system worked but it wasn't really possible to do anything complicated with it as far as I could see.

SteamPipe Mounting

Monday, March 4, 2013

Today I made steampipe mount properly. If you don't know what SteamPipe is – check this out.

I was having a bit of trouble finding the install folders.. but Valve added a function to the Steam API to retrive them – which worked perfectly.

Then I had a bit of trouble with files with double extensions inside vpk files. I have just found the problem here though – and managed to fix it. I think this is one of those bugs that Valve already fixed in their internal version.. so I might have wasted my time by fixing it.. but oh well, it was good to learn more about how the vpk system works.

So anyway, now we're all good. The TF2 Beta is mounting, with maps loadable and models spawnable etc. So we're all ready for when Valve switch it over!

Mailbag – Questions

Monday, March 4, 2013

Remember when I used to do mailbags? Well here it is again.

Post your questions in the comments, or send an email to mailbag@garry.tv.

When there's enough I will answer them all in a post.

Office Refurb Progress

Saturday, February 23, 2013

Someone asked to see how the office was getting on. So here you go!

This is what it looked like when we first got it.

Here's what it looked like about a month later.

And then a couple of months later

And right about now..

We are now ready for fresh souls.

Here's our little coffee making area

And my office..

We're getting started on the downstairs now. This is how it looked.

I don't have any pictures of how it looks right now. I'll save that for the next post :)

Testing GMod Updates

Saturday, February 9, 2013

We're in a hard position when testing GMod updates. It's an area I've wanted to improve for a long time. It's really hard to test them properly. Let me explain.

User Content

There is so much content in GMod. So much user created content. So many different ways GMod is used. So to truly test an update we'd have to try every piece of content, every map, every model. This is obviously impossible for us to do.

Engine Updates

When we update the engine (or change the network datatables) it renders the new version incompatible with the old version. This means that we can't join old servers, and people using the old client can't join our development servers.

This means that all the developers on the forums that ask for features or bug fixes can't really verify that they've been fixed (it is possible - but only with a lot of steam.cfg editing and file copying).

The Beta

The answer to a lot of the problems of testing is to test it via a beta version. This sounds like a good idea except for two big problems. Hardly anyone uses the beta version, and of those that do - hardly anyone reports bugs.

So you get the situation where the beta is there and it's being updated. But it doesn't get anywhere near the same level of testing because everyone has their crazy addons and gamemodes already installed in the live version. So that's what they play on.

Hire Testers

A lot of people suggest this. Sure - hire 10 people to play GMod all day - to test every area. How much would that cost? £150k a year?

It does sound like it would work, but at the same time I hate this idea. It's not just the money. It's the fact that you have 10 people hanging around that have nothing to do 95% of the time.

Plus it's not even that effective. They still can't simulate the hundreds of gamemodes, the thousands of server configurations. It still won't catch all of the bugs.

Unit Testing

This is one area that we can do better in - that I want to improve on. It's basically running a program that will verify the result of a bunch of function calls - to make sure they're all operating properly. 

This would work for a lot of things - it just requires a bit of investment in time to set it all up. To be 100% effective we'd need to set it up with EVERY function though.

I am envisioning a Lua script that can do it all automatically though. I mean, we run a script - it somehow calls all the functions on a player object, or an entity object. Then it stores all the results (or errors). Then the next update you run it again - and if they don't all line up with the previous results you show the diff.

Maybe they're different results because you fixed a bug, maybe they're different because you created one. Either way we're at least aware of it.

Generally..

Generally though this isn't an issue because if I change anything in code I have only changed one thing. If I change a single lua file - it can only affect so many things - so it's easy to test. I don't need to test EVERYTHING else - because I didn't affect them.

So usually between updates there's not a great deal that could have broken. As long as everything compiles without errors, and the build server's configuration hasn't changed - everything is simple.

But sometimes..

Sometimes I merge in with Valve's latest code, and apply all the enhancements and bug fixes they've added. In this case everything needs a good test. This is what happened with the update on Thursday that I had to roll back.

Although the huge majority of the merge has no affect on GMod at all, sometimes Valve has edited a file in the same area that I have edited it previously. In this case the code needs to be merged by hand. This is just a case of looking at the original code, at the changes I made, and at the changes Valve has made. Then I need to decide whether to get rid of my change, or put it after Valve's change, or before Valve's change.

Sometimes these merges go wrong. As is the case with the update on Thursday.

Pink Maps

One of the errors in Thursday's update was that maps were pink that had been downloaded from the workshop. This was because the filesystem couldn't mount the pak file that was inside the map, so couldn't get the custom textures.

This is one of those bugs that should have never really got past us - but it did. As soon as we made the update live it was plainly obvious that it was a problem, and what the fix was.

Solution

So we've added 'check workshop map gm_atomic' to our list of things to check pre-update.

This is kind of what we're going to have to do, build a check-list of things that can fuck up - and check it manually before each update. On each platform.

Catch Up

Friday, February 1, 2013

Things have been a bit of out joint lately. We've moved into our new office, after a lot of renovation. The work is all still going on below us - but we're all moved in now. So I haven't been posting as much as I used to. I'm hoping as things calm down I'll be able to blog properly.

Servers

I've been setting up servers on and off over the last month. Mainly to build GMod (pc, linux and osx). But I've been finding other uses for jenkins.. like using it to run cron jobs from a central location.

Garry's Mod

Garry's Mod hasn't had an update since just before Christmas. One of the things I wanted to get right this year is testing updates. And we're working on that now. To set up a simple test procedure we run through before making a patch live.

I'm going to be looking at doing updates monthly from now on too, with smaller patches inbetween as needed.

We've started using GitHub for pull requests and issue tracking - which is working brilliantly so far.

Rust

Helk is still working away on our pet 'dayz rip off' project, Rust.

Nothing much to say on that just yet, Helk is still working on the terrain stuff. We have some ambitious plans for it.

Hiring!

We're hiring. So I'm spending a lot of my time looking over CV's and exchanging emails with people. We're looking for coders and artists that live locally (Walsall, England).

If you think you can do something for us, or know someone who you think can, and you can travel to our office every day then shoot us an email at jobs@facepunchstudios.com.

I don't so much care about university or college education. But you should have a lot of examples of work you've done in your spare time. We're looking for people who would be doing this stuff in their spare time if we weren't paying them to do it for us.

Git outa hear

Wednesday, January 16, 2013

Everyone tells me that Git is better than SVN. And for a lot of things that's probably true. Git has some practical issues though. Committing binaries would make your repo huge - because when you clone the repo it downloads every iteration of the file - not just the latest one like in SVN. You can get around this by speficying the depth to clone, but you're kind of losing one of Git's great strengths if you do that.

It seems a lot of the features people praise Git for are features of GitHub - not Git itself. GitHub is awesome. One of the features they have is the ability to check out, and commit Git repos as SVN. This is a great feature and makes transitioning projects to it simple.

This was one of the big hurdles for me because I tend to make repos for smaller projects - like Bootil or Holly - and have them external'd into larger projects (like gmod). So being able to 'external' them as SVN repos gives me all the benefits of Git while retaining them in my current SVN codebase unchanged.

I did a similar thing with the Garry's Mod game code. I created a Git repo containing the light files, such as the Lua and the HTML. Then in my existing SVN repo I created externals to each of the specific folders. So the SVN handles the grunt of hosting the binaries - while the main code is on GIT - and the community can offer up pull requests.

The SVN interoperability was a deal breaker for me and I've already moved most of my stuff over to GitHub with no real inconvenience to any of my existing projects that use them.

Shadow Gap

Friday, January 4, 2013

When I first started renovating my house a couple of years ago I wanted shadow gap at the bottom of the walls instead of skirting board. But no-one knew what I was talking about and I couldn't find anything online.. so I caved and made do with skirting.

So when we started renovating our new office I insisted on shadow gap again. And again, no-one knew what I was talking about. But this time I pushed for it.. and we got it!

Shadow gap is when you have a receding gap at the bottom of the wall, so it looks like the wall is floating slightly above the floor. Why do I want that and not a piece of painted wood at the bottom? I don't know.

2013 Goals

Monday, December 31, 2012

Lose More Weight

I did good in 2012 with my weight loss, going from ~186 lbs to ~166 lbs. I'm going to be looking to reach 150lbs by the end of 2013.

Increase the Bus Factor

The bus factor of Facepunch right now is 1. If I died so would Facepunch. Over 2013 I'm going to attempt to hire the best game developers I can find to increase that number, and hopefully pump out some awesome PC games.

As much as I'll miss it and this could all fuck up.. I feel that these are the kind of risks I should be taking.

Play More Games

I have played some games this year.. Hotline Miami, Max Payne 3. I picked up the latest COD game and didn't even play the single player. I hit Battlefield quite hard for a bit. But generally I haven't played enough. It makes me feel guilty. How can a game developer not play games.

My problem is that I get that much enjoyment from coding that when I think of playing a game it feels like work, I'd much rather be balls deep in Visual Studio instead. But I feel that 90% of this problem is me being dismissive of the games ability to entertain me - because I've played so many shit games.

So I will try to be more open minded and play more games.

Go to a proper conference

I would like to go to a game conference this year. Something developery. I think I'm a bit dismissive of conferences in general because they always seem like an excuse for everyone to have a few days off work and get drunk together, and I don't see what I'd get out of it. We could set up a GMod stand and have people come and play it - but it seems kind of like it wouldn't be worth the effort.

But yeah, that's me being super cynical. So I'll try not to be, and it could be fun.

Enter Ludum Dare

Something that I'm always jealous of when I see people posting their WIP for it. I'd like to take part!

PC Hardware Design Sucks

Friday, December 28, 2012

I think it's probably a fair guess that most people reading this blog have looked inside their PC. And it's a fair guess that most of those have built their own PC. And it's a fair guess that most of those don't yet realise that their PC design sucks. Well let me clue you in.

In the PC world - particularly in gaming PCs, this is considered cool.

Now maybe it's an age thing but to me as a 30 year old PC gamer that looks horrible. I don't want my PC to look like future Biff Tannen's hoverboard boots covered in lights. I want a nice clean PC that doesn't look out of place in my nice clean house.

Maybe I want to change a hard drive, or the graphics card, or add more RAM - I want that to be easy - I don't want to fight through hundreds of cables and struggle to get my big fat hands between lagged bits of plastic to release a catch.

Have you ever seen inside a Mac

Even if you're not an apple fanboy it's something you should look at. Just because it's so well done. I know this is going to sound like an Apple fanboy banging on about how great Apple are - but it really isn't. I would love to see a PC manufacturer make hardware this well designed, this focused, this nice. And I wouldn't mind paying an extra couple of quid for it either.

So the outside design. It might not appeal to everyone. To me, I like the legs on the bottom - and although I probably wouldn't have chosen the handles at the top - they really come in useful when or if you have to move it. It's very simple looking, functional and clean. Compare that to the alienware above.

The back is also very organised. It has a level - when you pull it, the side panel falls off.

But it's really when you look inside that you truly appreciate how much design work has gone into it. Everything inside has been custom designed, custom made to make your life easier. And really - on the inside - it's a PC. The components are there, you can take them out, replace and upgrade them. There's the memory, CPU, GPU, hard drives, optical drives.

One thing you might notice in that picture is the complete lack of cables. I mean, the only cables I'm able to find in the whole thing are the cables for the optical drives, and optional power cables for the graphics cards. The hard drives all slot straight into the motherboard.

The bottom section with the memory on actually detaches and slides out from the main motherboard. You just pull these two latches and it comes sliding out.

This tray also contains the CPU.

That big silver box is the CPU. You can get them with dual CPUs too.

If you wanna see more (there's a lot of cool features) take a look at this video. (the guy talks a lot about nothing, but it was the best video I could find that shows you the good stuff)

What are we doing?

There's a lot to be said for the way PCs are doing it. You pick up a case of your choosing, a motherboard of your choosing, a CPU, GPU of your choosing, you jam them all together and it's what you wanted. Exactly what you wanted.

But maybe that isn't the way it should be working anymore. Compared to the design of the Mac Pro - our PCs are an ugly, outdated, black, plastic joke.

No more cables

Think about the cables in your PC. Most of these can be eradicated by designing the case and the motherboard together - and shipping them as one. The CPU, memory and graphics card is still up to the PC builder. USB, power, reset, HDD LED, power LED, sata, sata power, atx power - all these cables are no longer needed - because the motherboard is integrated with the case.

Why isn't this happening?

Maybe PCs don't sell anymore? Maybe everyone is buying laptops and iPads? So maybe it's not in anyones interest to do this, to champion and bring PCs up to date, to make them relevant. Maybe the way forward is the iMac style, where all the workings are built into the monitor.

I don't know. Before I bought a Mac Pro (and installed Windows onto it) I searched far and wide for an alternative. The hunt for a modern PC continues - but in the meantime Apple have my soul.

Borderless Window Mode?

Sunday, December 16, 2012

GMod goes into borderless windowed mode is you choose windowed mode with the full screen native resolution. You might need to restart gmod for the changes to take effect.

More Kinect Stuff

Sunday, December 2, 2012

Here's a video I made yesterday:

[youtube http://www.youtube.com/watch?v=cKDRcHab6mc&w=853&h=480]

There's a few things I want to explain about the video. So here goes.

Feet Positions

As you can see the feet are regularly off the floor. I did originally start coding something to make the feet fall to the floor - so you'd always be on it.. but I decided that you don't actually always want it to be on the floor.

So in my opinion the best thing to do was to make it so that the user can pick the sensor up and move the ragdoll wherever they want. That way I don't have to force this crappy code on users - and they can tweak it all they want.

Ragdoll Movement

On Thursday/Friday I changed the way we move the ragdoll. Previously I was setting the physics object positions directly - just teleporting them in to place. This worked but it has issues when interacting with other objects. Your hand would go through them instead of pushing them.

I changed it to use a motion controller - which instead of setting the object's position - applies the correct forces to move it into the chosen position. This is the same thing that is used to move objects with the physgun, or the gravity gun.

The result is much neater realistic interactions with the world - as you can see in the video above.

The motion controller stuff is something that really should be exposed to Lua coders - so I will try to find a way to expose that this week.

Recording/Playback

This is something I want to get in, and I'm contemplating the details at the moment (record & save clientside, share on workshop, allow playback for people without kinect, etc).

If you're really itching to record what you're doing you can record your input using Kinect Studio - which is included in the SDK.

It's Not Out Yet

I keep getting tweets asking why it doesn't work for people. It's probably because it isn't out yet. It's on the SVN but that's a developer thing - it's not meant for people that don't know what they're doing. I'm aiming to release it on Thursday (the 6th).

CoD or Battlefield?

Sunday, December 2, 2012

Right now.. Battlefield.

I used to like COD a lot, but battlefield's engine just seems years ahead. I hate the fact that it matters - because it should be about the gameplay - not the engine. It just feels like I'm playing a 10 year old game when I play COD now.

Kinecting GMod

Tuesday, November 27, 2012

Over the past few days I've been playing with the Kinect SDK with GMod. It has been super, super, super fun. Super fun!

The outputs from the kinect are really simple. You set it up, query it, it updates, and then you get a bunch of vectors.

So you draw them in-game - and what does it look like?

Awesome, so then you draw lines between the right vectors and bam, you got yourself a skeleton!

Which looks cool, but we want to control ragdolls, right? So all our stuff is clientside right now. We need to treat the kinect like any other controller - and pack that shit into the usercommand.. so it gets sent to the server like any other button. The positions are then available serverside on the player object.. player:GetKinectPos( int ).

So I tried setting the physics bone positions and angles. I believe this is what John B did in his implementation a while back.

That kind of works. But it's kind of shitty. Kind of laggy, and weird. This is because we're setting the positions every serverside think.. which really isn't often enough.

We add some code in the ragdoll entity - setting the positions in VPhysicsUpdate.. which is called all the time (when the ragdoll isn't sleeping).

That's cool! Obviously all the positions and the angles are fucked up - but it's super responsive!

One of the issues with the positions is that the kinect skeleton isn't really the same as our skeleton. We need to make some adjustments.

What I do is lerp between the kinect positions to build a table of 'valvebiped' positions. Just to get as close as possible. We can over-lerp and under-lerp if we need to.

Then I use that table to work out the angles between the limbs. The kinect doesn't know about angles of limbs - the sdk does offer a function but it just processes the position vectors to work out the angles. This seemed like a waste of network bandwidth to me - so we just work out the angles ourselves on the server. This is something we'd probably have to do anyway since the kinect angles aren't going to match our target skeleton.

Once we have the angles we just have to 'solve' the ragdoll using those angles. This makes all of the limbs the expected, normal sizes.

And it's as easy as that!

[youtube http://www.youtube.com/watch?v=avgqr75MVcg&w=853&h=480]

Entity Editor

Thursday, November 22, 2012

A question that gets asked a lot is.. where the hell is the turret tool? Well. Let me explain. I hated the turret tool. Not in theory, I just hated how it was implemented.

You see, in my mind, the turret is a turret. It has nothing to do with tools. It shouldn't be spawned using a toolgun. The same could probably be said for lights and lamps. I don't like the idea of making things like the turret a tool - because the tool list isn't very good for listing huge quantities of things. The more you add to it - the worse it is.

So something I've had in my mind for a long time is an entity editor. You spawn the entity - and then edit it. That's how the turret tool should work. You spawn a turret - then you edit it. Not the way it used to work - where you edit the settings and then spawn it. That's backwards. So I've been coding stuff for a long time with the end goal of things being editable in this kind of system

Well this week I started putting all of that together. Here's what happens when you right click a bouncy ball..

And then this window pops up.

And everything is editable. You can leave this window in your C menu for as long as the entity exists, and happily edit it whenever you want.

This is why I didn't add a sky or fog editor straight away either. I wanted to make these into entities - so that people can duplicate them, and save them.

One of the things I'm trying to do is to make it as easy as possible to make entities editable. For example, to make the ball editable I just added an editable var:

And added some meta to its network variables - so the client knows how to edit them.

That's what I've been up to for the last few days. You can watch a video of how it works in practice here.

Fan Mail

Thursday, November 22, 2012

Remember when I used to post fan mail, and it would always be someone really angry at me? Things are worse nowadays.

Lua Errors

Thursday, November 8, 2012

A couple of updates ago I started reporting Lua errors back to our servers. This was to serve a few purposes.

  • Show us workshop addons that were erroring, so we could warn/remove them
  • Show me where my scripts were erroring, so I could fix them
  • Show me where something in an update caused problems with addons, so I could retain compatibility

So I got a rudimentary site up here, and it's working pretty well, serving its purpose.

One thing that was apparent was that people were getting Lua errors that they shouldn't have been getting. For example..

lua/postprocess/morph.lua:6: attempt to call method 'SetMaterialTexture' (a nil value)

This shouldn't have been happening because morph.lua isn't included in GMod anymore. This file must have got left over somehow. (one of my theorys is that it's still on some dedicated servers - but at the time my stats didn't reveal whether error reporting clients were connected to servers). So I added some code to delete the file if it found it.. and the errors faded out.

The fact that they faded out instead of just dying dead suggests to me that they were probably being sent by servers. Since the server update was optional, the servers might not have restarted for hours - but clients could still join and get the old Lua files.

To prove this theory, here's another graph. This error was happening when people loaded an old save with a camera in it, a bug I fixed with yesterday's update. As you can see, the error dies straight away.

So it's working out pretty good. I'm going to expand the system so that we can show all the errors created by a particular gamemode, addon or addon author. Maybe one day we will have a GMod where players don't have to live with an error notification on their screen while they play.

Optimising GMod

Tuesday, October 30, 2012

For the last few days I've been trying to squeeze more performance out of GMod. I've been looking for slow areas, bottlenecks, over-called hooks. To do this I've recorded a demo and played it back using timedemo and used the Source engine's vprof tools and the very awesome very sleepy.

Here's some stuff I discovered.

User Data

User data was stored in a kind of stupid way. To push the userdata I just used Lua's userdata function to create a pointer sized userdata pointer, then stored the pointer to the userdata on that. This was cool but when it came to determine the type of the userdata I had to do some wacky shit - which involved getting the metatable and looking up an integer on it. This is even worse than you'd imagine - because every call to an entity, such as ent:SetPos checks that the type of userdata passed as the first argument is an entity. So pretty much every call to entity functions, or physics object functions, or vector functions was looking up a metatable and then looking up a number on that metatable. For nothing.

So now what I do is push a custom struct as the userdata, which holds the type and a pointer. So to check the type all you have to do is grab the userdata pointer, cast it to the struct and BAM.

This took the FPS from 127 to 135.

Timers

I then moved the timers module to the engine. The timers module is really very simple, so it was easy to move. The performance increase wasn't massive, but I was happy because it's made the module feel less fragile.. and any gain is a gain.

This took the FPS from 135 to 137.

Entity Handles

Entity handles in GMod were over-engineered. This was to account for the fact that when you lag the entities clientside are deleted and re-created. At the time this didn't make sense because I really wanted to keep the entity tables around (If I could do it again this wouldn't be the case). So I had this whole system where entity references are stored by serial/ehandle numbers in a global table called _ent. Which has worked fine for about 8 years.

But it was stupid. Server entities don't need to give a fuck about that shit. And neither do purely clientside only entities. And we only really need to give a fuck when the entity is deleted - not all the time.

So now entity and entity table references are stored on the entity themselves. When a an entity is deleted clientside (and it has an entindex > 0) it keeps the reference around for a frame, then removes it. If an entity is created in that frame with a matching ehandle it uses those references and doesn't call :Initalize. Clean as a bean.

This took FPS from 137 to 145.

Hook

Then I decided to tackle the biggy. The hook system is used by pretty much every system in GMod. I guessed it would be a lot faster if it was in the engine rather than in Lua. I guessed wrong. Very wrong.

Turns out that moving it to the engine actually made it slower, by about 15fps. The issue I'm guessing is the multiple pcall's from C to Lua (for each function, and each hook). Coupled with having to re-push the arguments to the stack for each one.

So even though it took a few hours to do and the code was super awesome, I ended up having to revert it all. Sadface. It kind of opened my eyes too. I'm sure there are other places where it would be faster to have stuff running in Lua instead of in C. The __index functions on the entities come to mind.

ShouldDrawLocalPlayer

While coding the new hook system I noticed that this function was being called about 50 times more often than it should be. Literally. So I cached the result, and invalidated the cache when rendering a new scene - or calling cam.Start.

And the rest

While I was trying to make the hook system work at a decent rate I found quite a few other optimizations. Common sense optimizations that wouldn't be worth doing if the functions weren't being called thousands of times every frame. These all added up.

So in my timedemo I've managed to get it from 127fps to 157fps. By my math that's a 23% gain. And that's just running a very simple (client only) demo.

Texture Filtering

Saturday, October 27, 2012

Something has annoyed me in GMod for years. You know how when people draw text, or a HTML panel in the world it looks all pixelly? Well yeah that's annoyed me. So I took 5 minutes to add these functions in the next update.

render.PushFilterMin( TEXFILTER.ANISOTROPIC ); render.PushFilterMag( TEXFILTER.ANISOTROPIC ); render.DrawSprite( .. blah .. ) render.PopFilterMin(); render.PopFilterMag();

These allow you to force the texture filter mode to a certain value - and ignore the filter value set in the textures. *Min is the filtering to use when the texture is smaller than its size on screen, *Mag is the filter to use when it's larger (magnified). Modes are:

TEXFILTER.NONE (force normal behaviour) TEXFILTER.POINT TEXFILTER.LINEAR TEXFILTER.ANISOTROPIC

Toybox Torrent

Tuesday, October 23, 2012

So, I had the toybox stuff downloading in the background yesterday.. and it finished some time yesterday. All together the content is 36GB. That includes 21GB of maps, **2GB **of models, **10GB **of materials.

I know there's people who would say "only torrent the top 10%", but that goes against the whole point. This is all for the guy that uploaded their map 3 years ago and don't have any other backups of it.

The torrent is available here: http://puu.sh/1hQvX

It's obviously huge and not fully seeded yet, but it's there if you want to jump on for the ride.

Toybox Disabled

Monday, October 22, 2012

I have disabled toybox.

Snack Chair

Saturday, October 20, 2012

I love eating, I love frazzles, nik nacks, monster munch, apple turnovers, rhumbarb crumble, black pudding, raw sausages, boiled eggs, shortbread. I love all kinds of snacks.

But I realised something the other day. As much as I love these things I would enjoy them less if all I was doing was sitting in a chair facing a wall while I ate. I eat while I watch TV, I watch TV while I eat.

So I think it would be a good idea for people trying to lose weight to have a snack chair in their house, in a room with no TV, no internet, ideally no windows. They can eat as much as they want when they sit on that chair - but only when they on that chair.

Coffee Shirt

Saturday, October 20, 2012

Earlier in the week I was waiting for a parcel to be delivered. When it came I answered the door, signed for it, and said thanks to the guy. As he was leaving I saw he gave me a funny look. When I went in the house I realised that I'd spilled coffee all down the front of my tshirt as I got up to get the door.

So I was pretty embarrassed and ashamed about it, what must he have thought. Maybe he thought I was a heroin addict, or like I'd just threw up on myself, or I'd been wearing the same shirt for days. But then I figured fuck it - I won't ever see him again why do I care so much, right?

Well the next day I had another parcel delivered and it was the same guy. Neither of us mentioned it though.

Crash Dump

Thursday, October 18, 2012

Does anyone know of any sites or services that process crash dumps for your programs? It seems like things could be a lot better in this area. Google Breakpad has pretty much become the standard crash dump generator, and provides tools to upload the crash. But I haven't come across anything that you put on your server ( or ideally an externally hosted service) to process the crashes.

When a program crashes, it'd be nice to give the user the option of viewing a webpage about the crash. This could provide quite a few perks for the user and developer.

  • Statistics - first seen, last seen, crashes per month, week, day.
  • Support - developers could ask with a specific crash a question
  • Discussion - users could discuss the crash with each other - finding solutions - which in turn would help the develop debug.

It seems that most users would like to help diagnose the problem when a program they're using crashes. It'd be nice if we could target and use that energy.

So, anyone know anything like that?

UPDATE:

@pvanzelst directed me to crash-server.com. The design isn't great - but it ticks a lot of boxes. Seems to be Windows only though.

LuaJIT

Tuesday, October 16, 2012

In GMod13 we've switched over to LuaJIT. This is something that people have requested for a few years, but I've resisted due to some incompatibilities. So here's what you need to know.

Benefits

LuaJIT is faster than plain Lua. If you need to know how or why you can find that info on their site. But something to consider is that this isn't going to take your FPS in GMod from 20 to 100. Most of the strain in the engine is still going to be rendering - the graphics card is almost always the bottleneck.

You should also consider that Lua isn't really doing any hard work in GMod. In general Lua is only really being used to call engine functions. You're only really going to see a speed increase if you're doing a lot of processing with Lua.

That's not to say there aren't any speed increases. In a timedemo I ran a few times I averaged 132fps with LuaJIT, and 126 without.

Changes

GMod changes the Lua syntax in a few ways. It adds C comments, it adds the continue keyword, it adds !not and && and ||.

The old version also added bitwise | and &. These are removed in the new version - which is going to break some code that relies on it. I chose to make this change now while we're breaking other stuff. We have access to the luajit bit library now - which is a lot more complete.

Another change worth noting is that the global "_R" no longer exists. It's accessible via debug.getregistry().

Thanks EU

Thursday, October 11, 2012

I don't know how we used to browse the web without having to close a warning about cookies on every website we visit.

New Office

Monday, October 8, 2012

I don't think I mentioned that we're moving offices. Our current office is in Walsall town center on the 10th floor of a 12 floor building. We've been there for a few years now. It's way too big for us - but we've got more money than sense - so fuck it.

To cut a long story short we found a better place. It's twice the size and half the price. And it's about 2 blocks from my house (!). Before we got it it was a Gym. Then it was serviced offices. Then it was a dance studio.

Obviously we can't be having these mirrors everywhere.. not with CandyMan roaming around. So we decide to make it more like home.

Have you ever took something apart and forgot how to put it back together again?

Sky Shader

Wednesday, October 3, 2012

I hate making skybox textures. That's probably why GMod has been using HL2's cloudy, stormy skyboxes since it was born. With the new flatgrass I decided to make a new skybox.

This works - but it's not without its problems. The biggest problem is that the corners of the skybox are clearly visible when you spin around. You can tell the skybox is a skybox. That ain't good.

So instead of making another texture I started to think.. this is just a simple gradient. I can do that in a shader. And make it configurable.

When I looked into it there's some really complicated shaders around that simulate the atmosphere to give accurate looking sky. But I'm not patient or smart enough to do anything like that. So I decided it would be a good idea if I just kept it as simple as possible - that way it could be used for unrealistic alien skies and stuff too.

This is what I got.

In the screenshot above there's two effects. First we have the sky colour gradient - which is deep blue to a light weak cyan colour. Then we have the horizon effect - which is orange/red. This effect hugs the horizon - but intensifies near the sun. You can see that effect on the screenshot below.. the horizon effect is stronger on the right.

In the screenshot above you can also see a star weak effect (you might need to open it in a tab and zoom in). The stars are just a texture you choose (any texture) - which gets scrolled across the sky. In flatgrass we use them for subtle clouds, like this.

But of course you can make the clouds look as awful as you want by controlling scale, fade and position.

Or change them to stars, and change the colour of the sky. This would obviously look a lot better if the map used night-time fog and lighting.

Or use clouds and colour to make it look stormy!

Here's a video of the cloud movement:

The important thing to keep in mind with this stuff is that it's all totally dynamic, on the fly. It's all controlled using a material proxy. So even though by default there's no transitions - a good gamemode coder could use this system to make a really nice day/night cycle, or a weather mod.

If you're making a map and want to try it out - the entity is in the fgd in the next GMod Beta update - it's called env_skypaint. I'm hoping to get an in-game tool to fiddle with the settings done.

Egypt!

Friday, September 14, 2012

This is a blog about my holiday to Egypt. It was a family holiday. Me, Sarah, my two sisters, their boyfriends, their kids and my mom and dad. Eleven of us all together. We flew from Gatwick.. which is about 300 miles away from my house. So we decided that we'd drive down the day before and stay in the Hilton. So a two and a half hour drive and we're there. Settle in. Find a McDonalds. All good. So we get in bed and start watching this awful comedy show about a pakistani family - which was that bad that we were laughing at it (I don't know whether that was the point).

Cleverly - I'd had a shower and decided to sleep without any underwear on. The logic being that it's a waste of underwear in a situation where underwear is limited. So obviously this is when the fire alarm goes off and I'm running around opening my suitcase trying to find some boxers to put on. The whole hotel was evacuated. Everyone stood outside while two fire engines arrived. Some people had no shoes on. They handed out tin foil silver fire blankets. Then about an hour later we were able to return.

The next day we flew there. It was night when we landed - which was about 5PM. They fed us and showed us to our room. Which we hated. It had two single beds, the aircon was broken and the bathroom was shit. So against my whole nature we complained and asked if we could get a better room - and the next day they moved us to a new one. It had a double bed, working aircon and a shit bathroom. We decided that was the best it was gonna get, and we'd basically paid jack shit for the whole holiday, so decided to stick with it.

I was surprised in the morning by all the mountains. Mountains wasn't something I associated with Egypt. I thought it was all flat with pyramids. But there are mountains everywhere in Taba.

I was also surprised that wherever you seem to go in these mountains there seems to be litter. Mainly plastic bottles and cups. You can look out in the distance and see carrier bags blowing around in the wind like tumble weed.

It's also a lot more modern than I thought. Maybe it's because we were in the touristy bit. The shops were run by guys in their 20s in jeans and designer t-shirts. I expected them all to be swamped by dirty poor guys with their teeth falling out. I guess when you're shown Egypt on the TV or wherever, people are hunting for the Egypt looking things. They're taking photos of Camels - not the Burger Kings.

We went snorkeling. Which was cool - because I've always been scared of swimming out in the sea. It turned out that it wasn't as scary as I thought. But after 5 hours I was so glad to be off the boat.

We went on a star trip too. The idea being that you go out into the desert and look at the stars. It turned out that the first 4 hours of the trip involved watching a tribe of desert people cook some bread on a fire, then eat their bread, then buy their crappy tat, then eat some more of their food, then watch them dance, then bat the kids away as they begged you for money. The whole thing was kind of rehearsed and awkward.

Then we watched the sun set.

Then the stars. The stars were amazing. You could actually see the milky way with the naked eye. You could see shooting stars. You could see satalites flying over. I would have never believed that you'd see so much with just your eyes.

In the last few days I had the craps pretty consistently. So my worry would be that I would get the craps on the plane. That was something I didn't want - so I tried to clear mysefl out the day before, and before the flight tried to not eat very much. It didn't work.

About three hours into the flight I got stomach pains. Followed by being really hot, like I was going to throw up. That was followed by being really cold. So I was forced to drop a load on the toilet. All I could think was "I hope no-one out there can hear this" - and thinking of the look on their faces when I slid open the door. I reached for the toilet roll - there wasn't any. There was some peices discarded on the floor - so I had no choice but to bundle them all up and use those. As if that wasn't enough, I stood up and flushed - but it didn't do the usual sucky thing. The half lumpy yellow crap just stayed in the bowl with blue water running over it.

I found my way back to my chair. I had a another episode in the car on the drive home. It was 3AM, I'd clocked up about 50 miles - and the pains stated again. Hot, feel sick, cold. I was forced to pull into beaconsfield services - and calmly walk through the lobby as if my ass wasn't going to explode - and get on the toilet. But the toilet was so quiet and so populated that I couldn't drop the bomb. It wasn't until someone activated a hand drier that I eventually decided that it was time. Someone had written "Jesus Loves Your" on the wall of the cubicle.

It was a good holiday - but man - there's no place like home

I'm going to Egypt for 2 weeks

Monday, August 20, 2012

You know what's crazy. When you're coding like a mad man because in 4 weeks you plan to release the biggest patch to your game for 5 years, and you spend 2 of those weeks on holiday in another country with no internet connection. It has been planned for a while and I took it into account when coming up with the September 24th switchover date and part of me is still hopeful that GMod13 will be up to an acceptable level by that time. But I am definitely starting to worry.

What I'm trying to say I guess is don't be too surprised if the release date slips to October 24th.

Make maps bigger

Friday, August 17, 2012

People sometimes ask me to make maps bigger. As if it's that easy.. Jut change a variable right?

Well. No. First of all you break compatibility with every other source engine game. Then you need to ship your own version of hammer, vis, vbsp, vrad etc.. Then you need to change all the network code to support the bigger coord system (every coord would now use more bits). Then you've got to think of the ramifications of having bigger maps. For things like flatgrass it's fine.. But there's a reason maps are a limited size. If the maps twice the size, that's twice the lightmaps, twice the ai nodes, twice the entites, twice the vis data, twice the env cubemaps. So loading your map takes twice the memory, and is twice the size. We now have 600mb maps.

And finally… Why bother? Yeah it sucks that you can't build a to scale 747 and simulate an 8 hour flight from London to new York, but do you really need to.

Approved Updates

Thursday, August 16, 2012

People still ask me now and then "How long does it take Valve to approve an update".. and occasionally "wow this update is crashing every time I x - how did Valve approve this?". They seem to be under the impression that when I send an update to Valve there's a Microsoft style certification period - where hundreds of people play the update and give it the thumbs up. This isn't what's happening at all. When I send the update to Valve they're putting it on Steam. The time delay is the delay between me uploading the update - sending the email - then someone at Valve getting into work, checking their email, and pushing the update out to the hundreds of Steam content servers.

It probably sounds like a stupid process to the outside world - since updates aren't checked why can't we just upload them and push them out ourselves? Well yeah. Valve already answered that prayer for the majority of steamwork developers though - with their new Steam Pipe stuff (which offers instant updates among other awesome features).

Unfortunately it's a system we can't use right now - being tethered to the Source engine like we are. I'm told that it's probably going to be one of the last things that gets updated - which means I won't be sending out 15 GMod updates a day any time soon.

Context Screen Improvements

Sunday, August 12, 2012

The context screen has been a hack since I first implemented it just before the release of GMod10. It's mostly completely clientside. When you click on the screen it sends a console command to the server telling it where you clicked, and the toolgun receives that command and does the rest. That works but it's stupid as hell. It only really works for the toolgun - and isn't predicted properly (sometimes noticable by the multiple blue lightning tracers coming from the toolgun).

So today I fixed all that. It's now all nicely integrated into the user commands. It predicts properly and you can use it with any weapon. WAY COOL!

[youtube http://www.youtube.com/watch?v=K9H9wmjImHQ&w=640&h=480]

Auto Refresh

Friday, August 10, 2012

Man I suck at blogging. I'm gonna post more details on some older stuff I've done. I've been meaning to post about it for ages but keep forgetting.

So, autorefresh. We all know what it is right now? Right? If not see that video.

I don't know why I never added this before. I guess because I thought it would be too much work, too hard. It didn't help that the Lua file loading code was everywhere. Files could be loaded from about 5 different sources. I cleaned that up. It hurt, and took a week, but I cleaned it all up.

So this is how the Lua refresh works in code. I wrote a nice little file change class years ago and put it in Bootil. So I hooked that up.

So now any time a file changes in the garrysmod folder we get notified about it. So every frame in a Cycle function we check for changes..

If there's no changes then fuck it, return and do nothing. But if there's a change then grab it.

This gets the file that's changed and removes it from the changed queue.. Then we separate this filename into file extension, folder and filename, and pass to some handler functions. (A nicer way to have done this would to add some kind of factory - but fuck that for 3 functions).

The easiest of these to hook up was the material reloading function.. because all of the work is already done for us. Obviously this is a total waste of time on dedicated servers - and only useful to the listen server host (because the texture isn't changing on clients).

And there we go, materials are auto reloading. Lua is a little more tricky - and involves specializing reload routines for every type of file load (entity, effect, gamemode, weapon).

First we get the file that has changed. In our Lua system we store a cache'd of every file that has been loaded (so we don't have to load from disk again if we don't have to).

No we've got the file but we've got a problem. This file could be part of an entity and we need to extract the filename from it. For example, the entity could be in entity/ball/shared.lua - but this file could be entity/ball/extrastuff.lua - which was included from shared.lua.

So what we do is, whenever a file is included() we store its parents file. So this function goes up the chain and finds the first file that was included (one without a parent).

At this point we have our file, we have our root file, we're ready to see if we can do business. So we load the changed Lua file and replace the contents in pFile with those. Then we call the shared function..

The first parameter here is the source - which describes what engine function loaded this file (Entity, Gamemode, Weapon etc). This enables us to perform special operations based on the type.

This is kind of a messy system - and it's something I've long regretted in GMod. Entities and Weapons shouldn't be separate systems, with separate management functions. They're all Entities.

But anyway - the HandleLuaFileChanges function looks like this..

EntityFilename seeks the entity's actual name out. This convert "blahblah/garrysmod/lua/entities/sent_ball/init.lua" into "sent_ball". Which isn't that hard.

The reload functions are pretty simple. It;s pretty much all Lua from there on. It switches the table in the entity manager library and then goes through all the active entities replacing their functions with the new functions on the table. The entities don't get re-initialized - that's more trouble than it's worth with very little value.

So that's the serverside reloading. But what about client entities? Where you at dawg? Well basically it's a piece of piss.

First of all we have to make sure the client has this file. What I mean by that is we need to check that this is a clientside file. We'd be wasting our time sending changes to server only files.

Then we update the datapack with the new file changes. This is so that clients joining the server after this point will get the updated files.

Then we simply send a usermessage to all clients with the changes. Which is then received on the client and we get to call HandleLuaFileChange..

So now the clientside is updating live too!

GMod 13 Release Date

Wednesday, July 18, 2012

24th September 2012

I decided a couple of days ago and have been keeping it to myself to make sure it's not conflicting with anything. My logic around the date is I want to release this year - and before Christmas. Two months is enough time for me to get what needs fixing fixed and what needs adding added.

Will it be ready?

I hope so. The whole point of putting a date on it is to make sure it's ready for that date.

I hate GMod 13 - I want to stay with 12 forever

That's not going to be an option.

Is stuff going to break?

Yes. A lot of stuff. But I'm sure it will all get rebuilt, bigger better stronger. Toybox is gone - so all that content is going to disappear on the switch-over.. but I'll figure out some way to give access to your uploads/scripts so you can convert them to the new Workshop system.

Pyro Patch

Wednesday, July 4, 2012

Last week Valve updated the Source Engine and GMod broke. That's nothing new but I was totally unprepared for it this time.

First of all my static IP had changed - that meant I was locked out from Valve's servers so I couldn't download the latest code. So I had to get them to change it to my new IP. Which meant that I had to wait until it was day time in Seattle. Which is about 1PM our time.

Secondly my build servers weren't prepared for it. I had a great build system set up - which was working great. But I'd started tinkering with it a while back and never put it back together. Building for PC was easy enough - I could do that from my computer.. but building for OSX and Linux was going to be a bit of a nightmare. (On a side note I ended up building two completely new servers, formatting, installing the OS and compiling on them).

And finally the internal project building tool that valve uses (VPC) changed at some point, so my build process had to be re-thought to take the changes into account.

When I released the patch it became apparent that opening VGUI panels was slow. This was down to calls to the Material function in Lua - which loads a material. The problem was that internally this was calling IMaterial->Refresh(). This wasn't normally a problem but the Pyro vision stuff added code in which scans a load of directories for "replacement.vmt" on Refresh. Removing the call fixed the problem (but I'm sure it was there for a reason so gulp).

SFM vs GMod

Wednesday, June 27, 2012

So Source Film Maker has just been announced. I am GMod's creator and if I made machinima I would be moving to SFM right now. It's the much better choice. It's what it was made for.

But I think the idea that it's going kill GMod is a bit much - for three three reasons..

First of all - GMod isn't a movie making tool. It's used to make a lot of movies and screenshots - but I don't think that's what people would describe it's primary function as. It's a sandbox game. There's building, there's coop, there's gamemodes, there's roleplay, there's coding, there's addons. Making movies is a tiny part of the experience. It's like suggesting that Hammer would kill off GMod.

Secondly it's the Source Engine! It all goes hand in hand. I would hope that once it's all tested Valve will open it up like all the other tools and lets us flop it over the top of Garry's Mod. Combining the best of them both. [To be clear I don't know whether this is going to work like this for sure, but I would certainly hope that it's a possibility]

Finally, past experiences have shown me that this kind of thing has the opposite effect on GMod's sales. More people getting involved in the Source Engine mean more people wanting to explore and play with it. 

The bottom line is that I don't know how this is going to affect GMod, but I'm going to try to work with SFM instead of trying to compete with it. That's the best thing for the community.. which is what it's all about.

More Dieting

Monday, June 18, 2012

I reached my target weight today. On January 1st this year I was 188lbs.. today I'm 169lbs! That's 19lbs loss!

So technically according to this app I'm no longer overweight. Which is cool. But I've still got a bit of a belly so I'm going to push onto 160 to see if it goes. Apart from that I'm pretty happy with the weight I'm at right now.

Here's my weight loss tips, from my experience:

  • Less McDonalds
  • Less Burger King
  • Less KFC
  • Less Pizza
  • Try to eat fast food only once a week. 
  • Look how much sugar and calories are in your drinks. It's a big deal.
  • Sugar stops your brain getting the `I'm full` signal. That's why mcfood leaves you hungry 20 minutes later. Water is kewl. Coke is the devil.
  • Think about how much you're eating. Why are you eating that much? Do you need it?
  • Don't eat after 8pm.
  • Exercising will help, but keep it realistic. Don't overdo it in the first few weeks and blow it off. Find something you can easily do every day. Stairs instead of lifts. Get out of breath every day.
  • Eat breakfast.
  • Don't snack. Look at how many calories are in the crisps/chocolate bars you're eating in front of the TV. Read the back of the packet and put it in context. Estimate how many calories you've eaten, how many you need. How many over you are.
  • NO FAST FOOD!

I saw a documentary the other day. A fat guy was moaning that public toilets aren't big enough for him, he can't get clothes to fit, he can't fit in certain cars, he had to buy 2 seats on a plane. He was running around confronting people, trying to  make the world 'fat friendly'.

It made me angry. Is that the way the world is going? Should we change the world for these people? Should we be more understanding and considerate to fat people? 

Or should they just stop eating so much?

Amazon Cloud Search

Saturday, June 9, 2012

Facepunch forums are pretty huge. There's over 20 million posts in the database. This is cool, but the database regularly locks up when searching. There's a number of ways to try to get around this, better database server, faster hard drives, pruning posts, slave databases. But whatever you do sooner or later as your post count increases you're going to have to do it again.

So last week I looked into Amazon Cloudsearch. Put simply you throw all your posts at this service and it provides an API for you to search them. This means that search isn't using your databases anymore, so your database doesn't need to be half as powerful, and doesn't keep locking up.

Inserting Posts

First of all let me start by saying that you can put anything in here. It doesn't have to be plain text - you can throw pretty much any document at it and it'll make it searchable.

The way I do it on our forum is simple. I added a 'indexed' field to the posts table. When a post is created or edited it sets the 'indexed' field to 0.

Then I set up a cron that scan the posts table every minute, then any posts that are indexed=0 it uploads them to CloudSearch. You upload to CloudSearch by sending AJAX queries - it couldn't be easier. Here's how I build mine

So obviously I've selected the appropriate posts from the database, then I loop through them all adding them to an array. I don't add them if they are lower than 10 letters, and I strip UTF from the posts to save space (you don't have to do this, I just decided it'd be a waste of time preserving these characters since we're an english forum).

Then it's just a case of converting the array to JSON

And sending that baby to Amazon

And if it succeeds, mark them as indexed..

The Fields

You might have noticed that I send date, forumid, threadid and userid with the posts. This allows us to also search via those fields, and filter by those fields. So if you only want to find threads containing the word 'Butt' in General Discussion, posted last week, by me - you can do that easily.

But more than that. When you search it will also categorize your results. It'll show you the top x forumid's with that word in, and the top userid's, and the top threadids.

This allows you to show the results in a way that lets people drill down to find what they want. For example, this search:

http://api.facepunch.com/#/page/1/forum//thread//user//search/max%20payne

You can see that it's most mentioned in the Max Payne thread. And most mentioned by "A Big Fat Ass". But it's also mentioned in the Max Payne 3 thread a lot, and maybe that's what we're looking for. So clicking on the thread restricts the results to that thread.

http://api.facepunch.com/#/page/1/forum//thread/1125222/user//search/max%20payne

Not a super example of why this is cool, but compare that process to VBulletin's search:

Searching shouldn't be THIS much work.

Getting Results

Searching is as easy as opening a URL. Because that's all it is. When you create your search domain you'll be given a unique URL to query. You can do this from inside your site (I wrap it in an API) - or you could query it directly via an ajax request. Their dashboard lets you run test queries, so you can make sure it's working.

Price

This is where the usefulness will probably drop out for most people. The price starts at around $80 a month. So if you're providing search for one small thing - it probably wouldn't be worth it.

It scales with usage. So if you have a hundred million entries, and you're querying 1000 times a second - it's gonna cost a lot more $80. But on the upside performance will remain the same.

Right now we have nearly 3 million posts indexed and we're still on a single small search type (it scales automatically). I am expecting this to change to the large type soon (which is around $350 a month).

Summary

For us - even at $350 a month - I think it's worth it, for these three reasons.

  • Search Results are Instant
  • Search Results are Better
  • Takes pressure off the Database

<3 AngularJS

Thursday, June 7, 2012

I had a learning week this week. I fell in love with AngularJS.

What Is It?

I don't even know what to call it. A framework maybe. It totally changes how we make websites. It makes everything dynamic, and somehow manages to make everything easier in the process.

This is the old way. You request a page. The server looks at your request, gets data from a database, fills in a template, and posts it back to you. 

That has worked for years - and it's cool. But doing it with AngularJS kinda makes a lot more sense.

It is kinda that simple. Templates are loaded dynamically and the HTML is rendered on the client. So your templates are resources just like images or stylesheets.

Example

To learn it I coded this website. Check this page out. So let me show you how the forum list is created. I'm not going to go into the detail of the workings - there's enough tutorials on the site for that. I'm just going to show you how easy it makes stuff.

First of all we need the data, this is retrieved from this URL. It simply provides a list of forums with thread/reply counts.

So now we have the data we feed that into our controller and it fills a template in. This is where it gets clever.

Yep, that's it. the ng-repeat copies that element for every child of forums (which we passed from our controller).. and it automatically does it all!

This is cool by itself - but guess what.. if you change the forums object in any way - edit it, add to it, remove from it - it's reflected instantly in the design. It's directly tied to it. You don't have to do any work to make it update - it just updates.

URLs

A huge advantage is the URL system. For example, I coded a search system on the API site. A search for plasma.

http://api.facepunch.com/#/page/1/forum//thread//user//search/plasma

Totally dynamic - totally linkable (you can make these HTML5 links so they don't have the # - but I don't really care enough to do that). You can drill down to link to a certain forum, and a certain thread.

http://api.facepunch.com/#/page/1/forum/110/thread/1169457/user//search/plasma

Rad!

But it isn't search engine friendly!

Sure it isn't as friendly as a static html page - but it isn't search engine unfriendly. Google still indexes ajax created websites.

More Stuff

There's so much cool stuff going on that it BLOWS MY MIND. The examples on their front page speak for themselves.

Frame Blending

Wednesday, May 16, 2012

In my last post I talked a bit about frame blending, and how you can render videos with it. Today I added it as a post processing effect. I kind of want to explain more about how it works so that people don't get confused as to why they get massive frame rate loss.

So frame blending is about simulating a camera shutter. When you take a picture the camera mechanically opens the shutter, then closes it. There's a short period where light gets in. So obviously the longer the shutter is open the more light will get in - and the more things will blur - because they're moving while it's being exposed.

So what we do is instead of rendering one frame per frame, we render a frame, collect 16 frames, then render another frame. So we're practically rendering 1 frame every 16 frames. With those 16 frames we ignore the first 4, and the last 4. This is to simulate 180 degree shutter (the shutter is closed half the time). Then with the 8 frames in the middle of the block of 16 we blend them together to make one, with the intensity of the frame curved towards the middle (so the nearer the shutter is to fully open the more apparent the frame is).

This sounds like it'd be slow - and it kind of is. But the weird thing is that I can run around fine with it on 16 - and it feels great. It obviously knocks my fps down to about 30 - but you really don't notice because it feels so smooth.

But to be honest I never really expected to run around with it on in real time - I  implemented it for the video system - and I implemented it as a post process so that you can take screenshots with motion blur. Like this!

The technique has two options. The number of frames to blend (default 16) and the length to keep the shutter open (default 0.5 for 180 degrees). Obviously the longer you keep the shutter open the blurrier the image becomes.. and I've found that 0.5 looks the most natural.

Demo Movies

Tuesday, May 15, 2012

Over the last week or so I've been working on something I've wanted to work on for a long time, a tool built into GMod to easily convert demo files into movie files.

There are actually a variety of ways to accomplish this without this tool, but none are really that easy. So in the next GMod Beta update you'll be able to select a demo (from your local demos, or from workshop) and easily and simply render it to a video file.

But there's more - you can render them with DOF, camera smoothing and frame blending. You can see what that looks like here - be sure to turn it to 1080!

I owe a lot of thanks to max for helping me get the frame blending just right, and teaching me about the 180 degree shutter rule.

When it's rendering it shows a screen like this, with the time taken, time remaining etc.. There's probably more useful stuff I can add to this screen too - like what's taking the most time, rendering or encoding.

So, yeah, it should make creating nice little movies from GMod demos a lot more accessible for everyone.

DOTA2

Saturday, May 5, 2012

DOTA2 isn't my kind of game. Enchanted Axes, Boots of Travel, Eyes of Looking. Really not my kind of thing. 

So it's kind of weird that I can't stop playing it. It's like every time I play I understand a tiny bit more, so an hour after I've rage quitted I want to keep trying. It's not like Valve, they're usually formulaic with the learning curve (to the point where the learning mechanic is plainly obvious and kind of patronizing.. see episode 2). In DOTA2 you are dropped right in it.

Even just the menu screen. There's so much going on. So many words I've never seen before (never played WOW).

So here's a list of stuff that turned me off, scared me and made me not want to bother:

  • So many characters. Each one unique. Which do I choose? I don't know what I'm doing!
  • The ingame shop has so much stuff. This isn't too bad because you can't afford most of it and it has a suggestion thing.
  • Playing multiplayer is intimidating. Not because the other team will kick your ass - but because you're scared of letting down your teammates.

Here's some stuff that I didn't understand, that makes me more likely to play it.

  • I thought you built your character up over time. But it resets every game. So it's a level playing field. I thought that I'd get murdered by experienced players because they'd built a character up for years.
  • Everyone has the same choice of players. Whichever team you're on you can choose the same group of players. I thought that the bad guys chose the bad guys and the good guys chose the good guys.
  • Each character is different. I mean wildly different. Not just like in TF2 where one guy runs a bit faster than the other. They have wildly different magic shit.
  • Teamwork is incredibly important.
  • There seems to be only one map.
  • It's kinda funny. I thought these games took themselves very seriously, but maybe they don't. "To read the future, I need entrails!"
  • A robot guy has the same voice as Kleiner!

I still wouldn't say it's my game.. but it's nice to dip my toe into this genre that I haven't played before and find out why people put up with all the stupid lore bullshit.

Weight Loss Update

Wednesday, May 2, 2012

At the end of January I posted about how I'd started watching what I was eating and generally trying to lose weight. Well here's an update.

Well I've been keeping it up.

  • Fast food twice a week max, down from around 5 times a week
  • More home cooked meals
  • Less crisps, chocolate, snacks (especially after meals as part of the meal)
  • Less eating after 7pm
  • No snacking as part of watching TV/Movie
  • Stopped drinking tea (but moved onto coffee)
  • Started drinking water
  • Bit more exercise (taking stairs, sit ups, treadmill)

And so far it's working.

I did have a bit of a heavy week last week. I took Sarah for a Balti, and ordered what I'd normally order (and normally eat). Half way through I could feel my stomach stretching, so I had to stop.

Which I think is a good target for weight loss. Shrink your stomach and eat till you're full, not till your plate is empty.

And don't be put off if you don't see weight loss day to day or week to week. Your weight will jump up and down like crazy. Only worry about month to month.

Here's my progress sheet..

Not far to go now. I've slowed down as time goes on - but as long as the graph isn't going up it's a good thing.

Last time I posted a lot of people asked about the app. It's called Weight Bot - it gets the weight data from Withings Scales. They also asked my height.. I'm 5'9.

Cheaters in GMod

Friday, April 27, 2012

People ask me - how is it possible to cheat in Garry's Mod? It's a sandbox game - right? Well yeah - the sandbox part is. But we have lots of gamemodes right now. Gamemodes where wallhacks and aimbots ruin the fun for everyone else.

So a few days ago I turned on a system I made similar to VAC. VAC works great for other games - but it can't easily detect Lua hacks in GMod - because they look pretty much like GMod's own code. But my system can.

Since cheating is obviously wrong - so those cheating obviously knew what they were doing was wrong - I have decided to be harsh. Once you're detected and you're on the list then you're banned from all servers (unless they remove the cheaters.cfg - which is up to them). This is the only workable way to prevent people from cheating.

Here's some of the feedback I've got:

Hello Garry.
I must be honest in this - I bought SethHack more then 4 months ago. I got banned for saying the hack is shitty and disrespecting members. Would it be possible for an unban? I don't cheat at all anymore.

Thanks.
I don't cheat anymore isn't an excuse.
I have had my 2 accounts banned from joining garry's mod servers for sethhack. I have not used SethHack on ether account in months and didn't plan on using it again. I was wondering if there is any way I could get unbanned. I will not use it again now that people will be getting stopped. Please let me know if I could work something out as I own lots of games on the steam accounts and enjoy playing Gmod.
I know it sucks, but you shouldn't have cheated.
First off, i want to make it clear. That what you are doing here, is illegal. Banning people from other servers, using a system that is probably unreliable, and the fact that you are not using the VAC system, that all the players have said yes to, that they will not hack. Is also a violation, if the players on that list have been tagged as a "non hacker" on in VAC. You cant just ban them because you see fit. It is also a violation of the human privacy rights. You have violated every server that this has been applied to. By going in and changing their in their CFG folders.

Now, i know that making the system public so that the individual server owners could use if for their servers would be easy to patch. But, remember that you have secretly implentmated a system that bans them, with out their approval. It is not legal garry. Would be like, if i go change your router to only let in the people, that i believe is not trying to communicate with your dog, and making it barf all the time..
Astonishing insight from another cheater.
So there it is. You've been warned.

Portable Computer

Saturday, April 21, 2012

I have a problem. I work too much. I work at the office, then I come home and work. This is a problem because when I come home I'm using a different computer. All my settings are different, all my programs are different. If I install a visual studio extension at work I miss it when I get home.

So I looked into various solutions.

Laptop

The obvious one is using a laptop instead. I could plug it into my monitor and keyboard and mouse wherever I am. The downside to this is.. it's not upgradable.. graphics power is limited.. and I'm pretty sure I can't easily plug 3 monitors into one laptop. 

Active Domain

I tried this, and it kind of worked. The downside was that programs weren't synced. While I'm sure that it is possible to sync programs using some advanced technique - in the end I thought the whole system was flawed because I'd be transferring stuff from the office via my home internet connection.

Remote Desktop

Using a computer over remote desktop isn't the same feeling as using one in real life. Especially when you're really using it - and not just changing a few settings on a server. Plus I'm pretty sure it wouldn't handle games very well.

Hard Drive - Winner

What I'm doing now is carrying a hard drive to and from work. It's got the OS on it, and a D partition with my work.

I bought a slot loader thing for the front of my PC at work and home, so I can just slot it in.

I would have considered a USB external drive but I'm not sure whether you can install Windows on one (easily). Carrying around a bare hard drive does feel a bit risky - so I'm going to set up a system to back it up easily.

This is working for me right now though. I can come from the office - plug it in my home PC - and have exactly the same environment that I had at work. The only downside I'm suffering from is that now I have to actually shut my computers down.

Coding Websites in C++

Friday, April 13, 2012

I'm trying to make more 20% time for myself to experiment with things that are scratching away in my head. So I decided to have a look into something I've been thinking about for a while. Why don't we code websites in C++.

It isn't a totally new idea. Google is coded in c++. A lot of Yahoo is or was. And it was actually incredibly easy to make a module for IIS7 that did it. Here's a post I made in the programming forum with an explanation - and a bare bones project.

Good Stuff

  • More control. You can hold stuff in memory until the next request. Pool database connnections. There's a lot of application specific optimizations you can do in this way.
  • Obviously faster than scripting languages like PHP
  • If you code it right you can still use PHP etc.

Bad Stuff

  • More to control. Threading. Multiple server instances. These could be seen as positives too though.
  • Any speed increase will probably be paled into insignificance if you're accessing a database (but again - you have more options to detour around these issues).
  • Probably not that much faster than something compiled like C#

I did get a nice system done. It has hotloading DLLs, so you could compile and refresh the page and it would automatically reload the DLL. It has virtual pages - so you can add a page string like "/my/page.html", or "/my/page.*" and it'll load the page from the specified class based on the request.

Ultimately I decided to stop working on it because I'm not totally convinced of the speed benefits (the database being the bottleneck). And while I do love C++ - I feel that coding websites in it would be cumbersome without spending some significant time coding a framework.

So here's some useful links for anyone else thinking of doing this.

  • CTemplate - template system for c++ by Google (like smarty for php)
  • Poco - looks like a good generic library with some useful stuff for anyone thinking of doing this.
  • G-WAN - makes the case for webpages coded in c++. Unix only. (maybe tellingly, the website is down right now)
  • Stack Overflow - there's a few threads on SO on the issue. Most make the point that we use PHP etc because it's established and it's easier. A good point is that things like PHP, ASP.NET, ROR and Java have had lots of money invested in them to evolve them to where they are today - but C++ doesn't really have anyone fighting its corner like that.

I get the feeling that there's undiscovered potential in there somewhere, so I still have it rattling around in my head.

Bigger Maps

Thursday, April 5, 2012

I'm getting asked a lot whether now that we're shipping our own Engine I'm going to increase the maximum map size in GMod 13.

Well.. just so I don't have to keep repeating myself.. the answer is here.

Steam Captcha

Saturday, March 31, 2012

I just opened the new GMod Wiki open to registrations. Within a couple of hours there'd been attacks by about 4 spambots. How annoying. You can use captcha's against these things - but they rarely work because believe it or not it's actual humans filling out the captchas.

So I made a quick plugin for mediawiki. When you try to create an account it asks you to log in using Steam (something anyone editing the wiki should have). Once you've done that it saves a cookie saying you're `ok` and you're free to create an account.

It doesn't create an account based on your SteamID anymore. That system proved to be more trouble than it's worth. But it does offer you perfect shelter from spambots.

If you want to try it out:

require_once( "$IP/extensions/SteamCaptcha/SteamCaptcha.php" );

Feel free to improve/redistribute/do whatever you want with it. You could probably use it as an example of how to make a log in page using Steam's OpenID stuff.

Quitting Caffine

Thursday, March 22, 2012

I tried to quit caffine last week. It didn't completely work but I learned a few things.

I drink a lot of tea usually. I'm talking about 10 cups a day. I have since I was about 16 (~13 years). I used to have one right before I went to bed because I'd wake up with a headache if I didn't. I never realised that caffine withdrawl gives you a headache.. and now so much makes sense.

Whenever I've gone on holiday I went without caffine and got headaches for the first couple of days, I never really thought anything of it before but now I realise that was caffine withdrawl too.

When I tried to give it up last week I couldn't. I don't think it's an addiction, I wasn't thinking "God, I'm dying for a coffee". I just felt like I couldn't function properly. I had the headache, paracetamol wouldn't get rid of it, I was driving to the office and nearly crashed 3 times because I wasn't concentrating properly. I couldn't work properly because my brain was too slow, I couldn't remember what was in my clipboard, I couldn't remember where in the .h file that function was that I was about to edit etc. All things that came easy before were hard.

So I was looking on the web for reasons why I should give up caffine completely. And it seems like the benefits outweigh anything else. Cures cancer, more alert, speeds up metabolism, tastes nice vs high blood pressure.  I think I can live with it.

I haven't had a cup of tea since last Saturday though. Now I just have a coffee in the morning. I am finding that I sleep a lot better.. I usually wake up during the night, or when Sarah is getting ready for work - but now I get that deep sleep. My tongue has stopped being yellowy when I wake up too! (Which I had previously put down to liver failure)

The only downside is that since I've started drinking water any room I've been in has a bunch of half empty bottles everywhere. Yeah this water has existed for millions of years, since the dawn of time, but I'm not gonna drink it if it's been sitting in the bottle for 3 hours.

Making Gamemodes Better

Monday, March 12, 2012

I'm trying to make gamemodes a bit more relevant in GMod13. I'd like to get it into a position where people actually map and release their singleplayer and coop mods in GMod (using workshop).

So to make this easier I've added a button to the bottom right of the menu screen..

And when you press it you'll be able to select from a list of gamemodes..

Which will then change the background image to one supplied by that gamemode.

I'm looking for other ways to make gamemodes better for users and developers in GMod13, so hit the comments if you have any ideas. (Not asking for gamemode ideas).

Lottery Results

Sunday, March 4, 2012

So the results are in. At first I didn't think I'd won anything because they didn't send me any emails until this morning. But this morning I got 12 emails. And the reult of the experiment is.. I won £120.

Out of 350 entries, 12 of them won - and all of those got 3 numbers - which paysout £10 each.

So this year I'm down £230. 

To be totally honest that's more than I expected. Helk linked me to this yesterday. It really shows you how lousy your odds of winning the lottery are.

GWEN Designer

Friday, March 2, 2012

A week or so ago I mentioned that GWEN was in desperate need for a designer. So I started making one in my spare time.

You can't do much more than drag controls onto the canvas and see the few properties I've set up. But I think I've done all the foundations and the hard work.

I plan to make the export modular so we can export designs in json, xml, c++ and lua for GMod.

You can download the test here.

Unclamped Faceposer

Wednesday, February 29, 2012

By default faces (or 'flexes') in the Source engine are clamped to sane levels. This makes sense in the real world, but makes slightly less sense in GMod where we don't always want people's faces to stay on the front of their heads.

So I found the clamping code today and disabled it. Now GMod's faceposer can totally wreck faces.. like this.

But if you take your time and are careful you can generate new extreme faces that haven't been possible in GMod before..

The Lottery

Tuesday, February 28, 2012

I play the lottery twice a week. I spend £8 a week on lottery tickets. That's over £400 a year. And I've never won anything more than £10.

So I decide that's gone on long enough. I'm cancelling my direct debit and I'm going to throw my cash away in one go instead of spreading it over the year. The chances of winning are exactly the same [no chance at all], so who cares?

Plus I'll be only spending £350 - so win or lose I'm already up at least £50.

The draw is this Saturday, I've got 350 chances to win spread over 70 tickets, I'll let you know how it turns out.

Poster Screenshots

Saturday, February 25, 2012

I had a play around with making poster screenshots today. These are screenshots that are bigger than your screen's resolution. You're only really limited by memory.

Instead of rendering a screenshot the full size of the screen it renders the top left of the screenshot the full size of the screen. Then it renders one screen to the right, etc, so you end up with a composite of multiple screenshots. A bit like this.

But obviously I don't just pump out a load of different screenshots. That'd be shit. I stitch them all together for you!

Here's an example. Full size this image is 19200 x 10800.

You see the tiny white dot sitting to the top right of the 'C' on the castle? Well here it is full size.

You can check out the full screenshot here.

Inevitably people ask how fast is it. The picture above was rendered 10x10. So it uses 100 screenshots instead of 1. It takes about 10 seconds including encoding to jpg/png and saving to disk.

But why? Well if you're printing your screenshot to a poster or something you'll want it as high res as possible. And a lot of people like to render their screenshots in an insanely high resolution and then downscale them - as it tends to remove any aliasing or other defects.

Trade Off Game Dev

Saturday, February 25, 2012

We started a Trade Off Game Dev caper in the Programming section of the forums a few days ago and now it's under way.

It works like this. Someone codes something for a day and pass it to the next guy, who codes something for a day and then passes it to the next guy. And then he codes it for a day and he passes it to the next guy. And so and and so on.

There isn't a theme or a direction - you just do what you want on your day. If you don't like what someone's done you can change it when your day comes around next.

i300 is in charge and has made a spiffy little website for it. I don't know how it's going to turn out but it's gonna be fun!

Version 49 Models

Thursday, February 16, 2012

Today I got version 49 models working in GMod 13. It involved a bit of hacking around. The problem is I don't have the source code to the Portal 2 engine so I couldn't really see what was going on in the new format. Then just when I was about to give up I searched google for "STUDIO_VERSION 49" - which shows up code from the alien swarm base. It gave me what I was missing.

So a bit of this later:

I managed to get Portal 2 models loading reliably, without affecting the loading of other models..!

There are some issues with L4D2 survivor models. For some reason they show multiple versions of themselves like Siamese twins. The Nuclear Dawn models are hit and miss too. I think they increased the limits in their engine or something.

Most of their other models seem to work though..

So yeah. That's all good in the hood. I did other stuff today too.

You can read more about the beta here.

Improved Shadows

Sunday, February 12, 2012

I tweaked some of the flashlight code a week ago - and didn't really realise how much it improved the rendering until I fired up GMod 12 today.

Here's some comparisons..

I was only trying to change a bug reported by maxofs2d - in which the flashlight lit the world as if it was always started projecting from the player's eyes. This illustrates it I think..

You see in the first image the light gets brighter the closer it is to your eyes. Which is wrong - it should get brighter the closer it is to the light source.

I thought I'd share some pictures because I was impressed by the difference - even if I didn't mean to do it.

quick tool: bundler

Sunday, February 12, 2012

I made a quick tool yesterday to convert a program with a bunch of other required files into a single exe. I did some searching for a similar tool but everything I found was either shareware (the phrase shareware on a site usually means it's from 1996), or expensive with a load of unneeded security features.

Bundler is pretty much as simple as it can be. It creates an exe, then zips up your files and adds them to the back of the exe. When the exe is run it looks at itself, finds the zip file, extracts it and runs the program.

This is great if you have a program you want to distribute that has a few smallish required files. Obviously not so great if the required files are 3GB. It works for what I wanted to use it for, which is to convert this:

into this:

You an test out how that works using this. There's still a couple of things I need to do. I'd like to get the icon of the embedded program into the launcher. I'm sure that can be done by splicing the memory from one to the other - but I need to look into that further.

You can download bundler here. Just drop a folder onto bundler.exe to create an exe (the folder needs to contain an exe).

Weight Loss

Friday, February 10, 2012

I've been trying to lose weight over the last month. And it's been going well, I think I've got it under control. Here's my weight loss tips.

Don't go crazy

Diets are a temporary thing. You'll never last if you try to only eat bread or whatever. It's not sustainable and you're always going to end up breaking. Don't try to lose too much weight. And be happy if your weight just stays the same.

Habitual Eating

I identified two big habitual over-eating issues.

First of all I couldn't watch TV without eating. If I'm sitting down to watch a movie I need get some food to munch while I watch it. It actually feels weird to watch a movie without eating.

And secondly I always had to have a snack after dinner. If I'd had a sandwich I'd have a big of crisps afterwards. Even after I'd had a quite big dinner I'd have a crisps afterwards.

These are the things you need to get under control. The things you do every day without thinking. If you can change these you're set.

Graphs

I have some withings scales which make recording my weight really easily. All you have to do is stand on them and it uploads your weight to the web. Here's my graph for last year.

As you can see I was doing pretty good weight loss wise in the early part of the year (when I bought the scales). Then it crept back up - peaking at Christmas (I put a full stone on over xmas ).

I've lost weight pretty consistently this year.

According to the graph if I keep doing what I'm doing I should no longer be overweight come May. My aim is to get to the overweight line and hover on it though.

This app is pretty cool because it shows you a progress bar, so you can see how long you've got before you get where you're going. A lot of weight loss seems to focus on the past - so you never really think of the future. This plainly tells me that if I keep trucking in 70 days I'll reach my target.

We'll see how long I last.

In the last month I have had a couple of Balti's, a Chinese every week and fish and chips every week. The fact that I'm losing weight goes to prove that those things don't matter as much as cutting out the habitual out of meal eating.

Workshopping

Thursday, February 9, 2012

This week I've been working on a tool to upload workshop addons for GMod. It's a pretty simple task but I decide to do it using GWEN.. just to make things a bit more challenging. 

Why? Well, it makes it easier to make cross platform (although I could have used VGUI, or another widget toolkit). Plus it gave me a chance to ride through GWEN and round off anything that's a bit rough. It also has the added bonus of looking exactly like the UI in GMod - because it uses the exact same skin. This one.

It turned out that it works!

But man - I need to make a designer for GWEN. I thought people were being lazy when they asked me for one - maybe they were.. but it turns out I'm pretty lazy too.

You can try it out here. (You'll get steam errors if you try to do anything unless you own the GMod Beta).

And you can see the uploaded files here if you're in the beta. (you need to log in)

More Stuff I did

Thursday, January 26, 2012

I feel like rambling about the stuff I did.  So here goes.

Addon System

I made a single file addon system for GMod. This is what it sounds like - a single file which contains a bunch of other files. It gets mounted on the filesystem so that the game sees no difference between files in the addon and files in the normal folders.

This is a lot faster than the old way of mounting folders. I've said this before but every time you mount an addon it makes your loadtimes a little bit worse. This is because it's adding the folder to the search path, when it's looking for a file it looks through all the search paths. Most of the time it doesn't matter because the file is usually found in the HL2 content - but if it's not it falls through. The biggest hit is when you search for files in a folder - which isn't exactly super fast anyway - nevermind when you're searching through 100 extra paths too.

So why doesn't that happen with the new system? Because the addon contains a list of filenames. When the addon is loaded the filenames are added to a tree. This tree is super super fast to search - especially compared to searching the disk. Problem Solved.

Well Hopefully. Only 4 addons exist for the new system so far, so we'll see when the next beta comes out and people start pumping the addons out.

Workshop

The new addon system uses Steam's new Workshop feature. It's totally awesome - and was really incredibly easy to get it working in GMod. I'm looking forward to exploring and finding more uses for it.

The GMod's Workshop Addon Distribution System has some pros and cons that it's nice to be aware of.

Pros:

  • Fast Downloads via Steam's network
  • Easy, simple installs - no messing with files
  • Can be used inside or outside of the game
  • Integration with Steam
  • Addon Ratings
  • Addon Comments
  • Addon Reporting
  • Automatic Addon Updates

Cons

  • No Delta Updates - download the whole addon again (which isn't that much of a big deal really - is it?)
  • Filesize restrictions. I'm told this is a temporary thing - Steamworks is in its infancy. The biggest file I've managed to publish and re-download was 40mb (compressed).
  • Haven't figured out a way for it to work with servers yet

So a mixed bag. It's great right now and it's only going to get better as time goes on. Steamworks is a revolution for GMod.

Lost Coast

Someone on the forums reported a bug. When you started Lost Coast the camera got stuck and you couldn't move. So I looked into it.

Someone suggested that the spawnpoints were broke. There's 3 spawnpoints and we're spawning at the wrong one - we should be spawning at the one with the master flag. I checked out my spawning code. It did just that - spawned at the point with the master flag. I compared it to the engine code - yep - same.

So I got in game with all the debug output on and saw that some trigger was being enabled but not triggered. So maybe somehow I changed the player's collision group, or changed which collisions collided with what. About an hour running through this, stepping through the debugger trying to find the problem. Running every ent_ command in game. Downloading the Lost Coast map source and analyzing the players.

Turns out my spawning code had one little difference. It returned the last player entity with the master spawn flag. The engine code spawns the first. And yep - all 3 spawn points in the lost coast map have the master spawn flag. As soon as I made that change it worked perfectly. Doh.

File library

I updated GLua's file library this week too. I added backwards compatibility to some of the legacy functions - but a couple of them are changed.

You should check out this document to see more details.

Console Key

Something I always hear people with foreign keyboards moan about is that they can't find the console key. So in GMod 13 it's bound to F10 by default too.

Other STuff

I'm going to bed now, but here's a list of stuff that is in the next beta.

And here's a list of everything in the previous betas.

Here's a list of shit that's going to break when GMod 13 comes out.

PEACE

Cool stuff I did this week

Tuesday, January 24, 2012

  • Got Visual Studio 2010 working with the Source Engine
  • Got OSX installed on Virtual Machine so I can compile on my PC
  • Made a Steam Workshop based addon system for GMod 13
  • Shaved My Pubes

MegaUpload

Friday, January 20, 2012

It seems a lot of people are outraged that MegaUpload has been shut down and the owners face jail. I don't totally understand the outrage. Maybe it was because I never used sites like that - and hated when people tried to make me download from there. Why would you make me fill in Captcha's and wait 20 seconds for the download link to appear - and then try to fool me into pressing the wrong link so you can try to sell me a premium download service - when you could just put the file on dropbox. Or puush. The whole thing seemed stupid to me.

But it wasn't taken down for being an awful throwback.It was taken down for all the pirated shit on it. And there was an awful lot of pirated shit on it. 

The thing is if someone came to me with a the idea for MegaUpload my first question would be "wouldn't people just upload warez and tv shows to it - how are you going to stop that?". Literally my first thought. But for MegaUpload the pirate stuff was a good thing.

They obviously ignored any DMCA's that were served because if you went a site such as IceFilms.info yesterday you'd have seen hundreds of TV show episodes - some uploaded as long ago as 2 years. Now you're not telling me that in 2 years of downloads MegaUpload didn't notice these files getting all this traffic from all around the world and think to check into it? All the referrers from this one website? No. Because it was making them money.

Speaking of IceFilms:

That's the mentality. "The CORRUPT US GOVT shut down this website were using to distribute all these pirate movies to you - the bastards!".

There's a lot of arguments to all this.

But what about the people who were using it legitimately!

Yeah it's a shame if it's gone forever. But I've gotta kind of wonder why they were hosting their stuff there. Was it because they paid for a premium account so they could download warez faster? Was it because they really didn't know of a better place to host their priceless family photos?

But you're missing the point - it wasn't EVEN ON US SOIL!

It wasn't the Americans that made the arrest either? Jurisdiction arguments are pointless. They're not poor kids that didn't know what they're doing. They've got lawyers. They've obviously got money. If there's any doubt over the legality of the arrests at all they'll get off.

But where do we draw the line! Now they can take any site down!?

Of course they can't. They got done for a reason. If you have a sensible policy on piracy and sharing copyrighted material, and actually act on DMCA notices then your site is fine. That's the whole point of the DMCA.

You can't stop piracy! 

It doesn't mean that you shouldn't try to stop people who are making hundreds of millions of dollars out of it.

SOPA will be next if we let this stand!

How do you figure? I'd say it's the opposite. This has proven that you can get rid of a huge source of piracy without SOPA. So if anything it's a case against it.

Since when were you mr fuking anti piracy shit dont smell

I've pirated stuff. I don't deny that. Don't get me wrong - I'm not hailing this as a great win for anti-piracy. If anything I couldn't give a shit that the site is gone.

I'm annoyed at the entitlement people feel towards pirate stuff. It's against the law - you can't complain that they try to stop you doing it.

Oops

Tuesday, January 17, 2012

So I wanted to get 3 monitors going, and someone on Twitter alerted me to the fact that you can put any graphics card in your computer and run a 3rd monitor from it - you don't need to SLI them or even be the same brand.

So cool - I grab another graphics card and jam it in.. but it doesn't work. The computer doesn't even boot.  Then I realise that the power PCIE cable I'm using to go from the PSU to the graphics card isn't made for this PSU. 

Then I decide to make my own. How hard can it be? I already have one working cable - I just have to pull the pins out of the connectors, put them in the right order and then splice the two cables together - again in the right order.

I did this carefully. I tested the connections to each wire and verified that they matched up. They were identical. I tested again. Yep. Identical. Tested again.

Then it came time to put it in. I somehow put the GPU side in the PSU, and the PSU side in the GPU.

Fried motherboard. Oops.

SOPA

Saturday, January 14, 2012

yawn.

Family Tree

Saturday, January 7, 2012

I've been playing a game this week. Basically you put your name and birthday in this website, then your moms and dads, then their mom and dads.. and then this green leaf appears..

Then you press on the leaf and you find out who their mom and dad are. I got my dad's family back to 1490. Their original family name was "Daft" - but changed to Newman some time in the 50's (luckily for us).

It's pretty addictive when you get into it. There's all kinds of records available. You'll mostly be using birth records, death records and marriage records to fill the tree in. But every now and then you find something cool like this:

That's a record from the post office.. showing that Frank Daft in 1935 got a job as a post man! That was either my grandad on my dads side.. or his dad!

The further you go back the more common ancestors you share. So the more chance that stuff is already researched for you. This is cool but it's hard to trust the accuracy of some of it. No matter how awesome it would be.

or how sad it would be..

Anyway its fun and I'm gonna keep on digging. It's funny how much this feels like a fun game :)

Top 6 Games of 2011

Friday, December 30, 2011

In retrospect I haven't played many games this year. I'm not sure whether that's because not many games were released.. or whether it was because the games that were released weren't my thing. 

Where's Minecraft

I know I know. I still haven't played it. For the same reason I've never played WOW. I'm scared that once I start playing it I won't be able to stop and then my work will suffer.

Where's Duke Nukem Forever

Didn't play it. I knew it was going to be awful.

Where's Skyrim/Deus Ex Blah

Not my kind of games

6. Limbo

Limbo is awesome. Beautifully animated. The interactions are perfect. The gameplay pace is perfect. I loved every second of it.

5. From Dust

Came out of nowhere really. I hadn't heard of it until it popped up on Steam. The screenshots and videos were interesting enough to give it a try. Once you get over the weird controls it's a really fun game. It's one of those games where you think you're cheating all the time. You think you're doing stuff that they don't expect you to do. But that's exactly what they're expecting.

4. L.A. Noire

You know the deal with this. Dead people, messing with the bodies, looking for clues, spotting lies. Awesome game - consumed a few of my weeks this year.

3. Game Dev Story

This was this year, right? It was my toilet game for about a month.

2. Portal 2

Stephen Merchant. 

1. Battlefield 3

That's right. Battlefield 3 is my favorite game of this year. I'm as surprised as you.

Ant Farm 2.0

Wednesday, December 28, 2011

I made an ant farm a while ago. I made it out of plastic and wood. And while it tecnically worked - it wasn't good enough for me. The plastic was bulging at the center. The gap in the middle was too wide.. so once the ants burrowed I couldn't see shit.

So here comes ant farm 2.0. This time I'm making it out of strip wood and two table tops from ikea (which was cheaper than buying sheets of thick glass).

I built the frame out of strip wood. By gluing it together. The thin pieces are 6mm thick - the glass is 5mm thick. The main length of wood I'm using for the frame is 30mm wide. So this means I can glue a peice of strip wood on either side of the frame, then one down the middle.. and the glass panels will fit neatly between them.

These peices of strip wood only act as a lip to stop the glass from falling off. They're not holding much weight - so gluing is enough.

I glued the verticals with the glass in them - to make sure that they weren't angled.

And happily everything fits good :) I did a bit of wood filling, sanding, plaining.. and then put it on the wall. I cut a piece of wood the same length of the glass to make sure the gap stayed big enough.

Then the hard part. Putting the glass in. The glass isn't light and I didn't want to get fingerprints all over it (because they'll be near impossible to clean off). So after a bit of a struggle and some help from Sarah I managed to get it in.

And there it is, all ready for the ants. 

Coding Evolution

Thursday, December 22, 2011

I think over the last 10 years I've evolved as a coder. Here's some of the milestones I achieved.

You Start Using Source Control

You spend half a day trying to find what you changed in your code that has suddenly made it stop working. You realise that your current form of source control (CTRL+Z) isn't doing you any favors. You spend an hour learning about source control and never look back.

You Stop Obsessing Over Optimizations

You decide that getting everything working should be the first priority. Then you'll worry whether that function that gets called once on shutdown is fast enough.

You Stop Coding The Same Things Over and Over

You realise that half your time is spent writing the same thing. You would have used your old code but it's so messy and you feel dirty. You decide to seperate your common generic code into its own utility library. And never look back.

You Think A Step Higher

Instead of coding a new class factory for everything that requires it you make a generic class factory template.. now you never have to code a class factory again. You actively look at what you're doing and think "what can I do to make sure I never have to do this again".

Including Windows.h Makes You Itch

You don't want to include Windows.h anywhere in your project anymore. You know it's going to come and fuck you in the end somehow. It's going to rename your functions. It's going to give you shit loads to fix when you try to make your project portable. So instead you go the extra mile and you look for the standard functions. If you can't find alternatives you make a platform.h which includes a platform_win32.h under windows. It feels good.

You Start Using Build Automation

You have come to find that dropping cpp files into a vcproj isn't the best way to manage your project. This is drilled home when you come to compile it on another platform. So from now on you use something like premake to build your project files. Now you can generate projects for Visual Studio, GMake, XCode, CodeBlocks and anything else you would ever want to generate them for. You are portable.

Holly Holly, Get Dolly

Saturday, December 17, 2011

I got audio working in Holly yesterday. Check out the output here. (tumblr won't let me embed it, blargh). I now know a lot more about raw sound data.

I made a quick web tool to embed a raw sound file into a c array. I know tools like this already exist but now another one does.. ONLINE. This is the kind of ouput. That's the sound file you're hearing in the video above. I didn't want to include it as a file, so it's embedded in the code.

And to show I'm not just jerking off, here's what Holly does when integrated into GMod. I got some work to do on the sound syncronisation, but it works. If you're wondering how it is to use.. you just bind a key to "vid". You press it to start recording, then press it again to stop. And it outputs that exact file that's linked there. Woop! It should work with Source Recorder too. And you can completely control it via Lua.

mklink

Thursday, December 15, 2011

I found this feature the other day and it's made my life easier. When compiling GMod the source is in a folder called src, and the generated binaries go in a folder next to src called game. To test it out I had a script that copied the binaries from game to sourcemods. That way I can run the development version of Garry's Mod as a Mod on Steam.

Well with mklink I can create a link between game and sourcemods. So that when I open the sourcemods folder it's identical to the game folder. It's the same folder under a different name. The OS treats it exactly as if the files were in sourcemods.

The command line is pretty straight forward..

mklink /D /J [TARGET FOLDER] [SOURCE FOLDER]

For example I have a .bat file in my source 

with the contents:

rmdir D:gamessteamsteamappssourcemods
mklink /D /J D:gamessteamsteamappssourcemods game 

I have that file in both my garry's mod branch and my garry's mod beta branch - so I can easily switch between them.

Thought this was a cool feature that someone might want to know about.

Video

Tuesday, December 13, 2011

I went off on a tangent last week. I started messing around with video. I implemented Google's webm stuff into GMod, and I got it spitting out video.

It's fast - but it's not super fast. It's not Fraps or anything. Frankly I don't know how Fraps does it. Black magic or something. I couldn't even get Fraps' speed just reading the screen - nevermind actually encoding and saving. But that's kind of irrelevant since I didn't really want it for real-time stuff in the first place.

But it can kick out small movies at 30fps no problems.

So a couple of days ago I figured this stuff is probably useful to a lot more people than just me. I took a good look at FFMPEG (etc) and thought - fuck that shit. We can do better than that. It's 2011 - lets make pumping out videos a bit easier. So I threw all my code out into a project called Holly for anyone that's interesting to feast on. I'm hoping what seperates Holly from everything else is:

  • Modern code design (c++, namespaced)
  • Totally Dynamic linking (no libs, just headers)
  • Totally portable
  • Modular design (can code and drop in new codecs)
  • Simple, Easy to use

It isn't really anything special right now. It has one encoder module which can spit out webm and vp8. No audio. But the framework is there, and it provides the most lightweight way possible to encode any raw rgb/yuv data you can lay your hands on into webm video. It's something I'm going to touch every now and then when I learn something new. And hopefully once it's included in GMod some guys smarter than me will pick it up and add some new codec/container modules.

It comes with a simple documented example that outputs the video in this post. I've had fun playing around and learning some new stuff. Cya!

Blog update

Sunday, December 11, 2011

Blarghhh. I know I suck at updating my blog. I'll post something soon. You could always follow me on twitter if you can't get enough of reading words I post.

Ass Kicker

Monday, November 28, 2011

I'm kicking ass in GMod right now. I'm reshaping it and bringing it up to date. The next version is version 13. The logic behind this is that 9 was the last free version, 10 was when it went retail, 11 was when it went orange box, 12 was when it went mac and now we're at 13 because now it's undergoing some of the biggest changes since version 10.

I've got some Google Docs on the go.

Beta Changes - A list of changes between beta releases.
Version 13 Changes - The change list so far for Version 13
Reasons why the shit you coded is now broke - speaks for itself 

Putting these things on Google Docs has been particularly good because the viewers can chat to you and point things out while you're typing. Rad!

This is bad to admit but I've started making my first proper GMod video. By proper I mean not showing some gameplay element off, just a proper GMod video. And wow there's so much here that I can improve, and make easier for everyone.

I've got some quite ambitious plans.. planned.

That's my post-it idea wall. That's what I've got planned for you guys.

Other Stuff

Tuesday, November 22, 2011

IRCCloud

I love IRCCloud. It's awesome. But there's a few things I don't like about the design, so I made a skin for it.

Pitch Poll

We were working on a game idea in which you used your voice to control a character. The game idea didn't come off so we shut it down, but it wasn't a total wasted effort because we're selling the tech on the Unity Asset Store.

This makes it easy to make voice controlled games like the simple demo in the video on that site.

Stuff done did

Sunday, November 20, 2011

I had a few successful coding sessions this week. Here's what I've been up to.

I fixed SuperDOF. A lot of it. I fixed it crashing when multicore rendering was enabled. This crash was mainly caused by not having any idea how multicore rendering worked back in the day when I converted to Orange Box. I fixed it not rendering water properly too. This was caused by the aspect ratio being '0' inside the call to RenderView. I fixed windows showing the `not responding` shit if it takes longer than 5 seconds to render the frame, I just had to pump the messages to get that to fix.

I finished off the net library too. The net library is like usermessages except better. You can send up to 64kb in a single message and they're send instantly. And you can send client to server too. I added server sending functions for sening to all players, specific players, omtting players, pvs and pas. It works cool.

I made a halo library. It draws that ring around entities, like in L4D. I added a couple of cool things. You can adjust the size of the blur, and the amount of times the final quad gets drawn to screen (stronger glow etc).

I fucked about and after some head scratching finally got the glow to depth properly!

I also added an option for it to draw the glow dark - so you can add black lines/shadows behind objects. For whatever reason.

I added the new properties system, shown in the previous post. The idea being that instead of having a tool to do everything, and having to swap back and forth all the time (agh, annoying). You can just hold C, right click on an entity and change something. Yay.

I done maths

Monday, November 14, 2011

I'm really happy with the Widgets I added to GMod. They're working really well. They're fully predicted so they feel smooth and awesome in multiplayer, just the same as in single player.

I started coding them completely clientside. The vision was GUI type controls in a 3D world. I'd pretty much done them and they worked really well - except for one thing. On actually using them, say to move an entity, you'd have to send the command to the server to move it using a console command or something. Which works but it isn't predicted properly. Blah. So I had a good think and I made them entities instead.

This works much, MUCH better. There were a few challenges here though, the biggest being hit detection.

I've never pretended to be good at maths. Those formula images they show on wikipedia to explain what some maths thing means, I have no idea what they are or how to read them. But I can muddle my way through.

The Arrow


The hit detection on the arrow was kind of a bitch. The source engine has a function I wanted to use, "IntersectRayWithOBB". It basically detects a collision between a ray and a rotated box. This is perfect for the arrow because we'd represent the collision with a long box.

Except Valve's function doesn't work properly. Scouring the source for uses shows a few times it's used in functions in Portal, but not to the extent that we're using it. So I gets to thinking. And eventually it hits me.

There's a function called IntersectRayWithBox - which is used pretty much everywhere in the source engine. So it definitiely works. It's the same as we want except the box isn't rotated. So what if we keep the box unrotated but rotate the ray before we send it in. Then we could get the hitpoint using the fraction - which will always be the same.

And I did it. And it worked the first time. I shot finger guns into the air. Peow!

The Disc

I added a rotating disc too. I wanted this to work so it would collide if you were touching the radius. Obviously there isn't a function for this, so here's how it's done.

First you test your ray against a plane, which is basically in the same position and normal as the quad drawing the circle. If that hits you move onto step 2.

You take the hitpos and you take away the center of the circle. Now you have the distance from the center of the circle. 

If it's higher than the radius, you didn't hit the circle, bail out. If it's less, you're inside the circle. So if it's less than radius*0.9 - it's not on the line - so bail out.

Boosh. Also worked first time. More imaginary finger guns shooting all over the place.

I done maths.

PC Specs

Wednesday, November 9, 2011

Since I livestreamed Battlefield 3 at 1920x1080 at full settings people keep asking me for my PC Specs. So here they are.

CPU: i7 920 @ 2.67
GPU:  NVIDIA GeForce GTX 580 (1536 MB)
MEM:  6GB

 This is my home PC. The CPU is probably out of date now, and I could do with some more memory. The hard drives aren't very fast - but I have 7TB of storage (I went for size rather than speed this time).

Battlefield

Sunday, October 30, 2011

I got Battlefield 3 on Friday (because that's the day it came out in the UK). I am now loving the fact that I upgraded my graphics card. Full settings, full everything, full AA, full screen 1920x1080 at 60+ fps. Even when livestreaming!

I played a bit of the single player. Then I tried the multiplayer and I've been on that ever since. Ranking and unlocking. I love it. Wonder what the first FPS to do that was?

I was outraged by battlelog at first. The idea seemed stupid.. forcing me to use a browser plugin, quitting the game to join a different server - then loading everything again! Crazy! But I guess it does that every time you join a new server in any game, kinda. And it does at least seem responsive and hasn't been down any time I tried to use it. And it good being able to share links with people on the web.

My profile
Facepunch Server

Beta Keys Depleted

Thursday, October 27, 2011

All the beta key are gone, so don't waste your time by emailing me. I'll let you all know when I get another batch.

Coding & Beta

Wednesday, October 26, 2011

Been doing some awesome stuff in GMod lately. I'm not going to talk about it though because none of it is finished and the stuff that is, is too nerdy for you to care about.

The Garry's Mod beta has started. It's live on Steam and I have keys to hand out. So if I told you I'd give you a key once it started shoot me an email at garrynewman@gmail.com and I will sort you out (Remind me who you are and why you would like a key). There's a beta forum too. And you can chat it up in #gmodbeta on gamesurge.

How To Buy Hardware

Friday, October 21, 2011

I used to know all about graphics cards and CPUs. I could have conversations all day long about which were the best and which ones I was saving up to get. At some point in the last 6 years that stopped and now I know nothing.

So this is how I buy hardware now.

Basically you want the one at the top. If you can't afford that then the next one down. Repeat until you can afford one.

There's one for CPU, GPU and hard drive. Easy.

Bodygroups

Thursday, October 20, 2011

Today I made the icon editor able to edit the skin and bodygroups. This also alters what the icon spawns. So for example, you can copy GMan's icon and edit the bodygroup so that he spawns without the briefcase. Then you have 2 icons, one spawns with, one spawns without. Awesome.

The HL1 and TF2 models use bodygroups a lot. And now we can :)

Progress

Wednesday, October 19, 2011

I've been pretty productive over the last few days.

Garrysmod.com

I moved garrysmod.com over to tumblr. Seemed stupid self hosting it when you can throw it on tumblr. I like tumblr.. especially their online theme editor. I made the design completely using that. 

You can submit news to it too. I'm going to start posting community news to the main site again. I had hoped that a community site would pop up that did that stuff - but no one really ever stepped up to the plate.

Spawnicon Editor

One of the annoyances of GMod for me is how odd some spawnicons are. Well I made a little tool to edit spawnicons now. It works as you expect. You click and hold on the big view then you can WSAD around, zoom in and out until it's laid out how you want. Then you click the small spawnicon on the bottom right and it saves it.

You can play with the animations to get the pose right too. I have further things planned for this.

Time Scale

In current GMod if you want to slow the time down you have to change host_timescale in the console. This is great for singleplayer - but in multiplayer you need cheats enabled for it to work.

Well now we're shipping our own engine.dll I can edit that shit. So now we have a function for it. Boosh!

Numpads and gibs

Sunday, October 16, 2011

Sarah let me work today. I did some good coding.

Numpads

You know in GMod how you make a wheel, and you choose which numpad keys to control it? Well I got rid of that today. Now you can choose any key. Including any joystick or mouse buttons. 

HL1 Gibs

I fixed HL1 gibs not spawning properly :)

NPC Tab

NPC icons are now like regular spawn icons. The tab is gone, instead of there's a node on the spawnmenu tree. You can drag them and organise them into your spawnlists :)

I've got more plans for this - so no screenshots yet.

Beta

I've got a couple of harsh changes I want to make before the beta, but I'm hoping to start it next week. It will be a closed beta and I'll be handing out keys to people I feel will be able to contribute to the process.

Live version

I fixed the filesystem permission bug today. I'll bundle a patch up and ship it out tomorrow.

Spawnmenu update

Thursday, October 13, 2011

I've finished doing a major change to the left of the spawnmenu, so decided to show you what I've done. I'm only going to be talking about things that are coded and working. I have other plans to be added to this side of the menu - but I'm not going to talk about those until they're reality.

So basically I've moved the navigation from the top to the left of the menu - since monitors are usually more wide than tall, this makes sense.

Tree

It's a tree menu too, so you can easily add children of children of children, neatening things up a bit.

Drag and Drop

It's all drag and drop enabled so you can drag one tree node to another, or organise them however you want. You can select and drag icons to another category, you can right drag and drop to open a menu enabling you to copy or move.

Sortable

The spawnicons are all sortable now. You can drag them around and save - and the order will be saved!

Not just Spawnicons

The menu isn't going to be just for spawning props and ragdolls anymore. It's designed so we can add any buttons to it and they'll cooperate like anything. More about that in the future - but for now to show this we have titles.

Titles

You can have category titles. To do it you click that grey box at the bottom left to open the tool drawer. Then you drag and drop the aA button onto your list to drop a new title. Then double click the title to edit the name. You can drag the title around just like a spawnicon.

Screenshot

Back in business

Tuesday, October 11, 2011

I've been back in the coding seat for the last couple of days. Cleaning up the current version ready to throw onto beta. As I said before the plan is to get it into beta as soon as possible. It isn't complete - but I want to test out the big changes I've made and introduce more big changes during the beta.

To add to the confusion, here's the current changelog - translated to german and then back, all on one line, with alternate caps.

UPdAtEd mEnU ScReEn PHX MOdEl PAcK UpDaTe HTTP CoNnEcTiOn tO CrAsH FiXeD PhYsIcAl pEnEtRaTiOn oF ThE WaRnInG FoR PeOpLe wItH DiSaBiLiTiEs CHaNgE ThE MaP IcOn PNG iMaGe USiNg tHe wRoNg gIbS FiXeD HL1 NPC SoLiD GrUnT FeCeS HL1 GUI NoW UsEs GWEN SkIn THe eRrOr, LaCk oF VoIcE WaDe FIxEd mIsSiNg sOuNdS CrOsSbOw NOtE ThE CoNsTrUcTiOn oF NeW SpAwNiCoN PaNeL UpDaTeD SpAwNiCoN SyStEm sPaWnIcOnS FiXeD BrOkEn lIpS In THe eRrOr oUt oF ThE WoOdS NeW TEXT ENTRY: CuTSElEcTeD () NEw TEXT ENTRY: COpYSElEcTeD () NEw TEXT ENTRY: PAsTe () NeW TEXT ENTRY: UnDo () NeW TEXT ENTRY: SaVeUnDoStAtE () (B) tO AdD HTML: SeTSCrOlL BaRs aBlEd (B) tO AdD HTML: SeTCOnTeXtMeNuEnAbLeD (B) To aDd HTML: SEtViEwSoUrCeEnAbLeD ThE NeW HTML: GeTHTMLSIzE () THe nEw HTML: GEtHTMLScRoLl () AdD HTML: SeTHTMLSCrOlL (X, Y) ADd HTML: SEtHTMLSiZe (W, H) AdD MeNu: IsInGaMe () AdD VGUI DHTML cOnTrOl ADd DPaNeLOVeRlAy VGUI CoNtRoL AdD-PaNeL: GEtChIlDrEn () AdD-PaNeL: PAiNtAt (X, Y) InCrEaSe sUrFaCe.SEtAlPhAMUlTiPlIeR (0-1) NeW VgUi.GEtHoVeReDPAnEl () NeW De bOx NEw ñ dE DrAg & DRoP NeW DPAnElLiSt: SeTSOrTaBlE (b) NeW DPAnElLiSt: SeTANiMTImE (F) NeW DPAnElLiSt: SeTANiMEAsE (F) NeW TaBlE.ReMoVeByVaLuE (TBL, VAL) PAnEl: OnChIlDREmOvEd () CaLlBaCk ADd-PAnEl: DrAgHoVeRCLiCk () NeW DTReENOdE: aDdFoLdEr (ThEn sTrNaMe, StRFOlDeR, bShOwFiLeS, sTrWiLdCaRd, BDOnTFOrCeExPaNdAbLe) NeW DtReE: ONNOdESElEcTeD (kNoTs) NeW DLAbElEdItAbLe NEw DPaNeLLIsT: iNsErTBEfOrE (PReViOuSlY PNL) NEw DPaNeLLIsT: iNsErT AfTeR (PReViOuSlY PNL) NEw DDrAw cOnTrOl ADd-PAnEl: OnDeLeTiOn () HoOk NEw iNpUt.ISSHiFtDoWn () NeW InPuT.IsCoNtRoLDOwN () ADd GRoUp: StOp () (sToP AlL AnImAtEd dEaD) ADd pAnEl: QuEuE () (AdDeD An aNiMaTiOn qUeUe pOiNtS) ADd-PAnEl: AnImTaIl () (gIvEs tHe sYsTeM TiMe, ThE FiNaL AnImAtIoN StOpS) ADd pAnEl: DiStAnCe (PNL) NEw rEnDeR.OvErRiDeDePtHENaBlE (bEnAbLe, BdEpTh) NeW PaNeL: sLiDeUp (F) NEw pAnEl: SlIdE DoWn (F) ADd DTrEeNoDe tHe GEtNaMe () NeW UnIt: ReMoVeAlLDEcAlS () THe pRiMaRy dLaBeL SeTTExTCOlOr JBuTtOn fIxEd sEt ADd-PAnEl: HaSHIeRaRcHiCaLFOcUs () FiXeD SuRfAcE.DrAwTeXtUrEdReCtUV ADd IMaTeRiAl: GeTCOlOr (X, Y) (PNG oNlY) NEw ITeXtUrE: GEtCoLoR (X, Y) (OnLy aPpLiEs tO PNG) PAnEl wIdTh + hEiGhT NoW PaInT HoOkS KeYVAlUeS ??ToTaBlE CoRrEtLy lOaD KeYs iNtO ThE ApPrOpRiAtE CiRcUmStAnCeS PhYsObJeCt dElEtE () TAbLeToKeYVAlUeS ??NoW AlMoSt 162 tImEs NEw EMiTSEnTeNcE (sTrSeNtEnCe, VeCPOs, IENT, ICHaNnEl, FVOl, ISOuNdLeVeL, iFlAgS, iPiTcH) NEw EMiTSOuNd (StRSOuNd, VeCPOs, IENT, ICHaNnEl, FVOl, ISOuNdLeVeL, iFlAgS, iPiTcH) GEtPrEfErReDCArRyAnGlEs dUe tO ThE PhYsIcAl eNtItY CaLlEd bAsE NeW PaNeL AdDCHiLd (StRPAnElClAsS) ADd pAnEl: COPY BASE () NEw PAnEl: IsChIlD (pPaNeL) NEw PAnEl: InVaLiDaTeChIlDrEn (BREcUrSe) NeW DICoNLAyOuT NeW DICoNBRoWsEr CAn nOw bE SwItChEd oN JBUtToN AdD BuTtOn: DoDoUbLeClIcK CoNsOlE CoMmAnD ArGs vArIaBlE WiLl DElEtE DSYsBuTtOn ADd MAtErIaL: SEtMaTeRiAlUnDeFiNeD NeW MsGC (CoLoR, STR, … …) NEw gUi.sGaMeUIViSiBlE () NEw gUi.ISCOnSoLeViSiBlE () ADd-PAnEl: GeTFOnT () NEw UNiT: GEtNoDrAw () PaNeL: SIzETOCHiLdReN NoW UsEd tO FiLl iN ThE CoRrEcT AcCoUnT AdD TaGs: GeTTExTSIzE AdD TaGs: GeTTExTINsEt ADd-PAnEl: HaSHIeRaRcHiCaLFOcUs ()

We Beat Righthaven!

Friday, October 7, 2011

So we won our legal case against Righthaven! The judge ruled in favour of us, dismissing the case with prejudice.

This was kind of expected given everything that's gone on in the last few months with Righthaven - but it's good to finally have an end to the legal bills and not have this thing hanging in the air anymore.

Now we get to decide whether to go after recorvering attorney fees (around $30,000). I'm sure our attorney would love us to (either way they win), but I'm doubtful. These guys know the system, they know how to play it, and they have an exit strategy.

Great for the attorneys, not so great for everyone else.

Back from Holiday!

Friday, October 7, 2011

We got back from Holiday yesterday! 8 hour flight from Barbados, then a 3 hour drive from the airport. Now we're all unpacked and washed and awake.

I'm going to start work again on Monday. As usual I've come back from holiday brimming with new ideas and raring to go. My intention is to get the beta online as soon as possible and to update it incrementally. I'm making a lot of big changes so I want to get them nice and polished before forcing them on everyone.

Holiday Continue

Friday, September 30, 2011

So at the end of our last tale we were spazzing out at the airport because our flight was cancelled.

We ended up staying at Dallas Fort Worth Airport for about 8 hours. We spent the time watching news channels go over and over the Micheal Jackson Doctor case in stupid detail, pulling significance from every insignificant detail they could find. It was a long 8 hours.

At one point I went to have a crap, but the toilet stalls have a 1 inch gap around the door, so I couldn't go. I don't know whether this is to stop people masturbating in there or what, but I couldn't poop because I was unsure what face to pull while I was trying. There was a queue of people waiting to use the toilet and I'm sure they could all see me. So I just gave up.

The flight came along. From Dallas to Miami. We set out at between 8-9, and it was about 12-1 when we landed in Miami. Our flight wasn't until 10:30 in the morning so the airport had layed on a hotel for us. We jolted through the airport, not really knowing where we were going (when someone tells me what to do I usually only listen to the first 2 or 3 instructions for some reason). We got outside where we had to wait for a minibus to take us to the hotel.

The air in Miami was hot and damp. We were kind of excited because it's where Dexter is set. The trip to the hotel was quiet and tired. Miami didn't look like a nice place to visit, at least the part we went though.

We got to the hotel and pretty much just got straight into bed. My alarm woke us up at 6. Less than 5 hours sleep and we were at it again. The shower wouldn't turn on. I cleaned myself in the sink. All the smelly, dirty bits, and put on the clothes I' had on for the previous 20 hours.

We got to the airport and 2 hours later onto the plane. Miami looks a lot like GTA:VC from the air. I guess that's what it's based on since it's kind of based on Scarface.

We landed in Barbados, relived that nothing else went wrong. The drive to our hotel was long. About 30 mins. We drove past shacks, abandoned houses, boarded up windows. It's kind of a scary sight when you're going to your hotel. Has the recession hit these guys bad? Is the hotel going to be shit?

Thankfully the hotel i great, the pool is great, the beach is great. Everything is great here. The only negative so far is how much people hassle you trying to sell you plants and necklaces on the beach. But that's a small price to pay and they're all polite and leave you alone when you say no thanks.. but it's easier to stay by the pool really - especially since Sarah is scared of the beach, and the sea, and the fish.

Holiday Halt

Monday, September 26, 2011

The holiday was going so smoothly. We'd done our 5 days in Vegas and were flying to Barbados via Dallas.

Except we land in Dallas and bam, our next flight is cancelled. Sarah freaks out. We get a lot of help from the staff here in Fort Worth.

So now were waiting for 7 hours for a flight to Miami, where well stop overnight, then get a flight to Barbados in the morning. Which is a bit annoying but apparently the airport be covers the costs, so ok cool, this shit happens.

The annoying thing is rearranging our plans in Barbados. We need to tell the transfer from the airport were not coming, and tell the hotel well be a day late. We phone the emergency number the travel agency gave us… It tells u the office is closed and gives us a number to call. So we call it and the guy pretty much tells us this is his mobile number, he's out and about so can't do anything, and we should call the individual companies ourselves. Great service eh?

So we have to go on the net to lookup the numbers for these places and phone them.. And as far as I know this is all fixed now. We're still waiting in Dallas, so let's hope nothing else goes wrong!

Vegas

Friday, September 23, 2011

So we made it to Vegas. The flight here was 9 hours long. We had some essex boys sitting behind us. One of them must have had something wrong with his hearing - because somehow he managed to talk 10x louder than everyone, and he loved the sound of his own voice. He talked for the full 9 hours. Apart from that the flight flew by. I watched Super 8 on the plane, thought it was pretty good. Started watching Arthur too - seemed like it was good too, really like Russel Brand.

So we've been in Vegas for a full day now. Its hot as hell outside, luckily you only really go outside when going from place to place.

Today we went to the shark place.. It was pretty good. Kind of no suprises, fish in tanks. Everywhere.

Then we went to the Titanic exhibition. This was really good. You weren't allowed to take photos though. Lots of really interesting stuff. Full size mockups of parts of the ship. There's a big peice of the actual side of the ship. And there's a real iceberg too - that you can touch.

We went to madame tusaads. That was fun - it's what you expect.

Then we went on the New York New York Rollercoaster. Against Sarah's will. She was nearly crying when we were sitting in it waiting to go. It was pretty rickerty. But we did it!

Really enjoying Vegas so far. Wasn't sure whether I would - because I hate people, and I especially hate large groups of people. But so far I haven't been annoyed. There's lots of systems everywhere that optimise efficiency and reduce annoyance. 

Holiday

Friday, September 16, 2011

I'm going on my notch for 2 weeks next week. We're going to Las Vegas for a week, and then Barbados.

In Vegas we're stopping at the MGM, and I'm hoping to see the grand canyon.. because it's one of those things you've got to see apparently. Don't really have any other plans, I figure there's always loads to keep you occupied so we'll just find stuff to do when we're there, right?

Barbados is going to be a lying on the beach all week holiday, I hope, because that's my kind of holiday. Hoping the weather is ok there, considering all the storms and shit. Google's weather thing tells me rain every day - but webcams show sun. So I dunno.

Not exactly looking forward to the 9 hour flight to Vegas, or the 5 hour flight to Barbados, or the 7 hour flight home.. but that's just what you've gotta go though I guess. It's not that I'm scared of flying - I just find it annoying - I arrive on holiday angry, and get back angry. Everyone is an idiot.

Still Coding

Wednesday, September 14, 2011

Still hammering away at the big GMod update. And I'm loving it. It feels good to fix all of the stuff that has annoyed me over the years - but I've been too scared to touch. I don't think I'm going to break as much stuff as people expect - I haven't come across anything on toybox that has broken in the new update.

One of the things I'm changing is DPanelList. If you've done a lot of GUI work in Lua you probably know what this is. It's a panel that organises panels inside itself, and adds a scrollbar if it overflows. It's also a huge mess. Over the years it's been added to and bent to be used in situations it really shouldn't have been.

In the new update I'm phasing it out. I'm phasing the way it works out too. We have a panel:GetChildren() now - so there's no need for a panel like DPanelList to keep track of its children in an .Items table. Because we're using GetChildren the order they're stored in becomes important (the first one will be at the top, then the second one etc).

Instead of having a one size fits all solution like DPanelList - I'm moving towards general layout panels (DLineLayout, DIconLayout). These new layout panels don't automatically add a scrollbar, so you have to dock them to a DScrollPanel to get scrolling functionality. This cleans everything up.

I probably won't chop DPanelList out of the next update completely - but it won't be updated with the newer derma features like the new style or the drag and drop stuff - and it's usage will be discouraged.

Being Sued

Monday, September 12, 2011

Did I mention that the forums are being sued? It's been going on for a while now.

You see there's a 'company' called Righthaven. They apparently buy the copyright to news articles on the web. Then they sue people that have quoted those articles on their websites. (It's a bit more complicated than this - but that's the idea).

It all started around September last year - when a user on the forums posted a news article about some hotel in Vegas that is shaped in a way that the reflected sun burns people. Or something. 

Eventually, around November/December, I got served papers saying that they were suing us for copyright infringement. No "please take this article down", no nothing - just straight up court papers.

So we got an attorney and decided to fight it - mainly on principle. Which I'm personally starting to regret. We're around $30,000 down on the deal. I've heard on the grapevine we could have settled for less than $5,000. Having principles cost a lot of money.

The problem is this. If you sue someone in the UK and lose you almost always automatically have to pay their legal costs. In the US that's not the case. So most of the time it's a simple business decision - settle and it costs $1 or fight and it costs $20. And that's how their business plan works.

Righthaven seems to be folding up now. They've lost a lot of cases recently and are apparently starting no new ones. So annoyingly it seems like if we'd have just dodged them it'd have all gone away eventually and cost us nothing.

The judge threw the case out. And they appealed against that (thanks legal system, bye $10,000). So now we're waiting for the judge to read their appeal and our replies and tell us whether we're going to court or not. Even if we win it won't feel like a victory, it'll just be a relief.

Spawnicons

Wednesday, September 7, 2011

I've re-written the spawnicon code in GMod. It'll probably be fun to review the life of the spawnicons.

This is how the spawnicon started. It was a button on the wall in gm_construct.

A few versions later it evolved into this

Which was actually a huge leap forward because now it's map independent. The buttons got more organised over time.

And didn't change much, until in GMod 9 they got images.

The images weren't auto generated. You had to take screenshots and make an icon for it outside of the game.

In GMod 10 I finally had enough brains to make the icons auto generate. I've been tweaking that over the last couple of days. I've got the icons outputting as PNG files with (simulated) alpha, instead of TGA's with no alpha. I'm not going to show you what they look like ingame just yet (I know, I'm a tease), but I thought that someone might find this useful.

I've outputted all of TF2's models to 512x512 PNG spawnicons with (simulated) alpha. Might be useful for anyone making a TF2 related website or something?

They're autogenerated so they're not all perfectly aligned, but a lot of them are pretty and I'm sure people will find a use for them.

Obviously it's all Valve's property so bear that in mind if you decide to do something with them! Download (75mb)

Office Dog

Tuesday, September 6, 2011

I took Jackass up the office yeterday. I thought it would be cool if he hung around and just slept next to me while I worked, like he does at home. Things started off well enough. He burst our football but it was on the way out anyway.

Then he shit on the floor. And then he pissed on the floor. Not a normal piss that dogs do, but a "I haven't urinated for 3 weeks and I just drank the sea" kind of piss.

It wouldn't stop. He was walking around and it was still coming out. 

And I guess that's why generally offices do not have dogs wandering around them.

The Plan

Sunday, September 4, 2011

There's a lot of changes in the next GMod update. Lots and lots. I'm not saying what I changed yet because it's all subject to change. But believe me, this is the biggest change to GMod since GMod10 was released.

Because this will undoubtedly break a lot of gamemodes and addons my plan is to hold a beta for a month or two before. The community's best developers will be invited to the beta to convert their work ready for release - and I'll make myself available to help out with this personally. They'll also be able to make their content take advantage of the new features I'm adding - which I'll also encourage and help with.

If you want clues about what's changing keep an eye on my Steamshots page and my Twitter :)

Erection Failure

Friday, September 2, 2011

I was thinking the other day.. who reads this blog? It's probably mainly guys, under 20. So I was thinking what advice could I pass on that might help someone out one day? Here it is.

When you start having sex there will be a time where your penis won't cooperate with you. You'll go to put the condom on and it will be half erect, but you'll manage to get it on somehow, and she didn't seem to notice. Then you'll start doing it and you'll be thinking "is it still hard". Then you'll look down and it won't be. Your girlfriend will look at it, you'll be embarassed. You'll make eye contact. You'll want to crawl up your own ass. She'll blame herself, she'll think you don't find her attractive. You'll start to wonder whether you actually do - your dick doesn't, maybe you're gay, maybe you can only get off when watching porn. Next time you will be so scared of it happening again that it will definitely happen again. It'll probably happen for about a month. You might even consider getting Viagra or something.. but don't!

You see the problem is that you're thinking about the state of your erection instead of the sex. It's like constantly thinking of a dead dog while trying to do it.

When it happened to me I reached out to a friend on MSN, I told him the story. He said something like "LOL! you faget u shoud send her 2 me ill sort er out fer ya ;)".

About a month later he messaged me. Except it wasn't him, it was his girlfriend. She said she'd read the chat history - and not to worry about it. It'd happened with her and my friend - except he CRIED when it happened to him. Clever really because I'm sure it completely blew over the embarrassment of not being able to maintain an erection.

The Wild

Thursday, September 1, 2011

I wanna live in the wild. The film Castaway - that's my ideal life. On an island with nothing, surviving, building shit. All you have to do all day is find food and improve your shelter.

I recently watched a TV show called Alone In The Wild where some guy did just that. They dropped him in the wild to survive on his own for 3 months. Except he didn't. He hung around for a month, then he cried for a month, then he quit. He came to the conclusion that he could have survived - if he was allowed to shoot the moose. To me that isn't really surviving - unless he's got an ammo factory on the island with him - his ammo would run out and then he'd starve.

He ate 3 things. Fish - which he caught with a rod, porkupine - which he shot, and plants. And he lost a ton of weight on that diet. I don't get how when you've got all day to catch food and eat you could starve - I'm not suggesting it's easy - but if you're going out with a fishing rod every day for a week and not getting enough food you should be thinking "maybe I'll try a net" or "maybe there aren't any fish here".

So. In the ideal you'd get dropped on a desert island with a shipping container full of things you need to start surviving. What's in your container? In mine I have:

  • Lots of tinned food - just to keep me going until I establish a decent food supply
  • Seeds
  • Binoculars
  • Tools, axes, saws
  • Tool maintenance, sharpening wheels etc
  • Tarpaulin 
  • Survival books
  • .. And obvious stuff like medical supplies, boots, porn, sheets, etc etc

First thing I'd do is establish camp. If the shipping container is there that's probably become my home. If not I'd try to build a log cabin over the time I was there. I'd make it bigger, and the walls thicker, over time. 

Then while I was doing that I'd start a farm using my seeds. Maybe over time I try to get some animals breeding and farming those too. I'd be looking into routine water from a river or something by my camp.

Then I'd be set, just chilling out on my desert island for the rest of my life.

GWEN Skins / Pixel Reading

Sunday, August 28, 2011

I did something cool with GWEN over the last couple of weeks. I made it so that the included renderers (OpenGL, DirectX, SFML, GDI) can read pixel values from the textures. (If you're interested in the source for this, explore here).

What does this mean? Well in GWEN the skin is mostly defined using a texture. This texture:

To make this:

This is all good except you'd usually need a counterpart customised skin class to define the colours of text and lines. Well not anymore. You see those squares on the bottom right? Each one of those defines a colour for something like the button text, button hover text, button down text, label, bright label, dull label, etc etc.

Why an 8x8 square instead of a 1x1 pixel? Well - no reason at all really - it just makes it a bit easier to see. There's an editable photoshop file on subversion if you want to try your hand at making a skin. Here's the sample from the source as of right now:

GwenTest.zip

So if you're coding a game in c++ and are looking for a nice GUI solution, then be sure to give GWEN a look over.

These skins are synergised with the next version of GMod :)

WIT: Deus Ex (3 I think)

Sunday, August 28, 2011

I don't know much about Deus Ex, except that it is meant to be awesome. This hasn't been my experience.

From what I remember I tried to play the first one, there was a dock, there was a robot running around, and some door that wouldn't open for some reason, and when it did there were stairs. That's literally all I remember.

My memory on the second one is even worse. I think it used the Doom 3 engine, everything was black and cyan. There were sentrys that you could reprogram I think.

And then there was the one I just bought on Steam for £30. I gave it a good run, I did the first mission, which took about an hour. I don't think I'm going to play anymore.

I feel like a traitor to the gaming community for not liking it and for not getting what the fuss is all about. Everyone I spoke to has told me how awesome it is, everyone on twitter says it's awesome, it's getting 10/10 reviews. Because of all this I've forced myself to sit down and try to like it, try to find what I'm missing, trying to adjust my brain. It leaves me with one thought.. "are we playing the same game?".

There are elements of the game I like. I like the weapons, I like being stealthy, I like searching corpses, I like the fact that I die after being shot 4-5 times.

But they're greatly outnumbered by the things I don't so much like. The story, the characters, the art, the controls, the dialog choosing, the linear cliche'd levels. The fact that every room you go in has 3 cardboard boxes, even toilets and outside.

I don't know. It's like the older I get the more I think I've seen this all before, so the less likely I am to give it a chance. But at the same time I feel like I've given it a good chance to impress me and it hasn't. Someone on twitter told me he hated it until about 2-3 hours in - if that's the case for everyone then I think they did something wrong.

Sorry guys :( 2/5

CODBLOPS

Saturday, August 27, 2011

I know a lot of 'real' PC gamers don't like COD for some reason. Probably because it's so popular. I like it.

So I joined 2 black ops servers yesterday for the first time in about a year.. and automatically got kicked and banned from them both. Why? Because I had the `second chance` perk enabled. 

And that's why people shouldn't be trusted to run their own servers.

Resources

Friday, August 26, 2011

Got any useful resources? I have a bunch of links to useful stuff stored in my favourites. Here's some of them.

Textures

This is pretty standard, the best place for textures.

Color Schemer

Nice simple web tool to help you throw together a colour scheme for something.

Kuler

Same kind of thing.

Interpolation Methods

Simple list of interpolation methods, along with code and extremely useful image.

Atheist Quotes

Massive list of atheist quotes. Really useful if you have a tublr account and want to space your posts out with bold socially dividing quotes.

So what you got for me?

Docking

Wednesday, August 24, 2011

I added Docking to GMod a while ago. GWEN uses it too. I don't think many people designing GUI layouts in GMod know about it (probably because I only added it in the last 6 months and they're learning from older code).

I always feel like I learn better by looking at images rather than text. So here goes (this is in GWEN but it's the same principle in GMod)

New Window

New Button called Bart

Dock Bart 'Left'

New Button Homer - Dock 'Fill'

Dock Bart 'Bottom'

Dock Homer 'Left'

Send Homer To The Back

Reduce Homer's Width

Add Marge - Dock 'Fill'

Change Homer's Margin (0,0,4,0) (l,u,r,d)

Create Button ':D' on Homer, Dock 'Bottom'

Change :D margin to (4,4,4,4)

As you can see it makes laying out your controls set and forget. Previously you'd be setting the layout in something like PerformLayout - manually working out pixels, subtracting from the width of the parent. It gets messy.

Docking isn't appropriate for everything but it works for a lot of stuff. It also has the advantage that it automatically scales when stuff gets resized.

Steam Chat

Tuesday, August 23, 2011

Here's a list of things I'd love to see in Steam Chat:

  • Highlight words - highlights lines with these words on them (ie your name)
  • Your name a different colour
  • Officer names a different colour
  • Officers in their own category
  • Ban/Kick by right clicking names in chat window
  • Tab autocomplete of names ( !!! )
  • Being able to make it so non group members can't talk
  • Buffer clear itself so you don't have to close/open the room every day
  • If you try to join a room that's members only - show what group you need to join
  • Remember whether you want avatars on or off
  • Unbanning without the popup query asking if you're sure
  • Unban all

<3

Selling a Car Online

Monday, August 22, 2011

My friend is selling a car. He added it to Autotrader. He hasn't got a legitimate response yet - but he's got a load of scammers. You'd think they'd do something about that. It's got to be obvious from their point of view that someone is using their email form to contact 50+ sellers at a time?

Hey,

Thanks for the prompt response.

I will like to know more about its condition and possibly have more pictures of it I will be very glad to have more pictures of it. Do as well advise on the least amount you will like to give it away. I will be very glad to conclude this as soon as possible.
Due to the nature of my work, I will not be able to come for the inspection,because am presently out of the country. I will be handling the pick up of this merchandise through a legitimate shipping agent.. The vehicle will be picked up after you receive the full payment, so i really need to know the mode of payment because i need this vehicle urgently. Hope to read from you asap.

Thanks again and hope to hear from you soon..

Emily

Hi

Alright i want you to know that am so much interested in buying this car from you,the mileage,the car location .So i am ready to buy it now,I work as Engineer Road Construction Building Julius Berger we just got a new contract from the Government am not in the state presently.. I insisted on PayPal because i can pay from my pay-pal account, as i have my bank a/c attached to it,I will need you to give me your PayPal email address and the price so i can make the payments asap, i will not be able to come and look at it,i have a agent and shipping company that will come for the pick up of the car and they will be responsible for signing of the paper and title I'll email my details to them, as soon as we have conclude i will contact them asap and we can go from there.. And do not forget to remove the add okay,

1,Your Pay-pal email account.
2,Your home address. 
3,Last Asking Price.

Thanks

Hi Craig,

Thanks for the message and i am glad to the condition and reason why you are selling the car.My pick up agent will come for the pick up and delivery tomorrow after PayPal transfer has completely done, so will need you to send me your contact phone number and address to figure it out.

Mercy

Thanks for the prompt response.. I am ready to buy it for my uncle and
i am at sea at the moment as i am a marine engineer and due to the
nature of my work,visiting of website are restricted but i squeezed
out time to check this advert and send you an email regarding it. I
really want it to be a surprise for my uncle so i wont let him know
anything about it until it gets delivered to him, i am sure he will be
more than happy with it. I insisted on PayPal because i don't have
access to my bank account online as i don't have internet banking, but
i can pay from my PayPal, as i have my bank a/c attached to it, i will
need you to give me your PayPal email address and the price so i can
make the payments asap for it and please if you don't have PayPal
account yet, it is very easy to set up, go to www.PayPal.com and get
it set up, after you have set it up i will only need the e-mail
address you use for registration with PayPal so as to put the money
through. I have a pick up agent that will come and pick it up after i
have made the payments…

Thanks so much and i will be waiting to read from you soon.
Robert

You'd also think that they'd get more success if they slowly lead you up the garden path instead of copy and pasting a generic large email.

My First PC Games

Sunday, August 21, 2011

Games aren't really like movies. They don't always age well. Here's some PC games that I loved back in the day.

Carmageddon

I didn't own the full version of this game. I owned the demo. The demo was limited to 1 minute of gameplay I think. And although it was a racing game we set out in that minute to run over as many zombies as we could. We did this for hours. Particularly loved how the zombies were idiots and fell off buildings, tripped over and exploded into bits. Also loved how you could slice the car in two.

 I later got the full version and found that it wasn't as fun as the demo. Realised that the game was a car racing game. And it wasn't as fun with real people instead of zombies.

King Pin

DON'T YOU BE LOOKING AT MY BITCH! I played Kingpin for hours. I think I only got past the first level about 3 times. I put this down to how fun it was to try things. Pissing a guy off and running off and seeing if you could hide from him (you can't!). 

I loved everything about kingpin. Especially the swearing. And especially how hard it was.

SiN

I only had the demo of SiN. You helicoptered in with a minigun and then you went inside a bank that was being robbed. I loved how you could be shooting the bald guys for ages - but they died instantly from a headshot. I think this was the first game that I saw that in.

I also loved how there were women crouching down and you could crouch down and look up their skirts.

Future Cop: LAPD

This was one of the few full games I owned that actually ran really well on my PC. Although technically I didn't actually own it - I got it on an old Bobby pirate CD. I think it was meant as a multiplayer game - but it had a singleplayer element tagged onto it - in which the computer just played the other player.

I particularly liked how the computer would go AGGHHHHHHRRRRR!!! When you started to beat him.

WIT: From Dust

Friday, August 19, 2011

I was annoyed when I first started playing From Dust. Not from the game itself - but because on launching I was forced to register with some ubisoft thing. When I buy your game I'm doing you a kindness - don't force me to create accounts on something unless you have a damn good reason. As far as I can tell they don't have a good reason - so I'm annoyed before I even start playing.

Tech

From Dust is a cool game. The technology reminds me of Minecraft in as much that if you showed it me on paper I'd tell you it'd never happen and to get the fuck out of my office. But they did it - and it works, and it works really really well. 

Gameplay

The gameplay is fun. It's challenging. It's nice to be able to see what the game wants you to do, but to say to yourself "No, I think I'll re-route this waterfall instead" - and be able to do it. I like stuff like that.

I'm told that it gets 'too hard' as it goes on - but I haven't got that far yet. I don't see that as a negative though - I miss when games used to be hard. So far I've found the learning curve pretty good.

My only tiny annoyance with the gameplay is with the unskippable 'hint' cinematics.

Design

One area that I think it's lacking is in the design department. It's kind of like programmer art. I feel like they could have done with looking at a game like TF2 and coming up with a stylized look. It's the only thing that lets it down for me.. but it doesn't stop it being a great game.

4/5

Additional:

I just beat it. The ending isn't great - but what do you want for $10.  I enjoyed it.

That GMod Update

Thursday, August 18, 2011

I had a bit of a bad time with that last GMod fix.

.c files

My linux/mac compile procedure broke. cpp files were getting compiled, but normal c files weren't. Turned out that I hadn't noticed for the last 6 or so months because it was using .o files from previous compiles. I don't think this actually mattered because the only things in .c files are lua and cron - which never really changed.

mac version

Whatever updated that broke GMod didn't update and break the Mac version. This meant that when I updated the mac version, my update made it incompatible - the other way around. The only solution was to roll back to the working mac version. This means that when the mac version does update - gmod mac will break again - and I'll have to throw an update out.

boner

I screwed up the merge. When I'm merging my code with Valve's updated code it's 99% automatic. But every now and then the updated code is changed in the same place that I've changed something.. and I have to go in manually and tell the source control what I want to happen. I made a mistake in a bit of code which meant that a variable was left uninitialized - which resulted in props and ragdolls not rotating.

GMod Broke Routine

Wednesday, August 17, 2011

I have developed a routine when GMod breaks. 

  1. Wake up, see all the messages on twitter and email
  2. Post on twitter acknowledging
  3. Get out of bed and test it to make sure it's broke
  4. Post details on garrysmod.com
  5. Shower, head to the office
  6. Double sausage and egg mcmuffin on the way
  7. Download Valve's latest code
  8. Merge it with GMod's code
  9. Compile & test
  10. If it doesn't work make it work
  11. Compile for linux and mac
  12. Build depots
  13. Upload depots
  14. Announce update

I think I've got it down to an art now. I know that even if I finish the patch within an hour it will still be about 7 hours until Valve will wake up and be able to push it out anyway.. so I tend to just take my time and enjoy it nowadays.

Cloudflare security issues

Tuesday, August 16, 2011

The guys on the forums found quite a glaring security/privacy issue with Cloudflare. Cloudflare sits on top of your site, every request that is made from your site goes through cloudflare first. This allows them to do some cool things, like prevent DDOS attacks and automatically cache and minify content. It automatically caches files with these extensions:

css, js, jpg, jpeg, gif, ico, png, bmp, pict, csv, doc, pdf, pls, ppt, tif, tiff, eps, swf,  midi, mid, ttf, eot, woff, svg, svgz

Which is great, but imagine you have cloudflare on your site:

www.mysite.com

And you have a PM system:

www.mysite.com/messages/

Someone could potentially make you visit this URL (linked in an image maybe?)

www.mysite.com/messages/?.jpg

And then it would be cached in cloudflare - so then they could visit that URL and see the cached version.

This can be prevented with the Cache Level settting in Cloudflare, which stops it taking notice of extensions on the query string. Which'll save you from these type of attacks - unless you have friendly URLs on your site. In which case you need to make them more secure by not allowing stuff to be added to the end.

Images in Source

Monday, August 15, 2011

One thing that annoys me in the Source Engine is materials and textures. It's an awesomely powerful system when you need it. But I don't particularly want every texture I use on my GUI to have a generic vmt file with just the $basetexture replaced.

So I've made it so that in the next version of Garry's Mod you can load png/jpeg files as simple flat textures - simply by using the filename.

Advantages?

  • Only loading one file - so half the disk access time
  • Not losing out, still got the previous system
  • More accessible
  • Potentially load images from the web straight onto the GUI

It's pretty much as simple as it could be. It looks like this:

local mymaterial = Material( "gui/header.png" )

I'm playing around with it and exploring the possibilities. The same system has scope to do some cool things.

Visual Studio for Lua editing

Friday, August 12, 2011

I've always used Notepad++ for Lua editing. It did the job, I was used to it. I liked it. The problem is that when you have a large project and you want to quickly jump between files and search for stuff it kind of slows you down.

So now I use Visual studio. Here's how.

1. Install Lua syntax plugin
2. Generate Project files using Premake.

Obviously premake and visual studio weren't exactly made for this shit - so you have to fool it a bit. Here's my premake files (you don't need to download anything else).

Basically I have a folder called 'proj' next to my garrysmod folder, and the premake script looks in "../garrysmod/lua/*" and adds all the lua files. It's a lot faster than adding them all manually.

And when your files change you just run the .bat again to syncronise the project files.

<3 premake

More Android bitching

Wednesday, August 10, 2011

There's another thing about Android that annoyed me that I didn't mention in the other post.

When I heard about Android I imagined a kewl OS like iOS, made by Google, on a phone. Like iOS you'd get periodic updates that would update the entire iOS and make it even cooler. If you had a new phone it would be exactly the same OS - just on a newer, faster phone. All your apps and settings would be the same, just transferred.

Except in the real world it doesn't work like that. Google kicks out Android, then Samsung or whoever get it, modify it and add a bunch of junk all over it and then kick it out.

The handset providers want to make their phone stand out - so instead of having a generic OS on the phone with specialized versions of Android on each handset. Which is kind of a lesser version of how it was before Android where each provider had their own OS.

The only slight advantage nowadays is that you can root your phone and install a custom build of Android on it to get it exactly how you want. But it's 2011 - who the fuck wants to mess around doing that shit?

Riots

Tuesday, August 9, 2011

Post Music

There's a lot of riots in the UK at the moment of writing. People are scared. There's stories of people being burned alive, gangs of armed thugs heading to children's hospitals. What a load of bollocks. All the fear doesn't make sense, it sprouts up because people don't understand what's happening. So here's how I think it's happening.

1. Hear about Riots

People on Twitter or Facebook see that riots are going to be in their town that night. Their friends phone them up - hey lets go down and watch?

2. Go to watch

They go and stand around to watch the riot. They don't realise that they are part of the riot. They're all standing around - nothings happening. More and more people come to watch.

3. Anticipation

People are getting bored of waiting. Someone out of boredom throws a brick and it cracks a window. Other people start throwing bricks. The whole crowd is having a go. All these people that came to watch the voilence are now part of the voilence.

4. Opportunity

The window gets smashed - people steal things from the window display. Once all that's gone people run further in to the shop to steal stuff - until there's nothing left.

5. Spreading

One window is smashed so it's less of a stretch to break the window to the shop next door. That happens. And happens. Bystanders become active participants - because fuck - everyone else is doing it - why shouldn't they?

Why

From their point of view it's not some menacing, evil thing. I'm sure if you ask them their excuse would be the classic "everyone else was doing it". The situation is crazy and they see an opportunity to get free stuff.

They're not armed thugs roaming the town looking to fuck shit up. Why would you even believe that a group of rioters would get together and think "Hey - lets go burn the childrens hospital down - FUCK HEALING SICK CHILDREN!!!".

Why Not

The problem is that so far there's not been any visible repercussions for this stuff. The footage on the TV shows people looting - it doesn't show police arresting the looters. It doesn't show the police kicking in doors dragging them out of bed and into a cell.

People are smart nowadays. They know the police can't beat them. They know that they can stand up and be a big man to the police. If the police beat or shoot them there's a million "no fee" solicitor firms that will rinse the police dry in court.

The most punishment they'll get is thrown in a cell overnight. They know this. So what's to stop them, apart from their parents?

Home Gym

Tuesday, August 9, 2011

I have a beer belly.

I was really thin when I was younger. Really REALLY thin. All through school, all through leaving school. Up until I was about 23. Then the years of drinking beer and sitting down caught up with me and my metabolism slowed down, and I started cooking my own meals.

I wouldn't say I'm fat now, but I could do with losing some weight to get into my ideal weight zone. I hate seeing my beer belly and would like to get rid of it if I could. I'd like to get my arms a bit more built up too. 

So long story short I bought a treadmill and a home gym thing. I'm trying to wedge them into my daily routine so I don't end up being a twat and never using either of them. Although I'm quite unfit so I'm hoping it gets easier as time goes on. I'd love to give you stats of what I can manage right now but I don't really know the weights I'm using, of the exercises I'm doing. I know I ran 2km in 20 mins - which sounds good to me - but probably isn't since I had to walk most of it.

Android vs iOS

Monday, August 8, 2011

I've had an iPhone since they came out, so I'm biased. I love my iPhone. I love iOS.

So my phone contract was up and they told me they'd send me a free Samsung Galaxy SII if I renewed it for another 18 months. Fine - might as well. I haven't really messed with Android - and I am a Google fanboy way more than an Apple fanboy. So here's what I think of the Samsung Galaxy SII, compared to the iPhone 4.

Device

The device itself is bigger, but lighter. It's weird because you'd think the lightness would have made it feel better - but somehow it feels cheaper. That's probably just because the iPhone's weight is what I'm used to.

The screen is bigger than the iPhone4 - which is a plus. The androids, from what I've seen, have 3 buttons at the bottom - where the iPhone only has the Home button. These buttons are used extensively under android - and come in very useful.

Android

The 'desktop' on Android makes the iphone's look stoneage. It's tiled in the same way that the iPhones is but you can add widgets to it. The widgets might take up say, 3 tiles wide by 2 tiles high - so you organise your tiles around them. This is really cool for things like email, or twitter, as you can show the latest tweet on your phone screen all the time.

It also has a feature where you can drag down from the top of the screen to show the notifications and quick switch things like wifi, sound and rotation lock. This is incredibly useful - and it's something that apple have apparently unashamedly stolen in iOS5.

Ease Of Use

I think it's fair to say that Androids aren't as easy to use as iPhones. iPhones are easy - everything just works. Androids aren't exactly hard to use - but a lot of times when trying to use the Galaxy I found myself thinking "fuck me, this is a mess compared to the iPhone". It feels like a step backwards in one way. Back to the times of when I had a Windows Mobile phone - and it was almost like a traditional PC on your phone.

Overall

Whenever you talk to someone that knows about Android they'll tell you to install firmware x, then download package x and install and activate x. And that kind of sums it up. If you're into customizing the shit out of your phone then Android is definitely for you.

But if you're like me and you don't care about that stuff, you want the minimum amount of options, you don't want to jailbreak, you want simplified and clean and easy? Go for the iPhone. There's really not that much in it - and that's the only fundamental difference.

Doing Stuff

Sunday, August 7, 2011

Apparently when you're in a real relationship you have to do stuff. Birthdays, weddings, funerals, shopping, holidays. It never ends. I don't like doing stuff much. I have enough stuff to do. When I'm doing that stuff - I'm not doing my stuff.

If there's an event coming up that I'm forced to attend it ruins my life up until the time that the event is over. It's always in the back of my mind. I can't start doing anything because I won't have time because I've got to get ready for the event. My concentration always drifts back to the event.

More often than not I do actually enjoy the event when I'm there with a bottle of Smirnoff in my hand. But most of the time I feel like I just can't be bothered - and would rather be at home with a cup of tea and my slippers.

Blogging lookback

Saturday, August 6, 2011

Man, I've been blogging for a long time. I was looking through some of my old posts. A lot has happened since I started blogging.

When I first started writing a blog I was in my early 20's, living with my parents, couldn't drive, had no real job, no girlfriend.

Now I'm 29 - I'm with the girl I want to spend the rest of my life with, I'm on my 4th car, I own my own house and I own a successful software company.

Not that any of that has helped my ability to blog. But I've decided to make more of an effort to write here, every day. Even if I end up listing the different color cars I see that day.

From wordpress to tumblr

Friday, August 5, 2011

I changed my blog to tumblr. I don't blog as much as I used to and I'm hoping this will encourage me to post more. 

I've only copied over the posts that felt important to me.

GMod Updating

Thursday, August 4, 2011

If I've been quiet for a while that's because I'm working on a GMod Update. I've got lots to post about it. Lots of little things I coded that I would like to let people know about. But I'm not going to. I just want to get on with it in secret. So it's a total surprise when I drop it.

The update didn't start off this ambitious. There's a lot of things in GMod I'm not happy with, that I would like to change - but never dared to mess with because of the backlash from people that have got used to it being that way. I figured while I'm making some big changes I might as well change those things too. So it's growing. By the day.

Bullshit

Thursday, July 21, 2011

I've been looking at Facepunch lately, looking at where we're headed, where we want to be headed, what we could do better. One area I think we're particularly weak is in marketing. This hasn't been a problem up until now because GMod has huge viral marketing.. but going forward it's definitely something we need to improve. I'm kind of fighting against two forces.

Bullshit

I don't know whether it's because I'm English, or because I don't want to be judged, or if I'm just not that happy with my work.. but it feels wrong to self promote. I'd rather release and let people enjoy it if they want. No song and dance. But the real world doesn't work like that. You need people to play your game. The company needs to make money, people need to get paid.

I know a guy outside of the games industry that exists purely on bullshit. He has no actual skills, he does no actual work - he just bullshits. You need something doing? He owns a company that does that - he's been in the business for 10 years - he will point out 5 examples of his work within your current field of view. His companies fold all the time, but then another one springs and he's back in business. Walks around on his phone, purposely in earshot of other people, talking about how his 'Maserati' needs to go in for a service.

The power of the bullshit.

Managing Expectations

I remember a while back Introversion released DEFCON. It was the biggest thing on the internet for about 7 days before release then about 2 days after. The game was mediocre at best. But the marketing was amazing - they had everyone pumped for it somehow.

I'm sure it sold a lot of copies, but I'm also sure a lot of people played it for 10 minutes and thought "is that it?". My worry is how many times will these people give you a chance when you bullshit them? Does it matter? Will they always buy into your hype? Is this bad marketing? Is it fucking yourself in the long run?

Community Manager

Street Team, Community Support, Community Manager. All things that I have hated ever since I entered the modding scene. That's why I've avoided having anything like this. Every modding group about 5 years ago had no coders, no artists, one project manager and 10 community managers. More bullshit.

But maybe it's exactly what we need. Someone to spend their time thinking of marketing, creating materials, sending emails and making contacts.

Forum Owner

Tuesday, July 19, 2011

Running a forum isn't as hard as you think. It pretty much runs itself. People act like you need to keep an eye on it 24/7 incase something happens. Like if someone comes and posts a thread called "NIGGER NIGGER NIGGER" – it needs to be removed within 10 minutes or the forum police shut your forum down. No, that doesn't happen, it just stays in the forum, people get excited and post in it – have a laugh, then eventually it gets deleted. No biggy.

Bullying is an issue with forums I guess. Especially forums like ours where the majority of the users are under 20. My usual stance with bullying is NMFP. If you don't want to be bullied on a forum then close the browser. Easy. If you make yourself a victim instead of accepting a bit of craic you make it a million times worse.

But every now and then it gets under my skin. On our forums we have a secret forum called the Gold Member Forum which contains some members that have been around for a long time. They feel like they own the forum.

In the GMF they're real assholes. And like typical bullies they go with the herd – if one guy is being an asshole to someone then they all have to be an asshole to him. This mentality annoys me. Recently they were assholes to this one guy over and over until it became a problem. I don't want to own a forum where that is accepted. I warned them about it, handed out bans. They're assholes to him over Steam instead – declaring that we can't ban them because it didn't happen on the forums. Because apparently we're the police and we don't have jurisdiction to punish them for things that happen on Steam, we can't use logic it isn't fair on them. It all came to a head when I heard that they were invading his Facebook account and annoying his mom.

So, what's the solution? Ban the assholes? No, I don't know much about it to know who the main assholes are, I'd have to justify who I was banning. Ban the victim? Would be rewarding the assholes behaviour, wouldn't stop it, not fair on the victim. Do nothing? It'll get worse and worse over time.

My solution is to add the victim as a moderator in the GMF and give him permission to do what he wants. Then just sit back and laugh as the assholes go crazy like it's the end of the world.

Running a forum is as easy as you make it.

Sarah, Part 3

Wednesday, March 31, 2010

I've got no moves in the car.

The 9 inch gap between the two front seats that houses the gear stick and the handbrake might as well be a mile. My moves all involve already being close to the other person. The 13 degree lean that is required for the car move is beyond my skill range.

We said good night, and she went in and I headed home.

It's about a 15 minute drive from Sarah's house. On that night, on that drive home, I already knew. Traffic lights were turning green on my behalf. This was the one. Deep down I probably knew within 10 minutes of meeting her, but the time alone had given my mind the time to process all of the data. And the result was in. I was in love.

After numerous relationships of not feeling anything real and only being in it for the sex, I finally felt something. All of my cynicism about love, gone. Everything now made sense, everything fitted.

It was slightly after 1am when I got home. I'd left her 15 minutes ago, and missed her. A clenching in my chest that I hadn't felt for 10 years.

The checklist

So, perfect woman? Lets check my list.

  •  Likes Animals (more than people) 
  •  Doesn't have any kids
  • Doesn't swear (a lot)
  • Isn't racist
  • Has a good fringe
  • Overly positive, bordering on naive
  • Either
    • Smarter than me (in some ways)
    • Artistic and therefore on another level (somewhat)
    • Stupid – but well meaning (dizzy?) (somewhat)
  • Has her own career
  • Has dyed her hair pink in the past
  • Wears hats
  • Likes pizza
  • Good teeth
  • Has a driving license
  • Doesn't wear jeans all the time
  • Knows what xbox live is
  • Likes a drink, but doesn't need to drink to enjoy herself
  • Doesn't smoke
  • Doesn't have an orange fake-tan face
  • Is about 5 foot 6 (is about 4 foot 8)
  • Weighs about 10-11 stone (about 7 stone)

That'll do me!

Sarah, part 2

Tuesday, March 30, 2010

It was half past midnight. I was home, alone. I didn't want to have a hangover so I ate a bowl of baked beans and sausages and drank tea. I had got drunk as fuck and got home in one piece. All in all it was a pretty good night. I went to bed.

I woke up the next morning to find a text message on my phone.

 
Woop wooop! I text her back, she texts me back. I have learnt from past experiences to make your intentions known as early as possible. On my second text message I asked her out.

She said yes. We agreed on the cinema. In these initial text messages I have to really reign back my sarcasm and cynicism, these are the kinds of things that are taken the wrong way unless you know me.

The night of the first date was 3 days after we'd seen each other at Wendy's party. We hadn't spoken, or met. It was a deaf date.

I pulled up at her house. It was in Wolverhampton, I didn't know the area. She got in the car and said hi and I started driving. It was awkward for all of 5 seconds. I drove to the top of the street and asked her which way I should go. She said right, but pointed left. I stopped the car and looked at her. "Which way is right". She pointed right, and we laughed.

She talked a lot. She used some big words. Words that big that I don't think they would have even fit in any of my ex girlfriend's heads. There were no gaps, no awkward silences. Everything that was said was met with agreeing thoughts and confirming anecdotes.

We watched the movie and headed home. We talked in the car outside her house for over an hour. She played with her hair a lot.

She was waiting for me to kiss her.

Sarah, part 1

Monday, March 29, 2010

Remember at the end of last year, after I'd broke up with my girlfriend I posted a blog called The Perfect Woman which described my ideal woman. The comments were along the lines of "good luck, she doesn't exist".

Well about a month after I posted that I met her :) This is going to be a proper blog, I figured I'd weite it up since I have nothing else I can write about right now.

The date was January 8th, 2010. It was a snowy day. It was Wendy's birthday party. Wendy is Craig's sister. Craig is my oldest friend and is Facepunch co-owner. I decided to go to the party because I was single and if there's one place to meet women it's at a girl's birthday party.

That's where she was. Lovely Sarah. She was the sexiest woman there. Every guy there noticed her. Buzzing around, dancing, loving it. I asked Wendy if she was single, she was. Suddenly everyone was offering to ask her out for me. It's pretty lame, but I didn't really care, I was drunk.

Pete, Craig's dad offered to ask her out. He went over, pointed to me, came back. "She ain't too keen Gaz". We laughed. He said "I just told her, my mate over there wants to know if you're any good at bowling." Pete loves his bowling, and was drunk. We all were. All except Sarah. "Nah I just said my mate over there in the blue t-shirt likes you, and he thinks it would be nice if you go over and talk to him".

It came time to go home. My plan was to end up sitting somewhere near her then slyly get the chat on. But that didn't happen. I was drunk and talking to people about bullshit, time flew. The taxi arrived and I went home. No phone number, at that point I didn't even know her name. Oh well. Probably wasn't that keen anyway.

The Perfect Woman

Tuesday, December 29, 2009

After another failed relationship (The same relationship as the last 5 failures).. I've decided to put down in writing exactly what I want in a woman. Surely there's gotta be someone that ticks all these boxes?

  • Likes Animals (more than people)
  • Doesn't have any kids
  • Doesn't swear (a lot)
  • Isn't racist
  • Has a good fringe
  • Overly positive, bordering on naive
  • Either
    • Smarter than me
    • Artistic and therefore on another level
    • Stupid - but well meaning (dizzy?)
  • Has her own career
  • Has dyed her hair pink in the past
  • Wears hats
  • Likes pizza
  • Good teeth
  • Has a driving license
  • Doesn't wear jeans all the time
  • Knows what xbox live is
  • Likes a drink, but doesn't need to drink to enjoy herself
  • Doesn't smoke
  • Doesn't have an orange fake-tan face
  • Is about 5 foot 6
  • Weighs about 10-11 stone

The Duplicator

Sunday, April 29, 2007

I didn't do any coding yesterday because I was doing real man's work, like shovelling sand and smashing concrete with a sledgehammer.


On Friday I fixed a couple of things. First off the duplicator wasn't duplicating effects properly, which was a bit of an oversight. It does now though.

I changed the default Lua SENT so that you can override the bone positions of models (clientside). This allows us to easily create an entity that can represent a ragdoll's position, without all the lag associated with moving ragdolls around.. so now the duplicator will show the ragdoll instead of a watermelon.
It's awesome how easy it is to do that stuff via Lua. Here's the code to the new ghost entity . This stuff should go out on Monday unless there are any more problems.

STALKER

Saturday, March 24, 2007

Got STALKER the other day. I got the metal box. It makes every other game look like a plastic box containing a book and cds.

I really loved the sound of STALKER when they started showing it off 10 years ago. A huge free roaming landscape. Exploring with a "if you don't fuck with it it won't fuck with you" feeling. Other STALKER AI going about their business, learning new things and giving you the information.. and all wrapped in amazing graphics.

So I was kind of disappointed to find out that it was pretty much Half-Life 1 except with only 6 maps.

First of all, HUGE ROAMING LANDSCAPE. The levels are pretty big. Lets just take a minute to establish who you are. You're some army guy. You can be shot, bitten and fall about 60 feet without dying. So it's a little bit confusing to find that you can't go somewhere because there's a 4 foot barbed wire fence in the way. Instead, to get from level to level you walk into a trigger and it asks you "DO YOU WANNA CHANGE LEVELS??", then it loads the next level.


Second of all, Exploring. I liked the idea of exploring shit. Finding stuff on corpses and trying to find out what happened to make him die and stuff like that. But it's kinda obvious that it'd be hard to make that into a game. So obviously fuck all that off. Instead have enemy guys attack you for no reason every few feet.

Thirdly, the amazing Stalker AI. Somewhere during development the amazing AI got rounded down to a few basic things :

Sit down
Play Guitar
Wonder around aimlessly on your own
Keep saying the same thing over and over again
Shout at player in Russian
So not as great as I thought it was going to be. When you're talking to people they say a huge chunk of text that you can't be bothered to read and you click on an answer. It usually results in either them giving you money or telling you to go on some mission. Because you can't be bothered to read the text you pretty much always have no idea what you're meant to be doing but there's an arrow on the radar that tells you where to go.



But there are some good points.

The weapons feel good. The tracers are cool. When you search a corpse it sometimes reveals information about where something is, that's fun.

Even though enemies will randomly respawn into areas you cleared 10 minutes ago, the world is persistent. So if you throw something on the floor somewhere it'll probably be there all game.

The graphics are kinda weird. 80% of the time you will be playing a bad looking game. It won't have any shading and everything will look kinda fullbright. But during some time in the day things will start casting shadows and it will look pretty sweet.



This game is SCARY. There's a couple of times I've had to go underground and both of them were really fucking scary. I didn't really expect it to try to be scary so it was really scary when some invisible guy started whispering to me.

It's worth getting, but pretty far from what it was hyped up to be 4 years ago.

SUCCESS!

Thursday, November 30, 2006

That went pretty well considering the amount of stuff that could have got bollocksed up. There's a few bugs but nothing that's stopping people playing.

The response seems to be pretty good. Even people with high expectations are pleased with it.. and that's all you can ask for.

If you can get past the first release it's all plain sailing from there on.

Hey modders! I made a mod, released 20+ versions of it, sold out and released a completely new version, coded from scratch, on Steam - and you still haven't even released a single version! There's a lesson here :)

Released!

Wednesday, November 29, 2006

Man I bet you didn't see this coming last week when I was posting nothing but Peep Show.

Head over to garrysmod.com or straight to the horse's mouth.

Also, if you find bugs and stuff it'd probably be best to get them organised in the new wiki.

Release Today!

Wednesday, November 29, 2006

Are we excited?

I gotta get the wiki done, and do something with the forums probably.. and probably do something with garrysmod.org to seperate gmod9/gmod10 lua mods.

Oh yeah I get a lot of emails about RSS feeds. There IS an RSS feed - it's linked at the very bottom of the page.

Oh and don't forget to diggggg anything with garry in the title.

GMod10 - Tomorrow!

Tuesday, November 28, 2006

So GMod10 is coming tomorrow!

Oh man. That could have gone so much smoother.

First the forums are slow so I decide to shut them down a 20 mins and optimize the table. Which goes well but then my internet [b]DIES[/b] and I can't switch the forums back on.

So I figure hey it'll be back by the morning they're probably doing something. But it isn't.

So luckily I manage to get onto a neighbours wireless network and switch the forums on. Then I find out that the press release went out and I have a ton of shit to do.

So I drive to town to get a new router but the traffic is jam-ragged because of all the christmas shoppers beating the crowds and it takes 2 hours for a 2 mile jorney.

So I get home and now my router works and I find that some of TEAM GARRY have disputed the fact that it was going to be released - despite that I told them last week.

And now I gotta do shit.

Back In England!

Friday, June 9, 2006

You know, America isn't as bad as I thought it'd be. Just like England with different accents.. not sure what I expected. It's good to be home though.

The hotel was much too upper-class for me. When we got in I had a huge shit and couldn't see any toilet roll.. so ended up wiping my ass with Kleenex.. only to find later on that they'd hidden the toilet roll away nicely under the counter. Doh.

Immigration into the US was a bit hardcore. We were in Newark airport so I guess they're pretty hyped about 9/11.. it literally felt like we were entering jail. The cop was shouting STAND BEHIND THE RED LINE. Then we had our fingerprints taken (on both hands), then a photo taken. If we were concerned about our privacy we could have emailed an email address. Somehow.

In all the time we were in Newark it seemed like we were like cattle - and the cops should have been whipping us with sticks to get us through the various stages. Seattle airport had a much better approach. They just put posters up of what was about to happen so you could be prepared with everything you needed. Things went much smoother.

When I got back my sister gave me this news. These are my next door neighbours. I really can't believe that people would do this shit to an old couple. I just couldn't live with myself if I ever did anything like that.

But still.. good to be back.

New Lua Implementation

Monday, February 27, 2006

I just wanted to let people know what's going on with GMod.. because it's been a while without an update and everyone assumes it's dead.. and I like to be a honest with you guys as I can.

We might be doing something awesome with Valve but they stopped responding to my emails - so I don't know whether that will go ahead.

Anyway, here's what's going on.

I've kind of started from scratch again. This doesn't mean huge changes like the jump from 7 to 8, it's just because I need to start from scratch to fix a lot of stuff that's wrong. The Lua implementation, localization, crazy text bugs. This really shouldn't take that long either since most of the process will be copy > paste > clean > improve.

The downside to this will be that a lot of the current Lua scripts won't work. The upside will be that the new Lua implementation is so awesome that you wouldn't want them to. This will all be meaningless to people that haven't played with GMod Lua - but if you do know GMod Lua you'll get a giant boner.

The big change is that entities, vectors, players, angles etc are now types. Here's an example file


This file creates 2 console commands that clients can use. They spawn a ragdoll or a prop. It's the same command that the current version of GMod uses to spawn stuff - except it's in Lua.

As you can see it makes everything a lot simpler. Here's what running the script looks like in game.



As you can see the trace function returns a table full of useful stuff.

Some kewl things to note:

Entities, Players, Angles and Vectors are actually types with methods (pseudo classes).
Players type is derived from Entities so you can treat it as an entity and call any entity method on it.
Vectors can now be added/subtracted/multiplied without special functions.
Angles now exist (they don't in the current Lua implementation).
Some C syntax is usable ( !, !=, //, /* */, ||, && ) but you can still use Lua syntax.
Traceline now takes a table and returns a table - instead of having 10 functions to accept data.

Professional Mod Makers

Tuesday, February 21, 2006

There seems to be a new trend of "Professional" mod makers at the moment. Mod developers that work on their mod for 5 years before actually releasing anything (if they ever do).

After typing 4 lines about one of these mods in a chatroom their over-zealous mod leader took the time to look up my phone number and gave me a call demanding that I do not say negative things about his mod (I basically said that I had seen the beta of this mod and it definitely wasn't going to be released when the timer reached zero, it was a dicktease).

In the 33 minute call he explained that his plan was to hype everyone up with media for a year before releasing (he made it clear that it wouldn't be released for at least year). It became clear that he didn't really have any design docs to accomplish this, but he did have cool concept art, a team of artists and some cool scenarios in his head.

He noted that one of his worries with the CS style "community involved" beta system was that they might release their first beta and everyone will think "it's a load of shit" and never play it again. Yeah, of course this is a risk, but with it comes benefits.

Hyped up single release system

  • + Hyped up community looking forward to release
  • + Internal beta - stronger community/team?
  • - Unbalanced in public servers
  • - Stagnant community
  • - Demoralised team
  • - Bored community (How much fun can you have with screenshots)
  • - Over-expectant community
  • - Release date extended because it doesn't live up to the hype
  • - First release will definitely not live up to expectations of hardcore community
  • - Constantly worrying that you've wasted your time

Classic Mod Release

  • + Thriving Community
  • + Gameplay Tweaking
  • + Faster bug finding
  • + Faster development
  • + Motivated Team
  • - First release may not be received well if the mod has been hyped
  • +- Can tell if you're wasting your time almost immediately

You see, with the classic mod releasing method the first release is a base. Any releases after that are really appreciated by the community because it's an upgrade - and people love upgrading stuff. People will be more likely to join your community if it's going somewhere and they have something to look forward to.

That's why CS grew from what it was to what it is. They didn't try to compete with any other mods and hype it all up. They just added new stuff and people loved that. New weapons, new maps, new scenarios. The guy that phoned me said that the CS way is dead because gamers are fickle now. I don't think that's true, GMod proves it isn't. The first GMod release was just a simple base that I built upon, if I didn't use the CS method it would only have half the stuff I have in it now (with 5x the bugs (yeah, 5 million bugs)).

If you keep stuff locked up and dicktease your community they will get unrealistic expectations that you will never be able to fill - and it will all end up in tears.

Update 1: PM on IRC from 'Mod Leader X' demanding the removal of this blog entry
Update 2: 3 Missed calls on phone from 'Mod Leader X'

Grey Hair

Monday, January 30, 2006

I found a single grey hair on my head yesterday. Well it was less grey and more pure white.

I'm only 23, should I be getting grey hair already?

GMod Open Source

Monday, January 9, 2006

Nothing spectacular is happening.

On the GMod front I was considering making it open source - just to see what would happen. But then decided to just get more coders working on it. I can't dedicate the time to it that I used to (My new year's resolution is to finish Facewound) so it's probably a good idea to get one or two other people working on it to keep it rolling. So I'll probably be trying this over the next couple of weeks with one or two people that I can trust.

On the Facewound front it's pretty much the same. Still stabbing away at it. I'm writing a GUI system similar to Valve's VGUI to be used for the game's options screen (and probably other stuff if it's good enough). I had looked at a couple of other solutions but they either didn't work or were rubbish so I started my own. I'm trying to keep it pretty generic and clean so I can use it in other projects without totally re-writing it.

I added a couple of new things to the forums. First of all I added "community banners". An idea totally stolen from SA. Basically advertisment banners but less useless because they're more relevent to the community. This usually results in more clicks too since there's less of a tendancy to completely ignore them. The community seems to be having fu with them so far anyway. I was also pissed off with people saying 5/5 and >>>>5<<<< and YOU GET A 5!!! in every thread so I made it show the user's thread ratings.

PSP Problems

Saturday, December 3, 2005

I bought a PSP a while ago. I have GTA:LCS which seems like a really fun game.

I only have one problem - my hands are too big for it. I can't hold it right. My fingers cramp up after 10 minutes and I have to stop playing.

More FW Animation

Thursday, December 1, 2005

With the leg animations being a huge success I moved onto converting the arms to use the same system. This has been a pretty big job because I had to convert every weapon to use it. But it works and looks a lot better.

One of the big constant complaints when I showed FW to people was that the main character was really rigid. This has gone a long way to fixing that.



Oh yeah, and new site design!

Snakes

Sunday, November 27, 2005

DEADBEEF messaged me last night with a LUA script for GMod 9.0. I tried it this morning and was pretty amazed with it!



Once again let me emphasise that this is completely serverside. Clients don't have to download anything. You could literally join a server and out of nowhere be in a completely different game like this.

I'd like to put this in 9.0 but I don't know how we'd do it. I'm sure he'll release it when 9.0 is out anyway.

Facewound Update

Friday, November 25, 2005

I haven't updated for a while regarding Facewound. It's really falling into place now. Everything I hated previously is getting done.

This week I added a skeletal based animation system, because none of us can animate sprites but Podunkian kindly offered to animate it if I made a skeletal system to his design. So I did. And it's turned out amazingly. I really wished I'd done it a year ago.

I'll probably be converting most major enemies - like the zombies - to use the new animation system. I'd be stupid not to.



(I know this picture is going to break the design but fuck it)

Lost

Wednesday, November 16, 2005

SPOILERS ALERT!

Everyone was going on about Lost and how great it was.

So I watched it from the start. I was watching like 5 episodes each night. It's really awesome and really gets you addicted. You're thinking ok, so they're making camp, it's getting kind of boring. Then all of a sudden it's like WHAT, HE WAS IN A WHEELCHAIR!!?

One of the best bits for me was when they were counting people on the island and comparing it to the flight's manifest.. which led them to find that one of the people in their survivor group wasn't actually on the flight. I actually shouted "oooh shit" out loud.

So yeah, I can see why people like it. I'm thinking about getting into Arrested Development next. It seems pretty funny from the few episodes I've seen on ess.tv.

Superman

Saturday, November 12, 2005

In one Superman movie (the originals) Superman became a mortal so he could bang Lois Lane. Before becoming mortal he was told (by his mom I think) that he could never return, he didn't care, he was really horny.

About 10 seconds after the deed he realised that being mortal meant that people would be able to kick his ass. So he somehow managed to get back to his fortress of solitude in the north pole and changed back into Superman.

How did that happen?

GMod Text Corruption

Friday, November 4, 2005

Ok so it seems that the client.dll I released yesterday doesn't fix the problem.

From what people are telling me this bug seems to be mostly effecting Radeon cards. I can't reproduce it on my Nvidia.

I'm planning on releasing a patch over the weekend with a few changes that may have fixed it but I can't be sure as I haven't found any obvious reason for it to be happening.

GMod 9.0.1 released

Monday, October 31, 2005

Phew, I released a quick fix patch yesterday to fix a few of the most common problems.

Among these was a base NPC fix which makes the friendly NPCs a lot more friendly. They follow you, talk to you and cry when you die!

GMod 9 released

Friday, October 28, 2005

You probably already know, but it seems weird not to mention it here.

Release went pretty well. I used CoralCDN to distribute the download - which seemed for the most part pretty good. There were a couple of problems with slow speeds but apart from that it worked pretty well, and used none of my bandwidth!

I joined a couple of servers and people seem to be having fun. I really can't wait to see what people come up with once the predictable "SUM1 MAEK ME A DEAGLE FROM CS PLZ" shouts have died down.

Anyway, Download GMod 9!

Gmod 9 Release Date Update

Thursday, October 20, 2005

Can you guys see why I haven't announced release dates before?

A lot of you seem to think that GMod 9 is finished and I'm just waiting until a specific date until releasing it. This is BOLLOCKS. If it was finished you would be playing it. There's still stuff to do before I can release.

It will likely be on a weekend, possibly on a friday night. My best estimate is the 28th of October. This should give me a week to bugfix/add gamemodes/clean code/finish stuff/compile linux server.

Note: Although this is just an estimate, something will have to go really wrong if it's not released on this day.

Black & White 2

Monday, October 10, 2005

Development of everything pretty much stopped for 3 days since I've been poop socking over Black and White 2.

I really loved the original Black and White. It seems like everyone I mentioned it to says it was overhyped and was a peice of shit in a box - but I never got any of that hype. I hadn't even hear of it until my friend gave me a pirated copy (Calm down! I bought it eventually!).

There's a lot of changes from the first version. Your creature has less character. By that I mean he disobeys you less. He's more useful. It actually shows you what he's thinking, what he's doing and how likely he is to do it again (based on your interaction). Which is awesome because I never wanted a cyberpet anyway, I wanted something to help me out. Lets hope they don't come out with another rock throwing island expansion based on creatures.

In the game itself the object is to take over cities and win the hearts and minds of all the people on the island. You're not fighting againt gods this time around - you're fighting against human leaders. You can capture the people in 2 ways. Either get an army together and invade their town (Political), or you can build up an awesome town until they're so impressed that they want to settle and move into your town. Black and White.

I managed to beat it using only the impress method. In fact on a lot of the islands I had no army at all, just big fucking walls.

More 8.4 gamemodes

Sunday, September 25, 2005

I had a pretty good weekend of programming considering the flu I've got. Here's a run down.

First off I fixed a few bugs that Valve's latest patch caused with the modcache. Second of all I started a Nine Tenths gamemode script. It works pretty fine, here's a picture.

The HUD graphics are applied by the server. The server can draw any materials that the client has.. so if you're making a new gamemode and want to put graphics on the HUD all you have to do is include the materials inside your map's BSP. It makes good sense to put the lua script in there too so it's all in one neat package that can be completely downloaded from a server.

Then I started a new game mode. Melon Racers. You basically drive a melon around a map. I did a quick test and started a server and people joined and it was fun. Being a melon adds an extra challenge since if you go too fast and hit a wall you explode. One of the great things about Lua is that when you're editing your gamemode you can have a server with people on it and change the scripts in the background. You don't even have to restart the map. Anyway, here's some shots of what went on.

We changed the map to gm_construct and I was the only human. Everyone else were melons. As you can see from this shot the player melons are like real props. The players just control their velocity. The names above their heads are defined serverside (font, colour, offset).

I thought this was pretty cool. I told them to drag him underwater but they needed to use teamwork to get him there..

And finally.. melon players vs headcrabs. They can kill the headrabs by running them over. This opens a space for a melons vs humans gamemode - with a deadly melon leap attack.

So yeah. A pretty great weekend of programming. I really can't wait to get 8.4 out to see what people make - there's tons of possibilities.

LUA (the programming language)

Thursday, August 18, 2005

So I started playing around with LUA. I want to use it in Facewound for enemies to make things easier to edit without compiling.

For anyone that doesn't know, LUA is a scripting language. It's awesome because you can edit it without having to compile or restart the application. You just load the script again and the changes are reflected straight away. This makes a lot of sense to me. I think the enemies and maybe entities in a game engine should be external and should 'plug in' at runtime - just like graphics and sound. They should be an asset rather than something hard coded in.

That said, I've integrated it into GMOD. Which makes it REALLY awesome for modders and server admins. For example, to freeze every player on a server you could make this function in a script called "garrysscript.lua"

function FreezeAll( )

    while i=0, maxplayers do

        Player_Freeze( i, true )

    end

end

Then in the console you'd load up the script with the command I added "lua_openscript garrysscript.lua". So now that function is added to the engine and anywhere in the game (or in a script) you can call FreezeAll() and it will freeze all players.

So you're probably thinking, what the fuck use is this. I'll show you what's going to happen in 8.4. There's now a file called gamemode_default.lua. This contains functions that apply the normal deathmatch gamerules. Things like adding kills to the scoreboard, choosing spawnpoints, going to the next map when the current map ends etc.

Now we can add new gamemode_ scripts. You could say add one that would make it so the game happened in 3 minute rounds and you lost points for killing. You could add a mode where one player was invisible and did 10x more damage than everyone else. You could even add a mode where each player takes turns and gets 10 seconds to move. There's a lot of possibilities here.

This makes a lot of sense to me. I can't understand why Valve didn't add some kind of scripting language like this in from the start. It would have saved them days of testing and recompiling. Plus it makes modding a shit load easier.

Anyway, here's some screenshots of what I've done so far.

New System!

Friday, July 22, 2005

I've changed blog systems! The old one was obviously a rip off of this one.

Damn, every design sucks. Every single design.

Oh well.

Dee Dee Bam

Sunday, October 5, 2003

Quite a bit has happened but I haven't updated my site due to me being lazy. First of all I'm swapping ISP's soon - going from BTOpenworld to Nildram. BTO wasn't so bad - never had much downtime from them, but nildram are 10 quid cheaper - and I hear they have a good news server (which means that files are actually complete). They also offer 2mbps - which is awesome and I might go for.

I bought some 5.1 surround sound speakers. You don't really notice it for a while and then it hits you. I was playing The American Army Murder Simulator and i was running on some cliffs and i thought jesus that planes low and then I realised it was coming out my speakers - its fucking awesome. And the bass on it is sweet as a fucking nut.

I'm having trouble with my game not working on Windows 98 (and all its offspring). So I download virtual PC and windows 98, I install them both. I go to play my game and O. It doesnt support Direct3D so that was a big fat waste of time. So now I've got to either install it on a partition on this computer or my laptop or find some way of making it work.. It's a giant cyber kick in my giant real balls.

Vice City PC. I've pre-ordered it and it should come around the 20th (which is my birthday). But BAM! Vice city is warezed, the warez scene is going fucking crazy - 2000 peoele in one room hammering xdcc bots until they're flooded off the fucking internet. But I'm still downloading it - why? Because I wanna fucking play it you twat.

So to sum up - 5.1 is cool, win98 sux, vice city is cool, and there might be some downtime on the 21st because I'm swapping ISPs.

Steam Launched

Saturday, July 12, 2003

So steam just launched, grab it and play games for free! click here to download steam you FREAK. I used to be good at cs but now i'm shit. I'm still better than the majority of people out there though. Play DoD more nowadays, seems to be a lot more teamwork than in cs now. And I pwn at it!!

added a link at the top to the nerd thing because it's useful for us nerds, and I added a link to SnaBB0 highscores, and on that highscores page u can download the Latest And Greatest version of snabbo.

I haven't done any work on snabbo for a while. I'm trying to learn 3d math and all that shite so i'm not stuck making shitty 2d games forever.

I think that's everything. yeah it is bye


I PWN J000000000!!!!!1111 one one one nubs

Driving Test

Thursday, July 10, 2003

Yay! I booked my driving test - got it on the 1st of October.. If my driving instructor is ok with that date anyway. I'm pretty awesome at driving now - only problem is with the reversing around a corner which I always manage to totally fuck up.

Bought a book from amazon about game programming! God I'm a nerd.. But we already knew that - this just puts a line udner it. Anyway its massive and good.

There was something else but I forgot. Oh yeah. Oh no it wasn't that.

fuck it

Updated Game Test

Saturday, April 26, 2003

I did a bit of work on sorting office today. I'm determined to get it into a reasonable stage so I can just call it finished. I need to add some kind of game over screen and a title screen. Options I want to add are a next track/mute/play thing in the bottom right and some kind of point (like being able to complete the game. Maybe a high score thing.

Anyway, a couple of updates in this release. First is the exlosions work differently, when one is blowing up its lens flare is bigger than the rest. All the other tokens and the background go darker too (this is physcological, it makes you see the explosions as lighter). Ive also added a simple motion blur, this is basically just not clearing the background and blitting the background gfx with alpha set at 50%. I also changed the gui gfx - since I really do suck at that I think I'll leave them like this. I added a timer although it does nothing but go up and down. You get more time when you make combinations, when the timer reaches the max capacity you get 10 points.

click here to download.

requires directx 9, email me here.

Driving lesson and NS

Tuesday, November 5, 2002

So I had my driving lesson today and he was like 'OK now we're coming up to a dual carriage way - so the speed limit is 50mph here' and i was like 'FUCKING SOUND!' but didn't say it.. So were driving along and he's like 'OK, Now change to 5th gear - its UP and ACROSS' and I'm like 'hehe, ok'. So After the 4th attempt I found it and I was like HEY LOOK AT ME NNEEEEOOWW! I only stalled about 5 times.. Fkn traffic jams.

So I started playing Natural Selection.. and I was like WTF this is BS, its impossible to take down sentry's and everyone joins marines its fucking stupid POS FUCK THIS MOTHER SHIT CUNT. Then yesterday I joined a server where these guys were just learning how to play it - they were all on a LAN somewhere and I was the only one who wasnt there.. and I learned how to play the game and now its sound as a pound - safe as houses. I play aliens and im like WHAT U FUCKING LOOKING AT and bite the faces off everybody

Poor Titch

Wednesday, August 7, 2002

Had to take my dog to the vets today following a 4 day orgy of vomiting, diareah with blood in it, falling over, not eating and dehydration. They have to keep him in overnight.. I have strong doubts that he will be coming back to us.. :'(