Thursday, July 29, 2010

Getting things clear in my head: Game Design

Today I decided to do some design work, I find one of my biggest problems is getting a complex design clear in my head, and usually this leads to ambiguity, thus poor implementation, this kinda annoys me, because my ability to design must be far greater (or at least equal to) my programming skills if I want to advance to bigger projects.

So I sat down and asked myself "what is a game?", the following is a UML diagram that I wrote out, some of the notation might be a little wrong, but you'll probably understand where I'm coming from. (Hopefully the image will be enlargeable)


The above diagram is what I consider to be a game, I'm going to keep adding to this model, and eventually I may be able to build an engine out of it, one of my flaws is definitely design, sometimes I can't see wood from the trees!

Let's see what you make of it.


Thursday, July 22, 2010

Progress log, something different.

Throughout the rest of this relatively short day, I'm going to save up all of my progress updates, and add it to this blog, rather than constantly post on Facebook, lets see if this work, if it does, I'll do the same in the future :-)


15:47 - After hours of scribbling on my whiteboard and sipping tea, I've come up with a revised class design for generic "game", I needed to tweak and change a few things as my old design was suited to SDL (I had to write a lot of functions to cater for SDL's shortcomings), that means I have less coding to do, but at the same time, cannot use the SFML Classes out of the box because many things aren't included, currently been working out how to structure sprites, players and objects in a game, figuring out what SFML did and didn't do was probably the biggest challenge

16:32 - Started writing out the code for my take on a sprite class (an extension of the one SFML provides), the new one handles collision, and collision regions, most of the methods relating to collision are implemented , code compiles, but haven't tested the methods work yet, about to do that.

16:51 The collision works!
Note in the pictures, when the 2 rectangles collide, the are visible, when they aren't colliding, they disappear



17:22 A Slight hitch there, the region collision didn't work to start off, but I figured it out, I found out I was making the width and height of the regions the same size as the original shape, thus negating the effect of setting a region in the first place! it's fixed now and everything working fine


This post is getting a bit long, so that's enough for now, I've probably waffled on for too long now :P

Sunday, July 18, 2010

Next Week I'm getting Edjukated! & Birthdays!

I've decided that I'm being too complacent at the moment, I'm supposed to be developing lots of games/apps and building my website this summer, but much of my time is spent fretting over my main project, the GUI library (oh god, don't make me think about it again!)

This project is becoming the greatest regret of my programming pursuits, although I do want to finish it eventually, it's taking up way too much of my time, and since it's essentially a collection of code, with little tangible evidence of progress, I'm getting only small bursts of motivation from this project.

The website on the other hand is taking shape, I've started to get the hang of using the GIMP, and now I'm able to make what you might class as 'Art', but I guess we'll see how good it is when I eventually launch that.

But I detract from the primary purpose of this blog, and this is to talk about learning, over the next week, I will dedicate the majority of my time to learning some new languages/APIs/software, I need to break out of this cycle of complacency (a la, using SDL, and only the basic tools of GIMP, over and over again), therefore, my mission this week will be to read a book on JavaScript, look into the Multimedia Library 'SFML' and learn some more advanced features of the Image tool 'GIMP'.

Hopefully, by acquiring a new skill set, I will be able to make better quality things, more quickly, so that I can pass them on to you.

Oh, it's my birthday next week, turning 19 isn't exactly a big deal though, it's not like I'm legally allowed to do anything new, just another year older/wiser :P

Peace.

Tuesday, July 6, 2010

I guess I should keep everyone updated, I've been up to some stuff :D

So this is a rather informal blog, at least in contrast to the last 'write up' style blog, this one is just going to go over the stuff I've been doing during my holidays.

For about a fortnight, I worked on my GUI library, it's really taking shape! I have events implemented in a way that I'm really happy about (the interface between user and GUI is clean and easy to program), I've also implemented visibility and the ability to associate other controls with forms (the controls can even be forms! so you can embed them inside other forms!)

One major challenge I'm facing is how I'm going to implement text, for labels and captions etc, I can either use the SDL_TTF library or create my own bitmap fonts, neither option seems that great, but I'm not sure what other options I have, we'll see...

The second project I started on was working on the website, at the beginning of the week designing assets for the website (logo, navbar image etc) seemed like an impossible task, however, when I started to use the image editing software (I use GIMP), things got easier, and dare I say it, fun!

I've already made the logo and navbar and I'm going to keep tweaking them as I go along, I'm going to spend the entire week working on the website, then I'll flip back to the programming, A productive holiday indeed!.

As for just general life stuff, I'm ok, I keep waking up way too late, not getting to sleep till 2/3 in the morning, but apart from that it's all good, I'm kinda cool with just getting on with my stuff without interruption, It's kinda funny, I'm not even ashamed that I'm isolated, I kinda like it, taking a break from my social life seems like such a natural thing, and will make going back to uni all the more rewarding when it happens.

I hope you enjoyed my blog :-)

ProgrammerInProgress


Sunday, June 13, 2010

my p0ng haz > brainz thn urs!!!11!!!1222!! : A brief write up and update

If you can't speak noob, then what I mean't to say was "I have completed writing a pong game in SDL, here is my writeup!"

I decided, to start off my summer holidays to re-acquaint myself with C++ and SDL by writing a simple pong game, this now complete pong game (dubbed pong 2010) is simply a no-frills, back to basics pong game (white ball, white paddles, 7-segment display for scores).

I wanted to get back into the swing of things, so I set about making the game straight away, design documentation was pretty light, and things started off well, until I realised that my initial design just wouldn't cut it when I tried to introduce an AI player.

Originally, my design was simple, all objects in the game were independent of each other, and they interact by returning SDL_Rects via accessor methods, and I just checked if the boxes were colliding, sounds like it would work fine doesn't it? well it did, until I realised I wouldn't be able to write player AI very easily, because the Player class has to know certain details about the ball (such as the location, size and proximity to the player), my first design had no chance of Player AI working without a tonne of bugs.

Rather than restarting the project, I opened up my UML diagram tool, entered in everything I already had into a set of class diagrams, and started to move things around, fortunately I was able to find a decent design that meant I could use much of the existing code I wrote, whilst still being able to allow for the new functionality the game required.

The new design was fairly simple, the Player stores a reference (in this case, a pointer) to the ball as a more primitive superclass (called Rectangle, the paddles and the balls are derived from this class), and the 'Player' class became a super class for the 'HumanPlayer' and 'AIPlayer' subclasses.

This new design allowed me to move player input into the HumanPlayer class and out of the main body, and allowed me to move AI into the AIPlayer class, this made things a lot clearer, and aided me in completing the project.

I also added a nifty feature I picked up in A-Level computing, a 7 segment display, (you know, those displays you probably have on a digital watch or alarm clock you own, I used one for the score system), after an hours programming or so, I was able to finish a class called 'Counter', which was able to display the digits '0' to '9' anywhere on the screen, since the display is simply made up of rectangles, I was able to implement scaling, so now the display can be scaled for the needs of any game that requires a specific-sized counter (I may do a 14-segment display in the future to display the alphabet, but that's a little harder, as it requires diagonal shapes, I'll have to work out how to make those look right when I implement scaling)

That is the basic overview of my pong game, I learnt how to implement AI, which was fun (I've implemented very dumb AI in the past, the player in my pong game is at least a little challenging, but beatable all the same), and I feel like I'm back into the swing of things, after a year of ad-hoc programming due to my studies.


Aside from pong, I have been thinking about other projects to work on, one which I'm actively working on is my website, I really want to launch a new website before the end of summer, but I am going to take my time, and I will only release it when I'm happy with it, I want to do some things that will hopefully be really interesting!

I have a few other ideas in the pipeline, which I'll do if I feel daring enough! I also have the GUI library to work on, progress on that is slow at best, since I haven't really looked at it for a while, it's all about getting that crucial design correct, I tell myself that if I don't attempt to complete it, I am only stifling myself, because I need some GUI components for my various games and apps I have planned, which I cannot complete without getting this finished.


I hope this was an enjoyable read, hopefully I will be able to do videos when I get my new equipment and I have access to some fast broadband.

Thanks for reading

ProgrammerInProgress

Thursday, May 13, 2010

Major Progress I just had to blog about!

Recently I've been building up my efforts to get something into the public domain, namely the GUI library I announced a couple of months back (more than a couple possibly), admittedly, progress was slow, I have been very busy with university work and obsessing over my social life a little too much, as us students do, my bad!

But I'm not longer obsessing (and I'm saving a lot of cash, going out places is expensive you know), and my university work is finished and handed in, however I still have my exams to do (but I see the GUI library as a form of revision for my systems design exam, they both use UML!)

The point I am trying to get at is that things are moving along, I decided to scale back my ambitious plans a little, and work one something which is more feasible, still a GUI library, but instead of agonising over the mother of all OO designs that is modelled on concepts which haven't been implemented or even designed yet! , I decided to focus on the components that make up the GUI.

I intend to take an iterative approach to this project, that is, I will release fairly a rudimentary library to test a few simple components of the GUI, and see what's good and bad about them, a bit of peer review will hopefully make my project that little bit better.

After each iteration I will take stock of what has been achieved, and how I may want to progress, based on what I have, what people feed back to me, and what is feasible. I am very excited about this approach, I've never really done things like this before.

I am honestly more motivated than ever, and I'm raring to go, come the 21st may, I'm going into overdrive, my summer holiday begins and I can get mashing away at the keyboard (more so than I did writing this blog!)

More updates soon, and hopefully video, I have recorded some, it's just turning it into something meaningful and entertaining that's the problem!

ProgrammerInProgress


Friday, March 12, 2010

Major Revelations

Before I Begin, I would just like to point out that this is another one of my more "emotionally oriented" blogs as opposed to my technical blogs, I don't want to get anyone's hopes up in that department, my apologies.

I have been trying to make my way through my university work for weeks now, it's not particularly hard work, just very tedious, but this is even worse than if the work was difficult, at least I would be taxing my mind and receiving some sort of mental stimulation, as opposed to constantly looking through books on a subject I find less than appealing, and merely studying because it comes along with my degree.

Recently I have felt drained, partly because I keep getting all of the bugs going around campus, but also because I'm not doing what I enjoy, making things. It really begs the question, "why am I here ?"

Now don't get me wrong, I'm really happy at university, I'm glad I moved out and met new people, but sometimes I just feel that I came here to do more than simply "get the work done" and then rest, I imagined an environment where I would be constantly invigorated by my work and I would be learning new and exciting things which would aid me in my exploits as a hobbyist developer, maybe I expected too much?

Currently I'm rethinking the way I live my life, I feel a greater need to follow less and to lead more, I don't just want to be a sheep, doing what someone else tells me, this applies to my education and my social life.

I no longer want to go somewhere just because my friends decide to go there, and then have a crappy time because it isn't really my thing, I want to explore what life has to offer, not just continue the same monotony of going to that same old expensive club every Friday.

I no longer want to do work so tediously unimaginative that I spend my leisure time indoors, doing nothing but using Facebook, just to escape the tedium.

So what is the remedy? I guess firstly I should stop complaining, get off my arse, and start doing something!

Secondly , I'm going to cram, I have no love for this work, and I want it out of my life for good, I'm going to spend my weekends getting rid of the detritus which is my computer networks assessment, An endeavour I find pointless, but what the university deems essential(90% of my mark in the module)

Thirdly, I must rediscover my zest for life, I need to find some way of expressing my extra-curricular interests, anything has got to be better than the constant grind and the restless nights I'm currently having.

Finally, I need to take my social life by the horns and do what I want to do, I need to find people who interest me, and not expect the people to find me, why would they? when I spend my days at my computer, or going to loud clubs with friends, where no one talks to anyone.

In conclusion, I've got stuff I need to sort out, and writing this blog was the first step on a new path I'm taking.

Thank you for reading.

Mike.


Sunday, February 28, 2010

Just checking in :-)

This week has been somewhat non-standard, I've had lots of trouble sleeping, the average time I've been hitting the hay would be around 4-5am, so I've basically been getting about 4/5 hours sleep per night (If I'm lucky!) so I can't say I've been fully on task.

That said, I have completed a few tasks today which relate to the new library that I'm designing.

I have been thinking a lot lately about how the programmer is going to cope with using my library, and I've tried to alter the way I design the library to accommodate for this.

Usually I'll write an executable program, such as a game, and I'll really concentrate on the bones of the program before I consider how the user will interact with the program, this was a serious mistake on my part and so I'm really trying to put this right, before it wasn't much of a problem because these things can be left to the end of the development cycle when you're talking about games and simple applications, but when you're talking about libraries, making sure that the programmer can use the tools you give them is actually the biggest priority there is, that aside from it working.

Therefore, I have spent a good part of my day writing out how I would like the library to 'look' to the programmer, the various ways I would like the programmers to declare the GUI, create menus, and controls to go on those menus, then how to handle events and finally how to remove the GUI components or even the entire GUI from memory when it's finished with. This has allowed me to assimilate my ideas and create a draft interface for the system, hopefully I can now pair this interface with the backend stuff I have envisioned and modelled in class diagrams.

In a nutshell I've been able to design a 'face' for my GUI library today, I've got a set of methods that I personally deem desirable (however I am getting some consultation from peers on that front, after all I live in a house of computing students, why not make the most of it? )

Once I have come up with my final designs for the interface, and I've had it evaluated by my peers, I will then attempt to pair up that design with the core data structure I have planned out 'under the hood', after that's done I can start designing the implementation and I start looking for errors that need to be handled in the background so the user doesn't have to.

I'm very much looking forward to making a new video and presenting my progress, hopefully university will be kind to me and I will get some hours in the day to work each night, I'm just keeping my fingers crossed.

All of that aside, I still feel I'm not putting full effort into the project, there are many other things I wanted to put into this blog which I haven't completed, which is a little disappointing, hopefully I will sleep a little better thus allowing me to be a bit more productive in the coming weeks.

Thank you for reading my blog, your participation is much appreciated :-)

Mike.

Wednesday, February 24, 2010

The Good News, and the the bad news

So, this is me entering the world of written-word blogging, It's exciting to say the least, hopefully writing down my progress will be a lot easier, and I might be able to get across my feelings about my projects and what's going on in my life much better than any video could.

In my videos I tend to put on a facade, which, while it's totally me expressing my opinions and my goals, sometimes my feelings are left a little absent from said videos, mainly because they impair my ability to present, and my philosophy is that if you're not going to deliver an upbeat, and informative video, then why bother?

So, on to the good and bad news...

The good news is, I'm raring to go on the project, I'm pretty stoked at having a new idea and I'm glad that I might actually have the time to implement it in a way which I deem satisfactory, there's no need to rush, and it will be an excellent learning experience.

The bad news relates back to the subject of time, unfortunately I have recently been issued some of my university project work, now while this would usually be a fairly painless turn of events for say a programming or web design module, the work I have been given was for networks, it's a 3000 word pain in the ass that I could really do with out.

At the moment I am working on section 1, the 700 word report to start things off, it has proved somewhat more difficult than expected, mainly because I absolutely detest learning about networks, I cannot abide networks if I'm being honest, I think the way it's taught leaves a lot to be desired and I generally have no time for networking, as I take close to no interest in it.

Usually I will find a task fairly straightforward if I am able to link it to a hobby or interest I enjoy and make time for in my leisure time, unfortunately, networking has no such link, and therefore I'm forced to rough it out guerilla style.

I stayed up till 5am last night, reading the books and mashing away at my keyboard, the deadline is quite a long way off, so you're probably thinking, why on earth did I stay up till 5am working on module work I cannot abide? the reason I took this approach was because I know my own mind, if I were to leave the work till later, I would simply procrastinate until I could procrastinate no more, and would end up with a whole weekend of crippling stress and anxiety, because I have made the conscious decision to do the work instantaneously, I have brought the balance of power back into my own hands, and I'm now able to complete the work, and move on from there.

Why did I mention this in a technical blog? I mentioned it because I want to explain why I haven't touched my GUI project in about a week now, I have had to put that work aside, and prioritise, however, this does not mean I have given up, I am using the project as a metaphorical 'Carrot on a stick', I will be able to obtain said carrot when all other responsibilities are accounted for.

Frankly I'm a little fed up with the work, and I decided to rant on about it in a block, go figure?

Thank you for reading my thoughts :-)