Improving Upon Number Wizard

So, while working on my own projects at my own pace, I am also learning through a course on Udemy about the ends and outs of using Unity to develop games.  I recently just finished the section where we took a previous game we made in console only and gave it a User Interface.  That game was Number Wizard.

Number Wizard is a simple game.  You think of a number between 1 and 1000 and the computer gets 12 tries to guess it.  If it doesn’t guess it you win.

While the tutorial taught me a few things, like how to connect buttons to scripts and how to build scenes.  There was one thing I felt like they neglected on what would be a ‘final product’ of the game.  So I changed something and added something to the game and learned a lot in the process.

One of the major “bugs” of the game is that the way it was set up.  If your number was ‘500’ the computer would sometimes get stuck between 499 and 501.

“So your number is 499? No? 501 then? No? 499! No? Bah I give up, it’s impossible”.

Why did it do this?  Well it’s last guess becomes either you new maximum or minimum, and since it is picking a random number, including the max and min, it could randomly just go back and forth between the two.  So it wouldn’t always get stuck, but it would take it a few times bouncing around before it found your number, or sometimes it just wouldn’t find it at all.

So how did I fix it?  Well, before the old guess would become the new max or min, but we know we can rule out the old guess since the player did not say it was their number.  So if their number is higher, the min now becomes the old guess +1 and if the number is lower the max becomes the old guess -1. So now when the random number goes, it doesn’t include the old guess, it’s not an option.

This then lead to what I added to the game!  A tiny bit of AI (that’s artificial intelligence).  AI doesn’t have to be super complicated, and in fact this bit of AI is so simple, I only just realized that what I created was indeed AI.  Under certain circumstances the computer can tell you it’s got your number already or if you’ve made a mistake.

When I started thinking about using  the + and – 1 to the guess in order to rule out old numbers, I thought “What if min and max were equal, that would mean that number would have to be the correct number, the computer would automatically win.”  So I set that up.  If when you press “higher” or “lower” the max and min are equal.  You get taken to a different screen where the computer tells you that it figured it out already.

However, what if the user made a mistake.  They pressed up when they meant to press down.  What if they cheat and change their number in the middle of the game or they simply forgot their number.  Number Wizard can take care of that too.  If you tell Number Wizard to go higher or lower when you cant he will tell you that you made a mistake and claim victory for himself.

Making the “alternate computer win” screen was a challenge on it’s own.  Apparently in Unity your scripts and things get destroyed when you change scenes.  So I had to learn how to persist the Number Wizard script into the next scene to say that “this number is indeed your number”.  Also then using that script to display the number in a new scene other than the one it came from took some time to learn as well.

Overall I am happy with this game (mechanically speaking).  I took what they gave me for the lesson, refined it and added some stuff of my own.  I also learned a few new things that will help in my other projects for sure! When I get a site to put my games up on I will link it here.  Until next time!


Buttons Simulator 2016

As you may or may not know from my WIXOSS blog entry, currently the only thing working about that game is the menu (and even then really just one button does anything, although it does play music!).  However, I recently discovered that while my ‘settings’ button was taking me to the ‘settings scene’.  It was more complicated than it should have been.  Thanks to “Learn How to Code By Making Games – The Complete Unity Developer” course on Udemy.  I was able to learn a much easier process of doing it.  In other words, Button Simulator got a major update!!!!!

In Unity each level is called a scene.  So if I want to go from my start menu scene to my setting menu scene I have to tell the button which scene or ‘level’ I want it to go to.

Originally I wrote a script that handled the transitions, it looked something like this.

public void start_menu(){



public void settings_menu(){



So in that example using start_menu() will load the scene labeled as 1 in the build, which is the start scene.  Now there are a lot of things wrong with this.  For one, I would have to write a line of code for each single scene, as you see with my settings_menu().  Then I have to keep track of which number it is in the build.  What if I change a number of something?  Then everything breaks. Bad!  Bad programming!

So how did I learn to do it the right way (or atleast in a better way)?  Well, first off I created a new game object called LevelManager.  Then I gave that object my script as a component.  Then I got rid of all the previous code I had written and wrote this one line.

public void loadLevel(string name){



That one line does the work of ALL the other lines I had and would have had in the future for changing levels.  It’s so simple!  The LoadLevel() function apparently looks in the build for either the number or the name.  So when you connect your button to the LevelManager object we created and specify loadLevel(string name) as the function to run onClick() it will give us a place to input a string.  That is where we put the name of the scene we want to go to!


So on the settings button on the start menu we put settings_menu as the name and ta-da! It goes to that scene.  This is great because if we know what button we are working on, it is easy to keep track of which scene we want to go to. If we need to change the build order, it will just search for the names, so it doesn’t matter.

So WIXOSS got an update today.  Buttons should now respond better, or at the very least, more efficiently.  (Really it’s just good design, probably didn’t have an effect on game speed, but I like to think it’s a big change!)  Just a really good trick, I am glad I learned!

Project: WIXOSS

In Japan there exists a trading card game called WIXOSS (pronounced: we cross).  It is your basic card battle game.  You have a main card called your LRIG that you grow as the game continues.  You have SIGNI which are summoned based on your LRIG.  You can use ARTS which you can use to change the battle at a critical moment.  And you have a Life Cloth, whenever you lose all of you Life Cloth, you lose.

There is an official WIXOSS video game in Japan only but I wanted to create something a little more accessible and easily updateable.  Plus, this is my “big project”.  I suspect it will take some time to get the game working, then make it look nice.  But I want this to be the project that I look back on and say “Wow, I did this.”

At this time I am at such a loss for how to begin programming this.  I need to make a rules engine that knows who’s turn it is, when to draw cards, when a player can or can not do something, account for abilities of cards.  It seems very daunting.

Then there is the whole “programming every single card into the game thing”.  Which might be the easier part but will certainly take some time.

I believe I need to make everything in the game an object. The different zones on the field are objects.  Each card is it’s own object.  Are card effects objects? That’s a lot of objects.  The reasoning for this is that should a rule suddenly change, or a new mechanic be added to the game, I wont have to rewrite the code in each card to account for it.

I am not sure how to go about writing each card.  Do I have a database of the different cards?  I have also seen a suggestion to use a scripting language like LUA to make each card.  Which is interesting, and I think I’ll do that!

Currently, I have a few menus made for this game in Unity and I have a collection of most all of the images for all the cards in the game.  I have a design document but no game code has been written yet.  I’ll keep looking into where to begin until I have a solid starting point.

Minimally, I would like for this game to be a two player game over the internet.  Ideally, I would have a single player mode similar to the old Yu-Gi-Oh games where you start with one deck, then you battle characters and win money to buy packs to get cards to make better decks.  However, those are more stretch or long term goals.

As for releasing the game, I probably wont due to legal reasons of not being associated with WIXOSS but who knows.  In fact there is already a WIXOSS fan made downloadable game out there.  But it’s not as fancy as my ambitious little project.  I am literally just doing this one for fun and my portfolio.  Expect more posts about WIXOSS the actually card game, and the development of this game in the future!

Project: The Butterfly Town

The Butterfly Town is the first game project that I started to work on.  It is a horror themed visual novel / text based adventure.  The premise of the game is that you are a student at a typical Japanese high school.  On what seems like a typical day you do things that seem to be harmless or mundane but they in fact have a huge impact on how the rest of your day goes.  Usually with deadly consequences.  In order to uncover the entire mystery you have to die multiple times though the story.

I was inspired by a few different things.  The anime Higurashi no Naku Koro ni (When They Cry), is horror and has a somewhat similar premise with a time loop and brutal murders and mystery.  I wanted to create something like that but in my own Yandere and Yangire type style.  (What is Yandere and Yangire? I’ll explain in another post!)

I was also inspired by the Butterfly Effect phenomenon.  For those who do not know, according to Wikipedia (because they are reliable) “In chaos theory, the butterfly effect is the sensitive dependence on initial conditions in which a small change in one state of a deterministic nonlinear system can result in large differences in a later state.”.  In other words, something as simple, small, and insignificant as a butterfly flapping it’s wings could have an effect on your whole day.  Had the butterfly not been there your day could have ended up completely different.  I took this as the premise of the game, everything you decide to do or not to do in the game will change how things end up.

As mentioned above Higurashi no Naku Koro ni was an inspiration for the story. But it is also a visual novel, and it’s mechanics are also somewhat of an inspiration.  I said it was a visual novel but it’s creator Ryukishi07 likes to call his games a “sound novel”.  He makes use of sounds to build an atmosphere, and that is just what I would like to do.  It can be hard to convey horror without gruesome images or jumpscares, and I am not a good enough writer to articulate horror and scare you.  But with some slightly disturbing images, some ok story telling, and good use of sound effects.  I think the end result could be creepy.  Which is what I am going for.

Currently the game’s story  is still being written.  Being a text based adventure there is a lot of text, from dialogue, to menu options.  Then when each option splits off in a different direction it can be difficult to keep track of everything.  Hopefully I can get this project moving forward soon.  I still need concept art for characters.  I at least have someone to make some music for my game. Stay tuned!

About this blog

This blog is intended for me to share my experiences in both creating and playing video games.  Mostly the former.  I am currently working on two game projects while at the same time following the “Learn to Code by Making Games” course on udemy.  I hope that by sharing my experiences I can help others while helping myself retain the information.