[Map Script] SpiralGalaxy.py for Final Frontier

Hi Cephalo, is this script 3.17 compatable

The patch happened while my home computer is dismantled, so I haven't tested it. I'm not yet aware of any issue that would prevent it from working unless there are new terrain types or something.
 
I'm currently playing with SpiralGalaxy and 3.17, so far everything works fine (I'm in the middle part of the game).

EDIT: I finished the game, and there was no problem at all!.
 
I really like this map script but I am having problems playing this in multiplayer I keep getting OOS error's whenever I start a game.
I'm using patch 3.17
Does anyone else have problems playing with this in multiplayer?
 
I really like this map script but I am having problems playing this in multiplayer I keep getting OOS error's whenever I start a game.
I'm using patch 3.17
Does anyone else have problems playing with this in multiplayer?

Looks like there's a bug in there. It's supposed to detect a network game and switch to the apporopriate random number generator but it looks like I left it commented out by accident. Funny nobody noticed this for a whole year. :lol:

Ok I fixed it. Download it again and it should work. Let me know because I fixed it without playtesting...:eek:
 
Hmm, that wouldn't make much sense for a spiral galaxy, but if you want, you can modify the getWrapX and getWrapY functions and set them to return 'True'. That should give you what you are looking for.

What about a toroidal map?
Is this v3.19 compatible?
 
What about a toroidal map?
Is this v3.19 compatible?

Untested on 3.19. Should work though.

I didn't use a toroidal option because real galaxies are flat discs. If you are at one end of the galaxy, you really do have to cross the whole galaxy to get to the other end. Keep going off the edge and eventually you'll probably hit a whole new galaxy.
 
Looks like there's a bug in there. It's supposed to detect a network game and switch to the apporopriate random number generator but it looks like I left it commented out by accident. Funny nobody noticed this for a whole year. :lol:

Ok I fixed it. Download it again and it should work. Let me know because I fixed it without playtesting...:eek:

Odd indeed. I playtested (before the fix) on MOO2Civ with no real OOS problems - as far as I remember. Will use the fixed version for the next patch anyway. (I heard of this mapscript via deanej and was under the impression it was his; credit will be corrected as well.)

Untested on 3.19. Should work though.

Good to know.;)
 
How do you increase the size of the maps without increasing the number of star systems and other features/hazards?

Wow, I haven't looked at this code for a loooong time, but there's gotta be an easy way... I'll try to look into it.
 
Untested on 3.19. Should work though.

I didn't use a toroidal option because real galaxies are flat discs. If you are at one end of the galaxy, you really do have to cross the whole galaxy to get to the other end. Keep going off the edge and eventually you'll probably hit a whole new galaxy.
I understand that but I was just wondering how you make a toroidal mapscript.
 
I remember editing a couple thing in Final Frontier.py, or was it this one, and then it didn't show up. I was trying to make a mod where planets replaced stars and moons replaced planets. This mod didn't work in the end but why was it that when I removed a few features from the script so it was just a solar system the game didn't show it?
 
I remember editing a couple thing in Final Frontier.py, or was it this one, and then it didn't show up. I was trying to make a mod where planets replaced stars and moons replaced planets. This mod didn't work in the end but why was it that when I removed a few features from the script so it was just a solar system the game didn't show it?

I think all you have to do is change the getWrapX and getWrapY functions and set them to return 'True'.
 
many thanks, i look forward to your response

Ok, I had a look and right at the front of the script there are some tuning variables to adjust the densities of these features.
 
Ok, I had a look and right at the front of the script there are some tuning variables to adjust the densities of these features.
OK I have tried increasing the map size once before but it didn't work and now i've dived in at the deep end before i learnt to swim. Starting at the beginning, i'll ask questions :lol:
Is there a ratio of height to width that needs to be observed when adjusting the map size?
The variables you mentioned above do you decrease the value to decrease the density of features or increase it to do the same?
Is there a step by step guide to setting up or adjusting the parameters of your map before you even start the game?
 
OK I have tried increasing the map size once before but it didn't work and now i've dived in at the deep end before i learnt to swim. Starting at the beginning, i'll ask questions :lol:
Is there a ratio of height to width that needs to be observed when adjusting the map size?
The variables you mentioned above do you decrease the value to decrease the density of features or increase it to do the same?
Is there a step by step guide to setting up or adjusting the parameters of your map before you even start the game?

I think you can use any size you like, but it's possible that the map requires a square aspect. The feature density is how many of these objects are placed per map square.
So for a standard map with grid size 22x22, you times 4 to get map dimension of 88x88 which is 7744 map tiles. At 0.0045 SolarSystemsPerPlot, that comes to around 34 solar systems.
 
I was trying to make it possible for wormholes to be added to this mapscript (like I did with the default FinalFrontier mapscript) and ran into some confusing errors.

Firstly, I wanted to make sure that my wormholes would be placed some distance away from each other and added this function to the mapscript, based on the checkForRoom one that is triggered from each feature generation.

Code:
    def checkForWormholeRoom(self,x,y,feature):
        gc = CyGlobalContext()
        mmap = gc.getMap()
        xStart = x - (CyMap().getGridWidth() / 4)
        xEnd = x + (CyMap().getGridWidth() / 4) + 1
        yStart = y - (CyMap().getGridHeight() / 4)
        yEnd = y + (CyMap().getGridHeight() / 4) + 1
        for yy in range(yStart,yEnd):
            for xx in range(xStart,xEnd):
                if (yy == yStart or yy == yEnd - 1) and (xx == xStart or xx == xEnd - 1):
                    continue #skipping corners
                i = GetIndex(xx,yy)
                if i == -1:
                    return False
                plot = mmap.plot(xx,yy)
                if plot.getFeatureType() != feature:
                    return False
        return True

Then, I changed the checkForRoom and shouldAddFeature function line (which requires them to all be true) to this:

Code:
if self.shouldPlaceFeature(x,y,self.featureWormhole) and self.checkForRoom(x,y,self.featureWormhole) and self.checkForWormholeRoom(x,y,self.featureWormhole):

However, when I do this the map seems to hang while "initializing map". So I gave up and removed this... but now my wormholes get dropped within, say, six plots of each other occasionally (which make them useless). Is there something wrong with my code? Or some easier way I can do this?
 
Top Bottom