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.