Half Combat

Half of the super basic combat system works! For testing purposes, whenever a player clicks the Explore button, combat is initiated with my good ol’ pal Test Dummy. Yep, that bag of straw and anger is back to take another kicking. preAlpha_Combat01

Once in combat the player’s starting hand get’s drawn. When a card is used it’s cardPower is deducted from the Test Dummy’s health. This continues until the Test Dummy has no health left to lose, at which point the combat window is closed and the player is given a random reward.

Like the patient dummy he is, Test Dummy doesn’t fight back yet. That’s next on the agenda, I can tell he’s itching to strike back… or maybe the itching is from the straw… I’m so corny.

How to handle the Deck, Hand, and Discard

I spent a long time thinking about the best way to handle this aspect of the combat system. The inventory system already has the player’s deck as a Dictionary with a Card as the key and the Quantity as the value for each row and at first I thought I could just use this Dictionary as the deck in combat as well. First I tried to give the Card class a inHand and inDiscard boolean property. The idea was to just toggle these boolean values as the card moved from deck to hand to discard and back to deck again. This quickly became apparent that it wouldn’t work easily and that it would be best if each card had its own row meaning having 2 Punch cards would result in having 2 rows in the Deck array.

So I switched to a List, no big deal. At the start of combat the Combat Manager loops through the deck dictionary and turns it into a deck list. Now I could just look through the list for cards that have inHand and inDiscard booleans set to false and I can draw one of them!

Wait, no, that kinda sucks too! Doing that would make randomly selecting a card difficult as i’d always have to check to see if the card selected was inHand or inDiscard, if it was in either of those places, select another random card and keep doing that until an available card was found. Laaaame!

So the inHand and inDiscard boolean idea was scraped too and two new Lists were added, the Hand List and the Discard List. Now, a random card could be selected and removed from the deck list and added to the hand list. No having to make sure a card in the deck list was currently in the player’s hand. If a card was in the deck and was available to be drawn!

So there I was, spending all this time thinking up the right way to do it, the when I started implementing what I thought was the right, it turned out to be very wrong and the right thing fell right into my lap. I’m a little embarrassed I didn’t think of it sooner!

Nano Inventory and Deck UI Ready

Slapped away at the keyboard today and got the inventory and deck editing features put in, it looks pretty nice actually. I hope I can get someone to do a code review of it sometime, as I’m sure there are some more efficient ways to achieve what I’ve made. No matter, it works and that’s good enough for me.

An inventory system isn’t terribly exciting but now that it’s out of the way the fun part can begin, combat! Well, before there can be combat, there has to be something to combat against, so the next things to implement are Enemies.

To start, only a few simple, punching bag type enemies will be added so that the work on the player’s side of combat can begin. The player will start combat by shuffling their deck, then drawing a hand of cards from it. After that combat is turn based and after the player chooses a card to play, the enemy will perform its attack, then back to the player. Attacking back and forth will continue until someone dies, then a reward will be given to the player… as long as the player isn’t the one who died.

That’s the super high level overview of how combat will work. For me, the implementation of the player’s side of combat will probably go something like this:

  1. Add Enemies
  2. Create combat UI
  3. Add ability to draw cards from player’s deck at random and add to player’s hand
  4. Display cards in hand to player in combat UI
  5. Add ability for player to select a card to play, removing the card from their hand and drawing a new card

You’ll notice that having the cards do anything is not on that TODO list. That’ll come after all those basic things are in place, this is still just UI and basic functionality we’re talking about here.

 

Nano with Unity: Fresh Start

I’ve started to remake Nano using Unity. Nano will no longer be a browser game, instead I plan to release it for PC, tablet and phones. It’s a bit odd for me to say “release it” as if I’ll ever finish it. It would be really cool if I did and that is the plan but you surely know how these kinds of personal projects go.

So far I’ve got some of the basic UI in place, enough for some testing and experimenting. So far this UI is limited to displaying the player’s health points, a few buttons with placeholder actions and an early take on the inventory system.

Next up will be improving the inventory system and adding the Deck feature. Cards in the player’s inventory can be added to their deck, which is used in Nano’s combat system. Though, before combat can take place Enemies will be need to be added.

So that’s the game plan. I’m excited to be working on this project again, here’s to the hope that it’ll go further and be better than the browser version. It wouldn’t take much to be better than that ol’ thing.

Lil Critters – Class structure and the Nervous System

I’ve started working on the Lil Critters “Evolution Sim” project again. First thing to do was some refactoring, so I made many more classes and split up the methods. The classes and structure of the project is kind of interesting, since I am loosely modeling it after how the nervous system in living creatures tend to work. I’m no expert in biology, neurology or anything like that so I’m taking a more broad and general approach to the nervous system.

A critter’s “nervous system” is made up of three main classes which are Stimulus, Brain, Response. As you can probably guess, Stimulus is in charge of receiving input from the world outside of the critter and relaying those inputs to the Brain. The Brain chooses a response based on the input and sends this choice to Response. Lastly, Response allows the critter to perform some action as dictated by the Brain. There are other classes each critter has as well such as Raycast (to draw sight line) and Metabolism (to manage energy consumption). There will also be plenty more added as the project grows. The way I’ve been thinking of these classes in more specific terms is:
BasicCritterClasses
Raycast: Photons that hit the eye.

Stimulus: The eye that forms information from the photons that hit it and the neurons that transport that information to the brain.

Brain: Takes care of brain stuff… makes choices to call for particular responses based on input.

Response: The muscle system, applying forces to the critter when instructed to by the brain.

Metabolism: The chemical reactions and burning of energy in order to power the muscles and also just to maintain life.

It’s almost soothing to organize the series of inputs, analysis and outputs like this. This project often makes me think about real life a bit differently. While we all get the general idea that out bodies and minds are set up in this way, we typically don’t give this idea any weight or importance. I find it interesting to be building these little critters with this structure as a guide, which developed over billions of years of evolution.

12-1 Mage Arena Deck

I’ve gotten 12 wins in Hearthstone’s Arena a number of times, but usually ending at 12-2. This time I managed 12 wins and only 1 lose. The deck itself is pretty powerful with 3 Fireballs, 2 Flamestrikes, a Frostbolt and Onyxia to finish the job but many other cards did some serious work.

Here’s the deck in its entirety:

2 Flamestrikes can get you 5 wins easy, throw in 3 Fireballs and 7 wins is no problem.
2 Flamestrikes can get you 5 wins easy, throw in 3 Fireballs and 7 wins is no problem.

Some other key players were the Mana Wraith and Nerub’ar Weblord. Now these aren’t great cards but they were the best of a few shit choices. However they ended up allowing me to control the board early game. Coin into Weblord followed by turn 2 Mana Wraith and now all the opponent’s plans are on hold. These cards just screw up the enemy’s flow, which allowed me to get off a turn 3 Arcane Intellect for both card and board advantage.

One key thing to do when playing as a mage is to try and act as if you don’t have Flamestrike in your hand, even though we all know that every mage has a Flamestrike in their hand on turn 7. When you ping a Taz’Dingo down to 4 on turn 6 your opponent knows you’re lining up a Flamestrike and will play around it. Also, try to maximize the value of the Flamestrike by waiting until the opponent’s hand is empty or near so. Also, look for ways to deal with the board without using Flamestrike even if you have it. If turn 7 comes around and you don’t use Flamestrike, many people will assume you don’t have a Flamestrike and will feel better about filling up the board with his minions, then is the time to strike… FLAMESTRIKE.

Nano is now Open Source

I made Nano open source and it’s all available on GitHub here. I haven’t been able to find the time and energy needed to push further development, plus I think it needs such a massive refactoring that it might as well be rewritten from scratch. Regardless, I think if anyone wanted to take what I have made and expand upon it in terms of just content, art and UI, then you could have a pretty solid and fun game.

I still like the game play ideas of Nano, and I learned so much about programming from making it that it pretty much landed me a developer job. While I’m not working on it currently I haven’t stopped having ideas for it. All of them revolve around remaking it as an android game, perhaps as a Unity 2d project but still, finding the time and motivation will be tough in the next few months. To come home from a day at work of coding and spend the evening doing more coding might be a bit much for now, so any personal coding projects are on the back burner for now.

Anyway, it would be really cool if someone wanted to use this base for their own browser game. So if you do use it, let me know I don’t know about how to make something officially open source licensed or whatever but if you wanna play with the source and are concerned about that stuff just let me know how to set it up.

This was a really cool project and I’m sure I’ll revisit it in some form some day.

Playing with Unity and My Critters

I’ve been away from the Nano project for a few months now and I’ve instead been spending my programming time learning Unity. It’s actually pretty easy to use, and after watching a few of the tutorials on Unity’s site I was good to go and started off on my new learning project, which I’ve been calling My Critters. This is an awful name and isn’t a name at all really, it’s just what I say when I tell my girlfriend what I spent my day doing.

Her: “Have you been playing video games all day?”

Me: “No! There were a few hours that I worked on my critters… AND I showered!”

Unity?

Unity is a 3D engine typically used for making video games, incase anyone is reading this (no one is) and isn’t familiar with it. You can use Javascript and C# to write scripts for how the objects in your game should function.

Evolution Simulator Project

The Idea

In my case, I’m trying to make something I’ve been calling an evolution simulator. The idea is that when you start the simulation a few critters (aka spheres) and some food (cubes) are randomly dropped into a small flat world. The critters have the ability to detect the food via sight (raycasts) and then can move to the food (using physics and impulses) and eat the food. Now, every action the critters do burns energy, some actions burn more than others (moving forward burns more energy than turning) and simply existing slowly consumes energy, and when you run out of energy you die. In the end, critters try to get to food to stay alive, they will mate to make more critters and spread their genes.

Current State

This isn’t how it all works right now, currently I only have 1 critter who doesn’t burn energy at all and just poots his way around the world eating everything he sees, sweet life. But all that other stuff is coming and I don’t think it’ll be too difficult to get those basics in place. (In before the post where I talk about that stuff turning out to be really difficult.)

The Hard Part

The hard part comes when the critters aren’t told to do any of those things. The goal is to not have the instruction of move to food, eat food as an explicit instruction of the critters, instead the critters genes should determine what the critter does when it detects food, when it comes in contact with it, when it detects another critter, how it explores its environment, etc. This is when I’ll be getting into neural networks and stuff like that.

Polyworld

This whole idea is based off a project I saw years ago called Polyworld. The guy is a terrible presenter but it’s really inspiring the way the creatures in Polyworld develop their own survival strategies. My goal is to create a similar effect in a 3D space, the bigger goal is to then use this type of creature generation in a game of some sort.

Up Next

As of now, Nano’s development is on hold. I think Nano makes a decent portfolio piece and I’ve still got ideas for it that I want to implement, so the project isn’t canned, just on the back burner.

I’d really like to get some 3D models in the simulator. It’s really early, but I think having some models to look at instead of just geometric shapes would be more interesting to look at. Since I don’t know much about making 3D models, this part will likely require outside help. For me, the next part is to add more critters to the world, allow for mating, and add energy consumption.

Screen shots in next post!

Better Map Generation, Auras and Deck Include Modifiers

Getting back into the swing of things with the project by first implementing Better Map Generation. Like I said in my last post, the world used to be generated totally randomly as a player moved around, causing Mountain terrains to be right next to Forests which are directly next to Tundras, basically all the terrain types where just mixed together.

But now, when a player moves into a new location, with no terrain tile associated with it. The game takes all adjacent terrain tiles into account before choosing one. This causes larger Biomes to exist, hopefully this will make the world seem less random and give some aspect of actually being somewhere in the world. Especially when I get around to adding biome specific events, enemies and effects.

This is just the first step in expanding the terrain generation mechanic, so we’ll see how that goes.

Next up, I started adding in Auras but quickly realized I need to refine the idea. The basic idea is that Auras give you special abilities, and you can only have 3 equipped at a time. These special abilities would give you additional choices during events or alter how some items work. At first I thought they might just be stat modifiers but I scrapped that idea because I was afraid it would move in on the Deck Include Modifiers idea.

So my plan is to leave Auras alone for now and return to them after implementing Deck Include Modifiers. What ARE Deck Include Modifiers you ask? This is a mechanic I’d like to add where including certain cards in your character’s deck result in your base stats being modified, as a means of balancing a cards power.

For instance a FireBall card might do a large amount of damage when played in combat, but simply adding the FireBall card to your deck will lower both your Max Hit Points and your Defence. The overall idea is that by adding certain cards to your deck you have some degree of control over your character’s “class”. Want to be a Mage-like glass cannon? Add in those fireballs and other powerful abilities at the expense of your health and defence. Perhaps add in Armor cards that have no effect when played in battle, but their Include effect raises your base defense so long as the card is in your deck, making you into a Warrior like tanking class.

These are just off the top of my head, so there will probably be many changes as I start to add it in. Which is exactly what I’m about to try to do!

Post-Contest Hiatus, Planning and Card Art

The Break

I’ve been on a break from further development for the past month. Various reasons for the break including just being busy, freelance design work and playing too much Civ 5, DOTA2, Card Hunter and Android:Netrunner.

The World

One thing that added to the stall was trying to come up with the right way to proceed with the World Generation. The current way the world is generated in Nano is not very apparent to the player. But here is a summary of how it works:

  1. A player enters an x/y location, either through moving to that location or their initial spawning (which places them at 0x 0y.
  2. The game checks to see if a terrain piece has already been set to that location.
  3. If there IS a terrain piece saved to the player’s location, then that terrain piece is displayed to the player.
  4. If there is NOT a terrain piece saved, the game randomly rolls to see which terrain piece to use out of all terrain pieces in the database. Then that terrain is saved to that location and any player entering that location will find that terrain piece.

While this was very easy to implement, it also is very rudimentary and does not allow for the inclusion of Biomes. Ideally, if a player was in a Thick Forest terrain, then they moved 1 position they would still be in a Forest biome and hence get another forest type terrain piece generated for them. This would continue until the player came to a transition piece which the game would place semi-randomly (it would take into account the adjacent terrain which would affect the probability of the player’s location being generated as a transition piece). Once a transition piece has been placed, adjacent, undefined locations could be from any other biome.

Basically, this would make it so a player wouldn’t be in a forest one second, a mountain the next and then a desert after that. Hopefully, implementing biomes would make the world of Nano seem more realistic, with various Forest terrains adjacent to each other, as with all other biomes.

This however is much harder to implement and there are many ways to achieve the desired effect. I looked into a variety of procedural generation techniques which use height maps or Perlin Noise. But these methods seemed a bit too complex for my needs and it would also mean more terrain would be generated than I needed, if I was to generate terrain only on a character’s movement.

Another option was to simply create the game world manually. This has the benefits of being easy (no programming needed) but would limit the size of the world and would make the world less dynamic.

So, my current plan is to do something similar to transition piece idea, mentioned above. I’ve yet to begin implementing it but I think that will achieve my goal best without being overly complicated.

The Art

I’ve got new card art! Ashley Kuros has been a friend of mine for a long time and she is a talented artist. She has been nice enough to offer her help with the art needed for my game! So far she’s provided a bunch of pieces to be used with the various cards you can find in Nano. Below are a few of the pieces provided by Ashley already implemented in Nano and I hope she’ll continue providing more!

Punch Sand in your eyes!

Warm Up
Warm Up
Debilitating strike
Debilitating strike

Major development progress, entered into contest, Game Playable

Test Nano!

Nano is up for testing! Goto http://nano.apphb.com Sign up, and enter the world. There is limited content, limited design/art and only the most basic of features, but it works, and gives some sense of the basic idea of the game. Give it a try and let me know what you think!

Major updates

I’ve added a TON of stuff to nano over the past two weeks. Here is a summary:

  • Huge improvements to make it easier for me/admins to add content. Hence, more content and way more to come.
  • Proper enemy assignment to combat, allowing events results to dictate which enemy is chosen.
  • UI improvements
  • Card Design and some card art added.
  • Decreased Hunger/Thirst generation
  • Basic Character name validation
  • Leaderboard!
  • Text feedback for all event results
  • more food/water/item sources
  • Loading screen to prevent multiclicks
  • Soooo many bug fixes
  • Some minor balances

Nano entered in DevelTeam Contest, but…

I entered Nano into DevelTeam.com’s Summer Game Jam contest, you can try all the games that were entered into the contest here: http://www.develteam.com/GameJams/

But, this is embarrassing, I didn’t know all the unspoken rules and subtleties involved with a Game “JAM” contest. Once all the projects entered into the contest were listed I quickly noticed that it seemed all the other games had been developed over the 2 week period after the theme was announced. This is certainly not the case for Nano, and I got in contact with the contest’s administrator to clear things up. He said that since the rules didn’t actually state that the games had to be developed only over the 2 week period that he would let it stay in the contest.

That was really kind and understanding of him, but I felt bad that I’d have this unfair advantage of a lot of extra time, where the other entrants really beat themselves up to get theirs in. Granted I pushed way harder these last two weeks than ever before, and most of my time prior to these past few weeks was just learning to program.

So I tried to make it known that my game doesn’t really fit the bill for a “Jam”, I’ll know next time and I hope the people over at that site don’t hold it against me. I tried to be public about the matter on the site and urged anyone to not vote for Nano if they feel like I really should have known better and not been in the running. It was nice of them to let me stay in the contest but now I just feel a bit shitty about it. I’m sure they’ll be more detailed in the rules they provide next time.

I’m really eager for the contest to be over so I can make more additions to the game. I have plenty of things to add and I’m going to spend this down time sorting out my To Do list and prioritizing things. I think from here on out, I’ll try to do push a weekly build for testing.

Give Nano a try! http://nano.apphb.com