Coder Social home page Coder Social logo

pfa-nethack's People

Contributors

medrimonia avatar uoptim avatar

Watchers

 avatar  avatar  avatar

Forkers

uoptim

pfa-nethack's Issues

Write doc

There should be more doc and README files everywhere.

Keep track of end of game reason in database

There's several reason why the game can end, it could be interesting to have this kind of information in the database. Until now I found those end reasons.

  • Max moves reached
  • Deadlock detection (n invalid orders in a row)
  • Death
    • Door trapped
    • ...
  • ...

Segfault in create_table with create_level.patch

#0 0x081c1d8d in create_table (td=0x0, table_name=0x81fdd22 "doors") at ../../src/database_manager.c:235
#1 0x081c2062 in add_game_result (gr=0x981d738) at ../../src/database_manager.c:279
#2 0x081c0e6d in statistic_add_sdoor (line=37, column=16) at ../../src/game_statistics.c:127
#3 0x081c0d16 in pfa_add_sdoor (line=37, column=16) at ../../src/pfamain.c:100
#4 0x08165214 in create_door (dd=0x981d728, broom=0x8227dc0) at sp_lev.c:662
#5 0x08167b98 in build_room (r=0x981d640, pr=0x0) at sp_lev.c:1641
#6 0x08168ed6 in load_rooms (fd=0x981d4c8) at sp_lev.c:2017
#7 0x0816b4d6 in load_special (name=0xbfc11908 "ring.lev") at sp_lev.c:2655
#8 0x080e89c0 in makemaz (s=0xbfc11908 "ring.lev") at mkmaze.c:549
#9 0x080e3757 in makelevel () at mklev.c:627
#10 0x080e494e in mklev () at mklev.c:927
#11 0x0804adf9 in newgame () at allmain.c:525
#12 0x081b6350 in main (argc=2, argv=0xbfc11bf4) at ../sys/unix/unixmain.c:278

SCORR and SDOOR are not counted as walkable

Squares with an original type of SCORR and SDOOR are not counted as walkable, that's why it's possible to have nb_squares_explored > nb_squares_reachable, this should be fixed.

Strange move after a door explode

During a game, a move wasn't resulting with the expected position (moving north-east instead of east, checking in mm_log shows that a door has exploded just before).

GAME :

SEED=1361531833
bot= diffusion

mm_log last information :

mm_print_glyph: window 3 - 47:14:@
send(): g 0x2f 0xe @
mm_print_glyph: window 3 - 46:15:.
send(): g 0x2e 0xf .
mm_curs: 
mm_display_nhwindow: 3
mm_nh_poskey: 
send(): E
recv(): u
send(): S
mm_clear_nhwindow: 1
mm_get_nh_event: 
mm_cliparound: 
mm_print_glyph: window 3 - 48:13:@
send(): g 0x30 0xd @
mm_print_glyph: window 3 - 47:14:.
send(): g 0x2f 0xe .
mm_curs: 
mm_display_nhwindow: 3
mm_nh_poskey: 
send(): E
recv(): ou
send(): S
mm_clear_nhwindow: 1
mm_yn_function: In what direction?
mm_raw_print: The door opens.
mm_raw_print: KABOOM!!  The door was booby-trapped!
mm_raw_print: You stagger...
mm_get_nh_event: 
mm_curs: 
mm_putstr: Ludovic the Hatamoto   St:18/01 Dx:14 Co:16 In:10 Wi:8 Ch:6  Lawful
mm_curs: 
mm_putstr: Dlvl:6  $:0  HP:7(15) Pw:2(2) AC:10 Exp:1 Stun
mm_cliparound: 
mm_print_glyph: window 3 - 49:12:.
send(): g 0x31 0xc .
mm_curs: 
mm_display_nhwindow: 3
mm_nh_poskey: 
send(): E
recv(): s
send(): S
mm_clear_nhwindow: 1
mm_get_nh_event: 
mm_cliparound: 
mm_curs: 
mm_display_nhwindow: 3
mm_nh_poskey: 
send(): E
recv(): l
send(): S
mm_clear_nhwindow: 1
mm_get_nh_event: 
mm_cliparound: 
mm_print_glyph: window 3 - 48:1:-
send(): g 0x30 0x1 -
mm_print_glyph: window 3 - 49:1:-
send(): g 0x31 0x1 -
mm_print_glyph: window 3 - 50:1:-
send(): g 0x32 0x1 -
mm_print_glyph: window 3 - 49:2:.
send(): g 0x31 0x2 .
mm_print_glyph: window 3 - 49:3:.
send(): g 0x31 0x3 .
mm_print_glyph: window 3 - 50:3:|
send(): g 0x32 0x3 |
mm_print_glyph: window 3 - 49:4:.
send(): g 0x31 0x4 .
mm_print_glyph: window 3 - 50:4:|
send(): g 0x32 0x4 |
mm_print_glyph: window 3 - 49:5:.
send(): g 0x31 0x5 .
mm_print_glyph: window 3 - 50:5:|
send(): g 0x32 0x5 |
mm_print_glyph: window 3 - 49:6:.
send(): g 0x31 0x6 .
mm_print_glyph: window 3 - 49:11:#
send(): g 0x31 0xb #
mm_print_glyph: window 3 - 49:12:@
send(): g 0x31 0xc @
mm_print_glyph: window 3 - 48:13:.
send(): g 0x30 0xd .
mm_curs: 
mm_display_nhwindow: 3
mm_nh_poskey: 
send(): E

Result seems normal in fact according to the fact that player was stunned:

http://nethack.wikia.com/wiki/Stun

What should we do? Suppress stun, suppress traps still there on doors? I'll try to make an hotfix in the bot, but it might not be possible.

No way out from certain levels ?

On some games, even with detailed debug, I can't find a way out, an example is found in level 10, in the following game. Might it be necessary to go up to find another downstair?

SEED=1361520478
bot= diffusion

Glyph are not always what we defined

Some glyphs transmitted are not equivalent to what we thought, '#' can be sent when it is a sink and not an scorr. Glyph transmitted should always correspond to the protocol, for square types not supported by the protocole, a char must be choosen and broadcasted. This will prevents bots from "thinking" that a move is allowed when it is not.

Square appearance for different types may be found at the following link.
http://nethackwiki.com/wiki/Dungeon_feature

Handle indentation

Some standards should be chosen, there's mainly three questions

  • Use a specific indentation for each language or one for all ?
  • Tabs or space ?
  • Indent size, 2, 4 or 8 ?

I think that for all our files, spaces should be preferred to tabs. But for nethack patches, we should match nethack indentation.

GameRunner hardref

When the game_runner script copies the nethack_folder, the nethack script is still pointing to the original nethack location. The script should be modified or nethack program should be launched directly by game_runner

Some doors seems neither openable nor forceable

While debugging in detail the bot, I found a room at level 17 where with more than 30 tries with open and 30 tries with force, some doors did not opened. Is this a kind of trap? There's an unknown tile at the center of the room, maybe something to activate in order to unlock the doors? Is this kind of door desactivable?

Details on game :

SEED=1361521628
bot : diffusion

Verify Makefile dependency

  • If we modify a pfa src file, nethack should be rebuilt partially
  • If we modify a pfa header file, some nethack files should rebuilt too.
  • If we modify one of the .def file, according pfa files should be rebuilt

If this goal can't be achieved by modifications to nethack's src Makefile, a tutorial or even a script should be given in order to make partial recompilation as easy as possible.

Semaphore access isn't granted when a process is killed

When a nethack process is killed while writing in the database, the associated semaphore is not post, this is causing all the next nethack process to be eternally blocked when they call the wait before starting to write into the database.

This should be fixed with a signal handler for example, but the use of sqlite3 db in that code could be problematic for signal handling.

Invalid moves are not counted as moves

This implies that the bot can sometimes be in a deadloop and nethack kernel won't stop the game. Maybe each char read from the unix socket should count as a move? (open counting for two moves in this case)

Improve database

Actually, there's some fields repeated in different tables. The number of secret doors should be found with something like select count(*) from seek_secret s, doors d, where d.game_id = s.game_id

This modification implies to :

  • Avoid multiple existence of some fields (database diagram?)
  • Make reference to game id in different tables
  • Use a table for bots (name, id and eventually version

The sqlite function "sqlite3_last_insert_rowid()" should help to retrieve the game id obtained after insertion.

Bots should try to connect more than once

When running intensive test with game_runner, it happens sometimes that there's an UnixIOException : "No such file or directory". Bot should try to connect more than once after a sleep to avoid that kind of problem. (Nethack might reach socket creation after the bots tried to connect).

This error happens something like once in 1000 games.

Handling repartition of processing time

Game result entries might be more detailed about time consumption, separating

  • time spent in nethack
  • time spent waiting for the bot's answer
  • time spent adding the data to the database

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.