There’s not a huge amount to see in this update as most changes are behind the scenes or still needing some tidying up before being showcased.
The way the inventory and tasks worked together was somewhat flawed when adding a task which had requirements. The issue was that it was checking the current item quantities instead of what the runner would be carrying at the time. The solution was to create a ‘potential inventory’ system which would calculate what a runner would be carrying at the time of the task if all previous tasks had been completed.
A simplistic dialogue system has been added, only for the tutorial at the moment but now it’s in place it can be used elsewhere it’s needed. The tutorial itself still needs to be updated to be more informative, currently it just tells the player the items they need to complete it but I plan to change it so it explains the UI as well.
The majority of the map updates are still a work in progress but in the mean time I’ve added a new building type, the tavern. The tavern allows you to hire more runners and therefore allows you to perform multiple tasks at once. A few more random houses have also been thrown onto the map which at this point purely act as locations to receive quests.
The main update for this version is adding an info panel for the runners and locations. It provides the player with additional actions including centring the map on the selected element, creating a task for a runner from a location and opening the runner’s inventory.
The above show what will appear when a runner is selected, the icons are an image of the selected runner, the tasks button and the inventory button. The sizing and position still needs a bit of tweaking as you may have guessed. You’ll also probably notice that the runner has a different appearance too. The core method for allowing different skins is now in place so you can easily identify which runner is which (when you can finally have more than one)
I mentioned the inventory earlier which has also been put back into place but it’s currently being scaled so the text is a little blurry
Another important addition for this version is getting the saving working again which required a complete remake for the GDX infrastructure. Like before the gdx update the camera position and the runner data is saved.
The most visible change made this week is another one which hadn’t been implemented in the original version and that’s background animation on the map. This is really another reason why it was decided to move over to gdx, although possible with the original version it would have been time consuming and gdx has made it a breeze to get working.
Another change which is being worked on is adding landscape orientation support. The original version was purely portrait and adding landscape was always an afterthought but being that the UI is being rebuilt anyway, it’s the perfect time to get it plumbed in.
The rest of the development has been migrating elements from the original version into the new. A slow gradual process.
You’re probably wondering why after the previous posts about the runners game we’ve landed at version 0.0.1, well there wasn’t any sort of versioning before and it’s being remade to a degree. The way the original version was put together made it very difficult to implement zooming on the map. Because of this, zooming was one of the first things to be put together in the new version.
It was also made with my own implementation of OpenGL which was still pretty buggy so I’ve decided to switch it over to use libGdx. Now the new map is working the way I want it to I can start merging code over from the previous version.
There’s just a couple of new things to showcase after all this time which are the inventory UI and scrolling support. A fair amount of work was put into the tutorial but has been put on hold for the time being.
A bit more map work has also been done to start planning the position of additional locations.
The bulk of the progress made this week is with the UI. I’ve completely remade it all to use a base display to keep it consistent for each view. I’m not too happy with the buttons and there’s a little bit of a stretching issue but the new changes will make updating this in the future much easier.
Other updates include creating a dialogue handling system for displaying multiple strips of text which will be used for the tutorial and quest information. Hopefully this will be finished next week
Over the last month I’ve been revisiting the Runners game and quite a lot has changed since the last post a couple of years ago!
The first big change you’ll notice is the tile set has been swapped out for a brand new one. The new tiles blend together better than the old ones and will allow more interesting environments, they generally look a bit better than the last as well.
Under the hood
Now this is where the majority of the recent changes are so I’m gonna break it down a bit:
The graphics are now being rendered with OpenGL which will help with general performance and allow some advanced graphical techniques
The UI originally was a mash up of Android components layered on top of the map canvas which was a pretty nasty way to do it. It’s now been completely redone within OpenGL to make it more fluid.
The quest system has been completely rewritten to allow different types of objectives to be part of a quest and to give prerequisites to each objective if required
The map outline has now been completed so I can finally start concentrating on the actual layout and finer details of the map itself.
I've also finished the import from Pyxel Edit into the game and the video shows a quick device recording so apologies for the jerky movements. You’ll also have to excuse the black right border, it’ll be covered by UI so it didn’t need to go to the edge of the screen
One minor issue which is going to annoy me is there's a small line between each tile. This is a pixel or so from the Java bitmap selection functionality I'm using to get part of the tileset onto a Sprite. Not a huge issue, it's just going to bug me til it's sorted.
Up til now I’ve just been developing on a testbed 20×20 tile grid. This has been fine for testing but I wasn’t sure how well it’d run with the real map size of 254×212.
Method #1 – one big canvas
The original method was using one big canvas and drawing each tile to it which was fine for the small number of tiles used for testing. For the final number of tiles however resulted in instant failure due to bitmap size restrictions. I had considered using multiple smaller bitmaps but went on to trying the next method
Method #2 – individual tiles
The second method was using a separate sprite for each individual tile instead of one giant one. This had marginal success as in it didn’t fall over instantly. Instead it was just horrifically slow and made the game unusable. I spent quite a bit of time diagnosing bottlenecks and trying to speed things up. The main idea was to stop rendering all the tiles which were off screen but there was still the overhead of the tiles existing in the first place. This led me to come up with the final method
Method #3 – reusable tiles
The final method came from the idea: what if I didn’t need all the tiles created at once, all I need is enough tiles to cover the screen then reuse them when they’re out of sight. So now if a tile moves too far to the left and off the screen, it redraws and repositions itself to be the next tile on the right.
In this example, there’s only ever 80 tiles (8×10) yet I’m able to create a map of all 53,848 tiles with minimal overhead.
Over the last few weeks I’ve made a little more progress on the map but most of the time has been spent on the code base. Map-wise I’ve continued working around the map to get the edges in place and started the rough placing for a mountainous path (the swirly bit).
Code wise I’ve been reworking the tasks to allow building up a task queue so you can set your runner to do multiple tasks without interruption. They still need the option to view active tasks as well as remove or edit them.
I’ve also added in basic Quests. They’re randomly assigned at the moment but I’ll add in some structure later on. They’re automatically assigned upon reaching a location and they have a requirement of delivering one or more of a specific item. You can then assign the task to a runner to deliver an item if the runner have it in their inventory.
It’s all pretty rough but at least progress is being made.