Friday, 7 October 2011

MVC Architecture and Single Page Interfaces

It seems I always come back to this blog after taking a break. I’m going to try keep this up to date as I begin in finalising my design, the coding of the system and then the implementation into the real-world environment.

The Problem
The project I’ve taken work of is the forumgaming.com web game system. It runs similar to a board game but all from a single interface. This interface makes calls through Javascript (JQuery in this case) to backend PHP files which do the work and connect to the database.

This sounds fine, however over time the code has expanded with no organisation, comments or any kind of documentation. Things are half implemented with variables cluttering up the code all over the place.

Coming from a Java background I like things to be in neat ordered classes which can be extended when required. One of the problems with this is that websites and the programming of websites don’t work like this.

When a class is instantiated in java it is created in the virtual memory and so long as it stays in scope it exists. Web programming to my current knowledge is different, especially with PHP, as the class is instantiated on the server to do a purpose and then goes out of scope.

The Solution
My plan is to strip out everything from the game to and create a framework that all future code can be built off.

Normal MVC however would not work with this due to the fact the game is a single page interface whereas normally each normally indicates a new page. In my variation I am planning to make it so that views are called via AJAX calls from the main interface to do any processing required.

Very little actually is done through the interface except the viewing the of current state of the board (in this case a map) and then requests being sent to the database which update values, such as moving a unit or requesting an alliance with a player.


In a more visual method the MVC architecture looks like the following as standard:


Note: The solid lines represent a direct association and the dashed lines represent an indirect association through an observer pattern for example.

This is how my interpretation of the system will work. It's a little different but not much so. It's different enough so that I'm not using a pre built MVC architecture and instead I'm going to use the ideas of it instead since the bootstrap is going to effectively be my interface. This is how my MVC-SPI should look:

The interfaces will be updated directly from the views however all calls will go through the game interface (the core index) which will route them and update the correct sub-section. This should allow for extensible code while still allowing for the game to run as it currently does.





Monday, 11 July 2011

World Shattering

Okay so it’s been a long time since I’ve written a blog mainly due to the fact I’ve not had much to write about. Regardless of this while writing up some game design ideas I had I’ve found a topic to write about!
This topic as the world so subtlety suggests is to do with the shattering of worlds or in the case of this blog, the seemingly primal urge of most gamers to try break the world of the game they’re playing, sandbox or not.
It seems to me that anytime myself or almost every gamer I know gets in contact with a new game, the first thing we do are test the limits of its reality. Is this a case of us wanting to re-assure ourselves that it is really a game for the time that games and reality are impossible to determine?
Unlikely, but I think the real cause is that the majority gamers judge the quality of a game based on the quality of its graphics and its reality. Give the majority of modern gamers; referring here to those who grew up in the late PlayStation 2 or early Xbox 360 era, a game from the 90s or even some modern indie games and they’ll look at you as though you’re crazy, as the visual fidelity does not match what they consider the sign of a good game.
Another reason I think the reality of a game is key is due to the fact many gamers want to see the cause and effect of their actions to give weight to a choice they have chosen or an action they have performed.
An example of this for me would be the changing world of a Grand Theft Auto game to either show the passing of time in years, or the opening of new areas much like the mansion in Vice City.
This example being a sandbox game however is also reflected in games that are not in essence sandbox games, games such as Resident Evil. The formula of Resident Evil is probably farthest you could get from the sandbox of GTA; however the quality of the gameplay is hindered by the non-obvious obstructions in the original incarnations of these games.
The modern Resident Evil’s while keeping a similar formula show this cause and effect allowing the player to “know” and comprehend the reason for not being able to go backwards whether that be a security door locking due to the zombie infestation rather than an invisible barrier to stop inquisitive players.
Anyways to get to the point I think that the quality of a games reality relates to the fact players want to break the world to see if it reacts to their actions. It’s similar to a child poking a cat because it’s not doing anything, it’s not because they want it to break, it’s because they want it to respond.

Saturday, 22 January 2011

The Problem With Loss in Games and the Death of Fear

Most games do not try to cause the player to experience loss or overwhelming odds (although they create the effect of this). There are of course exceptions to this rule such as EVE-Online but the majority of game designers seem to believe that their player base would not be interested in such an experience.
                I agree that a game where you are killed continually and cannot progress is not a particularly interesting one but the effect that the fear of loss causes is food for thought. Fear in games is fascinating because players don't tend to experience it very often. It's very hard to be bored into a game if you're so close to failure yet the general consensus is that gamers will quit if they find it too hard and get frustrated.

                There are of course cases of games that use this successfully and one of these I have mentioned already is EVE-Online. This game uses real loss to reinforce its ethic of "life's not fair so why should Eve be any different".
                For those of you that have not played Eve it is a MMORPG set in space where the player has free-reign to create whatever legacy they find engaging, it has a full player-driven market system and a huge ever changing political landscape. Eve does of course have its downsides. Most of which come from its steep learning curve and unforgiving game design.
                EVE-Online takes the stance that it's players should be playing the game to engage in something more than mindless grind. Players do not advance by levelling or killing they grow by learning new skills and there are no restrictions on what a player can do apart from time. The other bonus of this is your character can train skills while you are offline making the game largely un-rewarding for people who just wish to progress their character. People that wish to progress their fortunes, stature or reputation will find Eve most rewarding since this is what the game excels at.

                Back to my original point, EVE-Online uses its game design mechanics to drive its economy and social landscape. This extends to the point that almost everything is created by players. Ships, modules (items), ammo, rigs (ship customisations) and implants (attribute or skill upgrades) are all created or pieced together by players.
                The key point that drives all this is that if your ship is destroyed and you are killed then everything that you had on your ships is gone. You are resurrected due to newfangled cloning technology and may lose skills if it's not up to date (a service that you pay for) yet the ship you had and the modules you had equipped are destroyed forever. Items in your cargo can be stolen by your enemies and your ship can be salvaged for parts (used to create rigs: See above).
                This causes the effect I mentioned earlier that you continually fear for your loss and hence will not risk an expensive ship for a cause you do not seem worth it. If you spend 6 weeks generating the money through mission running, trading and other in game methods to buy an expensive Battleship, then you will not go and throw it away at some random stranger (even though you can if you wish).
                If you lose a ship then you can indeed just go buy another ship of the same type and fit it exactly the same way but it is not the same ship. You still lost something physical that took you time to get. As you go up the triangle of value (from frigates up until titans) the fear of loss gets greater yet this is all relative to cost you paid which is varied by the economy that is driven by supply and demand.
                The other-end of the spectrum is something such as World of Warcraft or other similar play systems.  The game babies the gamer so they don't experience any real loss. When a player dies in World of Warcraft they have a run back to their corpse and the only other thing they have to deal with is a slight reduction in the quality of their gear. This is a small cost for the death yet only at a high level can this cause a slight hassle when raiding and death is likely.
                This causes more annoyance than loss and as a player you know that you will not lose any of your gear. This means that player fear is almost null, the only thing that most players will actually fear is their guild mates or friends looking down on them for their dying. This is not a game mechanic and is an effect of peer pressure from other players.
                It's quite strange how this has come about since World of Warcraft's predecessor is Dungeons and Dragons (as are most RPG dice-roll based games) and original DnD was notoriously difficult to survive a dungeon crawl. As the revisions went on it eventually got easier but still rather difficult at a base level.
                So why I hear you shout, did Blizzard decide to forgo this difficulty curve in World of Warcraft? It's quite simple from my point of view (as a gamer). The reason is that they wanted the game to be accessible to casual gamers and people that may not have been interested in a "true" role-playing experience.
                This would explain Blizzard's monstrous 11 Million player base but as their rate of adoption is so high then I'm sure their subscription losses are also high.
                Earlier I commented on fear being able to be used to drive the game play forward in a title. This has been seen in modern titles such as Left 4 Dead which uses fear to drive the players towards the conclusion of the chapter. Left 4 Dead also uses loss as a minor mechanic since when a player dies they are gone until the other players get to such a point where they can revive them.
                I think that modern games should use mechanics such as fear, loss and frustration to drive game play forwards and create a more engaging experience for the player. These mechanics must be twinned with intelligent and interactive game design so a player must not get so annoyed at the game or so disheartened that they quit.
                Games that use these mechanics well are games like Ninja Gaiden which uses a steep difficulty curve to drive the player onwards. Trackmania also uses frustration to drive game play. Players will spend hour’s shavings milliseconds off of a time just to drop it at the last corner the reason is they will always feel like they're progressing within the game.

                I should probably mention here that I'm a long time player of both games and I enjoy them both for different reasons but I personally think that the design ethic and design decisions of Eve-Online outstrips World of Warcraft on a variety of level. The reason that this article has a heavy focus upon Eve is that many gamers have not played or heard of it and i believed that it deserved a description to get my point across. Also the heavy focus is that way because almost all pc gamers have at sometime experienced World of Warcraft and its mechanics in one way or another.
                In conclusion I believe that more gamers should see the benefits in apparent "un-fun" aspects of game play such as fear, loss and frustration within the mechanics. Modern thinking would disagree with me due to the marketing and success of casual games that show no hint of these such as World of Warcraft and Counter Strike.
                So does that mean the game play mechanic of loss is a dud and not marketable? Possibly But let me leave you with this. The loss mechanic may not all be lost since EVE-Online has been growing at a rapid rate of adoption since its release and is still growing. Maybe the future for games that create fear, make the player feel loss and maybe even frustrates the player to the point of them becoming determined is not so dull.

Sunday, 12 December 2010

The Compulsion of Infection

Today I want to write about infection. More specifically a Zombie virus infection which as most geeks have one time or another thought about has the potential to destroy life as we know it.

As some of you may know who read this I’m a programmer who is slowly but surely improving his skills and always looking for something to interest me and extend my skills. I recently came to this idea after watching The Walking Dead a series currently showing on FXUK.

Ignoring the series (it’s about Zombies and the fall of society), the thing that interested me the most is that it follows the rules of Zombification or the more specifically the Zombie infection. The majority of these rules were pioneered by George A. Romero who has written some of the most famous zombie films on earth such as Night of the Living Dead, Dawn of the Dead (the original) all the way to the more recent films such as Diary of the Dead.

The rules for his zombies and the infection can be found online but what I'm most interested in is the idea that these rules can be written into code and simulated over a timeframe.

Romero’s rules encompass the following areas of zombie actions:

  • Process of infection and reanimation
  • Behaviour such as recall of former actions
  • Locomotion and their movement specifics
  • Physical causes and limits of the virus or reason for reanimation (this one isn’t really needed)

However I’m planning to change these rules slightly and go for the sub-set of rules written by Max Brooks in his books World War Z and The Zombie Survival Guide due to the fact he goes to close description in their “hunting” methods and tracking process.

The Plan…Batman

As a start I'm planning to program this in Java and to simulate the infection from ground zero outwards in a set area of land. I also hope to have different variables regarding the beginning of infection.

To begin with their will only be two starting states. One will be initial inception where one person will have the virus and the outbreak from their. Another will have a single party (1-3 Zombies) will come from elsewhere into the area and cause the outbreak.

For a starting goal the first area will most likely be around 1km x 1km wide and be simulated at 1 pixel = 1 metre level which will allow for a high degree of detail in movement considering the way zombies track.

I do not plan to model weapons or ways for humanity to repel this virus as that is not my original aim but the infection must be modelled to some degree to allow an un-winnable situation.

To begin with the things that are needed are Zombies and Humans with the ability to move while adhering to basic rules (of humanity and inhumanity).

Both need to know their landscape, the area of land also needs to be simulated most likely through a large expanse of white with red dots for zombies and green for humans. Possibly yellow or orange for the infected.

The working title for this is Infection if anyone has anything to add to this in either ideas or articles to the actual spread of a contagion then please contact me.

Sunday, 5 December 2010

Fashion and Zero Knowledge

It’s been awhile since I updated this blog and I decided that now is the perfect time as it’s a sleepy Sunday afternoon and there is no chance of me going out. The last time I updated this blog it was regarding friends with a slightly morbid tone but with a sense of trust regarding mine. I have some good friends that I wouldn’t trade for the world but however today this is not a blog post about me or those around me (at least it’s not focused at that) but let’s see how it goes.

Today I’m going to talk about William Gibson’s books but specifically Zero History, the Fashion industry, the necessity of learning however much we wish not to and my personal opinion of all these things. So grab whatever your poison is and join me in this mystic adventure of swatches and needles.
I think it’s best to start at where this thought chain started which is with William Gibson and more specifically his newest book Zero History. William Gibson is a mainstream and cult writer who has successfully managed to read the pop culture of the time to create some scarily accurate ideas of how technology will evolve in time and what uses it may be put to.

This is not to say that he’s necessarily correct and some of his ideas are truly fantastic (as in fantasy) however, his writing is superb and only getting better with age and his grasp of how language and slag is used is unrivalled. For all you doubters out there and you know who you are, there is one word in common usage that Gibson actually wrote and coined. This word is everywhere in our world and is used daily, this word is Cyberspace. Even MS Word doesn’t complain when you write it! That has to be some kind of seal of approval?

Anyways less about Gibson and more to the point. In his latest book he speaks of Fashion, as an industry, and more specifically the subculture of fashion trends which ebb and flow in the undercurrents of society and business that are not noticed by the average person during their daily lives.

 Have you ever wondered who makes the decision for the entire world to suddenly decide to change trends? Who decides to wear jeans around your hips rather than your waist? People that’s who but this has to start somewhere and Gibson decides to take the idea of viral marketing one step further to actual items  that are viral and moves through society being a known unknown which extends beyond the usual brand such as Levi’s.

Ideas of viral, you place an idea in someone’s head and this can expand to the point where everything they do is defined by it. A good example of this is relationships, you tell someone their partner is cheating and suddenly every action their spouse takes is judged by this idea which continues to grow and spread. Imagine if Fashion is the same, someone comes up with a new kind of jean design and people are wearing this. Manufacturers see this and decide to make similar jeans, these dilute from the original design but still hold the essence of what makes them that design and they spread until the idea dies and interest is lost. There is a point where these ideas become critical mass and they must either die or continue as an accepted tradition or design in its own right.

Fashion is a strange business which has a strange set of strictures around it. My girlfriend is studying Fashion and Dress History at Brighton University which is about the legacy of fashion through all classes’ boundaries and historical eras.

Fashion is big business due to the fact the design is where the real money is made. Clothing is made and sold with normally over 100% mark-up on the original materials. If you’re buying a pair of jeans for £70 then they’ve been made for around £35. This is at odds with how clothing used to be. During World War Two all items were rationed including clothing. The items of clothing that were creating during the war were designed to last and be of high quality so you would not have to buy another. They were designed with the idea that people would know how to take care of their clothing.

A shirt made during the turn of the 20th Century would have cost much, much less than it would have today even with currency changes but it also would have been of much better quality as our society decides that clothing should be discarded if it’s damaged rather than fixed and used again so quality is not at the fore.

Does this seem mad to anyone else? That this can be allowed to happen? Clothing should be of high quality to last and be maintained through its lifecycle. However there is a problem with this which is that it would come at the cost of progress within the industry and maybe even outside it.

Fashion is a very quick industry which has continual cycles of new and old showing in different guises. Gibson recently said in an interview with the BBC: 
"In the 1960s I think that in some sense the present was actually about three or four years long," he said, "because in three or four years relatively little would change."… "Now the present is the length of a news cycle some days," [LINK]

Because of this we have a problem which is that if people no longer have to buy clothing why would they? The business has sped up to the point that there is no longer a timescale of life for a certain item of any kind. The newest iPod may last for only a week until the next big thing hits the same is with fashion which is why I feel that we cannot move back to the old ways and from now you will always have to pay for quality and maybe it’s a social change that needs to happen to make people to feel okay about repairing clothing rather than discarding them.

Now on to the part that talks about learning even though you wish not to. Most of this is things that I have picked up from my girlfriend and through general reading of Gibson and other sources. I’m sure some of this is incorrect and I would be more than happy to learn of my ignorance so please feel free to contact me if you find any.

As Always I’d be interested to hear from anyone out there about my ideas.

Tuesday, 19 October 2010

When the World Comes Down

So it's been rather a long time since I last updated this blog. What's happened? Well as I mentioned last blog I lost my job and moped around for awhile. After that I decided that an old dog may learn new tricks but you certainly have more chance perfecting them with more time. With that thought I went back to school, or more specifically a foundation degree at the local university.

But this rant today is not regarding my current situation, it's to have a chat about friends. I'm talking the real friends that you have. Not the ones that sleeping with your best friend, or you meet randomly at the pub and defiantly not those internet friends you love so much. I'm talking about those that hold your head out of the toilet after too many tequila slammers or listen to you prattle on about anything that cares to slip into your head without so much as sighing or rolling their eyes once.

Pulp fiction once described a friend as someone you could have a comfortable silence with, share a $5 shake and dance the twist with. To me it's a much simpler affair. A true friend is someone that when the world continues on its path and the world crumbles around us, they'll be with you because there's nothing better than being around you watching it fall.

So think about these people, when the world crashing down around us there are people you'd rather be with at the end. It doesn't matter what you're doing or even how you're doing it. It's that you're together to watch the sun become black as sackcloth and the moon become as blood and usher in the end of days.

I know this is rather morbid but everyone knows these people, the ones who will stand by you regardless. It may not always seem like it but we are alone most of the time but it doesn't mean you're not in someone's head somewhere. Hell who knows? Maybe we're all in someone's head really?

Tuesday, 3 August 2010

Journey Through The Midnight Hour


Right so it's 00:17 in the morning and I'm trying to get ready to sleep as I can no longer sleep without getting myself so drowsy that when I get into bed I fall asleep instantly to forgo the act of having to actually converse with the beasts inside my head.
                In this strangely quiet hour I'm listening to an Environmental broadcast from the people at Sleepbot. This is a radio station that continuously plays only soothing environmental and instrumental tunes. It's supposed to be listened to while you sleep to give you a nice soothing mood while you dream away those midnight (or daylight) hours. I stumbled upon it via Warren Ellis' twitter. I find it relaxes me in a way music with lyrics doesn't, it allows me space to think in my own head while not listening to the screaming of the daily world around me. To find this broadcast take a look at the links at the bottom.
                As for why this blog has not been updated since my previous comic related spam it's because I've lost my job. No, not in the sense it's wandering around middle England somewhere but my work considered that I was not doing my job in a satisfactory manor which I suppose I agree with. I hadn't been putting my all into my job primarily because I was only there for the paycheck at the end of the month which never bodes well. I'm currently looking for a new job while trying to convince the British Government that yes, I do actually need some money to keep living however much they would rather not give me any.
                It's odd really that I continue to avoid the fact that If I want to succeed in what I really want to do which is Programming and more specifically game and UI programming. Then I will someday have to actually focus and do something regarding it. However I have no experience, no qualification and even no idea how I would go about such a thing. Yet I entertain ideas that someday I may be as technically amazing as Chris Delay of Introversion or Brad Wardell of Stardock.
                At this hour I find solace in that I'm still young and I can still learn new things but I feel downhearted at the fact no university seems to want to accept me on any course related to computer sciences. I feel I have an ability for computers within me yet no matter how hard I try I can't progress to where I want to be. I'm studying for a Java certification that I'm not sure is worth anything as without experience who would be interested in hiring me?
                I understand this is pretty much emo droning and It should clear up with the sunny skies (read: grey) but I feel self expression is a high form of indulgement that allows certain aspects of myself to reveal themselves in this case being that I'm melancholy and want a break.
                Well sleep starts drive me, the sleepbot is whispering sweet nothings in my ear and it sounds similar to The Real Folk Blues from Cowboy Bebop. Quiet, sad and beautiful. I feel night is the most refreshing time in a day. It gives us all time to recharge, relax and regardless of sleeping or awake be rid of others in our lives to recover our sense of being ourselves alone rather than us with others.
                Well that's enough rambling I think. It's 00:46 and my piece continues. I think I'll wind down a little more before sleep. I suggest checking out the links below to certain people or things I mention and let me know if anything I said makes any sense to you. I'd always like to know.
Warren Ellis - http://www.warrenellis.com - twitter: warrenellis
Brad Wardell - http://www.stardock.com/ - blog: http://draginol.joeuser.com/
Chris Delay - http://www.introversion.co.uk/ - blog: http://www.introversion.co.uk/blog
Sleepbot - http://www.sleepbot.com/ambience/broadcast/
Cowboy Bebop - http://en.wikipedia.org/wiki/Cowboy_Bebop