Tome 2.3.x under Linux - compilation and execution

Everything about ToME 2.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
atan59
Higher
Posts: 71
Joined: Sat May 22, 2010 6:34 pm

Tome 2.3.x under Linux - compilation and execution

#1 Post by atan59 »

Having spent a few days fiddling around with 2.3.x on an Ubuintu Linux 10.04 desktop, I will share my experience here, as it wasn't that obvious to compile things correctly, and that a non-gamebreaking but quite annoying problem persists. So here's the "recipe":

1) download the latest source:
- optionnally read forum post http://forum.t-o-m-e.net/viewtopic.php?f=1&t=21344 first
- optionnally take a look at http://gitorious.org/tome2/tome2
- open a terminal and cd to desired parent directory
> git clone git://gitorious.org/tome2/tome2.git tome2

Alternative: get the source of the latest "official" distribution, 2.3.5, but then the makefile has to be edited a bit more than what is described below, as the X11 directories are not those of a current system anymore (again, I did this on Ubuntu 10.04)

2) adapt the makefile and compile
> cd tome2/src
> cp makefile.std makefile
- edit makefile to remove non-existing main-dmy.o object
> make

3) create link and execute (must be in parent dir of lib/)
> cd ..
> ln -s src/tome .
> ./tome -- -n4 # replace 4 by desired number of windows

4) remaining problem: macros
the macro editors '@' and '$' don't work, at least under Ubuntu Lucid 10.04. : they don't let you choose a trigger but act as if a "null" key was pressed and then the game hangs.

- possible workarounds:
* manually add macros to pref files... but I have no clue what the correct keycodes are for function keys and such, after trying similar codes to those under windows - I wasn't able to make this really work
* run the latest windows binary under wine (a windows emulator). This works, but then it won't be the latest git version, but rather the last distributed one, 2.3.5, found here: http://t-o-m-e.net/dl/src/tome-235-src.tar.bz2

I tried to hack the source regarding the macro editor bug, but rapidly reached my incompetence level... :-(

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: Tome 2.3.x under Linux - compilation and execution

#2 Post by AnonymousHero »

You're not supposed to use the makefile (for my branch) -- it's not maintained. Use Cmake and all should work automatically out of the box. Btw, there's a file called "building.txt" which gives instructions for building. Maybe it should be made more easy to spot?

I think the macro thing may be that you have Num Lock turned on. The X11 front-end (at least) is known to have "issues" with Num Lock.

EDIT: Actually, maybe I should just completely remove the makefiles.

atan59
Higher
Posts: 71
Joined: Sat May 22, 2010 6:34 pm

Re: Tome 2.3.x under Linux - compilation and execution

#3 Post by atan59 »

AnonymousHero wrote:You're not supposed to use the makefile (for my branch) -- it's not maintained. Use Cmake and all should work automatically out of the box
Btw, there's a file called "building.txt" which gives instructions for building. Maybe it should be made more easy to spot?
Now that was easier and even made the gtk2 version work (with menus), which I was never able to completely achieve form the makefiles! Cmake works like a charm.

The reason I had directly jumped to the makefiles, besides the standard "./config && make" reflex, was that I hadn't started with your branch, but with 2.3.5 from here: http://t-o-m-e.net/download.php?tome_current=0 In fact, that download page is the most obvious place to start for any new player, so maybe it should be edited to include a link to the git repository as "latest version of 2.3.x, easier to compile and fixes some bugs". With 2.3.5 I had to start from makefile.WHICH, then change several things on makefile.std until it actually worked. When I found 2.3.8 I simply did the same, but was happy to find that less changes where needed in the makefile.

I suppose that if you could somehow make sure that people got to 2.3.git before 2.3.5 they would probably see "building.txt", but you could still rename it "README" to make it easier to spot with the most standard name for that kind of file (which is traditionally uppercased for a reason ;-))
AnonymousHero wrote:EDIT: Actually, maybe I should just completely remove the makefiles.
It's probably a good idea to leave at least makefile.std around in case someone wants to fiddle with it in the future when trying whatever with the code (different windows management or whatever) but with a simple comment at the beginning saying something like "it's deprecated and 'cmake . && make' should be executed on the parent directory instead".
AnonymousHero wrote: I think the macro thing may be that you have Num Lock turned on. The X11 front-end (at least) is known to have "issues" with Num Lock.
This solved it! Thanks a lot!! I was fighting with this for several days.... :-(
So basically the "num lock" key is being detected as an actual key press. Probably something that can be excluded from acceptable keys somewhere in the code, but more importantly: could you add a comment about this in your building.txt/README? (something like "Warning: under Linux, the NumLock key should be turned off when defining macros, otherwise it will be detected as the trigger key") This is especilly bad because no actual key code appears on the screen and the game enters some kind of infinite loop (perpetually detecting the fake keypress, I suppose) and hangs.

By the way, do you have any idea if and how multiple windows geometry (place and size) can be memorized or typed in a pref file or setup through the commandline in either the x11 or gtk2 version?

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: Tome 2.3.x under Linux - compilation and execution

#4 Post by AnonymousHero »

(Unfortunately something seems to preventing me from pushing my changes to gitorious.org, but once that's working again, I'll push the changes discussed here.)
atan59 wrote: In fact, that download page is the most obvious place to start for any new player, so maybe it should be edited to include a link to the git repository as "latest version of 2.3.x, easier to compile and fixes some bugs".
Yeah, it probably should. Unfortunately, I don't have any access to those pages. Anyone with access reading this?
atan59 wrote: I suppose that if you could somehow make sure that people got to 2.3.git before 2.3.5 they would probably see "building.txt", but you could still rename it "README" to make it easier to spot with the most standard name for that kind of file (which is traditionally uppercased for a reason ;-))
Yeah, I've renamed it.
AnonymousHero wrote:EDIT: Actually, maybe I should just completely remove the makefiles.
I've removed the old makefiles. At best their presence is misleading.
atan59 wrote: So basically the "num lock" key is being detected as an actual key press. Probably something that can be excluded from acceptable keys somewhere in the code, but more importantly: could you add a comment about this in your building.txt/README? (something like "Warning: under Linux, the NumLock key should be turned off when defining macros, otherwise it will be detected as the trigger key") This is especilly bad because no actual key code appears on the screen and the game enters some kind of infinite loop (perpetually detecting the fake keypress, I suppose) and hangs.
I've added a basic BUGS.txt file which lists this as a known bug.
atan59 wrote: By the way, do you have any idea if and how multiple windows geometry (place and size) can be memorized or typed in a pref file or setup through the commandline in either the x11 or gtk2 version?
With the X11 front end, it should be possible to set the environment variables
  • ANGBAND_X11_AT_X_0
  • ANGBAND_X11_AT_Y_0
  • ANGBAND_X11_COLS_0
  • ANGBAND_X11_ROWS_0
where 0 is the number of the window; I'm assuming 0 is the main window and that 1,2,3,4... are the extra windows.

atan59
Higher
Posts: 71
Joined: Sat May 22, 2010 6:34 pm

Re: Tome 2.3.x under Linux - compilation and execution

#5 Post by atan59 »

AnonymousHero wrote:
  • ANGBAND_X11_AT_X_0
  • ANGBAND_X11_AT_Y_0
  • ANGBAND_X11_COLS_0
  • ANGBAND_X11_ROWS_0
where 0 is the number of the window; I'm assuming 0 is the main window and that 1,2,3,4... are the extra windows.
Thanks! This works for the window sizes (COLS_n;ROWS_n) but sadly not for the placement (AT_X,AT_Y). Maybe the window manager is overriding these settings.

Post Reply