From: John E. <ja...@zh...> - 2002-07-08 09:48:07
|
I'm working on an influence map [1] for game civil [2]. I have a working version, but as a real numeric newbie I thought I'd bounce it off the people here before calling it done. I'm basically looking for an easy to understand but fast influence spreading algorithm. I've read that this algorithm is similar to those used to predict fire spreading or heat transfer in metal if that helps. The attached code is setup for a hex based map and the functions to take this into accounts (shift_hex_up,shift_hex_down) are probably the most naive. The others being only slight modifications of those in the life.py example. Its not really commented but its short and hopefully should be readily understandable. I've only included the base influence map class and its associated functions. If you'd like a version you can run, I can send you a .tgz setup to run in place (for *nix systems). Thanks in advance for any advice or opinions. [1] An influence map is used commonly in strategic war games. It is a simple means of capturing the areas on the game map that one side is strong vs the other side. Read the first post in this thread for a good description: http://www.gameai.com/influ.thread.html [2] Civil is a cross-platform, turn-based, networked strategy game, developed using Python, PyGame and SDL--allowing players to take part in scenarios set during the American Civil war. http://civil.sourceforge.net/ -- John Eikenberry [ja...@zh... - http://zhar.net] ______________________________________________________________ "They who can give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --B. Franklin |