Browse Source

turned smart recursion back on

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
2d536f3c8d
  1. 10
      chunkymap-genresults/chunk_x-4z5_mapper_result.txt
  2. 17
      chunkymap-regen.py
  3. 6
      minetestmapper TEST.bat
  4. 18
      minetestmapper.py
  5. 28
      minetestmapperTEST chunk_x0z0.bat

10
chunkymap-genresults/chunk_x-4z5_mapper_result.txt

@ -1,10 +0,0 @@
Result image (w=16 h=16) will be written to C:\Users\jgustafson\Documents\GitHub\minetest-chunkymap\chunk_x-4z5.png
Unknown node names: default:grass_1 flowers:mushroom_fertile_red air
Unknown node ids: 0x0 0x1 0x9 0x7
Drawing image
Saving to: C:\Users\jgustafson\Documents\GitHub\minetest-chunkymap\chunk_x-4z5.png
('PNG Region: ', [-64, -64, 80, 80])
('pngMinX: ', '-64')
('pngMaxZ: ', '80')
('Pixels PerNode: ', 1)
('border: ', 0)

17
chunkymap-regen.py

@ -643,6 +643,7 @@ class MTChunks:
if os.path.isfile(region_capable_script_path):
script_path = region_capable_script_path
#cmd_suffix=" > entire-mtmresult.txt"
expertmm_region_string =
cmd_string="sudo python "+script_path+" --input \""+self.world_path+"\" --geometry "+geometry_value_string+" --output \""+tmp_png_path+"\""+cmd_suffix
#sudo python /home/owner/minetest/util/minetestmapper.py --input "/home/owner/.minetest/worlds/FCAGameAWorld" --output /var/www/html/minetest/chunkymapdata/entire.png > entire-mtmresult.txt
#sudo python /home/owner/minetest/util/chunkymap/minetestmapper.py --input "/home/owner/.minetest/worlds/FCAGameAWorld" --geometry 0:0+16+16 --output /var/www/html/minetest/chunkymapdata/chunk_x0z0.png > /home/owner/minetest/util/chunkymap-genresults/chunk_x0z0_mapper_result.txt
@ -810,10 +811,10 @@ class MTChunks:
#print("DIDN'T MOVE: "+str(player_name))
players_didntmove_count += 1
player_count += 1
if not self.verbose_enable:
print("PLAYERS:")
print(" saved: "+str(player_written_count)+" (moved:"+str(players_moved_count)+"; new:"+str(players_saved_count)+")")
print(" didn't move: "+str(players_didntmove_count))
#if not self.verbose_enable:
print("PLAYERS:")
print(" saved: "+str(player_written_count)+" (moved:"+str(players_moved_count)+"; new:"+str(players_saved_count)+")")
print(" didn't move: "+str(players_didntmove_count))
def is_player_at_luid(self, chunk_luid):
result = False
@ -980,6 +981,7 @@ class MTChunks:
def check_map_pseudorecursion_start(self):
if self.todo_index<0:
print("PROCESSING MAP DATA (BRANCH PATTERN)")
if os.path.isfile(self.mtmn_path) and os.path.isfile(self.colors_path):
self.rendered_count = 0
self.todo_positions.clear()
@ -1140,7 +1142,7 @@ class MTChunks:
#if str(self.world_name) != str(self.mapvars["world_name"]):
# is_different_world = True
# print("FULL RENDER since chosen world name '"+self.world_name+"' does not match previously rendered world name '"+self.mapvars["world_name"]+"'")
print("PROCESSING MAP DATA")
print("PROCESSING MAP DATA (SQUARE)")
while this_iteration_generates_count > 0:
this_iteration_generates_count = 0
self.read_then_remove_signals()
@ -1226,7 +1228,7 @@ class MTChunks:
if type(signals[this_key]) is bool:
self.verbose_enable = signals[this_key]
else:
print("ERROR: expected bool for "+this_key)
print("ERROR: expected true or false after colon for "+this_key)
else:
print("ERROR: unknown signal '"+this_key+"'")
@ -1268,7 +1270,8 @@ class MTChunks:
#if self.last_map_refresh_second is not None:
#print ("waited "+str(best_timer()-self.last_map_refresh_second)+"s for map update")
self.last_map_refresh_second = best_timer()
self.check_map_inefficient_squarepattern()
self.check_map_pseudorecursion_start()
#self.check_map_inefficient_squarepattern()
else:
print("waiting before doing map update")
else:

6
minetestmapper TEST.bat

@ -1,6 +0,0 @@
REM C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --region 0 64 0 64 --output "try7amber.png"
C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --geometry 0:0+16+16 --output "chunk_x0z0.png" > chunk_x0z0-genresult.txt
REM C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --geometry -100:-100+16+16 --output "chunk_x-100z-100.png" > chunk_x-100z-100-genresult.txt
pause

18
minetestmapper.py

@ -165,7 +165,10 @@ drawunderground = False
geometry_string = None
region_string = None
for o, a in opts:
#for o, a in opts:
opt_index = 0
while opt_index <len(opts):
o, a = opts[opt_index]
if o in ("-h", "--help"):
usage()
sys.exit()
@ -194,9 +197,10 @@ for o, a in opts:
geometry_string = a
elif o == "--region":
region_string = a
#region_string = xmin_string+" "+xmax_string+" "+zmin_string+" "+zmax_string
else:
assert False, "unhandled option"
opt_index += 1
nonchunky_xmin=-1500
nonchunky_xmax=1500
nonchunky_zmin=-1500
@ -236,9 +240,13 @@ if geometry_string is not None:
usage()
sys.exit()
elif region_string is not None:
parts = region_string.split(" ")
#parts = region_string.split(" ")
dimensions = region_string.split(",")
if len(parts) == 4:
xmin_string, xmax_string, zmin_string, zmax_string = parts
#xmin_string, xmax_string, zmin_string, zmax_string = parts
x_bounds, z_bounds = dimensions
xmin_string, xmax_string = x_bounds.split(":")
zmin_string, zmax_string = z_bounds.split(":")
nonchunky_xmin = int(xmin_string)
nonchunky_xmax = int(xmax_string)
nonchunky_zmin = int(zmin_string)
@ -249,7 +257,7 @@ elif region_string is not None:
print(" zmin:"+str(nonchunky_zmin))
print(" zmax:"+str(nonchunky_zmax))
else:
print("ERROR: (Incorrect value '"+region_string+"' for region) Region should be in the form: xmin xmax zmin zmax")
print("ERROR: (Incorrect value '"+region_string+"' for region) Region should be in the form: xmin:xmax,zmin:zmax")
usage()
sys.exit()
#answer=raw_input("press enter to continue")

28
minetestmapperTEST chunk_x0z0.bat

@ -0,0 +1,28 @@
@echo off
REM C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --region 0 64 0 64 --output "try7amber.png"
MD chunkymap-genresults
MD chunkymapdata
cls
SET CHUNKYMAP_CHUNK_WIDTH=16
SET CHUNKYMAP_CHUNK_HEIGHT=16
SET CHUNKYMAP_CHUNK_XMIN=0
SET CHUNKYMAP_CHUNK_XMAX=15
SET CHUNKYMAP_CHUNK_ZMIN=0
SET CHUNKYMAP_CHUNK_ZMAX=15
SET CHUNKYMAP_CHUNK_LUID=x%CHUNKYMAP_CHUNK_XMIN%z%CHUNKYMAP_CHUNK_ZMIN%
SET TARGET_GENRESULT_PATH=chunkymap-genresults\chunk_%CHUNKYMAP_CHUNK_LUID%-genresult.txt
SET TARGET_IMAGE_PATH=chunkymapdata\chunk_%CHUNKYMAP_CHUNK_LUID%.png
C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --region %CHUNKYMAP_CHUNK_XMIN% %CHUNKYMAP_CHUNK_XMAX% %CHUNKYMAP_CHUNK_ZMIN% %CHUNKYMAP_CHUNK_ZMAX% --output "%TARGET_IMAGE_PATH%" > "%TARGET_GENRESULT_PATH%"
REM C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --geometry %CHUNKYMAP_CHUNK_XMIN%:%CHUNKYMAP_CHUNK_ZMIN%+%CHUNKYMAP_CHUNK_WIDTH%+%CHUNKYMAP_CHUNK_HEIGHT% --output "%TARGET_IMAGE_PATH%" > "%TARGET_GENRESULT_PATH%"
REM REM C:\Python27\python minetestmapper.py --input "C:\games\Minetest\worlds\try7amber" --geometry -100:-100+16+16 --output "%TARGET_IMAGE_PATH%" > "%TARGET_GENRESULT_PATH%"
start notepad "%TARGET_GENRESULT_PATH%"
start "chunkymapimage" "%TARGET_IMAGE_PATH%"
echo To delete the test output,
pause
del "%TARGET_GENRESULT_PATH%"
del "%TARGET_IMAGE_PATH%"
Loading…
Cancel
Save