Monday, June 30, 2014

ESO Update 2

I'm a little behind with my ESO news.  I know it's not the hot new thing anymore, that title belongs to WildStar.  But I am still quite interested in what goes on with it though.  It feels like Update 2 came pretty quickly after Craglorn's release.  Although, I'm not the best judge of time anymore.  As you get older, it feels like it passes quicker.  The patch notes for this update are pretty hefty.

Crypt of Hearts.  They released a veteran version of this dungeon.  While neat, it is of no interest to me.  I barely have time for solo content much less the group content.  This makes the second update in a row where the focus has been group content.

Lighting.  I won't pretend to understand how they did it, but they made improvements to how windows and lighting from them works.  The screenshots they provided look excellent, so it should provide some improved ambiance.




Weapons and Armor.  You can now pick up weapons and armor throughout the world from racks and other placements.  I'm not quite sure why they did this, as they don't seem very useful.  They are not worth anything, they are low quality, and they don't give you much of anything when you deconstruct them.

Bug Fixes.  There are a huge amount of bug fixes and balance changes included with this patch.

It was a decent patch, especially considering the turnaround time.   I do wonder what they have on tap for Update 3 though.  Hopefully it will include some non-group content.

Friday, June 27, 2014

They Got Me

I'm usually pretty prudent (read: cheap) when it comes to buying things.  Sure, there are exceptions but for the most part I don't go crazy.  Steam sales never pried too much cash out of my wallet.  In fact, I was thinking I'd get through the whole summer sale without a purchase.

That was until yesterday.  Kerbal Space Program was on sale for $16.  KSP is a game I have watched from afar for a while.  I loved reading about people developing their space program and exploring the solar system.  I was always hesitant to jump in though.  This sale was just the push I needed.

Now I just need to make some time and play the game.  Still, it is nice to know it is there waiting for me.  It's an extraordinarily deep game, so I'll really need to set aside a decent chunk of time to get started.  I may give WildStar a whirl first though so I can see where I stand with it.




Thursday, June 26, 2014

Dropping MongoDB for Redis

Up until now,I have been using the NoSQL database MongoDB for Project Venice.  It is very neat and easy to use.  It is almost perfect for my needs.  However, the more I thought about it, the more I was bothered by one feature MongoDB lacks:  transactions.  This is kind of a deal breaker for the game prototype I am developing.

Let's look at the scenario of a player buying an item off of a marketplace.  There are 2 main things that need to happen:

1)  Check and deduct item inventory
2)  Check and deduct player funds

This would involve two MongoDB documents.  While each of the two can be done atomically, they can't both be done together.  So stuff could happen in between.  This would be a bad thing and lead towards all sorts of problems.  MongoDB just does not support atomic operations across documents.

I started to research alternatives.  A traditional relational database ( mysql, postgresql ) would do the trick but I didn't really want to go that route.  This prototype is about learning new things, so I wanted to stick with NoSQL.  Redis and FoundationDB ended up being the two I seriously looked at.

FoundationDB has full ACID/transaction support but looked pretty daunting.  Redis, on the other hand, has transaction support ( but no rollback ) and looked very simple to use.  Keeping with the KISS philosophy, I went with Redis.  Implementing it was very simple and did not take long.  So now Project Venice is full on Redis-fied.  

Redis also has the advantage of being memory resident, so it is very quick.  The drawback is that it needs a lot of RAM.  I'm not anywhere close to needing to worry about that though.

Tuesday, June 24, 2014

Window to the World

My first milestone for Project Venice was to make a chat system.  With that complete, it is time to make my next goal.  Project Venice is heavily data driven and makes use of HTML to interact with that data.  An entirely form based game isn't going to cut it in 2014.    So, there will be a 'window to the world'. 

With this feature, you'll be able see the solar systems (only one in the prototype) and ships.   I am going to use Unity for this part of the project.  I was tempted to go HTML5, but Unity is better (quicker) to prototype with.  Basically, the Unity web app will use Socket.IO (web sockets) to get data from the server.  So all of the locations in the solar system will be displayed in the Unity window.  It'll be an isometric view, so think birds-eye but at an angle.  

Not only will locations be view-able, but you'll be able to see starship traffic between them.  This traffic will all be caused by player activities.  The main goal of this feature is to let players have a visible effect on the game world.  So if a new trade route develops, you'll be able to see traffic increase between the locations.   We need to crawl before we walk, so the goal here is to just have planets showing up and for the app to be integrated into the webpage.

Monday, June 23, 2014

Almost, WildStar. Almost.

Over the weekend we were out running some errands.  One of our stops was Target.  As per usual, I made my way to the electronics section to hang out while the wife did some shopping. I had no plans to buy anything, but you never know.  So I was looking through their selection of PC games, and much to my surprise I came across WildStar.

Sure, I can buy WildStar anytime online.  But there is something about holding a box in my hand.  I guess it reminds me of the old days when you could only buy PC games in a store.  So there I was, WildStar in hand all set to give in to the impulse buy.

I just could not pull the trigger though.  The $60 price tag just felt like too much, plus it would be my third subscription fee if I stuck around.  I was just not confident that I would get my monies worth.  I also remembered that WildStar offered guest passes.  Getting my hands on one of those might just scratch the WildStar itch.


Friday, June 20, 2014

ESO vs WildStar

ESO and WildStar are the two new hot games.  I'm currently only playing ESO, but I still pay attention to what is going on with WildStar.  Just this week, WildStar announced their first content patch, The Strain.  Its a good time to compare the kind of updates each game is putting out.

ESO.  Craglorn is already live, and the Crypt of Hearts has been announced.  Both introduce new group content to the game.  Craglorn included a new zone for groups to explore and ESO's first trial (raid).  It also bumped up the veteran rank to 12.  The Crypt of Hearts is introducing a veteran version of an existing dungeon.

WildStar.  The Strain will introduce two new zones.  These zones have solo and group content with no level increase.  They also include new 20 player group content.  PvP considerations were also made when building these zones.

And the winner is...  WildStar!  Unlike ESO, WildStar is introducing content for all types of players.  If I played WildStar, there would be something for me.  Also, the Veteran level creep in ESO is a bit concerning, so I am happy to see WildStar not going there just yet.

Thursday, June 19, 2014

Chat it up!

With Project Venice, I am setting concrete goals for myself in order to keep the project moving.  The eventual goal is a playable prototype.  My first milestone was to create a working chat system.  This involves people to be able to log in, and send messages to each other.  It sounds simple, but I had to create an account system, and get client to server communications working.  So a lot of base work for future systems had to be put in place.

To handle the chat system, I leveraged Pusher.  Pusher is a web sockets Publish/Subscribe system which makes it very easy to handle real-time communications.  Clients subscribe to the global chat channel, and on the server side I send messages to the channel and everyone gets them. Very easy.  I could have had clients send messages directly to each other, but that has its drawbacks.  I need to sanitize what is sent, so going through the server is a necessity.  Don't need folks sending XSS and other such nastiness. 

I also implemented a Title system.  Everyone starts out with the title 'Citizen.'  You can change your title, if you had more than one.  Right now the title is just used in the chat system.  That's another reason I need to go through the server, so I can add title information.  

You can check it out (and test it) here:  http://venice.duckdns.org/signin  There probably won't be anyone to chat back, but if you see your message in the window, it worked. 
 


Tuesday, June 17, 2014

Lots of Money

I was working building out some Project Venice data structures, specifically money, when it occurred to me that an Integer value would not be enough.  It would only allow players to have ~2 billion bucks (  2,147,483,647 exactly).  While that is more than enough for the prototype, I figured I better solve that issue now by moving to 64bit integers.  That will give us a max value of 9,223,372,036,854,775,808.  I think that should be enough :) 

Javascript does not really support 64bit numbers, which will make doing things like addition and subtracting difficult.   By default, mongoose ( the ORM adapter I am using for MongoDb ) also does not support a 64bit integer data type  Luckily, there is a workaround with mongoose-long.  So I went ahead and added that to my package.json file then did a npm install ( or you can do npm install mongoose-long).

Next, I adjusted my database schema and added:   money:mongoose.Schema.Types.Long

Now you can pass in really large numbers to the money field, hooray!  We're not quite done yet though.  The Long datatype is actually made up of a few fields and looks like this:  money: { _bsontype: 'Long', low_: 1942892530, high_: 2874 }.  That's not very useful, so we need to use toString() on it to get it to display as a readable number again.

If you are not using Mongoose, I'd suggest node-bigint.  It is pretty to use:  

var m = '1000000000000';
var lotsofmoney = bigint(m).add(10).toString();

With these options, Project Venice now supports a whole lot of money.  What will you do with it all?  Well, that will be the fun part :)

Monday, June 16, 2014

Bite-Sized Gaming

These days, finding the time to game is becoming more and more difficult.  Between work, projects, and family, gaming just gets lost in the mix.  That is unacceptable!  I will find a way to play games regularly again, even if it is not as much as it used to be.

I think the answer lies with how I work on my projects.  I pick one small task to accomplish each day, and no more than that.  I think I need to apply the same philosophy to my game playing. I am going to pick a small task, like doing a quest, and just try and accomplish that.

ESO is still my main game, so I will apply this new plan to it.  I'm just going to try and do one quest, or explore one area per day.  I will still progress at a glacial pace, but it is something.  Speaking of bite-sized gaming, it is also one of the core ideas behind Project Venice, but more on that later :)

Thursday, June 12, 2014

Farewell Rivs

Yesterday, some horrible news came across my Twitter feed.  Fellow blogger, Rivs (River), had apparently passed away.  He was only 41 years old.  Rivs was a fixture on my blog feed for as long as I can remember.  He started the Way of the Chosen long ago to cover Warhammer Online.  Then he moved to A High Latency Life to cover just about anything he wanted.

We talked many times through comments and a lot via Twitter.  He was always friendly and willing to help.  I still hope that this is all some elaborate joke, as he did have an interesting sense of humor.  I'm afraid that is just wishful thinking though.

Rivs, thanks for everything, you will be missed.

Wednesday, June 11, 2014

Concurrency

I've reached the point where I am ready to do some coding for Project Venice.  I'm starting with the basics: client to server communications.   Node.js is a bit different the way it approaches things.  Unlike other programming languages, it is not very sequential.  Instead,  it's all about doing work when a call has completed, rather than just being next in line.  

My client (the browser) will communicate with the server (Node.js) using AJAX.  So what happens if a user double clicks a button and one request arrives before the previous one is finished?  That is the problem I am most worried about.  In fact, this issue may also affect my Google App Engine projects, but to a lesser extent.  In any case, it is time I solve this problem for good.

Here is a scenario example from the same user who is attempting to purchase some in-game good twice:

Request A: Check Funds
Request B: Check Funds
Request A: Subtract Funds
Request B: Subtract Funds

When we get to the last step, there may not be enough funds left since it doesn't know a previous request subtracted funds.  That is a big problem.  So how do we go about ensuring requests don't interfere with each other?  MongoDB, which is what I am using for this project, doesn't have a concept of transactions. Nor does it really let you lock anything specific down.  But is does provide a method to avoid the above issue.

MongoDB provides a findAndModify() function which lets you query and update a document atomically.  That means it will happens at the same time and other db operations won't happen in between.  Mongoose, the Node.JS ORM, provides wrappers for these functions: findOneandUpdate, findOneandRemove, findByIdAndRemove, findByIdAndUpdate.   An example from https://groups.google.com/forum/#!topic/mongoose-orm/5b94sq-pjsg:

var query = model.findOneAndUpdate({
      _id: 123,
      balance: { $gt: 10 }
    },
    {
      $inc: { balance: -10 }
    });

Using these functions,  I can avoid some concurrency issues.  However, these are only good for a single MongoDB document.  What happens if I am accessing multiple documents?  That is a post for another time. 

Tuesday, June 10, 2014

E3 Highlights

I was lucky enough to be able to catch the major press conferences yesterday.  I'm not counting Sony for a couple of reasons.  One,  it was on after I wrote this and two, I don't have a PS4.  I currently have no plans on getting one as my PS3 Blu-Ray player is doing just fine.  I did watch Microsoft, Electronic Arts, and Ubisoft though.

I would say EA had the best conference of the three.  Microsoft was surprisingly full of games, but none of them really did much for me.  I was hoping for something very ambitious, but did not see anything like that.  I stink at multiplayer shooters, and always will.

EA started off with Star Wars Battlefront!  I know I said I was bad at shooters, but Star Wars!  I always liked how the previous games worked with big battles.  The next iteration running on modern hardware could be amazing.  Sadly, it is not coming out until 2015.

The second thing I liked from the EA conference was the Mass Effect info.  Sure, it was next to nothing, but it was still awesome.  If they are going for bigger and better than the original trilogy it could be spectacular.  A more open universe to explore with BioWare quality is what I am hoping for.  Considering how little they told us, it has to be far away :(

Honorable mention goes to the Dawngate video.  Neat to see EA putting it out in front of everybody.



Monday, June 9, 2014

Sixth Anniversary

On this day six years ago, I made my first blog post.  I don't think I envisioned it making it six years, but here we are 1,655 posts later.  Time sure flies and my life has changed quite a bit since then.  I'm working a new job and have a couple of kids now.

I started this blog to talk about Warhammer Online.  It's a shame that I outlasted it, but many years of fun were had.  Lucky for me, the name Werit is general enough that I can switch the focus of the blog.  Not that I really have a focus now,  I kind of cover anything that interests me at the time.

Thanks to all my readers, without you it would be much harder to get the motivation to blog.  Do I have another six years in me?  I don't know but I sure hope so.

Friday, June 6, 2014

I am not satisfied

Looking at my game playing for the last year or so it is clear that it has been in decline.  Working and the family are part of the story, but really don't explain it all.  I think the biggest contributor is that I just don't get any satisfaction by just playing a game anymore.

During the time I played WAR I was an active blogger, part of the Core Tester team, and ran the Arsenal of WAR website.  So I did more than just play the game.  I really enjoyed all that too.  Now I find it hard just to play a game without all of the extracurricular activities.

Instead, I've turned my attention to projects like Sites with Benefits and Project Venice.  Both allow me to be more than just a user or player.  Don't get me wrong, I still like to play games.  I just don't get as much satisfaction from them as I used to and that leads to less playtime.

Thursday, June 5, 2014

Farewell Mythic

Last week, the news came down that EA shut down Mythic Entertainment.  You may know the name from such games as Warhammer Online, DAoC, and Ultima Online.  Although at the time of its demise it was focused on mobile games.

The games that made it famous, except for WAR ( :(  ), were recently transferred to Broadsword Online so they will live on.  I think the staff responsible for the games went with them, although I could be just making that up.  As for the mobile games they developed, I'm not sure if they will go on or not.

I am pretty bummed about the news, mainly for the folks who worked there.  The people at Mythic were always very good to me.  I was given the opportunity to visit them on several occasions.  They were trips I will always remember.  It made WAR more than just a game to me.

I also made friends from from the trip, both with the folks there and other bloggers.  I still talk to them today.  Although, if Keaven would get on Skype it would make things easier!  So, thanks for everything Mythic folks and I look forward to the next stuff you work on :)

Wednesday, June 4, 2014

Logging In

One aspect of my previous projects which I liked was that you could log in using existing accounts on Google, Facebook, and others.  It is convenient for the user and it saves me from managing credentials.  Sounds like a win-win to me.  The only downside is that people can get confused which account they logged in with before.  I think the upside outweighs the confusion issue though.  I want the barrier of entry to be as low as possible.

Sites with Benefits leveraged Janrain for authentication.  I'm going to go a different route with Project Venice, Passport.  This solution was built for Node.js and supports a large number of authentication providers including Twitch and Steam.  To start with I am just going to use Google.   Well, that was the plan at least.  Instead, I was greeted with:  OpenID auth request contains an unregistered domain.  It seems Google has depreciated the OpenID method of authenticating for new sites.

The 'proper' way to do this now is with Google+.  Luckily, there is a Passport Strategy for this as well, so it is easy to plugin.  On the Google side, this post explains how to get started.

Initially, I tried to create OAuth2 tokens using my hosts IP address.  Google did not like that for the redirect URI, as it wanted a hostname.  I don't want to buy one quite yet, so I went to http://www.duckdns.org and created one.  Google is now happy with that.  

With Google+ authentication working, I went ahead and hooked up MongoDB so I can actually create a user.  I don't really want to use any of the name information I get from Google, so players will have to create a username when they log in.  That means I will also have to develop a filter to prevent obscene names. 

You can log in an try it out :)  Let me know if it works or not.  You won't receive any spam as the database won't last long. 

Tuesday, June 3, 2014

Project Venice: Milestone One

In order to keep on track with my new game initiative, Project Venice, I am going to break it down into smaller chunks.  The feeling of progress is very important to keeping a project going.  The end goal is just to make a prototype, which is still a lot of work.   So I've defined what my first milestone for the project will be.

Chat System.  What is a multiplayer game without a chat system?  I think this is a useful and reachable goal.  It requires a working login system, account system, and client - server communications.  As part of the chat system I really want to include configurable titles.  So what better time than now to add support for them?

E-Mail Verification.  As a part of the account creation system, I want to allow people to change their email address.  To do this, I need to verify the address exists which means I need a mail system. It's not the most exciting of projects, but one that needs to be done.  I do this for Sites with Benefits already, so I just need to port it over to Node.js.  

I've already made good progress towards my goal of a chat system.  I hope to have a demo of it all up and going very soon.  

Monday, June 2, 2014

Ascent: Choices

Sadly,  I didn't get much time to play Ascent this weekend.  However, that's not to say I wasn't thinking about it which is a hallmark of a good game.  I really need to figure out my path forward, as I have several possible routes.  Currently, I am flying a 160 ton Falcon and have 3 million credits to my name.

New Ship.  I can just barely afford the Squid, which has a 320 ton cargo hold.  I've been advised to skip this ship as the view from the cockpit makes mining difficult.  The larger cargo hold would make a lot of things easier though.




Mining Beam.  I currently use the basic class 1 mining beam.  I've been told that upgrading this is well worth the money.  For a 3 million credits I can get a class 3 beam.  This should improve my mining by a good amount.

Hyperdrive.  I could invest in a class 5 Hyperdrive and start exploring.  This is a part of the game I am really looking forward to, but does not really help me make more money.




Construction.  I still want build my own Mining Beam, but there is quite a bit to be done before I am able to do that.  I need to build a Starbase Warehouse which involves 2,000 Iron.  That is a lot of trips for my Falcon, so I am leaning towards a ship upgrade first.

Miners Guild.  This isn't really a choice, as I am planning on doing it.  The Miners Guild is a group of players working together.  Besides the social aspect, they offer discounts on items like the Mining Beam, so I may be able to get a good deal.  They have a website:    http://miners-guild.com/