StarWars.py Mapscript

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
Updated 9/23/09

The mapscript has been something I've been working on as part of my python work for this mod, but it's different enough from that that I wanted to open a new thread to discuss it.

Currently, as of the version at the bottom of the post, it does this:

-Instead of placing a Solar System like in Final Frontier, it will place a feature called the Planet Core (the "center" plot of the planet- it has no visual representation).
-Then, it will roll a random number and place a random type of planet around that Planet Core.
-The types are, as of the current script:

Code:
-"Class M": Good for food, production, and gold/credits. Represented by grassland and plains.
-Arctic: Good for production, weak in food and gold/credits. Represented by snow.
-Volcanic: Good for production, weak in food and gold/credits. Represented by Fall from Heaven 2 Burning Sands.
-Desert: Good for gold/credits, weak in food and production. Represented by desert.
-Aquatic: Good for food only. Represented by an island ringed by coast (water).
-Swamp: Good for food only. Represented by swamp.
-Forest: Good for gold/credits and food. Represented by forest on plains.
-Jungle: Good for food and gold/credits. Represented by jungle on swamp.
-Rocky: Good for production and gold/credits. Represented by Bare Rock from Song of the Moon.
-Gas Giant: Good for gold/credits. Represented by Gas Giant terrain by civ_editor11.
-Planets have a chance of appearing depending on how many yields they are good at producing. Types with 3 good yields have 1x chance, types with 2 have 2x chance, and types with 1 have a 3x chance.
-Large/Small planets (suggested by God-Emperor) have a full fat cross and a "thin cross" respectively. The percentage of worlds that are like this are governed by a map option.
-Solar System-style cities DO NOT exist in this mod.
-Orbital Space Terrain is added in a small ring around each planet.
-A "planetary name" (real Star Wars planet) is assigned to each planet, randomly. Currently, the random planets are:

Code:
* Balmorra
* Foerost
* Fondor
* Hypori
* Mechis III
* Metalorn
* Mustafar
* Nelvaan
* Ord Cestus
* Queyta
* Saleucami
* Skako
* Tar Morden
* Telti
* Vulpter
* Xagobah
* Geonosis

What's planned for the future?

-More random planet names


What's the purpose of this thread?

Well, there are a few questions I have for everyone:

1. What additional types of planets should the script be able to place, in addition to the four above? What kind of terrain should be used to represent them?

2. What other planetary names should be used in addition to the list of current planetary names?

3. Do you have any other ideas for the mapscript? Right now, it does default Final Frontier stuff outside of the changes I outlined. What else do we want on the map? Be it planetary related or not.

Also, of course, if you find a bug, post it here.

Credits:
-TC01
-civ_editor11
-T_KCommanderbly
-God-Emperor

Latest Version:
 

Attachments

  • StarWars.zip
    7.8 KB · Views: 210
good work your doing, here some more ideas for you

1. More planet types:
Forest Planet (like Kashyyyk) -good for credits and food
Rocky Terrian (like Kessel) -good for production and credits
Water Planet (like Komino) -good for food
and i dont know if you want to add a city planet or the planet can just devolope into one?

2. I would add all the planets IMO maybe planets like tatooine and naboo access a special resource that is unique from other planets. Like naboo would get nerfs and tatooine would get banthas.

3. Um well there are tons more i would add but the option of #2 would have to be figured out

4. no other ideas come to mind
 
I'd have to do a serious reworking of the units to make them work on water currently they're all land so water planets would probaly not work very well.
Your other ideas are great.
 
I'd have to do a serious reworking of the units to make them work on water currently they're all land so water planets would probaly not work very well.
Your other ideas are great.

Well, we could just make Water another type of land terrain.

Or, you could make the center of an aquatic planet be an island (where the city is), and then just make the tiles around it a barrier- workable, but impassable, terrain.
 
That would work it might take some time but it would work
 
Another possibility:

The big planet. Instead of a 3x3 square, it is a full fat cross. Those 12 extra tiles could be quite an advantage. This could complicate the map scrip a bit, and with the addition of some "coastal" orbit terrain around it the space taken up by the thing could be excessive.
 
The big planet. Instead of a 3x3 square, it is a full fat cross. Those 12 extra tiles could be quite an advantage. This could complicate the map scrip a bit, and with the addition of some "coastal" orbit terrain around it the space taken up by the thing could be excessive.

Interesting idea. I think we might just be able to manage huge planets. There should be enough space- maybe I have to cut out a few radiation clouds or a supernova- but it should be workable.


In regards to Forest worlds, the problem I'm seeing is the Planet Core implementation as a vital, but invisible, feature. (That and Jungle worlds- another idea). So I think we might have to copy the Forest and Jungle feature code as a variation of Planet Core. Understand what I mean? We can use the FeatureVariety art code to make Planet Core have three different appearances:

-Blank
-Jungle
-Forest

Then, depending on which planet type appears, we can display a different type of Planet Core. (On Forest Worlds, we display the Forest one).


Next script version will have the following planet types for sure:

-Forest (grassland covered in Forest- to make this work, I suggest renaming Asteroids to FEATURE_ASTEROIDS- I'll handle the python issues on my end), 1x chance of appearing
-Jungle (grassland covered in Jungle- again, you should rename Supernova to FEATURE_SUPERNOVA, I'll handle the python issues), 1x chance of appearing
-Aquatic (island surrounded by water), 1x chance of appearing
-Rocky (hills and plains), 1x chance of appearing

If I can get the Big Planet to work, I'll add that in as well.
 
What advantages would there be. Other than bigger land battles?
 
What advantages would there be. Other than bigger land battles?

Well, for one you get a full fat cross for your cities.

For another, you just said it. You're the one who championed the idea of land battles over solar systems...
 
Okay I was just wondering if there was another one I didn't see.
I do like the idea though
 
Now that I mentioned big planets, it occurs to me that you could also have the opposite:

The small planet. Remove the 4 corner squares from the usual 3x3 planet.

This would be a significant disadvantage. Not only would there be many fewer tiles to work but you could actually directly attack the central plot from the space tiles by coming at it diagonally, bypassing the land you normally have to cross. Sprinkling in a small number of these might make the map more interesting, but finding one close to your start could be a bit dissappointing - the equivalent of finding your starting location to be surrounded by tundra or desert in the regular game, I suppose.
 
That's also a good idea. But I think I'm going to do differently-sized planets slightly differently. There will be a small defined number of altered size worlds. The script has a random chance to make each world smaller or large until the defined value is exhausted.


Anyway, I've implemented both the TERRAIN_ORBIT (please tell me this is the right name) placement and the random planet name.

I have NOT yet renamed existing Forest and Jungle (asteroids and supernovas) to FEATURE_ASTEROIDS and FEATURE_SUPERNOVA. That will be for the next version. If you already have, civ_editor, tell me and I'll fix this first.

Otherwise, I'll release it in the first post to test it.
 
Another terrian that just came to mind and i dont know if it will work out or if is possible to put it would be

Gas Giant (Like Bespin) credits based because of carbonite
Swamp (like Dagobah) Food probably would be alot like jungle(?)
 
Another terrian that just came to mind and i dont know if it will work out or if is possible to put it would be

Gas Giant (Like Bespin) credits based because of carbonite
Swamp (like Dagobah) Food probably would be alot like jungle(?)

Good ideas. Swamp should probably be the base for Jungle planets as well (maybe Jungle can give food and production, but Swamp just gives food).

Gas Giant I don't know about. It would be cool, but do you have a graphic suggestion for it?
 
Gas giants would be great it could have the tibbana gas resource.
if we only had a graphic for it. I can try I shouldn't be too hard to make a terrain they're just 2d graphics.
 
For "Rocky" planets, I'm wondering if we should use the terrain graphics from Song of the Moon? (the old lunar colonization mod)?

Or should we create a seperate planet type to use that kind of lunar terrain?

Either way, I have the mod, so if you want it's art, you can have it.


I've released a new version of the mapscript in the first post. Here are a list of features and terrains that you MUST have defined in the XML. As you note, I've re-introduced forests and jungles and renamed Asteroids and Supernovas. Also, Planet Core now has three variety types as I mentioned earlier:

-Normal (no graphic)
-Forest graphics
-Jungle graphics

Make sure to add the extra varities in or you'll get an error.

(Because of this, you will also need to download a new python folder that's in the first post of the python modding thread)

Code:
	def __initFeatureTypes(self):
		self.featureForest = self.gc.getInfoTypeForString("FEATURE_ASTEROIDS")
		self.featureIce = self.gc.getInfoTypeForString("FEATURE_ICE")
		self.featureFallout = self.gc.getInfoTypeForString("FEATURE_FALLOUT")
		self.featureJungle = self.gc.getInfoTypeForString("FEATURE_SUPERNOVA")
		self.featureSupernovaArea = self.gc.getInfoTypeForString("FEATURE_SUPERNOVA_AREA")
		self.featureOasis = self.gc.getInfoTypeForString("FEATURE_OASIS")
		self.featureGravField = self.gc.getInfoTypeForString("FEATURE_GRAV_FIELD")
		self.featureFloodPlain = self.gc.getInfoTypeForString("FEATURE_FLOOD_PLAINS")
		
		#Planet terrain types (and space, and other features)
		self.planetCore = self.gc.getInfoTypeForString("FEATURE_PLANET_CORE")
		self.planetClassMCore = self.gc.getInfoTypeForString("TERRAIN_GRASS")
		self.planetClassMEdge = self.gc.getInfoTypeForString("TERRAIN_PLAINS")
		self.planetArctic = self.gc.getInfoTypeForString("TERRAIN_SNOW")
		self.planetDesert = self.gc.getInfoTypeForString("TERRAIN_DESERT")
		self.planetVolcanic = self.gc.getInfoTypeForString("TERRAIN_BURNING_SANDS")
		self.planetAquaticEdge = self.gc.getInfoTypeForString("TERRAIN_COAST")
		self.planetSwamp = self.gc.getInfoTypeForString("TERRAIN_SWAMP")
		self.planetForest = self.gc.getInfoTypeForString("FEATURE_FOREST")
		self.planetJungle = self.gc.getInfoTypeForString("FEATURE_JUNGLE")
		self.spaceOrbit = self.gc.getInfoTypeForString("TERRAIN_ORBIT")
 
Whats terrain swamp
 
Whats terrain swamp

Well, it's Swamp terrain, for Swamp planets.

It appears in Colonization and Fall from Heaven 2. Do you need me to upload it?
 
Yes that would be helpful. I don't have colonization.
 
Top Bottom