суббота, 23 июня 2012 г.

Procedural terrain. Part 2. Slicing camera, "fog of war"

Spent several hours, planing implementation. Considering stacks, queues, cashes, but decided to play only with visibility at the current moment.

So, here we are: for now, number of visible chunks (in current project, 1 chunk = 1 level of terrain) is depends on camera height. On theese screenshots, positions of the camera are the same, except height.
Next step is to add "fog of war": those cubes, that are incide of the mountain should be brown, and similary, cubes for air should be blue.

пятница, 22 июня 2012 г.

Procedural terrain. Part 1. Basic terrain render.

Decided to play with procedural terrain a bit. Terrain's square shouldn't be extremely high, so i decided to set 1 chunk = 1 level.

At first, i'm generating a terrain with Perlin Noise (as a highmap, highlighting it with particles). Then, i convert data to per-layer(matrix) form: now i can access to every layer and get known, where is air and where is ground.
Next step is mesh-creation:

Upper side

четверг, 21 июня 2012 г.

Juice it or lose it - a talk by Martin Jonasson & Petri Purho

Very good talk and really great and clear example of how juicing a game can make a dull game much more interesting without making any modification to the game mechanic.

Off-by-one error

An off-by-one error (OBOE) is a logic error involving the discrete equivalent of a boundary condition. It often occurs in computer programming when an iterative loop iterates one time too many or too few. Usually this problem arises when a programmer fails to take into account that a sequence starts at zero rather than one (as with array indices in many languages), or makes mistakes such as using "is less than or equal to" where "is less than" should have been used in a comparison. This can also occur in amathematical context.


Consider an array of items, and items m through n (inclusive) are to be processed. How many items are there? An intuitive answer may be n−m, but that is off by one, exhibiting a fencepost error; the correct answer is n−m+1.
For this reason, ranges in computing are often represented by half-open intervals; the range from m to n (inclusive) is represented by the range from m (inclusive) to n+1(exclusive) to avoid fencepost errors. For example, a loop that iterates five times can be written as a half-open interval from 0 to 5:
for (i = 0; i < 5; i++) {
    /* Body of the loop */
}


Src: http://en.wikipedia.org/wiki/Off-by-one_error

среда, 20 июня 2012 г.

Тесты на Topcoder.com

Topcoder.com - отличный сайт, предоставляющий платформу для тестирования программерских скиллов.
Рекомендуется при собеседованиях.

суббота, 16 июня 2012 г.

Чистка контекстного меню "Создать"

Можно удалить эти пункты из списка Создать, просто удалив подраздел ShellNew из ветви реестра вида HKEY_CLASSES_ROOT\«расширение файла».


Да, важно не забывать о резервном копировании реестра :)

понедельник, 11 июня 2012 г.

*Updateable* Gamedesign articles collection

Doom3 source code review

Unity.Class creation order.

We have creation code:


Debug.Log("1");
GameObject obj = GameObject.Instantiate(prefab, new Vector3(0, level, 0), Quaternion.identity) as GameObject;
Debug.Log("2");
obj.name = level.ToString();
Debug.Log("3");

and object code:


void Start () 
{
Debug.Log("4");
}
void Awake()
{
Debug.Log("5");
}

SendMessage vs Realtime Call

Unity3d, C#

gameObject.SendMessage("doTestCall"); vs tpb.doTestCall();

Происхождение украинского языка.

Недавно наткнулся на "языковедов", которые утверждали, что украинский был искуственно создан в районе 1890-х. Решил поковыряться в инете на эту тему, поспрашивать знатоков. Вот что всплыло:
http://uk.wikipedia.org/wiki/Енеїда_(Котляревський)

воскресенье, 10 июня 2012 г.

Ignore file for Mercurial and Unity


Here’s a working ignore file for use of Unity and Mercurial simple, but slightly different from the instructions posted in the current docs, so figured i’d pass it on for anyone else who cares to check it out.

суббота, 9 июня 2012 г.

Graphs, visualizing data

Using particles system in Unity3d.
Bonus:

пятница, 8 июня 2012 г.

Roguelike dungeon generation

Отличная подборка статей по генерации подземелий. Всего 10 статей, в конце есть ссылка на солюшен. Получается что-то типа

четверг, 7 июня 2012 г.

Perfect Arcanoid/Pong ball physics in Unity

this is what i did:
set Drag and Angular Drag of your ball to 0.

среда, 6 июня 2012 г.

How to choose a programming language?


Each new project, whether a standalone program, or a component for an existing program, faces a choice of programming language. Just using what is most popular, or what has been done before, is a poor way to select. You should always evaluate your options and be constantly looking for better ways to get the job done.
While evaluating a language you should also be considering the overall architecture of your project. Not all part of a project need to be, or even should be, written in the same language. The language process will actually be a vital part of your initial design process. How you split your modules and connect the pieces is highly influenced by the answers to the questions posed here.
I’m going to avoid giving specific language examples in this article; I don’t wish to bias your selection with my experience. While some projects will clearly have winners and losers, you should be able to arrive at those conclusions on your own. Languages also change over time, so what was best two years ago may no longer be so, and what was previously excluded could now be a good candidate.