Game development studying

by Maxim Zavadskiy

week 4: Profiling using SlimTune

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

14.01

21:14

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.

22:47

19.01

15:43

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" (http://www.gamasutra.com/view/feature/1879/the_top_10_myths_of_video_game_.php?print=1)

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" - http://www.gamasutra.com/view/feature/3137/profiling_data_analysis_.php

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.

17:45

21.01

16:10

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.

19:30

Total time spent: 6:50

3rd - Debugging using MonoDevelop

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

31.12

11:00 a.m.

LECTURE

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.

14:07

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.

TASK 2

Lets start things!

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

15:00

16:31

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."

19:53

22:41

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!

22:53

23:25

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.

1:00

1.01

11:18

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.

13:00

13:51

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.

14:43

20:00

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!

23:53

2.01

14:30

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:)

16:00

20:00

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.

21:51

21:00

Fine I tested the game and all works!

23:00

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

CONCLUSION


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: http://unity3d.com/support/resources/tutorials/2d-gameplay-tutorial. I'll follow that and will look at this at the same time: http://unity3d.com/support/documentation/Manual/. But I think that I have to read some overview of scripting and game engines. I found this http://www.rabbitwhite.com/WebCourses/IntroductionToGameDevelopment/OR_Uni.html 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: http://youtu.be/9QWVnplPfiY

The build file is now attached.

Attached files Attachments 1

3dDownload.build (1.2KB) - Download

Feedback

Anssi Gröhn - 02 January 2012, 2:50 PM

Module 1:

You have raised good questions, nice!

I didn't understood why we will use Nant not Apache ant? what are their pros/cons? Why we have choosen ant script  when there're plenty it seems other builing scripts?

Ant is for Java, Nant especially for C#. C# will be used in Unity Projects during this course.

But why do we have to know much about those building scripts if IDE will do all the work instead of us?

IDEs do not do everything for you, and it is good to know how to automate things for others (such as artists).

I think we gone to fast and concetrated immediately on Nant.

I would like nothing better than just give you full arsenal of different build automation things, but time is short and we need to focus into C# - hence Nant.

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

Not to my knowledge in task-level, but if your unit testing environment can be executed from command line, then you can do it. Nunit is again meant for C# specificially (and works pretty well) so giving one tool as starters will work just fine. You can freely seek different alternatives if you wish.

Could you tell how Mono is building the project actually?

It's open source, please read on your own :)

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?

Study the XML course, it won't hurt.

Why Nant doesn't support nunit testing without that stuff, it can look automatically for needed dlls.

Ask the developer, I did not write the Nant.

Your screencast is excessively long, 15 minutes should be absolute maximum. Also you should explain in audio what you are doing in it. You do not have to record every single thing, just the essentials. I suggest you do the assignment on your own (without recording first) and then create a simple screencast where you type necessary things pretty quickly and explain what you wrote does.

Anssi Gröhn - 02 January 2012, 3:08 PM

Module 2:

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?

There is absolutely no time to cover all alternatives for Doxygen! You can check the differences to other tools later on on your own.

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

Again, please ask the developer - I did not write the Doxygen tool.

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.

Regular comments are for stuff that is not needed in the generated documentation.

In general are there exist some standart on how to write comment's actually?

That's language-specific, you can pick one standard and conform to it.

Personally for me the documenting syntax is not intuitive and elegant.

You are free to design a better one, if you can!

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"!

You could also teach yourself to ignore them when they are not needed... But IDEs allow hiding of specific code blocks (such as comments)

How can I comment these if I don't know how they are used actually?

Use the source, Luke! :) You know what the code does, so explain it.

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

Great, that is nice to hear.

You really should do task 2 as well. You also could focues little into your spelling, and give more examples in your entries how doxygen comments are written, what affects what and so on.Also writing a bit more structure into your learning diary would make it quite good (headers, process before publishing it).

However, those questions you have raised showed that you really have lots of knowledge, and are able to reflect them into new situations. That's just excellent!

Anssi Gröhn - 14 January 2012, 8:36 AM

Module 3:

In my opinion and experience a debuggin on paper is maybe the most effective way although it consumes more time

Yes, that is probably the most effective way, but when you are paid to get something done, results are also expected to arrive without too much delay. Debuggers are needed for that.

...there would be an option t hide debugging code when needed.(I have never used or met such features).

If debugging code is placed under a block, then it usually can be collapsed (at least in modern IDEs).

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.

It was explained on the lecture, but just not said directly.

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.

Hmm. Let's see, you would need some kind of program memory snapshot, and place that into stack. Issues might rise from the memory consumption, but I don't know enough details about C# implementation to give any conclusive answer.

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.

Maybe testing those breakpoints in action would have been in order since you did not have prior experience about them?

Joints are useful but... it is a physical cheat to be honest.

Games are full of cheating. Graphics, physics, AI. Everything just seems to work like the real thing. :)

Ok after some tweaking I get desired results.

What option made the difference?

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

Great!

we have to redraw the button each time with OnGui, event based system I think is more elegant

Engine to update graphics for each frame anyway, and if discussing about elegance in code, the Unity way beats regular event based system hands down in simplicity. You are just not used to this one, and seem to think it is somehow inferior.

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.

Where is this alledged CallMethod? I have never met one, and only place where it is mentioned is in API is AndroidJNI? SendMessage, on the other hand, works just fine for this kind of program, performance penalty is negligible compared to ease of implementation.

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.

But does lerpz have those properties (collected coins, experience, whatever) in your game? And since lerpz is no longer needed, it is quite the same to destroy it.

One important things about Unity classes .... 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.

Since you are looking the engine from source code point of view instead of the bigger picture where programmers are not doing the level editing - artists are for that. And for that purpose, plugging something in is far better metaphore in usability sense than implementing inheritance property via GUI. Artists rarely do code, so why bother them with such concepts?

 

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

Thanks, but screencast would have been even nicer!

All in all, lots of reflection in your entries! Nice job!

Seppo Nevalainen - 15 February 2012, 7:51 PM

Module 4:

Quite thorough entry on different aspects of profiling.

I have marked the entry as accepted in Moodle.

Page created 12 December 2011, 12:21 PM / Page modified 14 January 2012, 10:47 AM
You can see this page because it is public.