Making a simple RTS game – Week Two

So week two has gone relatively well, I didn’t spend as much time working on the game as I would have liked, it’s hard going from programming at work to programming at home every day. However I persevered and at least made some progress.

I ended up making a map since it was hard to try develop controls and camera without having anything to see, I found out about Tiled which is a free tile map editor, very easy to use. Not wanting to waste my time on trying to create graphics (and hating whatever I ended up making), I browsed /r/gamedev for some free assets to do for the moment, turns out this Kenny NL guy has some amazing stuff for free up there. I ended up going with his ’Topdown shooter pack’ as it seemed visually appealing to me.

Next step was figuring out how to get the cursor (arrow) keys to work as input, once I figured out how to do that I set those keys up to handle the camera movement. That was easy enough.

After that I wanted to deal with the mouse moving the map when near the edges of the screen, that proved a little more difficult, but not too bad.

My main achievement for the week (and the hardest part) was having the mouse create selection boxes, as you would in Windows etc. This will be used later on for selecting units & buildings. This proved more problematic as I first started out using the built in Phaser Rectangle Object and setting the (X,Y) to the point where the mouse was clicked and having the (width,height) update to where the mouse is before the left click is released. The first issue was my map is larger than the actual screen so it would not work once you scroll. Not helpful, luckily I then realised I could just add the camera.x and camera.y positions to my initial (x,y) points, and it is all good!

Lastly I realised that I shouldn’t have used the Rectangle object at all as the only way to fill that is by using a debug function in render (not what I intended), so I ended up having to switch that over to using game.graphics instead.

Also as a note I started making the UI for a mineral count in the top right (thanks Game Icons), doing it in jQuery as I couldn’t figure out how to do graphics on the screen at the time, but after going through my selection box stuff I now realise I need to re-do that part.

I’ve come to realise some things are going to be more complicated than I anticipated, for instance implementing a mini-map I am kind of dreading. However overall working with Phaser has been great, there are lots of resources out there and the community in both Slack and IRC are very helpful.

Here’s a crappy video of where we are so far:

I’m unsure if I will have enough changes to do a Week 3 next week as I’m currently in the process of finding a new place to live in London and it’s a whole insane experience itself, very time consuming, very tiring and very depressing financially. So week 3 might be on the 23rd, we’ll see!


Posted on September 09, 2016

Making a simple RTS game – Week One

So I’ve decided I want to make a game again, nothing crazy just a simple RTS game, browser based (mainly for speed of development and that I’m interested to see what it’s like), I’ve decided I may as well blog along the journey to keep myself motivated and prevent quitting mid-way through.

I might also do some videos & live streams as we get closer a prototype and there is actually something interesting to watch me doing rather than researching things. So watch this space.

So far stack wise I’ve decided on using the following tools:

  • Phaser.io – Open source HTML5 Game Framework
  • Socket.io – Real-time bidirectional event-based communication.

I need to find a tool for making tile based maps, but I’m not too concerned about that right now, I’d prefer to start with controls, units and economy before jumping into anything too graphical and getting demotivated.

I think plan wise of order of doing things will go like so:

  • Controls
  • Camera – Camera movement etc.
  • Units – basic movement and control
  • Economy – basic income system
  • Unit Types
  • Unit Attacking
  • Map – singular
  • Game State – Playing, Game Over, Winner etc.
  • Lobby System – Find Game etc.
  • Chat

I’ve probably forgotten some thing’s but that’s just a kind of overview for now, I’ll probably make a Trello board and share that at some stage.

Graphics wise I’m worried, I’m intending on the graphics for the game to be super basic, probably just spheres initially, if I am actually enjoying how the game is progressing I’ll either put myself through the pain of trying to do graphic design or (more likely) pay someone to do it for me.

Anyway that’s all I really have to say on this for now, I’m going to try do weekly updates if not bi-weekly. Hopefully motivation will stay with me!


Posted on September 01, 2016

My thoughts on management & time tracking

manager-time.jpg So I’ve talked about time tracking before , however that was much more a “Keep yourself on track / how to know what to bill per hour as a freelancer/contractor”. Today I’d like to share some thoughts on bigger companies and my feelings toward management and time tracking there.

I’ll preface all this with ”these are my opinions, I’m not saying I’m entirely correct here, this is just how I personally feel“.

As a programmer I love my craft, I spend hours playing around with new technologies, learning new languages and wrapping my head around computer science concepts. I’ve always known programming would be my career from a young age, finding it amazing that people would pay me to do what I love to do anyway.

What I never realised back then is how much of a programming role involves no programming at all. Meetings can be a daily occurrence, eating into your time, understandable though as things do need to be decided on/signed off. Managers need you to explain all sorts of stuff to them so that they can sound informed to whoever it is that they report to. Clients want you to explain why you can’t add five new features by next week. Customers want you to explain how to use things (and occasionally need you to fix things).. Priorities must be juggled.

All of the above I don’t really have an issue with, they are mildly annoying but to be fair, necessary evils.

What I do have an issue with however is time tracking on top of this in large organisations, usually so your manager can have some form of chart showing what their team have spent their time on the last few weeks. Of course this would all be possible without disturbing the programmers workflow at all (since we all have issue management systems) but the word “granularity” starts getting thrown around and the next thing you know you’re now in JIRA logging hours on tickets trying to justify where you spend every minute of your day.

I honestly don’t get it.

I feel as a developer getting told to do this makes you feel that you are not trusted to manage what little time you have to do programming yourself. That you’re possibly under performing and need to work harder. Or that your time isn’t as valuable as the managers time. All in the name of a granular report that probably gets a courtesy glance at and then binned. It definitely doesn’t create a happy team environment.

If you haven’t read Programmer Interrupted , I recommend that you do, but I’ll just include the results of their study here:

  • A programmer takes 10-15 minutes to start editing code after resuming work from an interruption.
  • When interrupted during an edit of a method, a programmer resumed work in less than a minute only 10 percent of the time.
  • A programmer is likely to get just one uninterrupted two-hour session in a day.

These are the problems that management should be trying to solve, not trying to interrupt a programmers time further by requiring that they log each and every hour that they’ve spent on each feature.

Another great article that discusses how programmers see time different to managers is the Makers Schedule.

Where I currently work (Kobas) actually deals with all of these things I’m complaining about very well. For a start there is no time tracking (making me very happy), we have a daily slack stand-up (i guess its more sit down?) where we give a few sentences of what we worked on yesterday and what we plan to do today. It’s very helpful for knowing what other people are up to without wasting time doing an actual stand-up.

Interruption wise at any point i feel I need to have an uninterrupted session I can pop in my headphones and unless something explodes I never get interrupted. Meetings for me are rare but when they occur they have an actual purpose. Developers != Support leading to less interruptions, of course I have to fix problems that come up from support but I’m not personally being interrupted by support requests.

So its certainly possible for companies to function well in these ways, why more big companies are not is beyond me.


Posted on August 29, 2016

First month at Kobas

Image of Kobas team meeting

So I’ve been working for roughly a month at Kobas now, I think things have been going very well and I wanted to highlight what I’ve been working on for the last couple of weeks.

For anyone that does not know what Kobas does, it is a hospitality management solution covering; stock control, rotas, HR, EPoS, customer loyalty and much more. It’s actually a very useful piece of software for clients, allowing them to gather lots of data from all areas of their business and providing a cloud interface that outputs that data in fancy reports. After seeing it in action I find it very surprising that not all businesses use this as it can really help you to increase your profits and avoid wasting money unnecessarily.

Anyway, on to what I’ve been doing, I’ve been mainly working on the EPoS (Electronic Point of Sale) side of things, which in layman’s terms are the Kobas tills.

To side-track just a little I think the Kobas tills are so nice to look at and use, here is an example screen from one:

Image of a Kobas EpoS

When you take that in comparison to a result from searching EPoS on Google Images (and what most places use):

Image of a generic EPoS

Bit of a difference there right. So unfortunately now I have been burdened with the curse of noticing every single EPoS system every place I go and thinking to myself, “how do they use this?“.

Anyway back to what I’m doing, basically I’ve been working on adding the functionality to accept deposits and other payment types to the EPoS. The EPoS accepted cash, card and voucher when I arrived, which was all you would really need basically.

But now with Christmas getting closer venues are going to be taking deposits for bookings and we wanted to be able to handle that within the EPoS itself.

Also with the rise of services like ‘Just Eat’ etc, venues are trying to figure out how to process payments from those services, as it’s not really a cash payment as you don’t have the money in your till and it’s not really a card payments as you haven’t put it through your card machine.

So with that in mind we also decided to create “Other payment types” which allow businesses to just tell us what other payments they want to accept and we are able to quickly add that functionality to the till and have it display in all relevant reports.

Our product manager Daisy Lang has wrote about it in much more detail over here.

Adding the ability to accept deposits and other payment types went well but I did encounter a few difficulties while doing it, for a starter constantly worrying about breaking the tax calculations (and having forgot how UK tax works).

Luckily I found a very edge case unit test wrote by Neil Mukerji (our CTO) and after converting it over to use the new version of the payment objects I was delighted to see it was still passing as expected.

Naturally I then decided to write a bunch more unit & functional tests, I’ve been on the Codeception train lately, after getting introduced to it at the end of my role at UBC and I’m determined to get it set up properly in Kobas so that moving forward refactoring and changing code is much easier (and less stressful). I’m hoping to get all our tests into Codeception shortly and add them into to the Jenkins build for automatic testing on deployment.

Also shockingly (due to not having it in my other roles) there is a whole QA team at Kobas, which has been a total life-saver for me. Actually having someone QA features you’ve added is unbelievably helpful as when you’ve been working on something for so long it’s easy to miss things.

Anyway that’s all I have to talk about for now, I know what I’m doing in the coming months but I’m not going to mention that here, but stay tuned, interesting stuff is coming!


Posted on July 03, 2016

An honest review of the Surface Pro 3

surface-pro.jpg

I bought a Surface Pro 3 in November 2014, I haven’t wrote anything at all about my thoughts on it since purchasing it, I figured it was better to wait until I had actually been using it for a significant amount of time and give it an honest review. A year and a half I figure to be more than enough time.

So this post is going to be structured in the following way, condensed Pro/Cons. for you speed readers and then just my personal thoughts on things I’ve come across while using the device.

Pros

  • Amazingly portable, very light and much easier to use on your lap than a traditional laptop.
  • Can run pretty much all software, Photoshop, Jetbrains products, Office etc all work well.
  • Can run certain games, Hearthstone works great, older games like Warcraft aren’t an issue. Processor heavy games like Starcraft II will work but become extremely laggy when lots of units are out.
  • Touchscreen is very satisfying to use for browsing the web etc.

Cons

  • WiFi is a complete joke. Sometimes after resuming from sleep you won’t have WiFi anymore. I’ve had the WiFi just completely disappear on me and ended up having to wipe & restore the entire device.
  • Overheating is a serious issue, even when running just a browser the surface can become incredibly hot, some people are combating this by having an external fan pointed at the device.
  • The chargers connection to the Surface is pretty much the worst design ever. Unless you constantly make sure it’s not bending in any way whatsoever prepare to replace your charger every 6 months. The chargers are not cheap either!
  • You constantly need to change the scaling of the resolution depending on what you’re running. Coding in an IDE scale up, games scale down. Changing scaling requires logging out and back into Windows, kind of awkward but could be worse.

Well that’s the basic pro and cons down, now lets get into why I actually bought the Surface and my personal feelings on it.

I bought the Surface because I needed a semi-powerful laptop that I could bring back and forth to work, having never owned a tablet the idea of the Surface appealed to me, being both a laptop and a tablet. I was not looking for a gaming laptop, but a laptop that could at least play some games. Mainly I needed a laptop that would allow me to do programming, wherever and whenever.

Success wise, portability worked out as expected. But I will say you really have to consider when buying the Surface for that reason how often are you going to be using it in that fashion. When I actually use the device on a table, I always get the feeling that I would be better of using an actual laptop. I do however find the tablet aspects of it nice, just being able to disconnect the keyboard and have a powerful tablet for browsing the internet or playing touchscreen games is very nice.

Failure wise, I have no idea what the WiFi’s problem is half the time, it’s extremely frustrating to have to deal with it disappearing completely. I’ve tried a bunch of solutions on Google and there really isn’t any set answer to it, sometimes simple fixes will work, other times you have to wipe and restore the Surface completely. It’s without a doubt the biggest downfall of this device. The power cable is also a real nuisance to deal with as mentioned above. Another point is like every other device the battery gets worse over time and since there is no way of replacing the battery in the Surface your only solution is to buy another one.

So overall I would rate the Surface 30/42. I’m not entirely satisfied with it and I certainly will not be buying another one. I think it would be more suited to journalists or perhaps artists who would make more use of the pen.

If I could time travel and talk to myself before I bought it I would be telling myself to either buy a Lenovo or a MacBook instead.


Posted on June 11, 2016