V4: Gameplay notes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #16
    What about map generation? That seems like a big deal. I assume you are using Dijkstra path finding?

    Comment

    • Derakon
      Prophet
      • Dec 2009
      • 9022

      #17
      Fizzix has a pretty good handle on map generation; the current version handles the basic rooms and corridors, and will be ready for vaults whenever someone gets around to translating the relevant data files. The current generator is a bit slow (takes a second or two to generate the level), but it hasn't been optimized at all so that's to be expected, really.

      I initially implemented pathfinding using A*, but since that's 1-to-1 it doesn't scale well when there's lots of monsters around. Currently I'm working with optimizing Dijkstra -- it certainly works better than A* but your average turn in a dungeon level (mostly not open space) takes about .07s, which I consider to be unacceptably slow.

      Comment

      • Pete Mack
        Prophet
        • Apr 2007
        • 6883

        #18
        OK, Got home and tried it.
        * Installed Python 2.7
        * installed WX 2.9

        Ran python:
        Traceback (most recent call last):
        File ".\pyrel.py", line 19, in <module>
        import procs.procLoader
        File "C:\Users\Peter\Documents\GitHub\pyrel\procs\procL oader.py", line 9, in <module>
        import proc
        File "C:\Users\Peter\Documents\GitHub\pyrel\procs\proc. py", line 132, in <module>
        import aiProc
        ImportError: No module named aiProc

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #19
          PS: ToME 4 was the same kind of deal, using lua instead of Python...

          Comment

          • Derakon
            Prophet
            • Dec 2009
            • 9022

            #20
            Oh dear, thanks for catching that. Looks like I didn't add aiProc.py to the repo. Shame on me!

            Unfortunately that file is currently in a state of flux (since I'm modifying it while optimizing pathfinding), but if you just want to get things running, you can open up things/creatures/creature.py and modify the update() function to this older version:
            Code:
                ## Update state. For now, just wander at random.
                def update(self):
                    import random
                    spaces = [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1],
                            [1, -1], [1, 0], [1, 1]]
                    random.shuffle(spaces)
                    for dx, dy in spaces:
                        target = (self.pos[0] + dx, self.pos[1] + dy)
                        if not self.gameMap.moveMe(self, self.pos, target):
                            break
                    self.addEnergy(-1)

            Comment

            • Pete Mack
              Prophet
              • Apr 2007
              • 6883

              #21
              No rush. I do figure you want to start tracking changes to AI sooner than later.

              Comment

              Working...
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎