четверг, 4 октября 2012 г.

Gentoo portage and x3 - Reunion: ebuilds, mods, scripts...

Hello, fellows!

I've done some work that might be interesting for those of you who have a crush on x3 - Reunion and Gentoo Linux simultaneously. As you off course know, that gorgeous game is a very high-moddable one so there are plenty of mods and scripts made by its fans out there in the Internet.

There is a ebuild for x3 in the bugzilla, and even to rewrite the x2 ebuild that is in the official portage tree so it could be used to install x3 is not challenging at all, even if you're a newbie to portage and bash.

When it comes to installing those magnificent mods and scripts the easiest decision seems to be just writing ebuilds so the portage would do the job for you. However, i assume 100% of those addons were developed under windows which is not case-sensetive. So it's normal if there are folders like Scripts and T and Mods or even MODS in the addon distribution package. And you'd dig deeper you'd get that the problem is not just the names of the folders (i think you've already figured what would happen if portage would just unpack the contents of that distribution into your live x3 installation) - it's the problem of the name of the every file throughout the every addon distribution. And the solution, actually, is not just mv the files into the lowercase. We can't do that. What if a file is supposed to be named the way it is? Meanwhile, if a package wants to install a file that would substitute the original one, its name should be exactly the same as the installed original one has (it is obvious, off course). So the real solution is to synchronize the names of everything throughout the addon distribution with the names of the original installed files. That is the problem number one.

The next problem (number 0, actually) you would face is that the addon distribution would have some root folder, so the actual addon files would be stored out there. The easy solution is to cd into there, yeah. But it is stupid. What if you want to install, say, ten addons and each has some root folder? And some other files you certainly wouldn't like to be in the root of your live x3 installation (like readmes, changelogs, etc). So, a true solution is to guess where the real source root is and sort the misc. files into some other folder.

So you made all that somehow, and you try to merge the ebuild and... there are collisions. The portage won't allow the ebuild be merged if the colliding files owned by some package installed at the moment. The collisions must be handled somehow. Well, there are several types of collisions you would face... oh, it is a real long story. Dull as hell. There is a problem of the names of cat-dat filepairs yet.


Straight to the point, i've wrote several eclasses that do all the magic need to be done. Actually, i've made an overlay thexgames, that provides a bunch of ebuilds for a bunch of mods and scripts utilizing those eclasses. And the ebuild for x3, off course.

Adding the overlay:

1. Open layman's my-list.xml (that resides in /var/lib/layman by default) and add this: double-click the code to select and copy


2. Now just execute

thexgames provides the following ebuilds...

games-simulation/x3-2.5.03
Open-ended space opera with trading, building & fighting

games-simulation/x3-mod-cockpits-2.0
This adds fancy cockpits to the x3

games-simulation/x3-mod-fotonc-1.0.0
This lowers GPPC and BEMP firing rates by 2.5 and 2 times respectively

games-simulation/x3-mod-hqoptimal-2.5
HQ rebalance

games-simulation/x3-mod-turbomod2-2.0.02-r2
This mod enhances overall game performance

games-simulation/x3-mod-xtm-0.7.5
The X-Tended Mod is a modification for the game X3: Reunion by Egosoft

games-simulation/x3-script-anarkis-advanced-defence-system-1.01
Lasertower deployment script

games-simulation/x3-script-anarkis-carrier-commands-1.40
X3R version of ACC

games-simulation/x3-script-anarkis-group-targeting-system-1.01
This script adds 3 targeting related shortcuts to the game for improved dogfighting

games-simulation/x3-script-assassins-guild-1.60
This script allows you to join the assassins guild and take on assassination missions.

games-simulation/x3-script-battle_scripts-1.0.0
x2 AEGIS and TelCat scripts port to x3

games-simulation/x3-script-bombardier-1.971
This adds 8 different weapon layouts and hotkeys for them

games-simulation/x3-script-engineer-tools-1.0
Hotkeys group for complex builders

games-simulation/x3-script-jumpwithescort-1.0
This allows a player to make jumps with escort ships

games-simulation/x3-script-mars-1.0.0
Improved turret script that actually hits it's targets and prioritizes them by how easy they are to hit

games-simulation/x3-script-mercenaries-guild-2.90
This script adds Mercenaries Guild into x3

games-simulation/x3-script-move-freebie-ships-1.01
A simple script to move all the freebie ships to random locations at startup.

games-simulation/x3-script-race-military-1.10
Join the military and take on missions for the different races to earn money and notority

games-simulation/x3-script-turretcontrol-3.0
Manual control for the turrets

games-simulation/x3-script-turretmissiledefence2-1.1
This script really makes turrets to shoot only missiles

воскресенье, 9 сентября 2012 г.

EVE Online in WINE (Linux). How to get it running nowadays (on nVidia 6/7 series cards). Or how i did, at least.

I have an old as hell pc. P4 Northwood, GeForce 6800 GS. It's an AGP one, yes. And it was a torture, actually, to get EVE running on it. However, it runs ok. Even in char creation it looks like 15 fps or so.

Ok, first of all i'd like tell y'all who can't even start the game with an old video card. If you've got an old GPU but it does fully support Shader Model 3 but not SM4 (like GeForce 6 or 7 series) but you can't get the game started and it says some shit of the bull like you have an outdated GPU that lacks SM3 support and the game needs it or whatever - that happens because WINE detects if the hardware supports SM3 or not by probing its glinfo to support ARB_shader_texture_lod extension. If it doesn't - you don't have SM3. You've got SM2.

There is a guy at wine' bugzilla who wrote a comment: http://bugs.winehq.org/show_bug.cgi?id=28529#c6 So, according to wine' logic, there are no GPUs manufactured by nVidia that do support Shader Model 3. They started producing SM4 GPUs right after SM2 ones. Tough guys, aren't they?



PHASE 1: PATCHING THE SOURCE

Well then, here's a little patch for y'all: Click to show

To apply it cd to the directory containing unpacked wine sources and execute: Then recompile and reinstall your wine (actually, all you need is wined3d.dll.so and wined3d.dll fake  reinstalled; you can just copy them over into the right places).

Now EVE finally quits complaining about SM3 support and just starts.



PHASE 2: WINETRICKS THE PREFIX

Next, EVE requires native d3dx9_36 (fixes black screen) (and maybe d3dx9_42 and d3dx9_43) to run. Also, there are rumors that native corefonts are required too (however, i don't really remember if i did install them or not).
To be completely safe you can just execute this:

PHASE 3: REGEDIT THE HELL OUT OF IT

Now, if your EVE freezes or crashes at character creation procedure (at bloodline selections, in particular) and shouts something like "bin/ExeFile.exe: malloc(): memory corruption:" you can try this registry tweeks: Off course, you should change VideoMemorySize to whatever value your videocard posesses.

Set windows version to 2000. I just don't really know, what in particular make the game run: either windows=2000 or "OffscreenRenderingMode"="backbuffer"



PHASE 4: STARTING THE GAME

Now you can start the game (i do it after changing directory to bin/) you could want something like this in your path: Name it eve, place it into your path (like /usr/local/bin, or whatever) and chmod +x it.



PHASE 5: EULA AND PERFORMANCE

When the game finally starts you most probably will see just a square with 2 tabs: eula and 3rd party eula with a label in the bootom that says "scroll to the bottom to continue" or whatever. Just wait. It takes about 5 minuts for the text to appear. =) Click accept. Everything will be slowly as hell. Have patience now. =) Proceed into the settings and lower the graphics quality. Restart the game. When you'll go to the character race selection hit ESC and lower graphics quality again (there will appear some options regarding char rendering etc.). Don't forget to untick "Render Station Internals" or "Render HeadQuaters" whatever the hell they call it (don't remember the exact name for it %), bu i believe you'l figure it out).

Well, if i didn't forget anything, that's pretty much it. Frustraiting as hell, but managable.

P.S. Double-click the text in the code sections to select and copy it.

Good luck y'all. Fly safe.
xoxoxo
Serge

среда, 18 июля 2012 г.

HTC Hero CM9 (ICS) with ad-hoc support

Hello, folks.

I've just flashed a CyanogenMod 9 (Ice Cream Sandwitch) onto my HTC Hero and it's pretty cool but it doesn't connect to an ad-hoc wifi spot. There is a good old flashable piece of software somewhere in xda-developers forums but you just can't flash it using the current ClockworkMod Recovery (using any 3+ CWM recovery version, actually). It says something like:
Amend scripting (update-script) is no longer supported. Amend scripting is deprecated by Google in Android 1.5. It was necessary to remove it when upgrading to the ClockworkMod 3.0 Gingerbread based recovery.Please switch to Edify scripting (updater-script and update-binary) to create working update zip packages. Installation aborted.
That means you need CWM recovery 2.x to flash the ad-hoc support hack.

The easiest solution is to install the Rom Manager from the market and flash the recovery from it. It'll flash 2.x.x CWM Recovery onto your HTC Hero (I assume it flashes the last version CWM guys support for our dinosaurous devices). Now you can reboot into the recovery mode and flash the ad-hoc support piece. After that you are safe to flash cwm recovery 5.x again.

Now you have an ICS CM9 device able to connect to ad-hoc networks.


Cheers,
Zoreg

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

Force conky to use full screen width

Hello, dear anonymous lurkers.

Todays tip is about how to force conky (we're talking about single line conky setups) to use all available screen width without a gap at the end (without any gaps, actually). Also i'll show you how to make your conky not overlapable by other windows and how to make it available to click through its window.

Ok, first things first.

Open your conkyrc and make the following changes:
own_window yes
own_window_type panel

This makes your conky act like a panel: maximized windows won't overlap it, it won't be shown in pager or taskbar, you can click through it.
A quick-tip: if you supply own_window_hints above - that'll be a direct shot in the leg: conky window will be able to gain focus and you won't be able to click through it. I suggest you follow the official documentation and not set own_window_hints if you don't know what you are doing.
According to the official documentation, in this mode conky retains all available screen width at the edge specified by the alignment setting. However, there is a gap at the end. And it is there no matter what you do. You set minimum_width but it is still there. You pray - nothing. You cry.

That stupid gap is there because conky is drawn at position -5,-5. I don't know why, honestly. But if you connect one more display to your pc to the left of the primary - you will see that.

The most basic solution is to start conky with -x 5 option:
conky -x 5
or just set gap_x in your conkyrc to 5:
gap_x 5

Actually, i can't really say if '5' will suit your needs. Use xwininfo to get the proper value.

Advanced KDE users could benefit the whole kwin 'special window parameters' power to make conky act whatever they want it to.


Cheers,
Serge.

понедельник, 28 мая 2012 г.

Convert ALAC m4a to FLAC with tags, artwork and lyrics

Hello, dear anonymous!

There is a script i wrote i'd like to share with you. It uses ffmpeg, mp4info and metaflac to convert an ALAC file to FLAC keeping tags, artwork and lyrics! It has several options, so execute it with -h option and read. I don't like batch scripts so use find -exec to convert all your ALAC collection to FLAC like this:

double-click the code to select and copy Download: http://alac2flac.googlecode.com/files/alac2flac-1.0.1.tar.gz
ebuild: http://alac2flac.googlecode.com/files/alac2flac-1.0.1-ebuild.tar.gz

If you're not using gentoo, then you have to install its dependencies manually. It depends on: ffmpeg, flac, libmp4v2 (built w/utils).

If you don't want to download anything, then open the spoiler below and save the code to alac2flac. Don't forget to chmod +x alac2flac it. Exec it from the dir containing it then: ./alac2flac Or save it in $PATH. Or maybe you just want to look. Anyway, here it is:

Click to show

P.S. At first i was relying on an alac|flac pipe, but when i used it in batch mode on my ALAC collection it turned out, that alac_decoder (http://craz.net/programs/itunes/alac.html) couldn't decode some m4a files. :(  Then it turned out that ffmpeg does the same job 5-10 times faster.

суббота, 12 мая 2012 г.

Conky' various graph' scale parameter

Hello, folks!

At last i have some time and some linux-related stuff that worth of being posted to post.

So, here we go.

The first note is about conky' varios graphs' scale parameter. There are several unanswered topics out there in the www and the conky' official documentation lacks of the information about the proper usage of that parameter too.

OK, what the scale parameter means? The scale of the conky graph is the maximum value of the graph.

Let's look at this example (it's a real config line from my conky setup):

${downspeedgraph eth0 10,20 888888 FF8C8C 2441KiB -l -t}

The first parameter to downspeedgraph - eth0 - is the name of the network interface that looks out to the www through my ISP (Internet Service Provider). eth0 is a 100Mbit connection interface, but my ISP lowers its bandwidth to 20Mbit because of the internet plan i pay for. So, the maximum download speed for eth0 is 20Mbit. Most of ISPs (and, btw, mass storage hardware manufacturing vendors) use decimal bytes instead of binary bytes. Decimal kilobyte (kB) consists of 1000 bytes and binary kilobyte (kibibyte - KiB or KB) consists of 1024 bytes. Most operation systems and software use binary bytes (that is why OSs or file managers show lower capacity of your 3TB HDD). Just like any other normal software, conky uses binary bytes also (at least by default). So to figure out the proper value for the scale parameter 20Mbit (20 decimal megabits) should be converted to binary kilobytes (kibibytes). Using Qalculate it's done by simply typing "20Mbit to kibibyte" and hitting enter. If you do not trust your machine do the math yourself: (20*10^6)/8/1024. Don't know why, but scale should be set strictly in kilo's (KiBs).


That is how to get the proper value for conky' graphs.


Other parameters passed to downspeedgraph:
10,20 - 10 is the height of a graph and 20 is its width.
888888 - is the first color and FF8C8C is the second one.
A graph is drawn from the right to the left. The last measurement is shown at the right side of the graph. When it becomes obsolete it crawls to the left.
If -t switch is not used, then the rightmost measurement is FF8C8C and the leftmost is 888888. Graph' color fades from the second color at the right to the first color at the left.
If -t switch is used, then graph will be  888888 at the bottom and FF8C8C at the top. The higher value is - the more FF8C8C'er it will be.

So, that is pretty much it.


The other article will be all about a eclass i developed to make various game's additives like mods or addons easy to install using portage. Stay tuned and good luck.
xoxoxo