Saturday, 24 October 2015

Unity.exe caused an Access Violation (0xc0000005)in module Unity.exe

Quick tip since this drove me insane.

I reached a point in my Uni project where I would crash every time I loaded into a specific scene. At one point the crash went away but two builds later it came back. Unbeknownst to me, this occured after I adjusted or changed fonts in my project.

The error message read "Unity.exe caused an Access Violation (0xc0000005) in module Unity.exe at 0033:405ee4af.".  

The stack trace was all in hex and I wasn't sure how to pass it through a debugger so I resorted to google. In my case it turns out it was my fonts (on my OS) messing up for some reason. I fixed it by doing the following:

Go to Control Panel
Go to Fonts
Restore default fonts
Boot back into Unity and load the crashing scene
Observe scene loads fine!

If that doesn't fix it in your case check out these links, god speed!

Tuesday, 6 October 2015

Decisions, decisions ...

Okay, let's fast forward through this lack of updated blog content! Ready....go!

Finished my second module at university, which I think I already mentioned. I had a lot of fun on it and learnt a lot (of C, C++, OpenGL and using glfw, Visual Studio). But the stress kind of outweighed the fun parts. Another string of 'I'll just not sleep, it's fine' days. I didn't manage to snag a first for this module, I was off by around 2%! My supervisor was amazing though! It always helps when you have really enthusiastic people around to spur you on.

It was the same problem I always face, do I do something I know really, really well - and not learn anything new, or do I, trail by fire, take on a whole new area. As usual I choose the latter and unfortunately my grade reflects that.

I wasn't that upset about it as I learnt a bit about a huge sub-field in Comp-Sci, graphics programming. 

At the end of the module it was the summer break. I spent some of this time learning Perl. I had two weeks to get competent at it. Now I am really pretty good at it if I do say so myself. 

My employer, who remains nameless but is awesome, gave me the opportunity to switch from being a tester to a more developer oriented role. The specifics are yet to be confirmed but thus far I've been mostly building/maintaining tools to help other departments/developers with their day to day. Automation, baby! Most of the time I use Perl but from time to time I stumble into C++ or some other languages. I am loving it! It's pretty much the best job in the world for me right now. People have problems that need solving by some form of system/tool and I get to solve and build it. How is that not the coolest thing ever!? One of my finest moments was making a manual task that would have taken weeks take a minute with a script. That was pretty awesome.

University started up again yesterday, currently learning how to use as you might have guessed I'm a bit ahead of the curve. But now I am faced with another choice again. Do I stick with the Unity game engine, or do I stray into Unreal territory so that I can have more face time with c++?  Seeing as how I still need to work my day job and have a total of 3 weeks-ish to do this first assignment which counts for 50% of my grade, I don't know.

During the summer break I built a little twin stick shooter in Unreal following a tutorial, it's pretty sweet and looks great I think. I did it just to see how things work. But I still don't feel like I know UT well enough to even make a start on my own projects. The blueprint system is neat, but I need to make more use of c++. I get that you are supposed to set up the building blocks in c++ classes and then interface with the blueprint system so designers can make use of your building blocks. But I am not good enough at writing the building blocks yet! It's so annoying.

In any case, for my current Uni module, I already have a few game designs I made which I have been wanting to prototype for a while now. I have just not had the time to do so until now. So once I get my assignment brief I'll know which design I can use, save time having to think of one that way.

As for my final year project, after working in my fancy pants new position, I see what it takes to be a good graphics programmer, in the Industry. And to be frank, I don't think I have it in me. I am still not nearly experienced enough at it and I don't think I have enough time to spend getting to that point. Graphics programming is way out of my field of expertise. My undergrad was devoted to AI and I am still in love with that. I don't know what it is about graphics programming, I don't mind the low-level stuff or the math even. I am willing to spend as long as I need on that, it's just that in my current situation, I have deadlines for everything I do and I physically don't have the time to get to where I need to be.

I told myself I would specialise in graphics programming as it's very important in my line of work, which it is, but I feel that currently, as far as University goes, I'd set myself up to fail if I pursued it as a final year project. I have not made a decision yet but I am currently looking into alternatives. Constantly finding myself back at various AI topics. I'm looking into combining AI and VR on a project. Thus far with my ideas, the connection between the two are pretty loose at best. The superficial connection between the two fields is pretty underwhelming to me, but then that's what literature reviews are for right?

In any case I'll need to discuss with my supervisor and see if he'd still be interested in my new project and if not look into new options.

As for now, I need to get back to studying!
Rob out! Peace! *gangster signs*

Monday, 15 June 2015

Robs Stock Tracker!

Ever since playing Eve Online I've liked playing the market in video games. So much so I built a little trading game prototype at some point. One that relied on a barter system. 

I really should go back and finish this at some point! :D

I don't have the time to play MMO's anymore. But while watching my girlfriend play Eve I started jonesing to trade again. So I thought to myself, why do something in a game? If I was 'ok' at it on Eve then why not try the real thing. I mean, it's not technically a game but the term 'playing the market' must means it's kind of a game, right? :D

I started reading up on stocks and shares and came to the conclusion that this was a lot more in-depth than any game I've traded on. Reading candle graphs and trying out technical analysis was fun and all but I'd need to do a lot more research before being able to invest cash on this. I needed to find out what time scale I wanted to be using (day trading, swing trading etc). I'd need to settle on collateral to start off with.

I started trading on a fake/virtual stock exchange. Just to practise. I had a lot of fun and managed to make a profit of 3K fake Internet money in a week (albeit with a collateral investment of 100K).

During my dabbling I found that I would often have to do the same calculations over and over again. This got on my nerves really quickly. Especially when trying day trading where 15 minutes can mean profit or hitting your stop loss. It was at this time that I started dabbling with Perl and saw an opportunity to make something cool!

The objective of this Stock tracker wasn't just to track the value of my stocks and list them out as increases or decreases per stock. This information can already be found on the stock market and various other sites / newspapers. This information wasn't all that helpful to me as an increase on the day wouldn't necessarily mean a profit for me as this would be based on when I bought into the stock.

I wanted to be able to at a glance see what my total profits would be at any point during the trade day per stock. This included any commission fees and taxes. So I set out on doing this, making use of Perls text matching functionality. The tracker works really well albeit pretty basic.

I am able to retrieve a webpages source directly by making use of the LWS module, after this I parse the HTML extracting only the information I need. After I have this information, I simply use it with my own information (amount of stock I have, how much I paid for it, my stamp tax, commission per sale etc.) I read this in from another file and nothing is hard coded.

In fact I am able to specify multiple stocks by specifying it in a file (at the moment its a simple .txt). I specify the company, URL and the rest of my details. After this, my tracker uses the URL to grab the page. After it does its parsing and calculations it returns the values I want. At the moment only the total profit per stock.

The next step I wanted was to automate the updating as constantly re-running the script manually is pure madness. My script will start up when run and continue to update itself every minute (updating my profits). It will run up until the market closes (for debugging purposes it will run till 18:30 GMT at the moment). Once it hits this time it will shut itself down. You can also quit out using ctrl+C which will then run a subroutine to clean up a bunch of information and display a user friendly message.

After this I used the Term::ANSIColor module (a built in module) to colourise my output and make things a bit more user friendly.

The final feature I added was stop loss tracking. This allows me to set a stop loss values (in a similar fashion as the rest of the values input). This will the be used to either inform me that my current total stock value is still higher than my stop loss or if it drops lower it'll output a warning. This stop loss can be set in an easy way for each stock I wish to track. The number of stocks I want to track is (in theory anyhow) infinite. There is no limit but obviously tracking more will impact performance as I have to parse a lot of information.

The final output can be seen below! A stock tracker that can track any amount of stocks on the London Stock exchange and update it in real time. Only total profit numbers will be output and stop losses will be monitored. Pretty much automating a whole bunch of minor inconveniences for me. And best of all is it runs on most platforms (Only tested  on MacOS and Windows however).

Example of the script in action!

TODO - Future Work
There's still some things I'd like to be able to do with this script, but they aren't super important. These are:

User specified output - I already have this partially implemented in my script. It would in theory allow the user to specify what they wanted to see. For example perl Scriptname - StopLoss would only show stop losses. Scriptname - showall would output everything. Scriptname - help would list the help output. I'd need to use the getops module for this. At the moment I use ARG[] for this so I don't have to rely on cpan or third party mods.

This little project would also be really neat to use to combine with some AI. As I specialised in AI during my undergrad I am pretty interested in this. Mostly in terms of using some form of intelligence to calculate ideal stop losses. Seeing as how I can track the days trend / months trend and even years trend. This is something that seems feasible to me. If I had a week or so free I'd love to look into this. the AI field seems pretty dead in terms of Perl so I might have to rewrite things into Python or Ruby for this however.

In conclusion I'm pretty stoked with what I managed to get done. I got much better at Perls data structures and the flow control (which is pretty much the exact opposite of C++'s flow). Yea I get ones a scripting language and ones a proper programming language! Chill! Sheeesh!

Most importantly I got competent at using regular expressions, which was a big gap in my Perl knowledge until this point. For example, do you understand the code below? Cause I finally do! :D

Regularrrrrr Expressionnnnssss

Good times, good times!

Still transmitting! - What I've been up too

Hello world,

It has been a while since I last updated my blawg! :D

So what's been going on with me lately can be summarised in three words - University, Work and Perl.

As can be seen on my site, in the portfolio section I finished my second module on my part time masters course. My preliminary grade is 65% which is kinda low for what I wanted. But considering I was trying to learn C++, OpenGL and the Oculus Rift SDK all at once, I think I did ok :D I'll just have to focus on my next two modules to make up the mark. This can still work! Just means I need to write more (read ALOT more) c++. I also need to pick up a book and Datastructs and Algo's in C++. I have only recently come to understand the utter importance of data structures and algorithms. Something I wish I picked up on sooner. I always knew they were important in theory, but I always shied away from them and Big O notation. This will need to change soon. Additionally I need to pick up a good book on OpenGL, one that does not use deprecated stuff! Out of date GL stuff screwed me over a few times!

As you can probably tell, our Grimm Journey game project has been on hold for a little while, as most of the team are currently pretty swamped with various other projects that has been sucking all our time away. Hey we gotta eat and pay rent, right? But fear not for the project will continue soon! Personally I am aiming to implement the animations from the demo scene into the game and hook up the narration (yup still working on this) properly at the end of next month when I have the time. After all that C++ and perl, writing some C# should be a treat lol.

For now my main focus has been on refreshing myself with / learning Perl to a proper standard, due to work requirements. And because I learn better by doing than reading and watching I set out to make a little application/script. Making a game in perl would have been ... interesting. However I wanted to use it more in line with what it was designed for really. Covering scalars/arrays and hashes as well as regex and matching/substitution.

As such I made a basic Stock/Share tracker that pulls info from the stock exchange and does some math on it. The tracker doesn't track the value of stocks ion their own, mostly because this info is available all over the Internets. What it does instead is track your specified stocks, based on the mount you paid for them and the quantity you have. Then using that calculates you profits (after stamp tax and commission and things like that). The results update in real time (at the moment every minute).

What this means is I have an easy way to at a glance see where my stocks are at, if I had any. I'll make a follow up posts going into more detail for those interested. I am currently using it with a fake/virtual stock exchange to test. The goal here was to see the accuracy of my script and not make cash...although that would be neat.

Work-wise everything is going neat, should be moving departments at the end of this month and be able to focus on more programming and less testing. I'm looking forward to this. Exciting times.

That's all from me for now, I'll be updating my portfolio with some screenshots of my stock tracker sometime soon so go check it out :)

Seeeeeeeeeee ya!

Sunday, 1 February 2015

Grimm Journey Old and New

Before logging off for the night I wanted to make one last post and be all reflective. I know what you're thinking "Just finish importing the narration already!" and to that I say, "I'm working on it! GOSH!"

We started this as part of the Ludum Dare 31 game jam. We started with nothing, just a blank screen in Unity. Then we started doing awesome things to it.

I found one of our early GJ pictures and thought it would be neat to compare. Images don't do the functionality justice though. In the old image the giant troll had no movement, the enemies didnt patrol or have much AI. The Big Bad Wolf couldn't attack yet and the Character Swap was a white cube and didn't work properly yet. There were also no victory points. The game had no audio or sound effects.

A Grimm Journey during the Ludum Dare 31 game jam:

The latest commit had all enemies with their attacks / audio. Rob added some great AI and basic pathfinding. I put in out artists assets and created the level animations. Made the pause menu actually work. I added attacks for the Big Bad Wolf and Rob made it possible for the Big Bad Wolf to attack whilst remaining still. We added the Darkness into the game which rises from below the level. Laura grabbed and formatted all our audio and Rob added the audio into the game, with awesome timing on the audio queues. There are many, many other features and bug fixes which slip my mind at the moment.

A Grimm Journey today (commit 3d140fff89)

I think that even though we are making slow progress, we are making progress all the same! And I am super proud of what we have managed to accomplish thus far. And things are only getting better! Rob has been working really hard on adding some UI elements into the game (such as health bars) and I have been slowly adding narration and voice acting elements to the different levels, which our designer Laura made. They are really, really awesome and add a lot to the game! Our artist is working on some assets for Robs UI stuff.

Our bug list is looking good with 15 open and 27 closed bugs. I'm gonna post an example below:

I think I've finished about 3 games and I have like 6 prototypes/unfinished games. But this is the first game I have worked on that made me feel really good about what we've accomplished. When play testing a build with my girlfriend (its mutliplayer after all) we had so much fun! It was the first time I felt like this was a game and not 'another game project I have to debug and balance'. We all started with nothing and made something that is becoming more and more awesome as we go :D 

To the team - great job guys. Out of all the teams I've worked with, I want to murder you guys the least ;)

Grimm Journey Project page

Quick update, to show that I still live!

I refactored the sound manager, in our game into three different ones, and I am in the process on implementing them. Unfortunately as usual my University studies are keeping me pretty busy.

Apart from that I have set up a basic frame work for a project site for our little game project. It is pretty simple, has a few tabs. Currently these read About, Media, Play and Contact. It's not live yet since it still needs to be filled in and I want to grab some art for it to make it look nicer. I also want to set up a different page style as I just use the CSS from my main site at the moment. I am waiting for our artist to get back in touch so I can ask her advice. Will run this by the rest of the team as well.

I think it's important that we have one solid place to show people our stuff. At the moment it's all grape vined through blogs and links and repos. Hopefully this will be a solution and rather than try and explain to people we can just show em :)

Not heard anything from Leftfield peoples yet. Wondering if I should shoot them a mail or not. Will look into this.

That's it for tonight! 

Friday, 23 January 2015

Adding Narration into our game

Still making slow progress on this as Uni's been getting busy (more on that in my Student blog). However I have been doing s few things here and there. At the moment I am working on adding narration to our game.

Laura did some super cool narration for our project and I've been adding them in little by little as I test at the same time. Taken from our github tracker:

Added level 1_1 intro narrative as a test in afdeb2d. Started restructuring the Sound Manager a little bit. We drop all audio sources volume to 0.2F while the narrative is playing. Once finished we boost up the audio to all audio sources in the level to 1.0F. This works pretty neat currently :D The narration plays with quiet audio in the background and once its done the audio is restored to its full glory!

I am still thinking whether or not this is the best way to go as atm we are constantly updating each audio sources volume per frame. But I can't think of a better way right now. I'm gonna keep running this through my head, but the good thing about updating per frame is that the audio seems really responsive. And we don't have -that- much audio really so it shouldn't impact performance I think.

That's it for now, small update. After some more testing last night I am thinking the way we are doing it will be fine for now.

I'm looking at making a project site for our project now to show people. This means more HTML/CCS and javascript stuff when I get a minute spare.


Friday, 16 January 2015

EGX build - Almost done!

Well I realize I've not updated my blog in quite some time. Mostly because I've been far to busy with two projects. Our gamejam and my University project.

My University project progress can be seen here.

With regards to our Gamejam, we have been making steady progress. The submission deadlines for Leftfield is today and I still have two bugs to fix after work.

Rob1 set up an awesome little bug tracker for our project on github which we have be using to good effect :D It's been really useful in keeping things organized.

We are aiming today to have some more levels added into the game and the last remaining bugs for this cycle to be fixed. After that, time permitting I'll be able to run some more tests and see where we stand.

We have a bunch of polish issues on standby and I'd like to clean up my code a little as it appears really unorganized at the moment. And maybe improve upon some of my more 'hacky' fixes.

Our game is slowly growing up in front of us and I'm super proud of all the work we've all done. Huge shout out to Rob1 as he's been doing the brunt of the bug fixes for this submission. It sucks being so busy with my Uni project. I'm hoping that after the deadline for it on Monday I'll have some more time free to help out properly.

It still never get used to the feeling you get when you start with nothing and create something fun out of it. It is the most rewarding feeling ever. Makes all the hours of working on it worth while :D

Thursday, 1 January 2015

Ludum Dare 31 Results

Happy New Year!

So our results are in! We managed to do really well and I'm super proud of everyone on the team!

Our results can be seen below. Soon I'll be done with my University assignment and I should have a few days spare to spend fixing a bunch of bugs on it with other Rob. This is to get things ready for submission on the 16th.

#2640 total entries

#400 Graphics(Jam) 3.48
#406 Mood(Jam) 3.17
#449 Audio(Jam) 2.85
#746 Overall(Jam) 2.92
#785 Innovation(Jam)  2.57
#866 Fun(Jam) 2.52
#890 Theme(Jam) 2.96

Rob has been awesome and set up the bug tracking in Github so we can keep things nice and organised. For now though I have to rewrite a bunch of GUI code for my University project so I'm out for now.