Thursday, 7 May 2009

Accepted again!

I’ll work for WF second time this summer. Yay!
Here is essential part of proposal.

Synopsis

Implement game systems require to build a basic castle fortification from scratch from gathering raw materials to the completed construction.

Benefits for WorldForge

When asked about what WF is, you cannot simply answer “It is a set of tools for making games, look what cool game they made”, because there is currently no any playable game. Completing of this will increase number of things players can do in stock Mason game. It will also act as an example tasks for world creators. And hopefully, help to increase overall number of people who do custom world creation.

Deliverables

In the end, the set of tasks, tools and entity classes for cyphesis for constructing walls should be implemented. Needed core and client modifications will be made along the way.

Detailed Description

Proposal is to improve and implement cyphesis tasks and necessary accompanied things for following mason techs: plants, plant-fibre, logging, rope, sawing, pioneering, palisade, scaffolding, mining, earthworks, walls, gate, and fortification.
List taken from blueprint: https://blueprints.launchpad.net/cyphesis/+spec/gs-fortification
Each tech will require a set (zero, one or several) of tasks, a set of correspondent tools to perform the tasks and a set of entity classes on which action is performed. Some, tasks, tools and classes are already present in current mason impelementation and could be reused.
Here is the list of techs, a brief description taken from blueprints and my comments about how it should work and what should be done for each tech:

plants. Gather plants growing on the terrain.
Cut action could be performed with scythe on grassy terrain now.
An other task could be added for gathering different kind of plants suitable for making ropes, like gather reeds with knife.

plant-fibre. Process the right kind of plants into plant fibres to be used as a raw material.
Gathered plants should be cleaned, dried and somehow processed. This doesn’t require any tool, just time. Needs adding fibre class.

rope. Wind plant fibre into rope.
Here several fibres are winded into rope. Doesn’t require any tool either . Needs adding rope class.
Cyphesis, though, does not have ability to perform an action on several entities. So, perhaps, it require an improvement to server or a workaround.

logging. Gather timber by logging trees.
Chop trees could be performed with axe on trees now.

palisade. Palisade from logs.
Lever action could be performed with pole now.
But logs should be processed before levering so they look pretty, like the palisade around goblins camp.

sawing. Take raw logs and process them into the different types of shaped timber required for construction and crafting.
Slice action could be performed with bucksaw on logs now.
Task for making differently shaped timber could be added.

pioneering.
Create rough structures using rough cut timber and ropes.
It is good to have ability to make arbitrary wooden structures, but this proposal is not targeted at this.
This tech could be skipped and simulated by creation predefined wooden structures or by consumption of wood when constructing walls (like Warcraft :)

scaffolding. Construct scaffolding from sawn timber.
This is construction of predefined wooden structure that consume sawn timber and ropes.

mining. Gather rock by quarrying rocky terrain.
This was “quarrying” in blueprint, I renamed it to be more traditional.
Cut action could be performed with pickaxe on rocky terrain now.
It could be modified to produce rocks of different styles and sizes.

walls. Construct walls out of stone or wood.
Constructs a wall section like one we already have in media:
http://amber.worldforge.org/ember/screenshots/tn/screenshot_20081030_001318.jpg.html

gate. Construct a primitive gate from rough wood and ropes.
Like a wall, but constructs section with gate.

earthworks. Modify the terrain by digging trenches, embankments and other shapes.
Creating new and modifing existing terrain modifiers. It could be “flatten” task that is based on Level modifier.
Modifier for digging trenches may be implemented.

fortification. Construct a fortification with stone walls and gates.
A generic tech just head the hierarchy.

Project Schedule

We have 12 weeks on program. Here is the approximate plan on spending that time:

1. Tame the python.
2. Analyse the tasks. Describe what exactly they should perform and document this on wiki.
3. Add/improve simple tasks (plants, plants-fibre, rope, mining).
4-5. Start needed cyphesis core modification or invent the workarounds.
6. Make middle-level tasks that doesn’t require core modifications (palisade).
7. --- Mid-term evaluations: present some working code.
8. Finish cyphesis core modifications.
9-10. Make tasks down in hierarchy (scaffolding, walls, gate).
11. Make earthwork tasks, possibly expanding terrain modifiers.
12. --- The last week is to finish the work.



I was proposing something similar but vague last year: http://alexeytorkhov.blogspot.com/2008/04/improving-mason-game.html

Tuesday, 10 February 2009

Bulk file renames

I was always using shell scripts to do mass file renamings. But now there are definitely simplier tools exist. One of them came to my knowledge recently is rename. It is standard tool and does the most simple and common task—replace one substring with another in filenames.

Second useful tool is convmv. It not only allows to convert filenames between different encodings, but also to convert between upper and lower case.

Also mmv deserves mention. It could do replacement basing on pattern.

Monday, 9 February 2009

RPM verify and restore capabilities

Good that RPM could verify files (-V option) and restore permissions and owner modes (--setperms and --setugids keys). More here: How to reset the permissions of the installed rpm packages with --setperms option. It allow me to repair part of root filesystem with accidentally changed owner.

Saturday, 7 February 2009

Typographic layout

Finally, typographic layout has been included into xkeyboard-config release 1.5 that is available in rawhide now. It enables access to symbols like «, », ©, ≠, —, … from keyboard which is very convenient for typing web texts.

Unfortunately, something makes it non-working when selecting from gnome keyboard config dialog. So, I had to add typo typo:2 to xkb_symbols from setxkbmap -print output and put call of setxkbmap in autostartup programs. Resulting command line is:
$ setxkbmap -symbols 'pc+us+ru(typewriter):2+inet(evdev)+group(shifts_toggle)+level3(ralt_switch)+typo+typo:2'

Yay! I have typographic symbols in both English and Russian layouts switched with AltGr.

Friday, 6 February 2009

Interpretation of old paintings

Pierre Carrière-Belleuse. La place Pigalle in Paris. 1880.

I’m not frequent visitor of museums, but was recently here in Gallery of Impressionists. And it is interesting how old paintings could be interpreted.

For example, this picture. It clearly looks for me as picture from some pseudo-3D isometric computer game. Really, it has broken perspective close to isometric; it has level of detail—only near people have detail faces; it has sprite-alike layout—carriages and people are moving mainly parallel street edges.

Hmm… my mind is too computer-aligned. Need to go for a walk… :)

Friday, 30 January 2009

Configuring lm_sensors for Asus P5E3 motherboard

Standard configuration of lm_sensors with sensors-detect find right monitoring chip and it was showing all reasonable data except voltage, that was differing by more than 10% of nominal. And it was slightly bothering me.

Finally, after reading lm_sensors Asus article, I was able to craft right voltage sensor formulas for my Asus P5E3 motherboard that give the same values as BIOS.

First, need to decompile description tables (iasl package had to be installed):
# cat /proc/acpi/dsdt > dsdt.bin
# iasl -d dsdt.bin

Deciphering all ACPI magic that is written to dsdt.dsl is not very easy. I was looking for RVLT function that gives the formula for voltage:
Method (RVLT, 1, NotSerialized)
{
    And (Arg0, 0xFFFF, Local0)
    Store (VGET (Local0), Local1)
    Store (DerefOf (Index (DerefOf (Index (VPAR, Local0)), Zero)),
        Local2)
    Store (DerefOf (Index (DerefOf (Index (VPAR, Local0)), One)),
        Local3)
    Store (DerefOf (Index (DerefOf (Index (VPAR, Local0)), 0x02)),
        Local4)
    Multiply (Local1, Add (Local2, Local3), Local5)
    Divide (Local5, Local3, , Local5)
    Add (Local5, Local4, Local5)
    Return (Local5)
} 

Translating to normal language it does approximately the following:
Local1 = VGET(Local0);
Local2 = VPAR[Local0][0];
Local3 = VPAR[Local0][1];
Local4 = VPAR[Local0][2];
return Local1 * (Local2 + Local3) / Local3 + Local4;

To find out Local parameters for each sensors, need to look at VPAR definition:
Name (VPAR, Package (0x04)
{
    Package (0x03)
    {
        Zero,
        One,
        Zero
    },

    Package (0x03)
    {
        0x22,
        0x22,
        Zero
    },

    Package (0x03)
    {
        0x14,
        0x0A,
        Zero
    },

    Package (0x03)
    {
        0x3C,
        0x0A,
        Zero
    }
})

Comparing this to order of data in other places of tables (VCore, +3.3V, +12V, +5V) one can see that right coefficients for +12V is 60/10 and for +5V is 20/10.

Resulting config is here.

Sunday, 11 January 2009

Final GSoC gift

Finally, I’ve received my t-shirt. That was complete surprise for me, as I didn’t get any FedEx tracking number. So, Summer of Code 2008 is officially end for me. 2009 starts! :)