source: trunk/game/utilities/layer_fill_utility.py @ 392

Revision 392, 1.5 KB checked in by barra_parpg, 10 years ago (diff)

Patch by mvbarracuda:

  • techdemo1_ground_level.xml is now a copy of map.xml but with larger ground layer (250*250 tiles)
  • You can test ingame performance by opening settings.xml and changing MapFile? to maps/techdemo1_ground_level.xml
  • Observations: performance is rather sluggish even on my win32 desktop system (15-20fps) and the pathfinding algorithm doesn't seem to cope well with so many tiles and therefore possible paths to calculate (player character seem to be stuck for seconds occasionally)
  • Possible options for PARPG to address the problem:
    • Find the bottleneck in FIFE and either convince the FIFE devs to look into it or figure it out ourselves and send in a patch
    • Go for a smaller map size for techdemo 1; we can reevaluate having larger maps in case the relevant FIFE code gets optimized in the future
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2import sys
3if __name__ == '__main__':
4    base_string = """<i o="<object>" r="0" x="<X>.0" y="<Y>.0" z="0.0" />\n"""
5    try:
6        object = raw_input("Object Name: ")
7    except KeyboardInterrupt:
8        sys.exit(0)
9    xmin = None
10    while xmin == None:
11        try:
12            xmin = int(raw_input("xmin: "))
13        except ValueError:
14            pass
15        except KeyboardInterrupt:
16            sys.exit(0)
17    xmax = None
18    while xmax == None:
19        try:
20            xmax = int(raw_input("xmax: "))
21        except ValueError:
22            pass
23        except KeyboardInterrupt:
24            sys.exit(0)
25    ymin = None
26    while ymin == None:
27        try:
28            ymin = int(raw_input("ymin: "))
29        except ValueError:
30            pass
31        except KeyboardInterrupt:
32            sys.exit(0)
33    ymax = None
34    while ymax == None:
35        try:
36            ymax = int(raw_input("ymax: "))
37        except ValueError:
38            pass
39        except KeyboardInterrupt:
40            sys.exit(0)
41
42    try:
43        filename = raw_input("FileName - File will be overwritten without asking: ")
44    except KeyboardInterrupt:
45        sys.exit(0)
46
47    file = open(filename, "w")   
48    for i in range(xmin, xmax + 1):
49        for j in range(ymin, ymax + 1):
50            curlinestring = base_string.replace(
51                "<object>", object).replace(
52                    "<X>", str(i)).replace(
53                        "<Y>", str(j))
54            file.write(curlinestring)
55    file.close()
Note: See TracBrowser for help on using the repository browser.