Python Script - Imagine the Possibilities

Chieftess

Moderator
Retired Moderator
Joined
Feb 10, 2002
Messages
24,160
Location
Baltimore
Unleash your creative talent here. Even if it's not quite a new idea for Civ4, it might be something that shows the developers (well, Soren) what you would like it to do.

Here's an example:

Scenario: "Colonizing Planet X"

Story: You're a modern spacefaring civilization that has just landed your first colonist to this new planet. However, others have done the same, too.

Dangers: This planet has 5% water, and is very dry. It is, however, plagued by Ice Meteors, which will provide the planet with more water (and rivers!).

The idea behind scripting ice meteors? Well, you would do this:

1 - Set each meteor as an object (or "barb unit" in this case).
2 - Set each meteor object to a random size.
3 - When a meteor event is triggered (random number), a meteor strike of a random size, and special effects will occur. (Effects would be any terrain changes, as well as the ability to delay the draw time so that you can see an "animation" of sorts, and even popups as the effect is occuring). They can even be clustered in a specific area of the map.
4 - Generate lakes, and other terrain that the meteor would cause. (if it's already in a lake, it would become a sea, then ocean).
5 - Delete any cities, units, improvements, etc. that would be affected by the meteor.
6 - If a civ is taken out completely by a meteor, they are "conquered by barbarians" so to speak. If you're destroyed, then you lose by conquest.
7 - "Barbarians" would be given another name (i.e., "Metoer Strikes" -- CivX destroyed by Meteor Strikes!!!").
8 - After so many meteor strikes, they will cease to happen. (i.e., you might want 100 meteor strikes to try and generate oceans).

Scenario - "Colonies"

Story - Your civ, and others are forced to colonize the new world. However, keeping the people happy will be very tricky.

Dangers: Your people can become unhappy enough that the provinces you build break away and form a new civ.

The Idea:

1 - A "colonist" unit is treated as a special colony unit. When built, it acts like a city, but can be set so that you only gain the benefits of certain functions. (i.e., you only get the gold from the city, and not the production. Production of units and improvements, though, would be under the control of the province). Kind of like a puppet state, in that the province is there just to give you gold.

2 - Provinces would be formed either by preset boundries in the script, or per number of cities, or, even the ability to draw them in the game. (Don't know if the script is *THAT* powerful, probably not).

3 - A province can break away and form a new civ, instantly creating a civil war scenario.

4 - The player can play as the colonists, or the mother-country. If they play as the colonist, they will see the city production, but not be able to gain any gold, since it all goes to the mother-country.
 
With Python you can easily define new victory conditions, thats another advantage, for example the first to build a railroad that connects 42 cities wins or the first to have an empire from the western to the eastern side of the landmass wins anything you can imagine...
 
And be able to build an AI that understands that connecting those 42 cities via rail is important. ;)
 
Trip said:
And be able to build an AI that understands that connecting those 42 cities via rail is important. ;)

You'd need shortest-distance algorithms, too, but also so that you connect the most cities with the fewest number of tiles, and stack workers, too. I can see many AI scripts coming out of this.

GOTM AI
Demogame AI
HOF AI
WWII AI
Challenge AI
Impossible-to-beat AI (maybe in 3 years)
 
I was wondering, what can be done with this? Is it something like the events in Civ2? Could you program anything you want?
I think this is going to be one of the key features for civ4 if implemented correctly :)
 
It really depends on how much of the game system is exposed to Python.
 
warpstorm said:
It really depends on how much of the game system is exposed to Python.
Correct.

Hopefully since it's been announced so early (and as one of the "features") they will be very closely linked.

If so, I know I won't be getting much sleep. :D
 
MarineCorps said:
What is Python Scripting anyways?
A type of programming language.

This means players will be able to essentially "program" their own AI, combat engine, etc.

Great possibilities. :)
 
I think this will mean a whole new era of scenario making :twitch:
How hard or easy is Python in comparison with Java language? Is it hard, or very intuitive?
 
It is about the simplest to pick up of any programming langauage out there (once you get over the meaningful whitespace thing).
 
Python is said to be the easiest language to learn.

XML for the 'pedia, IIRC?

Well, shows promise. Let us applaud when they really deliver it and it works... :)
 
I just browsed through the home page of the Pythons and it really looks good.

This could really enable us to move to quite another level of modding, as I see it by now.
 
Yeah, Python is awesome. I use it all the time for server-side web coding and quick patchwork scripts. I love it!
 
I'm sure intelligent people who know about modding can probably do this now, but would Python make it easy to delete unwanted units, like in SMAC? The options lists get so long towards the end of the game, and I never seem to use half of them!
 
As I have said in the thread I opened, here's the commands I'd like to see:
Create unit (x,y,civ,turn)
Delete all units (x,y,turn)
Join a civ in the game (civ,turn)
Delete a civ from the game (civ, turn)
Flip a city from one civ to another (civ1,civ2,x,y,turn)
Flip all the cities in a certain radius from a civ to another (civ1,civ2,x,y,radius,turn)
 
Back
Top Bottom