Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1065833 Posts in 43491 Topics- by 35507 Members - Latest Member: M-e-f

November 23, 2014, 08:00:27 AM
TIGSource ForumsFeedbackDevLogsFinishedProject Acorn - A Family-Friendly Risk/Reward Card Game
Pages: [1]
Print
Author Topic: Project Acorn - A Family-Friendly Risk/Reward Card Game  (Read 2460 times)
jolson88
Level 0
**


View Profile Email
« on: April 25, 2013, 02:23:08 PM »

UPDATE: Project Acorn is finished and is now available in the Windows Store!!!! NEXT!!!

Well, after recently joining the TIGSource forums I figured I would start a DevLog to help keep myself accountable and participate in this great community Smiley. I hope this log is received well Smiley.

The Game
As mentioned in the title, Project Acorn is a risk-and-reward card game for kids. Think of it as a card-based version of Farkel/Zombie Dice/etc. in a kid-friendly setting. Being a lone-wolf, all code, art, and music is done by myself.

Menu screen:


Play screen:


Game Over screen:


The goal is to be the first player to save ten acorns. There are four cards to flip-over. A card has a value of one acorn, two acorns, or zero acorns. At any time, a player can choose to keep the number of acorns they have flipped over so far. If a player flips over a zero card though, that player's turn is over and they lose all acorns they've flipped over so far in that turn. If all cards are flipped over, four new cards are dealt and the player's turn continues.

Background
By day, I work for a small company on a small OS called Windows. I've long been interested in game development. The first blog I created and wrote on was primarily about game development (almost 10 years ago now!!!! Though the blog is long gone Sad ). In fact, that blog is how I got the exposure to get my first job here at Microsoft (as a Technical Evangelist). The problem is that I've always spent so much time focusing on framework and infrastructure that I've never made much progress on any game. This time around, I want to focus on actually finishing.

Another thing that happened along the way for me was becoming a father of two wonderful sons (now ages 3.5 and almost 6). Recently, my son has started playing games on my Surface tablet and I came to a conclusion: there's really not that many good kids games in the Windows Store yet. Either it's a memory game, a tic tac toe game, a storybook, or a bad Angry Birds clone.

So in the vein of focusing on finishing games and starting very simple (none of this "How can I build an MMO?" from me Tongue), Project Acorn was born.

Development History (how Project Acorn got to this point)
Project Acorn was first prototyped using homemade cards that my oldest son and I created to play the game on the dining room table. But you know what? I'm a cheapskate. I don't like spending money if I don't have to (especially if there is low chance for me ever getting that money back). I first started building Project Acorn with the free download of Unity 3D using some free 2D libraries that looked pretty good. It didn't take much time at all to get the core functionality of the game built in Unity and working end-to-end.

But then I stopped... As mentioned above, I plan on publishing this first to the Windows Store (I don't have a Mac machine or developer account to publish for iOS and I have no Android device either). The Windows Store support in Unity is currently in Beta and I want to be able to publish this game right away. Eventually, I most definitely plan on targetting iOS. But I first need to earn the money to pay for the gear I need. My hope is to earn that money over time using the money from Windows and Windows Phone games (while at the same time saving money up every month into an "platform expansion fund" Tongue). Also, the "frugalness" has me thinking of Unity as more of a long-term "want to get it eventually" thing as there is also the cost of unlocking publication to each supported platform (it can get spendy).

I started looking for other options and found Game Maker Studio. Once again, it didn't take long to get the core game up and running. Then I started hitting some hurdles. For instance, the ad support for Windows Store apps is broken (or was broken at the time) and ad-funding is one of the predominant monetization approaches I want to try. It also costs money to buy the full version of the software and I didn't want to spend $250-300 to unlock the platforms I care about.

So here I find myself today. Project Acorn is currently built in Visual Studio 2012 using MonoGame. The advantage for me is that everything I need is completely free. So I'm having to spend $0 up-front to do this. As with Unity and GMS, it took very little time to get the core game up and running. Most of the time has actually been spent on polishing the game (consistent graphics, animations, etc.). I want this game to be high-quality when I release. I want to spend that time that is needed to make a game "Done." Then, I will repeat that process with another small game I have in mind. For me, the focus is on _finishing_ this time.

The Code Structure
The actual implementation of the game structure is a Component-Oriented Architecture that I built on top of MonoGame. It is heavily based-on and influenced-by the book Game Coding Complete (one of my favorite game development books of all time, I must say; if you haven't read it, BUY IT Smiley ). I'll talk more about this in future entries. I'm doing a final little bit of refactoring tonight and tomorrow night and then will have it in a fairly stable form.

The Technology/Tools
Here's the list of tools I'm currently using to develop my games:
  • Visual Studio 2012 - For coding
  • MonoGame - Development framework
  • Inkscape - Art development
  • Spine by Esoteric Software - Sprite animations (surprisingly, even though I don't want to spend money, this looks like it could be a $60 very well spent to help get the animations integrated into the app).
  • ProTools - Audio development (I know I stated I'm a cheapskate, but I already had ProTools as I'm usually a musician by night)
  • Git/GitExtensions on Windows (hosted on GitHub) - Yummy, distributed source control Smiley

What work is left?
There are several things I have left to do before I consider this of release quality:
  • Going to introduce a SceneGraph tonight that handles all rendering and enables "picking" of entities. While choosing cards works right now, it's baked in directly to the input system by simply looking at collisions between input coordinates and game object collision boundaries. The underlying "engine" should be stable after this final refactoring.
  • Have either red or blue squirrel "run" onto the screen depending on whose turn it is.
  • Have acorns fall from sky onto the ground when a card is turned over.
  • When a player chooses to stop their turn (keep acorns), have squirrel run across acorns on ground (which then fly up into their proper place on the scoring meter).
  • Animate squirrels using Spine framework/tool (especially idle animations to give a sense of "feeling alive")
  • Compose and add background music, "card turned over" sound, "acorn dropping" sound, "acorns being added to player's score" sound, etc.
  • Add transitions between screens (elements flying off first screen and flying on for next screen)
  • Create game company logo and animate beginning splashscreens before getting to main Menu screen.

Then there are, of course, the "release" tasks that I need to do. I'm not making a big push for marketing on this game as I'm mostly going through and building up my game portfolio. I have a longer-term goal that over many games, I will start to find those "1000 loyal fans" that like what the company is about and likes the games. I don't expect to make much money at all with the first couple of games. But I will definitely still push to do the ground work of building up the audience to help the success of future games.

  • Release onto Windows Store (currently debating between ad-funded or $1.49 release price with free time-based trial)
  • Write-up game on new company website
  • Write-up about game on company's Facebook page (and send out to all my friends)
  • Twitter, twitter, twitter
  • MAYBE, do a Windows Phone port of the app.
« Last Edit: May 17, 2013, 04:31:20 PM by jolson88 » Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
Apophenia
Manbaby
*


View Profile Email
« Reply #1 on: April 26, 2013, 07:38:29 AM »

This looks like a pretty neat project.

I know you mentioned playing a card-based prototype with your son, but will the actual software be kid vs. computer? Hotseat multiplayer? Both?
Logged
jolson88
Level 0
**


View Profile Email
« Reply #2 on: April 26, 2013, 06:28:36 PM »

This looks like a pretty neat project.

I know you mentioned playing a card-based prototype with your son, but will the actual software be kid vs. computer? Hotseat multiplayer? Both?

Thanks Apophenia! My current thoughts are that I will support local multiplayer (two players playing against each other), human vs. cpu, and perhaps even cpu vs. cpu. Not sure yet whether I'm going to integrate NFC perhaps to support cross-device multiplayer (like tapping two Surface devices together to pair them up for a game).
Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
jolson88
Level 0
**


View Profile Email
« Reply #3 on: April 26, 2013, 07:10:38 PM »

Well, not a lot of visual progress on the game. Did some architecture/infrastructure work by adding a SceneGraph for rendering and View separation from Game State classes. The change I'm most excited about has small impact on the code, but I thought it was a clever fix Smiley. Posted this over to The Happy Programmer thread as well...

I have a simple MessageManager class in my code (C#) that you can register listeners with and send messages through. It is powered by generics. For example, adding a listener (before this change):

Code:
    public class MessageManager
    {
        private Dictionary<Type, Action<Message>> _messageListeners;

        ...

        public void AddListener<T>(Action<Message>> listener) where T : Message
        {
            if (!_messageListeners.Keys.Contains(typeof(T)))
            {
                _messageListeners[typeof(T)] = new List<object>();
            }

            _messageListeners[typeof(T)].Add(listener);
        }

The thing I hate about this code is that when you call AddListener, the Action you are registering is a callback that accepts the base Message type (not the derived type specified with T).

Because of variance (covariance and contravariance) in .NET Generics, Action<DerivedMessage> can't automatically cast down to Action<Message> as it is not type-safe. So, I'm left with writing ugly code that casts into the right type:

Code:
        public override void Loaded()
        {
            // Yuck, yuck, yuck! Look at those casts!
            this.GameObject.MessageManager.AddListener<CardsShuffledMessage>(msg => OnCardsShuffled((CardsShuffledMessage)msg));
            ...
        }

        private void OnCardsShuffled(CardsShuffledMessage msg)
        {
            _spriteComponent.Texture = ContentService.Instance.GetAsset<Texture2D>(AcornAssets.CardBack);
        }

Or in the above, I could have OnCardsShuffled accept just Message and cast to CardsShuffledMessage in the method body. Either way, yuck!!! This code has been bothering me big time!!!

I finally spent some time to solve it tonight. I don't think there is any way I could have solved this several years ago before I started playing around with higher-order functions in functional-programming languages (functions that return functions).

The key for me was to create a method that returned a "wrapper Action<Message>" delegate that internally did the casting to the type it knew about via generic type parameters. Then I stored listeners as List<object> instead of List<Action<Message>> to enable the more loosely-typed casting.

Code:
    public class MessageManager
    {
        private Dictionary<Type, List<object>> _messageListeners;

        // New lookup of senders that accept Action<Message> and invoke strongly-typed Action<T> in listeners
        private Dictionary<Type, Action<Message>> _messageSenders;
        ...

        // Now I can accept Action<T> (derived message listeners) rather than Action<Message>
        public void AddListener<T>(Action<T> listener) where T : Message
        {
            if (!_messageListeners.Keys.Contains(typeof(T)))
            {
                _messageListeners[typeof(T)] = new List<object>();
                _messageSenders[typeof(T)] = CreateMessageSender<T>();
            }

            _messageListeners[typeof(T)].Add(listener);
        }

        // The function that does the magic
        private Action<Message> CreateMessageSender<T>() where T : Message
        {
            return new Action<Message>(param => {
                foreach (var listener in _messageListeners[typeof(T)])
                {
                    // Do the cast to a strongly-typed action from our generic param T
                    ((Action<T>)listener)((T)param);
                }
            });
        }

        // When a message is sent to listeners, it's as simple as using the "wrapper Action" we created
        private void ProcessMessage(Message msg)
        {
            if (_messageListeners.Keys.Contains(msg.GetType()))
            {
                _messageSenders[msg.GetType()](msg);
            }
        }

Long story short, now I can write clean code that I _like_ without nasty type conversions:

Code:
// YUCK!!!! This is the code I had to write before...
//this.GameObject.MessageManager.AddListener<CardsShuffledMessage>(msg => OnCardsShuffled((CardsShuffledMessage)msg));

// YUM!!!! Much better :).
this.GameObject.MessageManager.AddListener<CardsShuffledMessage>(OnCardsShuffled);

I'm also very happy to have done this without having to resort to any reflection whatsoever. Quite ecstatic. I know I know, it's a small change, but I'm excited Tongue.
Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
jolson88
Level 0
**


View Profile Email
« Reply #4 on: May 02, 2013, 03:45:47 PM »

What are folks using to record videos of their games (preferably free software on Windows)? I'm to the point with the game that I really need to record videos for this dev log as I'm mostly tweaking animations and adding animated visuals to "juice it up" a bit.
Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
jolson88
Level 0
**


View Profile Email
« Reply #5 on: May 08, 2013, 03:31:38 PM »

Put in temporary sounds and music (thanks Matthew Pablo for the great music on opengameart.org). I'll be doing my own music this weekend and building some final sound effects as well.


Finally figured out recording (though low quality right now when it comes to FPS :/). Need to animate transition from play screen to winner screen and animate the winner screen itself. I also need to fine-tune some of the other animations.

I'm hoping that I'm about 1-2 weeks out from release. YAY! Going to be my first release and I want it to be of good quality (hence the work on animations, swelling, spinning, etc.).

Project Acorn Demo - 050813
Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
jolson88
Level 0
**


View Profile Email
« Reply #6 on: May 09, 2013, 10:20:41 PM »

Getting soooooo close. Finished up more screen transitions tonight and added some more sounds. One last animation to add, a Credits screen to add (should take about 20 minutes), and two sound effects to replace and it will be DONE. FINALLY! My first game Smiley. Done and submitted to the Windows Store hopefully by the end of the weekend (perhaps by tomorrow night!).
Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
jolson88
Level 0
**


View Profile Email
« Reply #7 on: May 17, 2013, 04:30:33 PM »

Whew!!!! And it's released. I am now officially a published game developer Smiley. All week though (after the game was uploaded) has been filled with a form of depression. I just don't know what to do anymore. I guess it's about time to get working on the next game Smiley.

Project Acorn in the Windows Store.
Logged

Owl X Games, high quality kid-driven games
http://www.owlxgames.com
http://www.twitter.com/owlxgames
Son of Bryce
Level 1
*


sonofbryce
View Profile WWW
« Reply #8 on: May 18, 2013, 02:00:01 PM »

Congrats on finishing. It was smart of you to pick something that was an appropriate scope for a first game!

I use a Mac so I couldn't play it, but I watched the YouTube vid.

With MonoGame, how much work is it to make your iOS and Android ports? I'm using Unity right now, but I was interested in seeing how complicated it was to work with MonoGame. It seemed like you need specific libraries for different ports, do you have to branch the code out or can you work from the same codebase for each platform?

You've really gotta get this on an Android and iOS tablet! You said you don't have a Mac, and iOS is really a pain without a Mac, if even possible at all. But Android's no big deal to publish on. And I'm sure someone you know has got to have a phone you can publish on. I'm sure you could get a cheap Android tablet online.

This is totally a tablet game, I think kids would like it.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic