Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - oohara

Pages: [1]
1
Programming / monsters surround player tech demo
« on: February 05, 2013, 09:45:36 AM »
I wrote a monster decision-making (monster AI) tech demo:
http://www.interq.or.jp/libra/oohara/surround/index.html
Only the source code is available.  Compile it with gcc and ncurses.

Monsters usually chase the player by following the shortest path
to the current position of the player.  If only one monster can be
in a grid, this is not the best.  To take advantage of numbers,
the destination of monsters should be the adjacent grids of
the player character, not the current position.

The tech demo assumes that:
  + the monsters want to kill the player at any cost
  + hitting the player is always a good thing
  + there is no ranged attack; the only attack is a bump into something
  + the monsters know the map of the dungeon
  + the monsters always know where the player is
  + the monsters know what others are doing

The decision-making code is called just after the player action is done.
It uses the current best action of monsters to improve the decision of
other monsters.

If a monster is adjacent to the player, it attacks the player.
Otherwise, it decides its next action in 3 steps:
  (1) see where it wants to go and find the path
  (2) make sure monsters near the player are not blocked
  (3) cancel the move if a monster near the player is alone

Path-finding in the first step is done with a Dijkstra map.
The first step uses 9 Dijkstra maps.  One map is for a direct chase:
  + the destination is the current position of the player
  + only the wall grids are considered blocked
The other maps are for an indirect chase:
  + the destination is one of the 8 adjacent grids of the player
  + the adjacent grids other than the destination are considered blocked
  + grids with a monster are considered blocked
A monster chooses a Dijkstra map with a non-wall destination and moves to
the best grid according to the map.

The second and third steps handle monsters which engage this turn.
Engaging means that a monster which is not adjacent to the player
gets adjacent.  In the second step, each monster counts the number of
the adjacent grids of the player which are also adjacent to the monster.
This is the number of choices of the monster in this turn.  The monster
with least choices decides the action first.  The third step cancels
engaging if only one monster is adjacent to the player after the move.

2
Programming / Re: Critique my "emergent economy" code
« on: May 16, 2012, 01:41:18 AM »

The code: [3] http://pastebin.com/eQQLdi0a (uses python 2.7 - and tabs for indentations (sorry!))


--- a/economy.py
+++ b/economy.py
@@ -376,7 +376,7 @@
          # All sellers re-evaluate prices - too simplistic as well
          elif len(auction.asks) > 0:
             for seller in auction.asks:
-               seller.owner.eval_bid_rejected(seller.commodity, None)   
+               seller.owner.eval_ask_rejected(seller.commodity, None)   
                auctions[commodity].asks = []
                
          ## Average prices      

3
Traditional Roguelikes (Turn-based) / Re: 7DRL 2012 game talk
« on: May 07, 2012, 07:40:38 PM »
The reviews are announced!


Revenge on a Toy Factory appears twice in the table.
(Use a case-insensitive search.)

4
Other Announcements / Re: Share your ideas for 7DRL
« on: March 03, 2012, 06:55:29 PM »
This idea is stolen from Every Extend Extra:
No, it's stolen from Warcraft II (although the dwarves in Warcraft II didn't get resurrected :) ).
The idea is that you must do self-destruction _right_
to gain enough piety, or you will be left dead.
Of course, you need to do self-destruction more than
once to win the game.

This idea is stolen from Onore no Shinzuru Michi wo Yuke:
No, it's stolen from Flood:
http://en.wikipedia.org/wiki/Flood_%28video_game%29
The ghost in the idea is your pet, not your enemy.

5
Other Announcements / Re: Share your ideas for 7DRL
« on: March 03, 2012, 11:56:47 AM »
Got any fanciful, hopeful, outrageous, outlandish, serious or silly ideas for 7DRL?

* kamikaze dwarf roguelike
You are a devout kamikaze dwarf.  Your only attack is
self-destruction.  If you do it right, your god will
resurrect you.
This idea is stolen from Every Extend Extra:
http://www.everyextendextra.com/

* lich roguelike
You explore a dungeon in a human form.  You will die
sooner or later.  When you die, you transform into a lich
and explore the _same_ dungeon again.  Your ghost appears
this time.  It does exactly what you did.  In other words,
it is your pet which is as wise as you are.  Plan for
your better afterlife.
This idea is stolen from Onore no Shinzuru Michi wo Yuke:
http://www.fromsoftware.jp/game/archive/oreike/

Pages: [1]