Choose location? More like choose your error part 2

Hahaha well thought it was over hey, well guess what the next step also caused more errors.

So this started with trying to get the ID from the database of the item that the user clicked on the list. Now i thought this would be simple, get the item clicked, its position and then get its ID. Well that was silly, the ID was the ID which represented where it was in the list. What a doughnut, ey? Well I soon learnt and grabbed it from actual array list that was holding its details and then by using the position on the list, I grab the ID that belongs to the selected item. Not that tricky but soon learnt.

Next issue was the filtering down of the bars shown on the map after the user had chosen a town, this I thought was easy, save the chosen location ID and compare it to all the LocationID’s that the bars belong to and then only show them. However this became a bit of an issue because without realizing it I was comparing it to the bars actual ID and not the LocationID in which it was associated to, simple mistake but one that was quickly fixed.

Next step was filtering down the list when a user types in the searchview so that its easier for them to find, which came with it’s own set off problems, main one being that ultimate question of of the hell do I do that? Well he’s a good (but long winded) answer. First my initial problem was that in other parts of the code I has made a “searchItem” variable of the MenuItem class which works well for the ‘setOnActionExpandListener’ which is needed for expanding and closing the search widget in the action bar. So with this in mid I searched through all the different features that the MenuItem class could do in hope to do some kind of filter. That didn’t work and then I searched gogle for it and amongst a few searches I realized that the issue was the MenuItem is generic and isn’t just for the search widget (yes I should have guessed from the start…but…well I didn’t and I soon did). Therefore to fix this I create a new variable called ‘searchView’ of (you guessed it) the SearchView kind and found the ‘setOnQueryTextListener’ and my day was saved. By then filtering the adapter to the text in the searchview I got it fully working.

The issue I have found now though is that when I refresh the map with the chosen location it still loads where the user is and they have to zoom out to find the city and bars aware abouts. Therefore my next plan is to do a check on whether this load is with no location chosen or with and if there isn’t one I’ll load it normally, however if there is, then I’ll load it in the area requested.

This can wait til next time however as I feel a nice little break is required 😛


Choose location? More like choose your error

So recently I have been attempting to create the option for the user to choose the location of where they wish to see deals from, one so that the app doesn’t show every single bar but also the user might be gooing on holiday or a day trip/night out to another town/city and want to pre plan. This will be done by typing in the action bar search view and then from the list, select the town they want. Sounds easy right, well……

So the initial part was easy, first of all I’ve got to grab all of the locations from the database and pull them down to the app, Okay that bit was easy as I’ve done it before. The hard bit was finding out how to create a searchview with a listview and theres not one tutorial online I could find that has the search being done with the actionbar. Why the hell is this not a thing? Therefore I’ve found a tutorial where they used a normal searchview on the apps page and I’m slowly manipulating this to work with the action bar.

First a lot of errors were due to not knowing if this code would do so or not, which as you could imagine lead to lots of messing around and changing/chopping up code. I formatted things to my way of coding which doesn’t always work as I hadn’t done this before so I soon had to learn a new way of doing some things. So after screaming at the code why it didn’t work, it did eventually and that’s when the next one appeared.

Another error was that when I was using the on click code from the listviewadapter t even just refresh the map it caused a Null error amongst others. This though was thank fully fixed by having learnt that a similar bit of code can be used on the main activity itself, it took longer than I would like to admit when it came to finally finding the fix, however it got fixed and I’m glad it was.

There were a few more to but luckily they got fixed and now to move onto the next part which is when an item is clicked it will refresh the map and filter it down to only the bars in that town

Minor Update

Today I’ve only done a small piece of work on BevNav and this small update is that now the application pulls more data from the database, this time the offer available and then searches through and see’s which one is connected to which bar. With this it allows for the correct icon to be shown on the map so that users will be able to tell which offer the bar is giving, meaning they can ignore the others if they wish.

This have given me an idea though, maybe I should add some functionality to allow the user to filter out which offer types they don’t want to see on the screen.

Next for me with this project is to pull through all the different cities throughout the country so that the user can search for which area they wish to view and this will then only show the ones they wish to see, plus it means that less data will be pulled through to the app.

Arena: Pushball The Basics

Today’s plan has been to put the basic game together using what I’ve learnt and gathered from the Zero to Hero tutorials that the guys at Havok have put together for Project Anarchy. I started of by just simply organizing the layout of the level and how I would like it to look. This look has two goals at each end and manipulating the playing field in the middle. With this comes two paddles now on at each end, yes I am using the ones from the zero to hero tutorials but eventually I will be replacing them with proper models, same goes for the static meshes for the arena. I have also renamed and organised the scripts to represent who they belong to whether it be the player or opponent player, this will make it a lot easier to reference and easier to know which set of scripts I need to edit or create for which side.


In the image above you can see the basic layout I am going for with the arena and all arenas I plan to put in the game will be based on this layout/design. Its very basic like the layout of many sports, Football (normal and American), rugby, hockey etc etc and that’s all it needs to be. I’ll be using this level in particular throughout the majority of development, however the plan is to add more and the player will be able to choose which arena they player in before starting the game

As for whats next, well with the basic game player being there, moving player paddle, when the ball goes in either end it adds a point to either the player or opponent score and displays it on screen, the next thing to do is sort out the opponent AI and how it will work. This I believe will be the hardest part of the basic gameplay as I’ll have to figure out how it ‘should’ work and look and then how to get it to work in Lua with havoks extra ingredients.

After the AI is done my plan is:

  • Put a damper on the Paddle
  • Collision box on walls so it adds momentum to the ball
  • Hit scaleform first and make a main menu
  • Create the GUI for the level while in play
  • Add the ability to change max score points (currently set to 5), leading to longer and shorter games
  • Create multiple arenas
  • Create a selection screen before playing where they’ll choose which arena to play in
  • Create all models needed

So you can see I have a fair amount to do on this project, I’ve been enjoying it so far, I love the idea and I am looking forward to what challenges this project will bring. Obviously with Project Anarchy being used for mobile development I plan to make it work on Android and iOS (eventually), a PC build would be nice but that comes with the price of a license, so I will see if that happens at all.

So it begins…

So it begins and begins with the second project, see this is going to be a big project and so I wanted to get a great start. First thing I did was search online for how to connect from an Android app to an online server, I took a while to get something I could use and follow which was very stressful for a while as it took quite a few days but eventually I found a great one and with that I’ve now set up a database online using the Wamp server and currently have it running on my pc, no that won’t be great in the future when the product is hopefully out, but for development sake it makes life very easy.

Currently I have one table in the database that holds information about made up stores (made up solely for the practice) and I am pulling that from the database through a PHP web-service to my phones app and having them appear on the Google Map, it has been really fun doing that as I haven’t really touched databases and web-service since from previous web job. My next job is to sort out the types of shops and use that information to decide the image that will represent them on the map. Then it will be onto putting a table in the database for each location and then sorting out the stores that will be shown on the map depending on the location that the user has chosen.

As for the my Project Anarchy project I haven’t touched anything recently as I’ve been concentrating on the Android app, however I have kind of thought of a name for it (at least a development name) and the name is ‘Arena: Pushball’. I will be working on the Android app for a bit more and then I’ll come back to this project and make some more progress on it, as I am generally looking forward to working with engine more as well as LUA.

Until next time, enjoy yours games people!