So.. the stackless framework is humming along (Quake? huh?!) nicely. Players can connect, move around, and it's reading/loading nice XML area files.
Tonight, I was working out the math for generating a spherical world/board that could scale up in size to accommodate more players. After a bit of sketching in Rhino, this is where it's at:
def lats(n):
print '0 0' #equator lats={}
for x in range(1, 2**n):
print x,x*90.0/(2**n)
lats[x]=x*90.0/(2**n)
lats[(2**n)]=90.0 #poles return latsdef longs(n):
longs = {}
for x in range(1,(2**n)):
#for p in ['E','W']:
#print x,x*180.0/(2**n),p
longs[x]=x*180.0/(2**n) #hm.. this makes doubling the longs a pita?
longs[0]=0.0
longs[len(longs)]=180.0
return longs"""
So a planet of order n=2:
has 3 lat lines in each hemisphere.counting them in order from the equator,
lat #3 should have rooms at longs(2)
lat #2 & #1 @ longs(3)(to step down away from the poles!)so, planet of order n=3 has 7 lat lines
pole(lat8) @ longs(1)
lat#7 @ longs(2)
#6 @ longs(3)
#5 @ longs(4)
#4,#3,#2,#1 @ longs(5)
"""def rooms(n):
lattys = lats(n)
i=0
for x in lattys:
if i<n:
i += 1
#print 'Lats:',lattys[x],'Longs:',longs(i)
longys = longs(i)
for y in longys:
print lattys[x],longys[y]
print i
So, calling rooms(3) returns a satisfying list of coordinate pairs. :)
Next up is working out the algorithm to create the exits!