The Last Month

1 Nov

During the last month, I’ve learned MonoGame for Windows, created two games, one for myself and one for the Bacon Game Jam. It was a very interesting month but I came to a point where I have to decide how to move forward. Should I continue the way I started or should I take a step back?

Basically I can say, I love MonoGame! I love developing in Visual Studio, I love the logic and the way how things work in XNA/MonoGame.

One thing I don’t like about MonoGame is related to the platform. Either you develop for Mobile with MonoGame or you develop for Windows Store. That’s the reason why I’ve decided to spend the next month learning some Flash game development. Flash is very different than MonoGame in every aspect! I like the fact that you can simply but the game on a web site and people can enjoy it!

That’s it for the moment 🙂 I’ll keep you posted!

Advertisements

Days 19 & 20: Collision Detection 2.0 – Which side was hit?

29 Oct

If you check out my last blog post, you see the game I did for the BaconGameJam last weekend. I’m still working on improving the game as I want to release it on the Windows Store and maybe port it to Windows Phone 8.

One issue I had was with the current collision detection. All I did was to check, whether the ball hits a tile or not. If the ball hit a tile, i inverted the Y-Velocity. This works great and is OK as long as the ball hits the tile on the top or bottom. If the ball hits a tile on the side, the Y-Velocity should stay the same and the X-Velocity should invert.

This is how I’ve created the detection:

  1. Check if the BoundingBoxes of the objects Intersect – otherwise there is no need to further check for collision.
  2. As the tile is a rectangle, I know its edges which i define as: yTileMax, yTileMin and xTileMax, xTileMin.
  3. I calculate the distance from the center of the ball (Position) to all the edges of the rectangle (tile).
  4. If the distance from the ball to xTile is smaller than the distance from the ball to the yTile, the ball hit the tile on the side.

I had to draw this on a piece of paper to understand it myself 🙂

Check out the code, this should make it a lot clearer:


public static int CollideSide(SpriteObject ball, SpriteObject obj2)
 {
 // 0 : No Hit
 // 1 : Hit on Side
 // 2 : Hit on bottom/top

if (ball.BoundingBox.Intersects(obj2.BoundingBox))
 {
 float ballSize = ball.SpriteTexture.Width / 2 * ball.ScaleX;
 float obj2Size = obj2.SpriteTexture.Width / 2 * obj2.ScaleX;

// Tile Hight
 float tileHight = obj2.SpriteTexture.Height * obj2.ScaleY;
 float tileWidth = obj2.SpriteTexture.Width * obj2.ScaleX;

float yTileMin = obj2.PositionY - (tileHight / 2);
 float yTileMax = obj2.PositionY + (tileHight / 2);

float xTileMin = obj2.PositionX - (tileWidth / 2);
 float xTileMax = obj2.PositionX + (tileWidth / 2);

float yDistMax = System.Math.Abs(yTileMax - ball.PositionY);
 float yDistMin = System.Math.Abs(yTileMin - ball.PositionY);
 float yDist = System.Math.Min(yDistMax, yDistMin);

float xDistMax = System.Math.Abs(xTileMax - ball.PositionX);
 float xDistMin = System.Math.Abs(xTileMin - ball.PositionX);
 float xDist = System.Math.Min(xDistMax, xDistMin);

if (yDist < xDist)
 {
 return 2;
 }
 else
 {
 return 1;
 }

}
 return 0;
 }

Days 16 – 18: Bacon Game Jam – Rainbow Ball

27 Oct

Friday was the start of the Bacon Game Jam with a very interesting topic: “Rainbows”. I didn’t spend too much time thinking about what kind of game I’d like to create as the time is limited and my main goal was to learn new things during the weekend.

Now, at 2:40 PM I’m already finished with my game and am able to “release” it.

What I’ve learned

  • One major drawback of using Windows SDK and MonoGame for a Bacon Game Jam is pretty obvious: How to distribute the game? There is not enough time to release the game on Windows Store for people to rate it. That’s why I have to describe the installation process, which is a pain! And I think this will cost me a lot of reviews.. furthermore not a lot of people are running Windows 8, therefor the audience is very small 😦
    Nevertheless, I’d never think about using another engine to develop my games, as MonoGame is just way too cool!
  • 48 hours is more than you think it is! it is fascinating to see, what you really can do in such a short period of time…
  • A good template / framework helps A LOT!

Tools used

Let’s step back a bit and go back to friday evening. The following is, what I had at hands at the beginning of the Bacon Game Jam:

  • Development Environment – nothing special: Visual Studio 2013 Ultimate & Team Foundation Services for Code Check in
  • MonoGame Framework & Template I’ve described in previous posts
  • Inkscape for my vector graphics

The Result

Let’s start with some screenshots 🙂

First, the Main Menu: Nothing special, simple XAML-Code. One thing I really like is the Statistics Box at the bottom.

screenshot_10272013_143428

Next, the Settings Page. Allows the user to set his player name for the high scores and allows him to reset the statistics (Times Played, High Score, Highest Level)

screenshot_10272013_143435

High Scores Page – loaded from Scoreoid

screenshot_10272013_143515

Game Play:

Basically you start with a very big board and very big tiles to hit. Whenever all tiles on the screen are erased, the next level starts with more tiles and a smaller board.

screenshot_10272013_143526

screenshot_10272013_143536

screenshot_10272013_143550

The Game Over Page allows submission of the high score to Scoreoid.

screenshot_10272013_143600

Game Files & Installation Instructions

You can download the ZIP containing all files here:

Dropbox

System Requirement

  • Windows 8

Installation

Now, let’s talk about one frustrating part of Windows Store Apps…. Installation without the Windows Store.

Follow those steps:

  1. Unzip the ZIP to a folder.
  2. Open Windows PowerShell as an administrator
  3. Execute the following command: Set-ExecutionPolicy unrestricted
  4. Hit OK.
  5. Execute the PowerShell File Add-AppDevPackage.ps1 from the extracted folder
  6. When you are done, execute the following command: Set-ExecutionPolicy default
  7. Now you should be able to find the Game: Rainbow Ball as a search result in your Windows 8 start menu.

Days 13 – 15: ListView ItemTemplate for a High Score Table

24 Oct ListView High Score Table

If you’ve read my last post about my Game Template you are pretty much up to date on my work progress. What I’ve been doing the last three days in my spare time is styling the display of my high score table.

Let’s start with a screenshot of the result:

ListView High Score Table

High Score Table

The XAML Code

First let’s have a look at the XAML code used to display the high scores:


<ListView x:Name="ReviewsListView" Grid.Column="1" Width="Auto" Height="Auto" Margin="100,0,0,0"
 Background="{StaticResource ApplicationPageBackgroundThemeBrush}"
 SelectionMode="None">
 <ListView.ItemTemplate>
 <DataTemplate>
 <Grid HorizontalAlignment="Stretch" Margin="3" Width="Auto">
 <Grid.RowDefinitions>
 <RowDefinition></RowDefinition>
 <RowDefinition></RowDefinition>
 <RowDefinition></RowDefinition>
 <RowDefinition></RowDefinition>
 </Grid.RowDefinitions>
 <Grid.ColumnDefinitions>
 <ColumnDefinition Width="150"></ColumnDefinition>
 <ColumnDefinition Width="*"></ColumnDefinition>
 </Grid.ColumnDefinitions>
 <!-- Grid content here -->
 <TextBlock Text="Rank"
 FontWeight="Bold"
 Margin="5,5,0,0"/>

<TextBlock Grid.Column="1"
 Margin="0,5,0,0"
 Text="{Binding Rank, Mode=TwoWay}"
 HorizontalAlignment="Left"
 Width="90"/>

<TextBlock Text="Name"
 Grid.Column="0"
 Grid.Row="1"
 FontWeight="Bold"
 Margin="5,5,0,0"/>

<TextBlock Grid.Column="1" Grid.Row="1"
 Margin="0,5,0,0"
 Text="{Binding PlayerName, Mode=TwoWay}"
 HorizontalAlignment="Stretch"
 Width="300"/>

<TextBlock Text="Date"
 FontWeight="Bold"
 Grid.Column="0"
 Grid.Row="2"
 Margin="5,5,0,0"/>

<TextBlock Grid.Column="1" Grid.Row="2"
 Margin="0,5,0,0"
 Text="{Binding Date, Mode=TwoWay}"
 HorizontalAlignment="Stretch"
 Width="300"/>

<TextBlock Text="Score"
 FontWeight="Bold"
 Grid.Column="0"
 Grid.Row="3"
 Margin="5,5,0,0"/>

<TextBlock Grid.Column="1" Grid.Row="3"
 Margin="0,5,0,0"
 Text="{Binding Score, Mode=TwoWay}"
 HorizontalAlignment="Stretch"
 Width="300"/>
 </Grid>
 </DataTemplate>
 </ListView.ItemTemplate>
 </ListView>

Some key points about the code:

  • ItemTemplate allows the customization of how the ListView is displayed in a very dynamic and powerful way, as you’ll see in the next few lines
  • I defined the ListView to be shown as a Grid with 4 Rows (<RowDefinition>). When I bind data to the ListView, I’ll generate the amount of rows from code
  • The Grid will display two columns as defined by the <ColumnDefinition> Tags
  • All the values are displayed within TextBlocks which are assigned to the corresponding row and column
  • {Binding XYZ} is used to display a attribute called XYZ in the data source bound to the ListView

In my version, I’m only using TextBlocks but imagine how powerful this can be as you can use ANY control you want. Use pictures, checkboxes, editboxes, …

The C# Code

(The C# Code is mostly copied over from Windows SDK Sample Projects)

</pre>
public class ItemCollection : IEnumerable<Object>
 {
 private System.Collections.ObjectModel.ObservableCollection<Item> itemCollection = new System.Collections.ObjectModel.ObservableCollection<Item>();

public IEnumerator<Object> GetEnumerator()
 {
 return itemCollection.GetEnumerator();
 }

System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
 {
 return GetEnumerator();
 }

public void Add(Item item)
 {
 itemCollection.Add(item);
 }
 }

public class Item : System.ComponentModel.INotifyPropertyChanged
 {
 public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

protected virtual void OnPropertyChanged(string propertyName)
 {
 if (this.PropertyChanged != null)
 {
 this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
 }
 }

private string _PlayerName = string.Empty;
 public string PlayerName
 {
 get
 {
 return this._PlayerName;
 }

set
 {
 if (this._PlayerName != value)
 {
 this._PlayerName = value;
 this.OnPropertyChanged("PlayerName");
 }
 }
 }

private string _Date = string.Empty;
 public string Date
 {
 get
 {
 return this._Date;
 }

set
 {
 if (this._Date != value)
 {
 this._Date = value;
 this.OnPropertyChanged("Date");
 }
 }
 }

private string _Rank = string.Empty;
 public string Rank
 {
 get
 {
 return this._Rank;
 }

set
 {
 if (this._Rank != value)
 {
 this._Rank = value;
 this.OnPropertyChanged("Rank");
 }
 }
 }

private string _Score = string.Empty;
 public string Score
 {
 get
 {
 return this._Score;
 }

set
 {
 if (this._Score != value)
 {
 this._Score = value;
 this.OnPropertyChanged("Score");
 }
 }
 }

}
<pre>
  • We define a class called ItemCollection inheriting from IEnumerable<Object> which allows us to store our items we want to bind to the ListView
  • We define a class called Item inheriting from INotifyPropertyHandler which are the items which will be stored in the ItemCollection.
  • Finally we need to bind our ItemCollection to the ListView using the following line: OurListView.ItemsSource = Collection()

That’s all the magic but I’m very happy that I found a sample in the Windows SDK samples. I wouldn’t be able to figure this out by myself. But using this as a baseline allows me to alter the code the way I need it.

Day 12: Game Framework & Template with Scoreoid

21 Oct

Thanks to the comment from mort8088 to my last blog post, I signed up to Scoreoid and was positively surprised. That’s why I forget about the Azure Mobile Service integration and focus on Scoreoid for my Cloud Storage, High Scores, and Achievements. One reason is how simple Scoreoid is to implement (for all kind of platforms) and the second reason is costs, Azure Mobile Service can get expensive.

Game Framework

Most of the framework I currently use is from the Book “Windows 8 and Windows Phone 8 Game Development” from Adam Dawes. Once again, I can HIGHLY recommend the book! It’s not even a month and I already have a working game and a pretty good framework and template ready! Everything thanks to the book!

Adam Dawes wrote in his book, that the framework can be used in whatever way we want to use it. That’s very generous! Once again a sign, that the game development community is awesome.

That’s why I took the framework as a baseline and extended it towards my needs. Everything related to object management, texture / sprite management, sound management, different game modes, .. is included already by Adam Dawes. At this time I’ve only added a new class to integrate Scoreoid High Score and another method for collision detection. I’ll extend the framework as I work on other games.

Template

My goal was, to create a template, which allows me to create a new game, without the hassle about creating the high score functionality, main menu, settings, game pause, and a lot more. At this moment, the template contains the following:

  • Start Menu
    A start menu with currently four buttons. This allows me to add additional buttons or customize the look and feel with little effort.

Game Menu

  • Settings Page
    A Settings Page with currently only one text input. This can easily be extended. The value typed into “Player Name” is stored in the application’s settings and will be used when submitting high scores.

Settings Page

  • Game Over Page
    The Game Over Page is displayed, when the game calls the Game Page method gameover. This allows me to display e.g. statistics about the played game, achievements earned and information about the current score (e.g. best score today, …) Additionally the player is able to submit his high score from this screen. As you might see: The text gets the players name from the application settings.

Game Over Page

  • Asynchronous Callback for High Scores
    Maybe not that impressive from a UI point of view, the asynchronous callback is very important when working with network resources. My game needs to wait for Scoreoid to store the high score before a new game should be started.

Asynchronous High Score

Next Steps

At the moment, I might be working a bit too much 🙂 So I’ll be not working on this project tomorrow. For Wednesday I’d like to target the following goals:

  • Include Achievements into the Template & Framework
  • Display High Scores with four categories (I’m looking forward to this task as I can finally utilize the Windows 8 App design with different pages and swiping!)
    • Today
    • Weekly
    • Monthly
    • All Time

That should be enough for Wednesday.

Day 10 & 11: My Next Game

20 Oct

Today’s post is a very short one, as I haven’t done a lot. Nevertheless I want to keep up posting daily or every second day to keep a log of what I do and what I don’t do.

I haven’t had a lot of time yesterday to work on my projects as I had to go to class the whole day. Nevertheless I finished the submission process for the game to the Windows Store.

Now I only have to wait until the game gets approved or rejected. 🙂

My Next Indie Game

I already know exactly what my next indie game will be like but I want to wait for the Game Jam next weekend.

Some facts about my next game without giving you an idea of the topic 🙂

  • The game will be written in MonoGame
  • The game will be released on Windows Store and Windows Phone Store.
  • It is a very simple game
  • The Game will feature 5 different screens as this is something i wanted to do with my current game but haven’t had the time.
    • Start Menu
    • Game
    • Settings
    • High Scores
    • Credits
  • The game will have background music – also one thing I want to learn how to do.
  • I’m still unsure if I should add network support. I’d love to get into azure development and make e.g. High Scores available over the internet. Maybe there is a simple way to include this with the Windows Phone SDK?
  • Make a dynamic Live Tile which shows the current High Score of the player and if I decide to include networking, the top High Score for the world.

Thanks to the book I’ve read, I already have a framework which allows me to do most of the things I want to include. What I’m currently unsure about how to do is, how to include networking and dynamic live tiles, but there are a lot of templates out there.

The Upcoming Game Jam

I can’t wait for next weekend to attend my first game jam. I’d like to participate in a team, but as I’m currently a newbie and don’t know a lot about game development, I first want to get some more experience and maybe search a team for the next game jam.

I’ll be updating my blog often during the game jam to create a small log of what I did when. Something like a SCRUM development with hourly sprints 🙂 It will be interesting to see how different my planning will be from the reality.

Day 9: Release the Game on the Windows Store

18 Oct

So far I’ve released apps on the iOS App Store and Google Play that’s why I was eager to find out the way Microsoft handles submissions of applications and games for their store. Here are the findings:

Application Certification

There is no application or game in the Windows Store that wasn’t tested and certified by Microsoft. It’s the exact same procedure as you find with Apples iOS App Store with one difference. Maybe I just haven’t looked good enough but I’ve never really found a good guidline about the requirements for a iOS application.

For Windows Store applications, there is not just a guidline describing all the required elements but also an application which is going to test your application or game against several rule and report back what is still missing.

Windows App Certification Kit 3.1

The tool used for this purpose is part of the Windows App Certification Kit 3.1 which was released yesterday as part of the Windows 8.1 SDK.

As you can see in the following screenshot, there are a lot of tests being performed:

Windows App Certification Kit Tests

Windows App Certification Kit Tests

Once the tests are finished, a report is being generated showing all the errors.

One thing to keep in mind: You need a Microsoft developer account in order to use the tool which brings me to my next topic… the Windows Store developer account.

Windows Store Developer Account

I am a lucky owner of a MSDN subscription which includes a Windows Store Developer License. Nevertheless I had to submit my Credit Card number and I still need to validate the card what I can only do once I receive the credit card bill. I am not able to submit an application until the credit card is validated. Something I don’t understand but well.. I have time 🙂

Finalize Images & Describtion

There’s still one final part for my game before I’m able to release it. I need to create a lot of pictures and descriptions for the Windows Store.

  • Logo: The default 150 x 150 logo of the application. This is the default size for an item in the Windows Start Screen.
  • Wide Logo: The 310 x 150 logo. This is not a required logo but I added one as it looks cooler than the default logo due to more space available 🙂

WideLogo

  • Small Logo: 30 x 30 logo. Nothing special. I just took the 150 x 150 logo and scaled it down to 30 x 30.

SmallLogo

  • Splash Screen: A 620 x 300 pictures which is used whenever a user starts the game.

SplashScreen

  • Store Logo: A 50 x 50 version of my 150 x 150 logo 🙂

StoreLogo

Apart the images, there is a lot of documentation that needs to be written or thought about before submitting the application: [Source: http://msdn.microsoft.com/de-de/library/windows/apps/hh694062.aspx]

  • Name – The name of the application which can be up to 256 letters (I’d like to see an application with such a long name!)
  • Selling details
    • Price, Trial Periode, Countries/Regions, Category, …
  • Description
    • Application Description – Up to 10’000 letters
    • Features – Up to 20 features, each with a maximum of 200 letters
    • Keywords – Up to 7 keywords, each with a maximum of 45 letters
    • Notes – Used to describe new released with up to 1500 letters. This is not used for a first release
    • Copyright and trademark info – 200 letters
    • Additional license terms – Up to 10’000 letters
    • Screenshots* – Up to 8 screenshots, each with a maximum of 200 letters as a description
    • Promotional Images* – Up to 4 pictures in the sizes: 414 x 180, 414 x 468, 558 x 756, 846 x 468
    • Recommended Hardware – Optional, up to 11 short comments with up to 200 letters
    • App Website – This will be my blog 🙂
    • Support Contact – Again, my blog 🙂
    • Privacy Policy – This is a requirement for most applications. URL with a maximum of 2048 letters. Luckily I’m not required to write a privacy policy, as this is only a requirement, if the application is sending/receiving data over the network. My game is basic and far away from being able to use networking 😉

* Both screenshots and promotional images is something I still have to do. What I’m missing somehow is the ability to upload a video, I’d love to upload my game play video as an asset.

Next Steps

I’m just going to continue finishing all the needed parts to be able to release the application. I’d like to release the application in October, this way I’d be able to add it as a finished game in my http://www.onegameamonth.com/indifab profile.

Day 7 & 8: Gameplay Video

17 Oct

The Last Two Days

I haven’t had that much of time to develop in the last two days due to my day job. Nevertheless I was able to further polish my game and I declare it to be finished. I know that there is still a lot to improve but I want the game to be finished for me to start a new development project. Furthermore I want the game to be playable by others and see their reactions.

If I look back at the project and think about my knowledge at the beginning (approx. 2 weeks ago) I am a bit proud of myself.

BaconGameJam

While surfing the internet yesterday and looking at game development sites once again, I saw something I wasn’t aware off before: Game Jams. A game jam is some kind of a contest where you get a fixed amount of time and a topic and you need to create a finished came in this period of time related to the topic.

I really like the idea and signed up for my first game jam which will be during the weekend starting on 25. October 2013.

I want to see if I am able to finish a game within 48 hours with my current set of skills.

To prepare myself I hope that I’ll find some time to extend the framework I’m currently using to make programming faster.

Week 1 Recap

It’s more than one week since I’ve started this blog and reading my earlier posts, I’m pretty excited for the future. I hope I can continue to make such progress.

Gameplay Video

One more important topic of today’s post is my first gameplay video. After “finishing” my game, I’ve created a short gameplay video and uploaded it to YouTube. I’m very eager to hear opinions from other people – especially game developers – about my game.

Check it out: http://youtu.be/U_j2iLItbzo

Next Steps

The next steps will be working towards the goal of releasing the game on the Windows Store. I’ll have to read through all the policy documents and maybe have to adjust my project to meet all requirements. After that I’m going to submit the game and once it is accepted, check out the possibility to port it to Windows Phone. I’d like to release it on both platforms.

I hope to finish this by the end of the next week. After that, there will be the Game Jam and then I would like to start my new project.

Development Statistics

One thing I would like to start doing, starting next week on a daily or bi-daily basis is, writing down my development statistics.

This included but is not limited to:

  • Lines of Code
  • Assets used

Once my game is released, I would also like to include figures like # of downloads per released platform.

Day 5 & 6: Cleaning up the Mess!

15 Oct

When is a game finished?

The last two days I was thinking a lot about when to finalize the development of a game. In my opinion you could be developing for years and still have enough new features you would like to implement and include in your game. So when is the right moment to not include any more features and start finalizing the game?

As my one and only reason to develop my current game was to learn, I can say with 100% certainty, that my project is finished! Although I’ve planned to include a lot more features in the first release, I’ve decided to go with the state I currently have. No more new features!

As this is the first game I’ve created, you can imagine the chaos in my Visual Studio and the many errors 🙂 I will take what I’ve learned and start over with a new game and see how far I’ll get with the new development project.

Next Steps

Not really the next steps for me, but the next steps after I’ve decided, that my game is finished from a features’ perspective. There is still a lot of work to do, before I’ll finally be able to release my game. Everything needs to be cleaned, everything needs to be smooth and so on. I’ve been working on this part for the last two days and might need up to one week to declare my game as “ready for release”.

I can’t wait to finally release this game. Not because I want to see it on the Windows Store, but because I want to start a new project.

Testing

I’m still not sure whether to ask someone to beta test my game or not. I would love to but it feels a bit selfish to ask someone to test a game that is as small as my game. It is my first game and I’m proud of it but this is not something that someone else should care about. A tester want’s to see a nice and smooth game, not something a beginner has created 🙂 So I might not be asking on the interwebs but ask some friends to play around with the game for a bit.

Day 4: No XAML for me!

13 Oct

As written in some of the previous posts, I had to read through some chapters to get to know the usage of XAML in MonoGame development. After some research, I’ve decided to not go the XAML route with my game development. Here’s the pro and cons list:

Why should you use XAML in your MonoGame development

  • XAML is what is used in Windows Store / Windows Phone development. Therefor the user knows what to expect and how to use it.
  • A lot of prebuild functionality useful for your development – saves a lot of time.
  • Easy integration

Why you shouldn’t use XAML in your MonoGame development

  • Windows Store and Windows Phone use different XAML syntax.
  • Not possible to port the game to Android/iOS/ or any other platform.

My goal is to learn as much as possible about portability and not make anything that limits my game to one platform.

In addition to the XAML research I’ve did a lot for my game:

  1. My game is now able to store local high scores. Whenever a game is over, the user gets prompted for his username (if the username was entered the last time, it will be prefilled) and the high score is stored locally.
  2. I’ve added additional art work to the project which you can see here:

CloudN

A new cloud created with Inkscape.

RokketLogo

The game logo and its name.

bg

The background which is shown during the launch of the rocket.

Next steps

There is still a lot of work to do:

  • Game Menu
  • Improve touch input
  • Change art work for: Fuel, Boost
  • Beta testing! 🙂

One thing I’m still unsure if I should include it is: Internet High scores. But I can add it later, there is no need to do this now.