Game development studying Whole by Maxim Zavadskiy: Game Programming Basics 2

Final project and links

Posted by Maxim Zavadskiy on 14 January 2013, 9:01 PM

Project with binaries (!bin) and sources -

Youtube screencast -

week 9 - MonoDevelop

Posted by Maxim Zavadskiy on 16 February 2012, 12:52 PM

I got some time and I see that the course in not graded yet. So I will go for MonoDevelop and will spend 1-2 hours watching tutorials. Let's start.


1.MonoDevelop Tutorials: Installation:

I did the installation already so there's nothing especially new for me.

2.MonoDevelop Tutorials: Graphical user interface

I suspect that the IDE looks similar on all the platforms because it uses some common GUI framework on all those platforms. It is GDK maybe..

Yes I see that MonoDevelop like other IDEs I saw have pretty similar GUI  and features. THe differencies are usually in detailes, like where I can find each feature/command in GUI and existing of special features in the IDE. But I see that it's those detailes that make people love one IDE or another.

3. MonoDevelop Tutorials: Workspaces, solutions, and projects

Aha, Seems one thing is a liitle different in MonoDevelop: apart from workspaces and projects it also has Solutions! That might be useful.

4. MonoDevelop Tutorials: Configurations

Treat warnings as errors was new thing for me. I haven't noticed such in other IDEs.

5. MonoDevelop Tutorials: Compiling and running

Nothing new or interesting. Same things almost in the same place as in other IDEs.

Ok I went through all the tutorials but I am not that satisfied with them to be honest:(. The things that were shown are quite intuitive and common for many IDEs but I have found just  a couple of "candies" or special features  in video lectures that differ one IDE form. I am sure there're much more in MonoDevelop. But Eclipse lecture was much better - many interesting and convenient things were shown which made me like very much that IDE. Ok that is probably my most short diary but just in case I will submit it too.


Time spent: 1h


The Lerpz poject

Posted by Maxim Zavadskiy on 13 February 2012, 6:05 PM

Here I am putting on the Web the Lerpz project that I did during the third week. Sadly I forgot to upload it there and now I cannot edit that journal entry because it's still no graded. So temporaly it will be here.

For the notes that I did during development please see week 3 journal entry. Binaries are in !bin folder for both Windows and Mac(untested). Enjoy!

Attached files Attachments 1

The Lerpz (47.2MB) - Download

Conclusion - self-evaluation

Posted by Maxim Zavadskiy on 05 February 2012, 10:58 PM

I like this course, especially that lerpz project. I didn't expect that big portion of software/game development tools, like debugers, profilers but it was all helpful. But I expected more of game programming itself. I see also there's a game programming project course that I think is the right one for me.

But now I have to go for the most boring stuff in the course - self-evaluation.

 1."Which of the course objectives you have reached?"

I think I did all the course course objectives well or even fine in some cases. But wait! Not all, it seems! I cannot say for sure that I can do this: "include debugging information into C# programs". Probably I simply don't understand that sentence. Does it mean inserting logging to console lines or smth else? I am also not sure about "understand how attributes are used to create NUnit test cases". Are things like TestFixture that we put before the test class mentioned here? Sadly I don't have time to check that for I am at very deadline. 

Also as I said previously I haven't studied MonoDevelop and VisualStudio tutorials well, so I can't say for sure that I met objectives related to those IDEs but I think I am familiar with MonoDevelop and especially with Visual Studio.

2. "In your personal opinion, explain

  • what have you learned during this course.
  • what kind of knowledge you have obtained?"

I am now familiar with a notable game engine, Unity. And I now know what to expect from other game engines. I studied useful tools that are convenient both for SW development and Game development.

I gained mostly pure practical knowledge, with a lack of theory beyond it. E.g. I know a tool, like Unity but I don't know how it works actually and what's it's architecture. But the topic about profiling is a good example with some theory inside it and that should be also applied in Unity's case.

That lerpz project that I did is smth that I can show to my possible employers to demonstrate some of my skills but sadly things about other topics are not so easy to show. Would be much better if we could apply all those things on the project while doing the course.

3."Give yourself a grade from 0-5 (0=failed,5=excellent)

  • based on reaching course objectives
  • based on personal effort you have put to this course (How many hours?)


I will give myself a 4 based on reaching course objectives. Firstly, because I always live some space to make things more perfect and I know I can always do this better than I did. If I would give myself 5 that means I am so satisfied with my result's that I don't see the way to make it better. A bit of philosophy...:). Also as I mentioned I haven't did the whole course but probably I will do that topics about MonoDevelop and VisualStudio soon.

Totally I spent about 45 hours doing this course but I still will do those two topic about IDE so it might go up to  55. Probably the amount is not correct because in one week's topic it seems I haven't counted the time so I simply took around 6 h for it. But in the course specification it  is 80 hours!! Does it mean that I did 45/80= 0.56 of the course with a grade of 3?? - Maybe but I had some experience in SW development and programming before the course so I knew much of things before the course. Well I see that I can work harder on the course, e.g. developing the lerpz project further. Ok I'm giving myself 4 based on personal effort.

I think that I did the course very well and even with some effort applied;). I am sure that the time and efforts that I spent on the course certainly worth it. A GREAT thank to teachers of the course and to all the participants!

week 6 - Know Your Hammer: Introduction of some IDEs (Eclipse IDE)

Posted by Maxim Zavadskiy on 05 February 2012, 12:23 PM



This is the last topic of this course:(. After that I just need to provide some feedback and that's all. I hope the content of the last topic will be fascinating. So, what I have... I see that I can choose one IDE of 3 to examine: Visual Studio, Eclipse or MonoDevelop. But where's the introducting itself?! I expected some articales or even video lectures about IDEs in general when I will undertand what is IDE, how it works and the most importand thing - classification of IDEs and most notable examples. I am more that sure there're plenty of IDEs and probably my favourite one or the one that will be favourite for some particular type of work does not belong to these 3. But  what I am waiting for? I will study that missing part myself! Let's google and read! To be honest I never did that although I dealed with some IDEs, like CodeBlocks IDE quite a lot. Now I think I will expand my point of view and probably will find another, even more convenient IDE.

I beginned with Wikipedia - The wiki article was a bit boring. Many of the wikisa are too formal I would say. I didn't studied much new from taht article but it leads to There are just plenty of comparasion tables for each programming language - quite boring. And no word in classification and also most notable IDEs are not mentioned. From those table of features I see that one of most powerful ones are CodeBlocks, NetBeans, Eclipse. I also see that MonoDevelop is not in the last place. I see that my teacher was not wrong when he advised me to look at Code::Blocks. But I still not satisfied with my understanding of IDEs, let's look on other articles... OK from what I see in the articles most of most notable IDEs support usually many languages but were designed only for a few originally. Again Eclipse, NetBeans and also Geany worths looking at closely. OK, I will start from Eclipse and maybe then go for MonoDevelop and finally will have a look at Visual Studio, a very short look because I am not going to use the product at this time that is beyong the freedom. So Eclipse...

Eclipse IDE

Eclipse IDE Video Tutorial part 1 : GUI (12 min):

I have seen in the beginning that there're different kinds of Eclipse for each programming language. Did I get it right that the core of Eclipse is the same in each case but it only has different plug-ins in each case? I installed the IDE in my Ubuntu distro as easy as going to SW Center and clicking install. There was just one Eclipse available, it seems that it's kind of universal build.

Ups, it seems I don't have plug-ins for C++ installed, only for Java. I need to fix it..

Wonderful!  I installed the missing C++ package for Eclipse and when I restarted it I see both Java and C++ Development links. I am beginning to love Eclipse.

The Eclipse layout looks natively and is similar to other IDEs which is great. I even think that among developers of IDEs there're some conventions or standards about IDEs.

The Eclipse UI looks fine and convenient, probably I like it even more than that of Code::Blocks IDE or NetBeans. But what a huge list of things appear when the right click in code-editor is done. That's too much to feel comfortable.



Perspectives are useful thing that I didn't use in CodeBlocks. Probably it's not there. In MonoDevelop it's called Layout I think.

Eclipse IDE Video Tutorial part 2 : Projects and Workspaces (6 min):

One idea that came to my mind when I was watching about Debug and Release targets: cross-platform support. It seems that at least with no special plugins it's not supported, i.e. from the beginning we bind the project to some toolchain e.g. GCC. But what if we would like to develop a cross-platform app using wxWidgets GUI? It's not convenient to create separate projects for each platform. In CodeBlocks I solved this by creating different targets, e.g. WinRelease, LinuxRelease.

Hm.. I wonder why Eclipse is restarting when I select another workspace? Did I get it right that all the settings including layouts are specific for each workspace?

Eclipse IDE Video Tutorial part 3 : Working with project (11 min):

 src source folder.... I always see the same folder names like src, bin etc, when browsing some open-source project. Is this some kind of convention or standard among developers? Probably there should be something about that on the Internet.



I didn't understand why Eclipse cannot clean or suggest cleaning a project when we move source files. Probably it can be done with plugins.

So what if I will delete some file occasionaly? How can I get it back?

Eclipse IDE Video Tutorial part 4 : Adding classes and refactoring (19 min):

Most of the stuff there I have used in CodeBlocks too but probably not auto include. Well actually it will be much more convenient if Eclipse will place includes as soon as we mentioned some class in the code. The method showed in the tutorial is partly manual but still more convenient than doing everything yourself.


OK I have watched all those tutorials and I see that Eclipse has almost the same apperance and behaviour as CodeBlocks. I suppose that once I learned some IDE, like CodeBlocks, studying another won't be a challenge because all of IDEs are pretty much the same.

The tutorials were informative but I would be much better if all the features are demonstrated on one small but real-life related project (calculator e.g.) during it's development process.

Well I think that what I studied from those tutorials meets the specification stated in the topic:

  • Setting up a working hierarchy of workspaces, solutions, and/or projects in the IDE.
  • Setting up and using different configurations for example debugging and release phases of the project.
  • Adding, creating, (re)opening and deleting files in a project.
  • Building, rebuilding, and cleaning projects.
  • Running and debugging projects.
  • Adjusting project and solution settings to meet your requirements.

Now I will go for Coclusion topic where I will write a couple of words about the course and after that I will look maybe at other IDEs.


Total time spent: 3:48

week5: Unit testing with NUnit

Posted by Maxim Zavadskiy on 21 January 2012, 10:41 PM



This week's material won't be interesting that much for me I suspect. I have experience with JUnit and NUnit won't differ much most likely. From the other side I may do the task fast.

Let's look at videolectures:

Video lecture

Why do we need Unit testing: The main problem for me is to make myself DO the test units once right after I did my class and then forget about it. But I always lazy enough so I leave this for "later" which may result in nasty situations. This is the same as in case of documentation:)



There was mentioned smth about "Simplifies integration" but it was swallowed so I didn't understand. How it can simplify integration?

Let's look at that wikipedia link about unit test tools... From there I found that NUnit and JUnit are related to so-called xUnit. That means that they are basically the same systems but just implemented for different languages. And for many languages there are relevant xUnit frameworks.

Creating a simple test: what's an attribute in C#? Is [TestFixture] similar to Java's @TestFixture? I am pretty sure it's so.

Why may we need constraint-based assert model? It just does the same as "normal" model but we write slightly similar line of code. I wonder when it may be more convenient that usual style?

ExpectedException: but what if we have several test for some method of class that are put in TestMethod()? Then if the first test in TestMethod will thorow an exception the others simply won't be run! What is the solution here? Currenly I don't see any sense in such feature because usually there are plenty of tests for each method. Of course we may put try-catch block everywhere but it's not convenient.

I am not sure if I got the difference between MaxTime and TImeout. So Timeout may be applied only for complete test fixture and it measures the executing time of the whole fixture?

I watched the demo and I go for task. Oh yes, almost forgot there're some articles in Material section let's read them first...


"About software testing in general": Yes I agree it would be nice to study a separate course in Testing, But the problem is that I haven't seen such on, or at my curriculum. A section "Testing methods" is interesting for me. So which of these 3 methods works better in most cases? Another question is, who should actually test some piece of the software: the programmer, who knows best of all what his code does  or other person, e.g. tester who will have a fresh look? Of course the best case is both but I think it may take to much time.

12 Unit Testing Tips for Software Engineers: "Instead, write a test that focuses on the behaviour of the system." - well, I am not agree here. Behaviour may depend on many helper methods/classes and if for some reason behaviour method test will fail we then have to check each non-behaviour method used here in that case. But if the test will be written for helpers too then we will see immediately probably where is the problem exactly.


Task: Write a complete NUnit test classes



:(( For one hour I tried running the NUnit test but I always crashes with reporting of invalid path. I googled it and tried a plenty of different ways but all doen't help:(. I left my post in discussion forum on Moodle. I see other guys have similar problem. I will probably reinstall MonoDevelop and try again later on.




Today I did that assigment, here's the link to the screencast -

I did this week's assigment in several weeks! Probably I was too lazy or there were many things to do maybe.

I have studied a couple of new things about unit testing but the majority of them studied before. To be honest that week was not that interesting for me as previous one. But now I will go for the next one!


Total time spent: 4:40

Attached files Attachments 1 (123.7KB) - Download

week 4: Profiling using SlimTune

Posted by Maxim Zavadskiy on 14 January 2012, 10:04 PM



The topic of 4th week seems to be more or less interesting, I think I have never done this in my programmer's experience. Also a note about video game optimization attracts me. So let's see what's there!

Video lecture

Introduction: From there I got that it's quite useful this profiling. I think it's especially good for optimization of big projects with big resource consuming. I'm remembering my ACM-contest that are about algorithms and data structures. There things is that not only the time(usually 2s) of execution but also memory was limited but the inputs were huge. So clever data structures and algos are needed to fit these limitations. Well actually I have never used profiling there though some of competitors do.

Hm If I'm not wrong in the definition of profiling given on the lecture debugging  also fits. Should it?

Ways of doing profile: well for me that's quite evident that we can use both. Or some tools offer one only? And yes, why we simply cant output needed info, e.g. memory use, all the time? We could use that during testing phase, when we play the game we develop and see at which moment it ates the memory.

Why profiling?: Good reasons were provided but for me it would be also strong argument that we should use this in case of big resource-consuming cases. oh Well actually many of modern games are such:)

When to profile?: I see the time that profiling takes is nothing compared to time to fix all the problems found. But first of all the developer should do the project from the beginning in such way that no optimization will be needed. I don't have enough experience if it can be in real live but at lest everyone should try. It's easier to do smth while it's hot and not e.g select non-efficient algorithms because efficient one is easier to implement and then to hope that it all will work fine. The same situation was described on Source code documenting.

Why profiling? I didn't understand why we need the program to be balanced in a way that frequency of each method call should be about the same? Probably I just didn't get it right what the lecturer says. Also can we actually see how frequently each method/object is used with dynamic call trees/graphs?

Calling context trees: So for the same function we have there separate node for each call of it. But won't it be inconvenient to see which nodes are related to the same function. At all, what kind of picture/info we get as an output from the profiling tool for those trees/graphs? Would be nice to look at it in the lecture but I hope I will have an opportunity when I will do my task.

Execution statistics: So these statistics can be collected during the run of the program? Then we have to get memory use and time use at each moment of execution. It differs from those two ways that were given in Introduction. Does this way have it's own name?

Execution flow: So how it's different from e.g. call graph? Do we get here just a list of function called?

Event-based profiler: C++ was not in the list of languages that have a profiler build-in. And I haven't seen that in C++ standard. But I am sure that some profiles exist with support of C++.

Statistical providers: Yes I was things about the fact that profiles can consume themselves a lot of resources. How they work actually? Should the profiler usually be built-in the project in order to work? But then the would be difficulties with memory and performance monitoring because the profiler use the memory and CPU too. Or it's probably is run as a separate process which interacts with the process of the program. But anyway I think the interaction will decrease the performance of the program so we won't get real results. It would be interesting to understand how it's actually done to get the correct results.

Simulators: so yes now I see that there're two ways: either to inject the profiler in the code or to run it separately. But Simulators I suspect is from another categorization that e.g. statistical provider. Statistical provider e.g. can be simulator, right?

Hm. but where is practical lecture that was mentioned in the end of the lecture? I haven't found anything. OK, I will see tomorrow.




Reading Articles

I found two interesting looking articles in the Material section of this week. I will go through them..

1."The Top 10 Myths of Video Game Optimization" (

The language used there is quite uneasy to read but the article seems to be helpful. The first myth touched interesting problem - when to optimize? Probably I remember not clear the lecture since 5 days passed but there was probably mentioned that the optimization is usually done in the end,But I read from the article that the optimization of micro level(amount lines of code) should be done closer to the end but not of Application and System levels. In the article wasn't explained that much why it is good to do so but one of the reason I got is that these last two levels are about hardware and class - structure so it's related also to design phase.

The article was a bit too professional for me to be honest and there were used such concepts that I haven't hear about. But the article worths reading. There was mentioned all the way that the main purpose of VGO is to increase Frame Rate. I'm not sure if that's true. Firstly the FR can differ from one moment of the game to another and at one moment it might be really slow and at another - really fast. I am sure that it's better to try to have monotonous FR during the game but that is not that related to the question. But what about game/level load time vs FR? I am not sure that all people would like the game that loads for 30 minutes but have extremely low FR. Well, probably I know to few about CPU and GPU work in Games to discuss that. But the good thing in that article is that the myths were related also to optimization in general.

2. " Profiling, Data Analysis, Scalability, and Magic Numbers: Meeting the Minimum Requirements for Age of Empires II: The Age of Kings" -

Should be interesting - real example of well known game! But to my embarassing I never played that game though many advised it much. I should certainly do that because I like good stategies. I hope the AI will be good enough.

" In these cases, we fixed the problem by capping the number of times the code could be called by other systems or by capping the amount of time the code could spend executing. " - here I was confused. How it is possible to limit e.g. number of times of function call by the system? If in some code that function must be called say 5 times how it is possible to force it to call it 3 times without affecting that code?

"And since performance profiling and logging significantly slowed game play, analyzing recorded games was a much better solution from the tester's perspective." - yes, I got a partial answer for my question raised during the lecture. At least at those times profilers deacresed the game perfomance significantly which caused some difficulties during optimization.

"While we were able to improve the pathing system for AoK, enhancing the unit-class hierarchy system was a much more onerous task. The unit-class hierarchy system from AoE couldn't be changed easily since so many game systems and so much functionality relied on the old implementation" - I guess that it was the problem of not good Object oriented design when AoE was being designed:). That again awaked a wish to study seriously OOD. At Savonia UAS there are no special courses about this. Probably it would be a good idea to ask my tutor teacher to run it there. Or maybe it is possible to run it as an online course like GPB2? E.g. "OOD in Games" or even beeter at first just general "OOD". But probably this topic is not that comvenirent to run online as I feel it will require a lot of discussions with teacher and student.

"VTune is great because you don't need to compile a special version of your program, it doesn't slow your program down while it runs, and it lets you see the amount of time the CPU spent executing processes besides your own." - Wow, nice! I think I will extend my knowledges got from the lecture quite a lot in this article. On example it's much more easy to understand differences between different profilers types.

Perfect, the article was amazing and I learned quite many things. Now I know roughly how optimization is done in real projects and what difficulties/solutions I can face/apply.




Ok, now I go to the assignment. I haven't found that practical lecture but it will be even more challenging and interesting maybe.

I installed the app and downloaded exercise app to profile which is a simple game like aero hockey where my opponent is a computer. Now launched the profiler which seems to be a light and not powerful one but let's see how it actually will do it's job. The good thing is that I don't need to recompile the app to profile in with SlimTune.

The input dialog of the profiler is simple but intuitive enough, from the first attempt I get things done. I played the game for about 10 sec and lost to the stupid AI:). The profiler generated statistical data based on sampling on each 5 milliseconds. Now I am analysing this info.

1. Per-Thread Call Trees Visualizer

Well to understand what is going on from that tree it would be good to examine the code at first but I don't see such task. From the screenshot1 it can bee seen that the app has 3 threads during it's run2 of them are some system functions in which I am not interested, they are called with frequency of about 1% and the Main thread with about 99%. Stop! That's wrong. It doesn't show the frequency of calling but just what relative amount of the time was spent in functions. So 99% of time during the app run was running Main thread and 1% - two other. two together.

Amoung functions called in Main the picture is slitly different. We see that Run method is used most of the time (91,57%). Other methods are some kind of initializers, like InitializeGraphics so they are called usually at app's start up. That's why the are not used much. I extended the Run function to check for the situation there and again noticed the method that is used most. I continued recursively to the very end. At the end it was PresentInternal method which belongs to DirectX3D library I suppose. 81,47 % of all samples were taken when that function was running. That makes me feel that this function is also uses CPU most, or hm.. GPU? I even don't know what is the actual situation. OKk anyway if the app is slow then I would certainly look at updateScreen function to optimize things. This is app's own method that make calls to DirectX to draw graphics I suppose.

2. Function Details Visualizer

I am confused a bit with this part of the task."Explain the function details from the program's own functions and library functions that are used extensively during the program execution. " - to do that I need to take several screenshots not one. But probably it's needed just to describe the situation with Main? I did in this way. The picture I got can be seen from screenshot2. I think this visualizer is a bit useless I get much more detailed and convenient info from Thread Calls visualizer. But it would be nice to have integrated function details diagram when I click on some method in previous visualizer(Thread calls). Sadly this feature is not available:(. Ok from that diagram I see that the Main method itselfs does not that much the most of work is done by Run method which Main calls. Some time is spent to initialize things, e.g. graphics(blue).

3.NProf-Style Treeview Visualizer

 In Tree View tab I get two trees of function calls. There're two of them probably because there were two threads running parallely. But where is that 3rd thread which was shown in the first part of the task? Hm.. yeah the input shown on the screenshot3 is not that clear for me. When I extend 47,Main()(I suppose this is the first function called in this thread) I get other function called in Main in their order of call and the first one is with id 265. But also after Main() this function is again present! I think that here two formats are integrated: I can extend some function to get a tree look what is called inside and also in the list form, if I won't extend anything. I feel it might be done in better way but can't say in which:). It's easier to use tree feature in this tab to find the info only about app's own methods(the task is such), From what I see.... Firstly the Run function is called and only after that initializers!! I don't know why it is so. Maybe a bug:)? Also that in that Run function some thread should be runned because it's calling tree is not big and I don't see there that updateScreen function that is called most of all. From the call tree I see that after Run() the graphics, sound is initializing and Window is drawing.

After the task is done I got a general impression what the profiler is and what to expect from it. I actually expected some more complicated output of information, probably more graphics, visualized graphs and that stuff. But that is a simple program I see and it doesn't do that much. Probably in most cases it is enough. But I am not sure if big companies will use such tool.

From this topic I got a lot of knowledges. I understood what the profiler is and why it is useful and also in which cases it is useful. I had a look at how games are optimized though reading that article about AoK optimization. But the main thing is that I now know that there profilers(I didn't know that):) that VGO is a big part of project.

I was missing a task about Lerpz platformer but nothing prevents me from do the task that I will invent! Of course it might be difficult to imagine some things about the game.


Total time spent: 6:50

3rd - Debugging using MonoDevelop

Posted by Maxim Zavadskiy on 31 December 2011, 11:00 AM


11:00 a.m.


This week's topic should be useful in my opinion although I have experience in debugging. Anyway in case of scripts and Unity things should be different a bit. Let's start from the lecture as always!

How to find bugs?: In my opinion and experience a debuggin on paper is maybe the most effective way although it consumes more time that e.g. debugging using a debugger because you have to e.g. update the variables on the paper each time manually and the debugger does it in your place. But nice thing about paper debugging is that you are acting as an interpretator so you feel some kind of total control on your program which is cool:) Also for me many logic problem are solved much more easily with this method.

I used debuggers quite many times but an embarassing thing is that I always was lazy to study info about some features, e.g. breakpoints! I knew only those that are intuitively clear how to use. But now at last I will learn a bit more I hope. Instead of breakpoints I always used run to the cursor but now I see it's quite manual way of debugging and it might be more convenient to set breakpoints in needed places rather that switch through sources and click a mouse each time.

What are tracepoints?: Well maybe useful thing sometimes instead of incode tracing but that has some disadvantages. For example unlike incode tracing( and debugging in general) I don't thing that tracepoints and traces can be so easily ported to another debugging tool if nessasary or goven to another programmer. So currently I preffer incode tracing. But it would be nice if IDE's would generate trace code automatically and there would be an option t hide debugging code when needed.(I have never used or met such features).

11:22 a.m.


It would be good to hear how debugers work actually. Maybe it is not that easy but I think we have to know at lease the basic principle.

From the lecture I didn't get what is the difference between soft and hard debugging and GDB, what are their pros and cons. Seems I should look into the Web for that. It also was a bit frustrating for me that it wasn't explained why we should use soft debugger and mono develop in most cases. I always like to understand what things I am doing and why.

Ok from the lecture I got a couple of new things such as breakpoint. Sadly tracepoint were not demonstrated at all:(. Not that advanced level I expected. Also I in the video tutorial of debugging and in my experience I see that it's more than frequently needed to step BACK. The fact that I haven't met this shows that this feature is hard to be done. But it would be really needed feature.

I will skip debugging excersises for now as I find them quite boring and not useful for me and will go to "candy" - developing the game futher.


Lets start things!

First of all I will do the remained task from previous week on joining wheels and box.



Ok, seems like a hinge joint is appropriate solution. Joints are useful but... it is a physical cheat to be honest. I wonder, is it possible to create a real joint which consist of physical objects completely. Then it will better simulate the real world I suppose. But proably perfomance will be decreased.

It's not that easy I see to get things work. I had to put 4 wheels but they are behaving like non-physical objects: they are ingoring collision with platforms! I don't know what is wrong. I have to look at reference answers for assistance...

Hm... Joints are not used there! Interesting... Aha! There are box and wheel colliders attached but they are not rigid bodies - that's the solution. Ok..

Now I will start the 2nd task.

I used our previous version of the project (the result of working on 2nd module) as a base. I noticed that it is quite hard to pull the cart on the moving platform because of it's small size and because it doen't stop at the bottom. So I resized the platform but I didn't touch the moving behaviour because it's even more interesting I think in this way. But the cart being placed on the platform behaves like it is too light, it is loosing it's balance and rotating. I tweaked many params of the cart but it is still bouncing.

Ok after some tweaking I get desired results. Now I have to "Make it possible to load the ship fuel."



I found a ShipFuelTrigger already done from solution of second week but I will do my own script.

I found an interesting thing in Unity: actually there're classes for Colliders, GameObjects! And I though it is hidden in Unity engine and we can only manage these objects though Unity IDE!



I studied GUI basics of Unity from the manual. Things are strange for me. I used GUI systems in Software in other way, there aren't OnGui stuff and GUI.smth to create smth. I don't understand why e.g. we have to redraw the button each time with OnGui, event based system I think is more elegant. But I see there's no way but only one in Unity(at least in non-Pro version:)).

Ok after some time I the button "Load Fuel" is desplayed each time the fuel is near the ship and the fuel destroyed when the button is pressed . Here is an interesting issue: where to put trigger script in the spaceship ot in the fuel?? I decided to put in the fuel for Fuel should know how to destroy itself and explose.




Now I need to make an explosion animation when the fuel is loaded into the spaceship.

After about an hour I did my very own(except textures) explosion using particle systems. Now I should make it instaniated when fuel is loaded.



I decided to make the game fair, i.e. the player won't be able to enter the ship if the fuel is not loaded. So I have to make a fuel_loaded member variable for the Ship. And that may be a bit challenging for I don't have Spaceship class but a set of scripts attached to Spaceship game object. For simplity I will add the entering script to the spaceship not to the Lerpz so I can easily access fuel_loaded.

I noticed that altough MonoBehaviour has OnTriggerEnter method, when I begin to type this in the script, the IDE don't suggest to fill the name of the method to the end, which is a bit frustrating.

I found another disadvantage of not creating separate class for each new GameObject(Ship, Lerpz) - when we want to call some method of other game objects we have to use this nasty CallMethod method which is not a good solution.



Some difficulty I met when I was finding out how to detected that the collider in OnTriggerEnter is Lerpz. When I checked that colloder==lerpz it doesn't work because actually the footEffects is the trigger of Lerpz. I am sure that there should be more convenent way than passing footEffects as a parameter to the script but I don't know which way.

foorEffect turned out to works badly so I added separate tigger area to lerpz.

I have a problem hiding/destroying lerpz. When I set active=false the lerpz remains. But GameObject.destroy works! But there's a hidden problem: it will destroy the lerpz not hide it so it's at first chating because the lerpz actually should be inside the spaceship, and at second all the members variables of lerpz will be missed, e.g. it's coins, experience or whatever. But for this time I will do in this stupid way of destroyin the lerpz.

Wohoo! I did it: the lerpz now can enter the ship when the fuel is loaded and I can control the ship but there's a problem with camera: it remains at the same point and not follows the spaceship.

I found a method in CameraScrolling script of main camera but to coall it with CallMethod I have to pass 2 parameters which is not possible it seems. That's another problems with separate scripts. So it seems I have to use default value in that function. But no! There's an overloaded method with one param there so np. OH! CallMethod doen't support overloaded methods! No way but to put there a renamed method.

Fine I did that! Now the last thing remains..

I haven't finished the task today and missed the deadline but I think it is no problem if I sent it to the teacher tomorrow because of holiadays. So no rush..

Wow I'm spending a significant but enjoyable amount of the time on this course, especially on this task!




I used a rotating particle system as an appearance of teleport: looks flne! But I don't know what effect to use when the ship has dissapeared. After a while I decided that the teleport will get smaller and smaller and then a blue explosion will be shown.

Hm, strange! When I copy-paste the explosion from fuel and change it's appearance that of fuel is changed also in the same way! Crazy!

At last! I found an issue: particles! I used in both cases flam particle and when I channged the color in particle system I actually changed the flame itself!

Yep, fine! Now "Quit application after ship has disappeared and final effect has been shown." I think it's not difficult:)



But not that easy because there aren't event's in Unity!!(it seems) So I ended up with this:

if(final_explosion_instance==null&&explosion_beginned) //the game ends after final exposion is gone

which is not beatiful

As for me there may be much better script support in Unity.



Fine I tested the game and all works!


I am attaching some screens demonstrating what I finally did in the task. Enjoy!


Totally I spent about 1080 minutes on this week, that's about 18 hours(if I didn't confuse my calculations)! I can't say of course that I was fully concetrated on the task at all times, so real time may be less.

For that time, I got a good portion of knowledge and experience about Unity and scripting. I began to understand how the whole consept of this game engine. Some things about scripting possibilities in Unity make me a bit disappointed, such as some OOP issues and invconvinces, SendMessage, no Event/callback support. But probably I simply didn't find out how to do all I wnat in Unity in the way I want. Anyway I find Unity quite a powerful and easy to study.

One important things about Unity classes structre I get is that properties of game object in Unity is not done by inheritance but with aggregation. E.g. if we make a gameobject a rigidbody  then the relevant GameObject fiels called rigidBody gets "filled" with RigidBody instance. I can't say for sure at this moment that inheritance would be better solution but I think that personally for me it would be more intuitive.


Attached files Attachments 7

1.bmp (3.8MB) - Download

0.bmp (3.8MB) - Download

5.bmp (3.8MB) - Download

3.bmp (3.8MB) - Download

6.bmp (3.8MB) - Download

2.bmp (3.8MB) - Download

4.bmp (3.8MB) - Download

The second week.

Posted by Maxim Zavadskiy on 10 December 2011, 4:40 PM

Wow, when I had a look at an assigment I understood that I know only few things to do this. Sadly I haven't been able to be present at the first course and I didn't realize that already in the first course Unity have been taught. Now I have to catch up with my grop mates. But from where to start? I had confidence in Software Development but I know so little about game engines! Ok, I think that I have to download the tutorial from Unity website: I'll follow that and will look at this at the same time: But I think that I have to read some overview of scripting and game engines. I found this and I will look at that lectures. But now I'm downloading that Unity3D and tutorials so I'll wait until it's complete. I'll try to run that on Linux with Wine but maybe it will better to do that on Windows. We'll see.

Oh no Wine doesn't work! It seems I need to install some stuff there and tweak smth but I simply don't have enough time so I have to give up and install it on Windows. I'll try then to run it on Linux.


Wow it's my first run time of the Unity. Looks fine! As usual I like to get familiar at first myself and only then have a look at the documentation. Ok it's not that simple and intuitive for me, I was not able to find e.g. where to input the code. I'll look at tutorials.

Oh no! I forgot to save the diary and some info is delete. Ok, in few words I did the part of the tutorial for 3-4 h and I really enjoyed this! Now back to assigments! I'm attaching a couple of screens of my work process.

Ok, let's start studying doxygen! I tried to run Unity in Linux but it's to slow there because of problems with DirectX. So I gave up and decided to do all the stuff in Windows. I have to install nant there and stuff.

Why to document the sourcecode: Yeah I heard many times it's needed. But.. Personaly me I'm too lazy most of times to write comment's. I usually put the comment's when I feel that the solution or meaning of smth will be probably forgotter. But! It always turns out that actually I fogot much more things so I have to force mysrlf to document stuff.

It's cool that unlike Javadoc, Doxygen is usable for many languages!

And Again! Alternatives of Doxygen were not reviewed. That makes me feel a bit binded, like we just have to use Doxygen and that's all. Maybe it's not the best tool?

how to configure Doxygen: Well I wonder why XML style is not used in config files there like in nant build files:)?

How to write Doxygen comments: So e.g. about C++, if I will write cimments like //.... then the Doxygen will miss that? Can we cinfigure to parse that comment's too? I think it would be conveniet.

Well about comment's itselfs. That commenting style we use to generate Doxygen docs, is this a standart way to write comments, it this a convention between programmers? In general are there exist some standart on how to write comment's actually?

Personally for me the documenting syntax is not intuitive and elegant. It make the code dirty I think and when I'm coding it disturbs my attention from the code itself. I haven't checked that but imagine how it wold be nice to have a feature in IDE "hide all comment's"!

Ok, the lecture was simple and almost everythings was clear. I'm curious which stuff I will get when asking the Doxygen to generate UML things and diagrams.

So let's start the hacking:).

After dixygen installation the running from CLI doesn't work. I need to change PATH.

Ok I will do first brush-up excersice as a warm-up. Ok fine, I decided to use this C stile /**    */. I like it more than others

I was using Mono Develop which was installed with Unity. Oh! It's so inconvenient! I'd better will use Eclipse or NetBeans or CodeBlocks.

Doxygen generates nicely looking html stuff, cool! I see that modules shoun't be used for grouping members, beause it's then gone to global paragraph of documentation. I ahve to use member gropus instead.

When I tried to use dot to draw diagrams, it was unsuccessfull. I don't knwo what the problem is.. Again no time to find out why. Probably because of one class only.

Now the assigment itself. Let's comment thins! well, I don't know much about those files attached but I think it will be easy to undestand the code.

There're several cs files attached to comment. But I don't undestand where in the game they are used and how they are integrated in the engine. Maybe those things were explained in previos course which I missed. I'll try to manage this.

Interesting thing! I haven't found some files to comment in the Unity project! How can I comment these if I don't know how they are used actually?

Ok, it seems those files are used in the task 2. I asked my groupmates to do 2nd task because I don't feel confident to do it. But I'll try. So I'll do the first part and will comment needed files and will make a doxygen automation.

I haven't found ShipFuelTrigger.cs in attachment. I'll download the solution and will take it there. Hm actually there isn't many things to comment:) But it's for learning purposes, so... Ok, read some things about scripting in Unity and now I understand those scripts.

Fine I commented out those four files (I haven't found ShipFuelTrigger.cs, my gruopmates will create it tomorrow when they will do the second task). I generated the docs and saved a config file. Now I have to automate this with Nant. Just one command, nothing more.

Ok, I made it work after 30min.

Oh I forgot to made an end to this diary:) So the things continued on this way. My groupmate Joonas did the second task concerning continuing the Lerpz game and I did the first because at that time I still didn't feel so confident about Unity. At that time I requested some assistance from Anssi Gröhn and with his help I get a lot of things about Unity and scripting. Thank tou again, Anssi! We did the most of the second task together but we haven't had enough time to do the last paragraph. So I tried to do it myself. The problem is that I attached box and wheel colliders to minecart but I didn't join them so it crashed every time. I will study how to join box and wheels and then everything will work then! I will probably describe my work with minecart in the next week's diary.

It was a very interesting and even challanging module for me. I begin to love game development more and more.

Attached files Attachments 1

screens.rar (1.8MB) - Download

My first diary in this course.

Posted by Maxim Zavadskiy on 04 December 2011, 4:57 PM

As always I leave everything on the last day.  So I'm a bit in a harry but I hope I will do the task well.

It my first exprerience with this service and I don't know much what customs here. So let's start from lectures. I started to do first lesson on 4 p.m. let's see if it will really take 10h).

1.Lecture: Build automation and Nant (20 min)

What is build automation: remembered makefiles I did in unix to compile my projects. Let's see if it's similar

Oh I'm lucky! I managed to find a bug in Adobe tool for video lectures(no sound). I have to reload it...

I didn't understood why we will use Nant not Apache ant? what are their pros/cons?

How to create Nant files: I seen that stuff when dealing with IDEs,e.g. CodeBlocks Ide or FlashDevelop. But why do we have to know much about those building scripts if IDE will do all the work instead of us?

These scripts are cross-platform, e.g. they are used in several range of IDEs? Why we have choosen ant script  when there're plenty it seems other builing scripts? 

Yeah, what I like in XML, that it's universality. I see it can be applied everywhere. I'm a bit used with it so it will help me understanding build scripts.

Example of simple build file: Now I see it's like old-school makefile. But it has nice advantage: unlike linux makefile it seems to be platform independent, I don't see any gcc -o...... like in that makefile. That's very nice because I love freedom - cross-platform things. But I would like to see hierarhy of all those scripts to understand which is related to which and when we use one, when another. I think we gone to fast and concetrated immediately on Nant. Maybe it seems for me so because I didn't learnd first part of this course.

Nant tasks: about nunit. What if I want to use another unit testing tool? Does nant support such things?


2.Installing Nant

Oh gosh! As always it requires lot's of headackes to do smth useful in Windows). I'm happy I can do it in Linux as easy as double-click on needed package in Software Center of my Ubuntu:)). Fine is that, it seems that corrently it's more convenient to make games in Unix but play them in Windows:D. I think it's a matter of the time. Soon we'll play all the games in Unix;)(I hope so)

Not sure if my blog is autosaved each time so I have to save and open it again from time to time - quite irritating.


3.nant_demo_writing_build_file: I though that Mono develop IDE will create this build file automatically and the use is when building. In my opinion it's the most simples and cross-platfrom way. Could you tell how Mono is building the project actually?

I have seen an online course about XML programming. But now I'm not sure whatever i should study that or not if I will study some XML in this course. What would you advice me?

There was no need to delete Release and Debug folder manually when we could create Clean target. We are using Nant script all the way, aren't we?

Oh ups, actually there was added Clean later, np then:)

Properties checking  in curly bracket seem to have different syntax from XML. What's this?

It not that convenient to point dlls for nunit testing. Why Nant doesn't support nunit testing without that stuff, it can look automatically for needed dlls. Also it would be nice if we could use other testing tools without changing lot's of studd in the script.

Finished these video lectures at about 6 p.m.

Decided to skip brush0up excersices for I have no time this time(.

Now let's do the main part. I see I have to recird video of what I'm doing. Well to be honest I don't feel comfortable when someone is looking what I'm doing. I mean video makes me nervous. But anyway let's see.

Oh no! It seems that Unity is not available for Linux! Such a dicrimination:)! OK, I see no need in it this time.

So firstly let's make a vpn connection. Let's look at video demo...

I installed the shrew tool for my ubuntu through soft center but I was not able to login to the VPN. I'm trying to install it with Wine.

AT LAST! I spent severla ours to make a vpn connectionfrom Linux.

Now let's do the coding...

I got all the time unable to create directory when unzipping. The problem was that on Linux the Fat32 disk where I had the build supported badly:(. When I did all that stuff in th home directory it went fine!

I got a huge recorded video. I don't know how to uploa such a file on the youtube with me speed of 100 Kb/S. I'll try to compress that stuff.

I finished the task at 9:35 p.m. It took me about 4.5 h to do this. Not 10h but it was really long for such simple task.

Here's the video:

The build file is now attached.

Attached files Attachments 1 (1.2KB) - Download