niedziela, 13 grudnia 2015

Spin of direction.

Ok, I got really pissed of by Unreal. It took me literally 6 minutes to compile a single class written in c++. Ok, first compilation you said. Well ok, then I wanted to debug... So I needed to choose different target in MS Visual Studio... And it took another 6 minutes to recompile + next 2 minutes to run editor in debug mode. But guess what, breakpoints doesn't work. So I spent 15 minutes just waiting to see that it doesn't work. Well another problem is, when in editor you press Ctl+Space to see completions... I waited 30s to get this... Fucking 30s for autocompletion? Ok, my computer isn't monster but it works much, much faster in InteliJ into which I put a bunch of heavy libraries. So I downloaded Unity, and started to learn new tool. Let's try to give a chance for different game engine. At first look it works like a blizzard, comparing to Unreal. We will see...

piątek, 11 grudnia 2015

Hard testing.

Ok, I resurrected my PC! Then I improved my Astah plugin to export even more data from diagrams. Now I can control dialogues, passages (doors closed/open) and initial location of NPC. I also finished corrections of chapter one dialogues. After exporting it to JSON it takes me 143kB of definitions. A little to much to handle it manually. So I decided to write Java application which can load all this and work as a NPC speak engine. So now you can check how it will behave in this same way as it would in game. This step allowed me to verify exported data structures. And as usual I discovered several bugs. Sometimes I was exporting nulls, other times conditions wasn't good. I also discovered few things which need to be covered in Unreal. Now it's time to send this to my beloved testers, and start to convert it into unreal. 
When I polish my tools a little more I'll upload sources to it. Maybe someone finds it useful.

poniedziałek, 7 grudnia 2015

Visit of a death god.

Well, I wanted to write some more things which I was doing lately. But... I got very sad situation, my win7 just died. Lovely "Side by side" configuration problem. It looks like I had no luck in resurrecting my machine and time comes to reinstall system from scratch. I just spent last 2 days to try not do this... Well, I'll back with new post after I solve this...

piątek, 27 listopada 2015

Dialogues Astah Plugin

As I promised here comes plugin to astah, which allows you to convert state machine diagrams into nice JSON which later can be imported into Unreal. To compile it you have to download AstahSDK and execute in console 'astah-build' and next 'astah-launch'. If this doesn't work you can follow tutorial for plugins or write comment here. Ok so how this work. You should do as follow:

  1. Open astah and create nice diagram of dialogues (must be state diagram). It should start with initialState and finish with finalState. Actually you can have several final states, it depends how you build your tree of dialogues.
  2. Save diagram (or diagrams). And then select from tool menu plugin.
  3. In directory where you saved astah project you will find 2 new files. One is JSON other one is TXT. Plugin also do basic checks of your diagram:
    1. If all paths of dialogue have final state
    2. If all dialogues starts with NPC speech.
    3. It builds you list of all variables used in conditions and exec sequences.
At this moment tool is very useful, I already found few things which I didn't finish, and few about which I forgot. When you doing one dialog a day, after week it's easy to forget that you had some great idea and you already putted some variables to achieve this. 
Another thing is, that internal structure of data for dialogues evolved, I found some problems with previous one... So I need to rewrite some parts of my blueprints, which probably will be pain in the ass. Thug life...



czwartek, 26 listopada 2015

RPG? It's easy we will do something like Baldur Gates! (but better)

Well, I heard a lot of sentences like title of this post. Probably in every game forum, some young programmers are searching for team members to finish some epic RPG project. Well before you start this, maybe you will be interested in scale of dialogues with NPC. Below one picture which is tree of dialogue with one NPC in firstof episode... About 3.5 hour of continuous work. So only 14 other NPC left to finish first chapter...

BTW.
If you are interested in polish history, and some materials which help me while creating my game here is link and another one.

niedziela, 22 listopada 2015

Building dialogues.

As I mentioned before I'm creating dialogues in way that all content can be scripted and loaded to engine without creating extra conditions to handle common cases. The main problem is to find tool which will be flexible enough to do so. I decided to use Astah Community editon to build graphs. Today I wanted to create content for UDK. Well ofcourse you can use notepad and create csv or JSON file manually, but really? Every time trying to maintain this will be pain. I also created tool in TurboDelphi to allow me to create it more like in astah... but Astah still wins. So? Let's search for some plugins :) And here we are: AstahSDK and of course you can have a JavaDoc! Now we can make some nice plugin which do all dirty work for you. Great! Time to dig in, and try to make what I need. At this moment I'm learning inner structure of data, but I'm progressing quite fast. Probably in 2 days I'll have ready what I need (I'll upload it here in case somebody need it). While analyzing astah data structures I realized something: I need to upgrade my current diagrams with speech, because it was more for human to understand not for autoserialization, but it shouldn't take me more then few hours to do so. So stay tuned for next episode.

PS.
 I also done small research about lifetime of object (which I mention in one of previous posts), still not clear how this exactly work. I'll write something about this when I'll be comfortable with my experiments.

piątek, 20 listopada 2015

Why I hear only one voice?

Once upon a time developer created some engine to do dialogues. He was happy and started to create data to this engine. But suddenly he realised that there is something wrong in his idea... Well we have this situation now. In the first concept I believed dialogue Player <-> NPC is enough. In most cases yes, and it should be ok for my project. But... where is the challenge?! Yesterday while creating some game content I realised that I'm unable to create situation when player speak with two other NPC at this same time. More over if we have room, and in this room there are two Persons and player want to start chat with both of them by selecting any NPC... Well, this situation is not covered by my engine :( So I need to upgrade it. I've few ideas but need to check which one is better. So expect in few days some more boring stuff about how to improve my last ideas. In meantime I would like to finish content for first chapter of my game.

wtorek, 17 listopada 2015

Let them speak!

This is actually old subject, but I spent some time to do it so, maybe somebody finds this useful. Like always if you do games there are several ways to achieve your goal. For example making tree of dialogues can be done manually (greetings Zuber ;p) so every possible path of speech has it own condition. But this approach takes massive amount of work. It's even worse if you decide to change some talks. So I didn't like it. Besides I'm lazy old fat guy who don't like to write too much. So I thought about some engine which allows me to do the hard work. After digging internet I found nothing useful or free. Damn! So I analysed what I need in game:

  • dialogues in form of graph.
  • some answers (choices) for player are available if some condition is meet
    • If you done something in past
    • If you have some spells
    • If your stats are at least at some level 
  • Some answers will open/close passages
  • Some answers will change state of your player (for example you might be liked more or less by other NPC)
Ok how to achieve this? Since there is no Hashmap/fancy structures in UDK blueprint I designed something which work for linear container like list. It's not super efficient but it doesn't matter, since about of data is so small that algorithm might be very non optimal. SO my structure describing dialogue is as follow:
  • NPCName: String - engine friendly name used when you press some NPC to discover dialogues for him
  • SequenceIndex: int - used to create tree of dialogues. If some option is visible on screen (NPC said something) then I use this field to discover options for player. It's connected with next field...
  • moveToSequenceIndex: int - Informs which dialogues are available in next step. This points to SequenceIndex.
  • Text: String - actual text to be shown on screen
  • NPCDialog: bool - if true this is something what NPC will say, false otherwise.
  • condition: string[] - boolean condition in human readable form which need to be meet to have this dialogue available.
  • execSequence:string[] - encoded sequence of things which will happen if this dialogue is selected.
I decided to use list of pairs Key-Value (String-int) to store state of player. So my player have list named state and in this list can be stored pairs which holds current state of game. What this give me? Well I can encode execSequence with just 4 operations. For simplicity of blueprints I used prefixes to encode operation. And we have:
  • >doorName - it's tell engine to open some passage/door for example ">DoorToKitchen"
  • !DoorName - it's tell engine to close some passage/door for example "!DoorToKitchen"
  • +variable - adds one to Key-Value with name 'variable'. If pair with given key doesn't exists then it's created, for example "+goldenKey"
  • -variable -  subtracts one from Key-Value with name 'variable'. If pair with given key doesn't exists then it's created, for example "-goldenKey"
Similar easy approach was used for condition array. This is what I plan to do (since I don't have this part done yet). 
  • each string will start with & or | operator which tells how to apply those condition to previous value.
  • then will be variable from list of Key-Value, if variable doesn't exists then this part of condition is false.
  • then operator in form of >, <, <=, >=, =
  • then value
example of condition: 
[0] |key>1
[1] &marryLikeMe > 10
which mean I need key and mary need to like me for at least 10 points. Ok. This is all for today, hope somebody understands me :)

niedziela, 15 listopada 2015

Need of beauty

It's about month of work. Until now I used just simple BSP geometry to make rooms in my game. Then I focused on learning blueprints and implementing some logic to move, change locations and making dialogues. Now it's the most exhausting part of it... writing what player can say and what NPC will respond. This is very core of my game idea... But it's fucking hard :( So, to easy my nerves I started to learn blender and make some meshes to my game. I know this will not become state of art, but I like it. And while working in 3d program I can allow my brain to think about what NPC will say. So I decided to do at least one dialogue or one mesh each day. I'll share my meshes for public domain, maybe somebody will find them helpful. At least for prototyping. 
Here are first three furniture on screen.

And here is ZIP with blender & FBX model.

czwartek, 12 listopada 2015

UDK, we have a problem!

When you used to program you used to some structures of data. One of them is Map (or Dictionary if you prefer this name). Actually if you look into udk documentation you will find implementation of it. So you are happy, but if you decided to use blueprint only you will loose your happiness quickly :) There is no such structure for BP. WHAT?! This is mean! But true, so be warned dear reader. But ok we have a lot years of experience not a fucking problemo! We use proper combination of arrays or custom objects and we can create any substitute missing map. But, there are more sad news... If you want to have some data taken from outside of project you can use CSV or JSON encoded table. So it's quite straight forward: 

  • Define structure of data (any primitive types can be used)
  • each structure will be one row in your CSV (or one node in json)
  • you import this as a data table.
Great! Now you can put all your dialogs and other things to this. BUT! There is one BIIIG gotcha! You can't hold reference to data table. So you can't make variable to which you connect Data Table and pass this value to other functions/macros. And this is pain. It leads you to situation when in many places you need to put switch and depending on some condition you redirect data fetching from different data tables. So after some thinking I made some workaround: on the beginning of episode/chapter I use switch to select proper data table, and then I iterate through it and copy it into ordinary array of objects. From this moment you are free to pass it as reference anywhere you whish. Of course this leads to duplicate memory usage for those data but since this is some lightweight object it will consume less memory then single texture.

The last thing which is worth mentioning for java/c# developers is that UDK works in word of C++. So "normal" call is through COPY nor REFERENCE this is painful when you start to use structures. I spent few hours searching for bug before I realised that I'm dealing with copy... 

I still need to research life cycle of object. UDK has some kind of garbage collector which works in way which I don't understand now. So I've no idea when object is disposed. When I discover this I probably write few words on this blog.

And the last thing... Well debugging of BP inside UDK, yes I think I can call it hell... 

środa, 11 listopada 2015

Help of a Wizard - concept.

Ok so I want to create game. Good. What's now? I needed to answer first question:

Am I expecting to get money with this?

Well, it will be nice, but be honest with yourself. Do you really want to put all needed effort to finish it? Do you have marketing strategy, do you have funds for it? Do you really want to search investors?
Well... not really, since I'm bored programmer I don't want to do all those things. I want to create a game, and don't really care about making cash on it. If I earn something, great! I can buy more beer. So if you answered this question this gives you some capabilities. For example I don't need to analyse market, other competitors, do research what sells and what is expected to be in game. Great! I don't care :) So I can do game exactly what I want, without worrying that majority of players will be not interested. Then we move to next question:

What genre of game? 

What a stupid question: RPG of course! Blah... really? No, lets be realistic. I created several years ago RPG manual and we played few months with friends. Believe me this is not so easy as it looks. There is a lot of complexity, a lot of rules which need to be met, and even more playing and testing and balancing. This is something for experienced team, not a single looser. So if I strip all character development, and all fighting system... and maybe items (but I'm not quite sure about this) whats left? Hmmm... point & click? Good enough :)
So I know that I want to create some very simple game, because I know shit about usage of UDK, and I want to create something what I'm capable rather than put some impossible to met vision and burnout after few weeks. And I think point & click is great for this.
In the beginning I choose to do it as a standard top view 2D game. But after several attempts to do it in UDK I changed my mind. So I go for full 3d. And there are few reasons behind this decision:
  • UDK is crap for 2D, a lot of problems with very simple things. Like path finding. Sprites also doesn't work to well.
  • It consumes massive amount of time to search tutorials which shows you how to do something in 2D.
  • Why to use cannon like UDK to create so simple 2D game? It's pointless there is plenty of other frameworks/editors which are created purely for those games. And I didn't want to use them, because it lock my learning skill. I go for some dedicated solution rather then learning universal engine.
  • I didn't want to write code at all. I'm totally not interested in programming at evenings after full day of doing this in work. So UDK and this blueprints system was perfect solution for me.

After few more beers I created briefly concept of my game:
  • Point & click in 3d. With camera pointing main character. You can rotate & zoom in/out camera but this it.
  • Small location. Since I've nobody who will help me, then it's no pointing to do large game world. I searched for some old buildings plans. And finally chose a quite large residence (2 floors) for some Polish feudal lord.
  • Main plot should be progressing through talks with different persons in locations. That's why I decided to have ~15 NPC's. A lot, but not all need to be present all the time.
  • Since this is game for adults, there need to by naked womans! I liked idea of Achievement cards from Whicher 1 with naked ladies. I decided to make this as a main goal for my game.
  • I like fantasy worlds with magic... so main character will be a wizard. You can choose several spells which give you some more options in dialogs & actions. I based this on idea from very old game 'Vampires the masquerade".


So lets summary my concept:
You are wizard invited by some rich guy, which want to impress few guest which will came to his villa. Your role is to entertain by conversations and maybe by some magic tricks, guests and home owner. Since there are women at residence, why not to undress them? Or maybe even more... That's it. Let's the work begin.

Few words about me

Well, this is the first post so I believe it's worth saying few words about me. To let you decide is it worth loosing time to come back here.
I'm not a native english speaker, so you probably already noticed some mistakes. This will probably continue :)
Ok something about me:
I'm senior developer which currently work at some world wide company. I'm leading team of mobile developers. In past I got experience in working both on mobile and server platforms. I also done some development on PC. In the beginning of my professional career I worked in small company which developed games for cell phones. After few months I was forced to change city in which I live and moved to other game industry company. I was leading team of programmers, our main goal was to create new games on mobile and do a lot of porting between various mobile platforms. In mean time I decided to create full scale game on PC, after few months of work I finished "The Loona Base" which was stolen from by published (greetings GarageDeveloper International). After that I moved to different areas of development, and my journey in game industry finished. By few months ago my friend asked me if I would like to join group who creating game. I said why not? After lot of talks everything break up when come time to work no to talk. But in meantime I got some momentum which pushed me to try something alone. So I decided not to write code/engine from scratch. I downloaded UDK 4 and started to work on first game. It was multi dimensional maze (up to 5 dimensions) it was finished. But due to selection of Obj-c over c++ it works only on Mac. Well since it was just learning project it's leaved in stage of stable playable, without plans for further development.
After initial contact with this technology I decided to create more complex game and maybe put it somewhere public. That's start new chapter in my game industry :) After few beers and talks with friend I decided to create game targeted to adult. Since I've no budget and no team, and no graphic artist it looks like it wouldn't be to nice. I will put most of effort to learn tools and focus on game story rather than gfx & effects.

On this blog I'll try to put my thoughts about usage on Unreal Engine 4, what's easy & what's hard. I've no background in using such tools so I'm quite noob in this, but I prefer to learn this rather then watching some funny cats compilation on youtube.