PDA

View Full Version : [Announce] NPPAngband 0.5.1 WIP 2


nppangband
August 22, 2010, 16:56
NPP 0.5.1 WIP2 has been uploaded. This is mostly a major clode cleanup. It now compiles cleanly with cygwin with no warnings ( I work with main-win.c.0. Probably about 40-50 bugs were fixed from WIP-1. The main new feature is mouse support for most of the options screens (accessed by '=') using the modern Angband code. This also includes addding the itemlist window from Angband.

People trying to compile using other main-xxx.c files and makefiles should have a much easier time now. Please let me know what changes I need to make for any other makefile or main-xxx.c. And thanks to those who gave WIP-1 a try.

The links are:

source:
http://download.nppangband.org/npp-0.5.1-src-WIP2.zip

Windows executable:
http://download.nppangband.org/npp-0.5.1-win-WIP2.zip



Thanks again to all willing to give this version a test. It should be fairly playable by now, but please save often.

-Jeff

d_m
August 22, 2010, 23:24
So, this might just be user error, but I wasn't able to compile WIP-2 on Linux.

There were about 6 fatal warnings (mostly redefinitions between externs.h and other files) which I did fix. However, there were *tons* of warnings about unreachable code. Some of these warnings were coming from system libraries like /usr/lib/bits/unistd.h, so I think at least some are bogus.

The compile ultimately failed because it was trying to pull cairo in unconditionally. I think I can get it working but so far no luck.

d_m
August 23, 2010, 00:16
OK, I got it compiling and running on Linux... I will make a patch for you once it seems to be working OK.

One bug I hit really quickly is that NPP wants to store prefs in $HOME/.angband/NPP0.5.1-WIP2 but doesn't actually create this directory. So after character creation it crashes.

I found that path via strace and I assume that if I manually create the directory it'll be fine, but obviously it would be good for the game to do it automatically.

nppangband
August 23, 2010, 00:19
Which makefile are you using? It must involve #defines that aren't #defined for main-win.x.

One thing I did between WIP1 and WIP2 is make sure most of the NPP.h files are practically identical to the Angband h files, and the different code moved to separate files. The main difference on all of the z-**** files was all of the extended character code and I moved that to its own file. All the main-xxx files and most of the .h files are straight out of Angband 3.1.2v2.

And again, many thanks for helping me out.

nppangband
August 23, 2010, 00:25
One bug I hit really quickly is that NPP wants to store prefs in $HOME/.angband/NPP0.5.1-WIP2 but doesn't actually create this directory. So after character creation it crashes.



Should there be another director made in init2.c? I thought it had all of the directories that Angband has, plus NPP/lib/bones for player ghosts.

I miss Diego, my NPP co-maintainer, for many reasons, but one is that he works in Linux, and I work in windows, so between the two of us we could catch most of the bugs that happen on the various OSs.

d_m
August 23, 2010, 00:50
Here are the changes I had to make to get it to compile. Some of these changes are quick and dirty so you probably shoudn't just apply the patch. That said, all the changes were necessary for it to build for me.

d_m
August 23, 2010, 01:18
Should there be another director made in init2.c? I thought it had all of the directories that Angband has, plus NPP/lib/bones for player ghosts.

I miss Diego, my NPP co-maintainer, for many reasons, but one is that he works in Linux, and I work in windows, so between the two of us we could catch most of the bugs that happen on the various OSs.

This turned out to be a problem related to autotools (used by V but not be NPP). The z-file.c program uses symbols like HAS_MKDIR to make the file handling functions work. So when I'm building NPP those variables aren't set (they get set by ./configure in V I thnk). I added -DHAS_MKDIR to Makefile.std and then the directory got created correctly.

Probably I should change the V code so if you aren't on WINDOWS and don't have HAS_MKDIR then it will crash during compilation. The "default" behavior isn't very helpful (basically everything just fails).

Also, two bugs from playtesting so far:

1. Sometimes when @ runs for a bit it doesn't reappear when the run is over... you have to move manually or do some other action and then the @ sign reappears. It doesn't seem to always happen but it was happening enough that it kept throwing me off.

2. the item name/enscript in shops gets drawn under the weight, so if you have an item with a long name/inscription the closing part of the inscription can actually appear to the right of the weigth ("behind" it).

nppangband
August 23, 2010, 01:54
Here are the changes I had to make to get it to compile. Some of these changes are quick and dirty so you probably shoudn't just apply the patch. That said, all the changes were necessary for it to build for me.

Again, thank you. Most of those changes involved redundant delcarations of functions or variables. As for the changes to the makefiles, I assume the long-term solution is to add the src/gtk/ subdirectory where the cairo files are located. I added them.

nppangband
August 23, 2010, 02:07
Also, two bugs from playtesting so far:

1. Sometimes when @ runs for a bit it doesn't reappear when the run is over... you have to move manually or do some other action and then the @ sign reappears. It doesn't seem to always happen but it was happening enough that it kept throwing me off.

I noticed that too. I fixed the problem. If it is really annoying you, the fix is in cave.c in map_info. Around line 1505, this line should read (delete the second condition about running):

/* Handle "player" */
else if (m_idx < 0)

Not that it affects gameplay, but right after that, around line 1560, near the end of map_info, there is a related "else if" statement that can be completely deleted. This bug came up when I removed the "hide player while running" option.




2. the item name/enscript in shops gets drawn under the weight, so if you have an item with a long name/inscription the closing part of the inscription can actually appear to the right of the weigth ("behind" it).

Yes, some of the calls to object_desc are wrong. This is because I am still using the old object_desc function from Angband 3.0.6. Sometime between 3.0.6 and 3.1.2 it got a re-write, and where I incorporated updated Angband code I haven't always called the function properly. Sometimes an object name is going to print with either too much or too little information. I am updating object_desc this week, and then these bugs should go away.

ekolis
August 23, 2010, 17:46
I can't get help on options: "cannot load option.txt" - the file is called options.txt, not option.txt!

edit: also, the "Please choose an item to examine" message in shops behaves weird when you get it several times in a row... and where is the "depth in feet" option hiding?! I wanna turn it off!

And I found a "rapier of slays" in the store... the examine screen says it slays orcs though...

And I tried to buy 99 arrows costing $1 apiece when I had $127... but I can't afford it, according to the game! What is this, fractional gold? When I bought twenty of them, I wound up with 98 gold remaining, so I had somehow spent 29 gold total... WTF?!

Do druids have some hidden combat penalties or something? I hit a black naga with one out of ten of my arrows, and could barely scratch anything with a dagger, but I still had +0,+0 on the char screen!

The set-trap command seems to be set to autorepeat, which is quite annoying!

Sometimes, when running, @ randomly disappears...

I was confused by a scintillating colored gas trap while BLIND? What, is it not just the colors that are confusing?

murphy
August 23, 2010, 21:11
Hi,

to get past the directory creation problem the necessary flag is -DHAVE_MKDIR rather than -DHAS_MDKIR .

also for my system I have to do gcu only compile, which means I had to hack up the Makefile.src and Makefile.std [maybe also Makefile.inc for vanilla] to get rid of gtk/* and maybe also snd-sdl.o as dependencies [had to do similar hacking to get vanilla angband to compile too ... so this isn't an issue specific to NPP]

the src/gtk/*.c stuff won't compile for me because I dont have the gtk system header files. but they aren't really dependencies for gcu only compile, so maybe at some point it would be nice to clean up the makefiles so that gcu and x11 dependencies don't get mixed together

nppangband
August 24, 2010, 00:43
I can't get help on options: "cannot load option.txt" - the file is called options.txt, not option.txt!


Fixed. Thanks.


edit: also, the "Please choose an item to examine" message in shops behaves weird when you get it several times in a row... and where is the "depth in feet" option hiding?! I wanna turn it off!

Consistent with vanilla, Depth in feet is the standard now, and the option has been removed. On the sidebar both are displayed.


And I found a "rapier of slays" in the store... the examine screen says it slays orcs though...

the "slays" ego item is similar to all of the "of slay orc/troll/dragon" ego items in vanilla. Only there is one called "of slays" and the actual slays are randomly assigned. Same deal with armor of resist elements, weapons of *slays", and a couple other ego types. Also, these egos have a chance of having more than one resist/slay/etc. Sometimes you will find one with 3-4.


And I tried to buy 99 arrows costing $1 apiece when I had $127... but I can't afford it, according to the game! What is this, fractional gold? When I bought twenty of them, I wound up with 98 gold remaining, so I had somehow spent 29 gold total... WTF?!


I believe this is also consistent with Angband. It used to come up with the price for one, round, then multiply. Now the function calculates the price for a group of items, rather than find the price for one and then multiply by the number. So, yes, these things happen. Have people complained about it in Vanilla?



Do druids have some hidden combat penalties or something? I hit a black naga with one out of ten of my arrows, and could barely scratch anything with a dagger, but I still had +0,+0 on the char screen!

Druids are incompetent with weapons/archery, even worse than mages. BUt they have the most powerful spells in the game.


The set-trap command seems to be set to autorepeat, which is quite annoying!

Copy and Paste error. I fixed this too. Thanks.



Sometimes, when running, @ randomly disappears...

I fixed this. Posting an update tonight...


I was confused by a scintillating colored gas trap while BLIND? What, is it not just the colors that are confusing?

The confusion is caused by the gas that the player is breathing. Although I must admit we did not think about blindness when we named that trap.

Thanks for the feedback. That @ dissappearing during a run is incredibly annoying, so I am posting WIP2a tonight.

nppangband
August 24, 2010, 00:46
Hi,

to get past the directory creation problem the necessary flag is -DHAVE_MKDIR rather than -DHAS_MDKIR .



How about the simple low tech solution of me just including the directory in the default download. Does that work?

I am open to suggestions about the makefiles, and I will definitely follow whatever Vanilla does to solve the problem.

nppangband
August 24, 2010, 01:17
Version WIP-2a hs replaced WIP-2. There was an annoying bug that prevented the player from being displayed at the end of running, and I fixed around a half-dozen other bugs. Also made a bunch of changes suggested by d_m to help compiling on linux systems.

The new links are:

source:
http://download.nppangband.org/npp-0.5.1-src-WIP2a.zip

Windows executable:
http://download.nppangband.org/npp-0.5.1-win-WIP2a.zip

ekolis
August 24, 2010, 01:38
Thanks! :)

buzzkill
August 24, 2010, 02:29
I believe this is also consistent with Angband. It used to come up with the price for one, round, then multiply. Now the function calculates the price for a group of items, rather than find the price for one and then multiply by the number. So, yes, these things happen. Have people complained about it in Vanilla?

This seems very wrong (though very minor). Aren't prices for items integers? If not then the price should be rounded up when displayed, so that mass quantities cost less than the advertised price, not more. There's no need to replicate a bug.

murphy
August 24, 2010, 02:34
How about the simple low tech solution of me just including the directory in the default download. Does that work?

Unfortunately no :-( The directory that needs to be created isn't in the angband source tree. The notes file, and also character dump files, go into ~/.angband/VERSION_NAME
where VERSION_NAME is set in defines.h

d_m
August 24, 2010, 04:29
also for my system I have to do gcu only compile, which means I had to hack up the Makefile.src and Makefile.std [maybe also Makefile.inc for vanilla] to get rid of gtk/* and maybe also snd-sdl.o as dependencies [had to do similar hacking to get vanilla angband to compile too ... so this isn't an issue specific to NPP]

the src/gtk/*.c stuff won't compile for me because I dont have the gtk system header files. but they aren't really dependencies for gcu only compile, so maybe at some point it would be nice to clean up the makefiles so that gcu and x11 dependencies don't get mixed together

When compiling vanilla, are you using autogen.sh and configure and such?


svn co svn://rephial.org/angband/trunk angband-trunk
cd angband-trunk
./autogen.sh
./configure --prefix $DESTINATION
make
make install


Unlike most variants for Linux, you should compile V from outside the source directory (not using the Makefiles in src directly). With configure you should be able to use --enable-curses, --disable-gtk, etc. That said on my Linux server I don't have to say --disable-gtk... configure detects that I don't have it and moves on.

If you're still having problems compiling an unmodified checkout of trunk, let me know. AFAIK it's worked cleanly in Linux for awhile.

Belgen
August 24, 2010, 09:01
I can't play the sound. Does anyone have this problem?

murphy
August 24, 2010, 18:11
When compiling vanilla, are you using autogen.sh and configure and such?

Thanks for the suggestion. The answer is No :-( But you inspired me to take another look at it.

Trying to build V trunk, when I get to the configure step, it is not detecting ncurses. In configure.log I see


configure:5167: checking for initscr in -lncurses
configure:5202: gcc -o conftest -g -O2 -DHAVE_CONFIG_H -fno-strength-reduce -W -Wall -Wno-unused-parameter -Wno-missing-field-initializers -pedantic -I. conftest.c -lncurses >&5
cc1: error: unrecognized command line option "-Wno-missing-field-initializers"


My compiler (gcc 3.4.6) doesn't like this -Wno-missing-field-initializers flag, so the ncurses test bombs.

My libncurses actually seems to be ok. If I do

readelf -s /usr/lib/libncurses.so

I can see initscr() in the symbol table.

murphy
August 24, 2010, 18:46
Got NPP WIP-2a compiled and running.

Only took minor hacking to Makefile.std / Makefile.src

1. remove gtk/* and snd-sdl.o dependencies [known issue]
2. had to remove one compiler flag: -Wmissing-include-dirs

that 2nd step is needed for me because I have a pretty old version of gcc. I had to do the same thing to build WIP1 and WIP2 too, just forgot to mention it

Playtesting so far hasn't turned up any issues, now this is the more fun part of testing :-)

nppangband
August 24, 2010, 23:09
I can't play the sound. Does anyone have this problem?

I did a search, and the option to turn the sound on is missing. So I think it is fair to say that everyone has this problem. I will fix this.

nppangband
August 25, 2010, 23:32
This seems very wrong (though very minor). Aren't prices for items integers? If not then the price should be rounded up when displayed, so that mass quantities cost less than the advertised price, not more. There's no need to replicate a bug.

The reason the prices may come out differently when you factor quantities before rounding is the charisma adjustment, and formerly the shopkeeper race adjustment. An arrow may actually cost 1.2 gold with charisma factored in, so it only shows up in bulk purchases.

But I do happen to prefer it the old way as well, so I did change it back. The price is calculated and rounded before the quantities are factored in, so 99 flasks of oil will once again cost 99 gp.

ekolis
August 26, 2010, 22:20
I wore a cloak which turned out to be cursed, but it still says <unknown>...

edit: also, dropping items in the home ID's them for free! :eek:

and aiming an un-id'd wand of light did not id it...

neither did drinking a potion of saltwater!

nppangband
August 27, 2010, 11:24
I wore a cloak which turned out to be cursed, but it still says <unknown>...


Many of the object names are written incorrectly. I will be fixing that in the next couple days.


edit: also, dropping items in the home ID's them for free! :eek:

Worse, it *identifies* them. This is fixed for next time. Until then, enjoy. :)


and aiming an un-id'd wand of light did not id it...

neither did drinking a potion of saltwater!

Getting an identification by use appears to be broken. I will fix that as well.