neljapäev, 5. november 2015

Day 8, 9, 10 - multilingual support

Like in my old project, I wanted my unity game have runtime language switching opportunity.

For certain, I will have 2 languages (English and Estonian), also 3rd language (Russian) is easy to add. Other languages might be added by community and as all data is loaded from XML files, I might end up with 30 languages that can be switched runtime.


I had to learn how to make runtime scrollable content, so I went through several tutorials, like this one about scrolling menus runtime.
So I tested it with 40 potential languages and ended up with something like this:



So thats how opening screen looks like now (together with language selection):
























I wanted to use Unity's own event system for swapping language and after many tutorials like this I went with simplest solution (tutorial here) .

esmaspäev, 2. november 2015

Day 7 Recap

Yeah. All my collections are loaded into Game Control object. I can use them.

























I could start on "battlefield setup window" tomorrow. So I can set up the 2 armies of characters that are supposed to get into fighting. After that ->  my battlefield scene.


pühapäev, 1. november 2015

Day 4-6 Recap

I found another excellent tutorial about Unity Event system, it showed nicely how to apply events not only to canvas, but to other stuff on your scene as well (like a door).

Also I watched tutorial about making new UI elements and accessing them. Actually I did plenty of Unity tutorials. Enough for me to make game's main menu's first version:
























Then I started tranfering data classes from my old XNA project into Unity . Just tranfering all those classes was like huge job, commenting out tons of code. I had to solve around 700 red errors total. And worse, I have to rewrite that code for Unity.

My next job is to to use those data collection-classes (load them into memory).



reede, 30. oktoober 2015

Day 3 Recap, switching to hexagonal

While I was playing, I was also thinking how should I proceed with my project here.

Originally I thought about making completely new combat engine from the scratch. But it seems a bit too much -> I need to create pathfinding (grid) for dungeons and lots of things to figure out. It might really slow me down.

Yesterday's Recap:

 Also, I already have lots of C# battlefield code from previous 2D project. This one is hexagonal battlefield tho, so It would be wise to switch to hexagonal (for now). I need something ready.

So, to speed things up for Unity and to have a nice starting point, I purchased Turn-Based Toolkit from Unity store.

























It had lots of features, including (optionals) line of sight, fog of war, per side and per unit turn orders, etc.

























In my previous 2D project, my game data, stats for units, items, etc, were loaded from XML files, and if those did not exist, from collection classes contructors.

I realized, that I dont know how to load/store data permanently for unity, as every scene loads from scratch and loses all old data. And most data is supposed to be in unity prefabs, not in XML files, like I have.

Some googling revealed that Unity has a class called PlayerPrefs, what some people used to store data. That seemed really horrid way to go about game data, as it stored data into registry and had 1MB size limit.

 So I kept searching for other solutions. Then I found one excellent unity tutorial on the matter - about persistant data saving. > so, this is solved.

I also watched through couple of other tutorials after that, the one about object pooling was interesting one for me.

Then I realized, before I start loading data, I should make main menu scene for my Unity game. I had one in my 2d Project, here it is:

 I also wanted to use latest GUI tools provided by Unity, I wanted to see, if I can make hover-over tooltips and such, so I decided that I will watch a tutorial about event system, even starting on actual menu will have to wait till next day.




After the 20 day gaming spree.

I had a 20 day gaming spree.  Woohaa!

What happened was that I reinstalled Steam -> most of my games had stopped working after upgrading to Windows 10, and now I got all my games back.

First I revisited rogue-like Dungeonmans.



I really wanted to try out the new Infinite Dungeon mode there, but it was locked. I played through the game, had tons of fun, managed to kill the final boss, hoping to unlock the infinite Dungeon. Nope, killing the final boss didnt unlock it, there was another (long) quest to unlock it afterwards and I was really disappointed. Why hide a whole game mode (and make unlocking it so hard)?? Grrr...


Then I started playing Cardhunter.


It was ... interesting. I always toyed around with systems where items unlock some skills for you, but this game took it to whole new level. Every item gave u set of actions (in form of cards), and each round you drew from that pool of cards (made from all items) randomly.


But playing games is not all I did. After watching series about angels called Dominion, I went to read about it on message boards, where someone suggested Supernatural had great Lucifer character, so I also watched 10 seasons of Supernatural. Ohh talking of 200 hours not so well spent...

neljapäev, 8. oktoober 2015

Day 2 Recap, My first dungeon scene.

I really want to get work going on combat. First thing tho- I must solve the movement/pathfinding for my game.

 There is one alarming thing I found out In this discussion : Unity's built-in navmesh system would not support procedurally generated dungeons, because navmesh cannot be created runtime. They are going to add that feature around March 2016, but for now, I must explore couple of other options: 

  • Implement pathfinding (buy in some A* pathfinding solution and make it work)
  • Skip procedurally generated dungeons for now, make/buy premade levels and still use Unity's navmesh.


I will try option 2, as premade levels are easier on testing too.
So, I bought in Fantasy Action RPG Tileset from Unity Store.  It had 3 demo scenes (premade dungeon levels) ready to be used. And it was top-down, so it was perfect.


Now I only had to bake a navmesh and make my guy follow the clicks:


But what is this? Demo girl I was moving with my keyboard, but my-point-and-click "ghost" jerks around like a lunatic. Damn, I need some more tutorials on navmesh and perhaps some coding. So, I will watch one tutorial today and will do some serious work on this tomorrow.

kolmapäev, 7. oktoober 2015

Day 1 Recap: PROCEDURAL CAVE GENERATION TUTORIAL

Going though unity samples, I found something that could pass for movement code (to start with).
Here is how movement is handled in divinity:


That I found from Unity examples:



Looks pretty similar? I really hope I can use it. Now I need a place, preferably a dungeon to start testing it with.


The Cave (Ominous sound)

My friend suggested I would do this tutorial:

http://unity3d.com/learn/tutorials/projects/procedural-cave-generation-tutorial

and I thought, why not, I wouldnt mind a cave, Skyrim had beautiful caves.

Tutorial was pretty difficult and I skipped through some parts, but I understood like 90% of what was going on. My former experience generating procedural overland map payed off a bit.

I was walking in my cave in no-time.



That did rise more questions for me tho:
How the heck I am gonna test stuff easily on something that is only created runtime?

Unity example (pathfinding) was using navmesh to walk around. Navmesh is something that is baked for already ready level for AI and inside unity editor (not runtime), so how the heck I am supposed to use navmesh for my procedurally generated dungeon? I might have to find either workaround or implement my own pathfinding, if I want to use procedurally generated dungeons.

Seems I need a one normal dungeon/scene for testing purposes anyway.




Game Design: Choosing direction with dungeons

I loved Divinity: Original Sin, but it had no replayability value. It has the same starting point, same places, exactly the same monsters in same spots, everything the same. Seen it once, seen it all.


Roguelikes, in other hand, traditionally implement permadeath, so starting over with a new character happens a lot. So huge amount of replayability is needed:

 For each start to feel like completely new game, it should have:

  • new places to explore
  • enemies are different each game
  • new items and skills to discover
  • new quests/storyline to solve


To have a new gameworld to explore, traditional roguelike games generate dungeon levels randomly 

Here is a nice random dungeon generator for Unity from Aegon Games, DunGen




This random dungeon generator seems perfect - If I would want to go with first person view approach (it has roof)

There is another, "half-ass" solution, seen in Diablo 3 (rifts), for example. The solution, is to have pre-made dungeon floors, select them at random and repopulate them with random monsters.   

For my combat engine development, I do not need a randomly generated dungeon. But, for later, random generated dungeons are boon to have.

Central Hub vs Infinite Dungeon

Games like Diablo 3 and Dungeonmans have a central hub (a town, city, a central place with shops).
Central Hub is good for choosing the difficulty of the dungeon (you can choose wich dungeon to go), and you can go into tougher ones once u feel ready.

Games like Lost Laby have infinite dungeon, where u can only go down from stairs. Every resource is important, food, drink, even a lightsourse. Your main mission is to get to next floor, spending as little time as possible.

So it is kind of farming vs survival setups. For this project, I am leaning towards infinite dungeon approach.










teisipäev, 6. oktoober 2015

Eador vs Divinity type of combat engine.


I had to consider a combat engine that matches (more or less) the following criterias:


  • Works for rpg game
  • Works for strategy game
  • Supports invidual characters duking it out
  • Turn-Based, so you have time to consider your moves
  • Outside combat, you can NOT move your party members one-by-one, in turn based matter, as it takes too much time.  

 Some strategy titles, like Heroes of Might and Magic series, Age of Wonders series and many others have done this already. They have one unit on overland map, that represents the whole party (here is lone rider from King's Bounty as example:



The armies meet, separate battlefield is opened, and battle is duked out in turn-based manner.
 Game, that has done this type of battlefield really well: Eador: Masters of the Broken World.




Even with separate battlefield, this approach is not a only viable way to handle outside-combat player movement.

Long time before any of those games were made, there were those early AD&D games, that had first person perspective while dungeon crawling and separate battlefield was opened to deal with battles. Here is an example from Curse of Azure Bonds:



Using Unity game engine would make first person view approach super easy as well and result would be beautiful.


I have another compelling reason to build hexagonal battelfield in Unity:

I already started building one for my XNA Game project (few years back). I could transfer majority of the code (also written in C#) from there.



And to make things even easier, I could buy in something like Turn Based Battle System from unity store, that has some stuff already implemented:



But then I happened to play Divinity: Original Sin. And I fell in love with it's combat.
I love it's action based system, weapon ranges and how it goes to turn based combat without opening separate battlefield. Yeah you run around real time and when the combat starts, it switches to turn based mode. But the combat simply feels better. And it's perfect for dungeon crawler.

 I have no previous code to build upon, but I would like to give it a serious try. I can always fall back to hexagonal battlefield, if it doesnt work out.





Purpose of this Blog

My main focus it to develop advanced top-down turn based combat engine, that can be used in dungeon crawler/strategy game.

 I am also gonna make dungeon crawler game with roguelike elements, that will be using that engine.

 For development, I will be using Unity.




I plan to blog about my progress, daily.

I will talk about my design choices - be free to give feedback or offer to help out, if you like what you see.

I will also be blogging about techical difficulties/research into subject matter, everything I encounter along the way, with links, - I can use that later while writing my final diploma thesis.