Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > creating natural disasters via SLIC????
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread   
Pages (4): [ 1   2   3   4   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 28-12-2000 09:30 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
creating natural disasters via SLIC???? Support Apolyton, buy Galactic Civilizations

i was looking at the SLIC flags, and started wondering if we could use them to simulate natural occurances. IF random locations are possible, we could have that spot get hit with an bombardment to simulate an earthquake, or plaque. Since bombardment can kill population and destroy buildings, a strong earthquake might consist of several bombardments. If nothing exists at the randomly selected location, nothing would happen. Also, a random weather number could give global food bonuses some years, and droughts in others.

Since my SLIC knowledge is limited, i figured i'd throw it out to those who have used it more.

------------------
History is written by the victor.

Depp is offline Depp
Prince
Stockholm, Sweden
Jan 1970
time: 05:14
Post  Old Post 29-12-2000 05:24
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Since you can change land you can write a sliccode that can grow mountains and such anywhere on map, and adding beaches where you need them. Could be pretty cool.

heardie is offline heardie
Prince

Aug 1999
time: 15:14
Talking  Old Post 29-12-2000 05:50
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Avatar Enlargement: We've got the solution

[Note: I have not yet looked at SLIC this is all pseudo code]

Okay 1st you should create random locations on the map.
If the map was 100x100 to create a random location you could use this (in Pseudo Code - I'll post how to do it in slick [hopefully] once Ii get back from a holiday)

CreateRandomNo(1-100) -> Store it in variable i
CreateRandomNo(1-100) -> Store in variable j
Variable TempLoc = [i,j]

Now say you wanted 10 locations. A for loop should doo that

Creat loop from 1 - 10 -> Variable m
{
CreateRandomNo(1-100) -> Store it in variable i
CreateRandomNo(1-100) -> Store in variable j
Variable TempLoc[m]=[i,j]
}

Maybe that could work for random locations. The first should work, but I don't know about the second. If the second one didnt owork you could just do the first one x amount of times, and cjust change the name of the temploc varibale.

Hope you understand, and I hope someone can convert my pseudo into SLIC

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 29-12-2000 07:25 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton or Terrorists Win

Good idea of writing it out in psuedo code. Here's what i was thinking:

pick an event (drought, great weather, quake, plague,none)

if drought (10%)
global decrease in food

if great weather (10%)
global increase in food production

if quake (40%)
determine richter factor (1 to 7)
bombard location richter times (if city only)
determine 1 tile radius around epicenter and bombard those tiles richter/2 times (if city only)

if plague (20%)
bombard location 3 times (if city or army to simulate deaths)
determine 1 tile radius around center and bombard those tiles 2 times (if city or army to simulate deaths)
if any of the tiles are a city
infect it (gives plague a chance to spread)

that leaves 20% when nothing happens. And the majority of quakes and plagues wont hit anything and cause no damage unless the radius is enlarged

It seems that this should be doable.

------------------
History is written by the victor.

heardie is offline heardie
Prince

Aug 1999
time: 15:14
Post  Old Post 29-12-2000 13:17
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Got spare money?

Okay, this code is to find a random location, and also for me to learn SLIC. I have come across a problem which ill describe at the end.
scenario.slc

code:
#include "msg.slc" int_t i; int_t j; int_t no_of_disasters; int_t x; int_t temp_locx[]; int_t y; int_t temp_locy[]; HandleEvent(BeginTurn) 'DStart_F' pre { Message (1, 'AGStartA'); } HandleEvent(BeginTurn) 'DEachTurn_F' post { if (random(3) == 1) { i = random(20); j = random(20); no_of_disasters = 2; //Change the '2' to how many natural disasters you want for(x = 0; x < no_of_disasters; x = x + 1) { temp_locx[x] = i; //x value } for(y = 0; y < no_of_disasters; y = y + 1) { temp_locy[y] = j; //y value } } }

msg.slc
code:
messagebox 'AGStartA' { Show(); Title(ID_AG_START_TITLE); Text(ID_AG_START_A); Button(ID_AG_BUTTON_NEXT) { Kill(); } }

scen_str
code:
AG_BUTTON_NEXT "Next->" AG_START_TITLE "Natural Disasters" AG_START_A "Made by heardie"


Now why doesn't this display a messagebox when the game loads?
Do I need to call 'DStart_F'
[This message has been edited by heardie (edited December 29, 2000).]

heardie is offline heardie
Prince

Aug 1999
time: 15:14
Post  Old Post 29-12-2000 13:41
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton buy from Amazon

thats a good ideas Alpha. when I get back on the 7th ill try and implement them. If its not done by then!

skorpion59 is offline skorpion59
Prince
Tulsa, Oklahoma, USA
May 1999
time: 23:14
Post  Old Post 29-12-2000 15:12 Visit skorpion59's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Inflate your Upload Space

For the messagebox problem, this will do it.

Scenario.slc:

code:
//just run once when the game starts HandleEvent(BeginTurn) 'DonStartGame' post { if(IsHumanPlayer(player[0])) { Message (g.player, 'DonTurn0'); DisableTrigger('DonStartGame'); } } messagebox 'DonTurn0' { Show(); Title(ID_DON_TURN_0_TITLE); Text(ID_DON_TURN_0); }


Scen.str:
code:
DON_TURN_0_TITLE "Natural Disasters" DON_TURN_0 "\nMade by Heardie"

wheathin is offline wheathin
Prince
home
Apr 1999
time: 05:14
Post  Old Post 29-12-2000 20:05
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Increase the size of your Attachments

What happens if the chosen location is ocean? You could add a check that makes sure that the disasters only hit land.

Also, for droughts, would it be possible to have it actually change terrain - replace plains with deserts, for example? If so, you could add a mini-ice age/el nino trigger with similar effect.

Finally, with the bombarding, will that also destroy tile improvements? If not, maybe that should be an additional effect of the disasters.

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 29-12-2000 21:35 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton buy from Amazon

I had actually thought about those options also. Like if the quake was just offshore, to flood flatlands, or if it was a mountain, for it to be a volcano. But at that point I hadnt read too much about SLIC yet so didnt want to get too complicated. I figured quakes would destroy mines, road/rail, but farms and adv farms wouldnt be that affected by some ground shaking. I figured it would take quite a few years of drought to turn land bad or good years to turn desert into plains, so I didnt know how realistic those options would be. Altho natural disasters seem to happen alot, the big world changing ones are rare.

I'm glad I'm not the only one that thinks this is viable

------------------
History is written by the victor.

Matthew Watson is offline Matthew Watson
Settler
Edinburgh, Scotland
Dec 2000
time: 05:14
Post  Old Post 30-12-2000 21:04
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Suffering from ads?

quote:

Originally posted by wheathin on 12-29-2000 10:05 AM
What happens if the chosen location is ocean? You could add a check that makes sure that the disasters only hit land.



Maybe it could represent a tsunami - the code could search for all swamps within a certain radius and turn them into sea.

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 31-12-2000 10:11 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Remove this text

quote:

Originally posted by Matthew Watson on 12-30-2000 11:04 AM
Maybe it could represent a tsunami - the code could search for all swamps within a certain radius and turn them into sea.


I had figured any flatland would be hit by the tital wave.

------------------
History is written by the victor.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 01-01-2001 00:19 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Instead of using bombardment to destroy things, it might be better to use manually destroy buildings (using DestroyBuilding), damage or kill units (using KillUnit or DamageUnit) or destroy terrain improvements (using CutImprovements) or change terrain (using KillTile or Terraform), change citysize (using KillPop or MakePop), etc. This gives you much more control over what happens and you could even come up with things that reduce the effects of these disasters.

One thing though, it's not possible to increase or decrease food or production through SLIC. The only workaround for this that I know is to create and destroy special city-improvements for this purpose (e.g. a city improvement called Drought that decreases food in a city with 10% or a building called great weather that gives 10% extra food in the city). It's not pretty but as far as I see there's no other solution to this.
[This message has been edited by Locutus (edited December 31, 2000).]

Cyrius is offline Cyrius
Chieftain
Minneapolis, MN, USA
Nov 2000
time: 05:14
  Old Post 01-01-2001 02:03
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton buy from Amazon

Clever... very clever...keep up the work on this guys, sounds fascinating! I'd love to include random weather in my games, it would help spice things up.

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 01-01-2001 03:59 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

part of the fun of adding disasters would be their unpredictability of damage. Once you start specific coding, wouldnt you lose that randomness? Plus even in this day, look at the damage that has been done in Californian quakes, which I guess has the most stringest building codes for surviving quakes. By using bombardment, you never know which buildings might be destroyed or how many if any population is killed. My personal preference is to keep as much totally random as possible, altho I understand that may not be everyones opinion.

If we cant do weather via SLIC, how about randomly generated wonders. WONDER_DROUGHT that reduces global food, or WONDER_GREAT_WEATHER that increases it?

------------------
History is written by the victor.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 01-01-2001 23:55 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Well, randomness isn't a problem since SLIC has a Random function. If a quake happened in or near a city you could specify the chance a building is destroyed (even make this specific for certain types or buildings or whatever) and cycle through all buildings and wonders in the city and use the Random function to test if it would be destroyed or not. This is just as unpredicable as the bombardment function, but much more tweakable (e.g. you could make a Bank much more likely to survive than a Factory or whatever).

One problem with the wonder/advance I forgot to mention is that there is a max of 64 buildings & wonders, so you can only have so much of these events. Also, the disadvantage of using a Wonder instead of a building is that you can only have one at a time, which might be undesirable (but sometimes it might not matter, so it's still useful but only when no more than one at a time is needed).

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 02-01-2001 00:20 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

quote:

Originally posted by Locutus on 01-01-2001 01:55 PM
Well, randomness isn't a problem since SLIC has a Random function. If a quake happened in or near a city you could specify the chance a building is destroyed (even make this specific for certain types or buildings or whatever) and cycle through all buildings and wonders in the city and use the Random function to test if it would be destroyed or not. This is just as unpredicable as the bombardment function, but much more tweakable (e.g. you could make a Bank much more likely to survive than a Factory or whatever).



Ah, now I understand. Yes, that would be more preferrable to bombardment. i had thought you meant that if there was a quake and the city has a bank then to destroy it. I didnt realize that you could cycle thru the buildings in a city and give it a percentage that it would be destroyed. We could have a building called IMPROVEMENT_BUILDING_CODE that would minimize the damage.

------------------
History is written by the victor.

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 05-01-2001 10:43 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton

Have you had a chance to try any of the disaster coding? If you can get it started, I probably can test asd debug it. Its the initial how to set it up in SLIC that I'm not very good at.

------------------
History is written by the victor.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 05-01-2001 01:25 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Well, problem is that I'm already working almost full-time on Harlan's scenario and the code for the MedMod, so I don't have much time right now (it will get much worse when college starts again). And even if I had more time, I'm still working on some decent SLIC documentation as well, which has precedence over this, so I won't be able to do much about this for at least the next two-three weeks (probably longer). I was kind of hoping someone else would pick this up. (If you'd dig into the archives you'd find so many SLIC ideas it would take one guy several years to turn it all into code, even if he's working 8 hours a day, so we definately need more people going into SLIC.)

Harlan is offline Harlan
Civ3 Scenario Haven Admin
Berkeley, CA, USA
Aug 2005
time: 21:14
Post  Old Post 05-01-2001 01:59
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Got spare money?

Locutus,
When you say there are a max of 64 buildings and wonders, is that something you know for sure or are you assuming that's how it was in CTP1 and its probably the same in CTP2? Also, do you know of any limits to the number of advances?

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 05-01-2001 02:20 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Would I be safe in assuming that any file whose first line is the number of entries probably has a limit? Any cases where this isnt true?

------------------
History is written by the victor.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 05-01-2001 02:29 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Support Apolyton buy from Amazon

Harlan,

Unless Mr Ogre is a pathelogical lie-er(sp?) I'm fairly sure of that 64 limit on buildings and wonders AFAIK there's no limit on advances or units though (and IIRC Mr Ogre confirmed that).

Alpha,

I don't know, that might actually be the case, it never occured to me that there might actually be a system

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 05-01-2001 05:07
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Support Apolyton


Guys, this is great. But I hope the idea is to restrict all disasters to the human. We don't want to overload the AI's already weak brain do we?

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 05-01-2001 05:32 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Remove this text

my AI's brain aint weak anymore. Disasters affect anyone. Whole cities have been wiped out by disasters, so if a civ is by chance hurt, it'll have to bounce back.

------------------
History is written by the victor.

Radical_Manuvr is offline Radical_Manuvr
Chieftain
Maryland, USA
Dec 2000
time: 05:14
Post  Old Post 05-01-2001 07:33
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Support Apolyton, buy Civilization 2

Great idea AW and additions from others. If I decide to "borrow" it for a scenario I'm working on, I'll be happy to post working code. I'm in the very early stages though, so hopefully someone will beat me to it.

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 05-01-2001 08:27 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Thanks. i figured its doable but i've been spending so much time improving the AI that I havent had a chance to practise SLIC. I'm also hoping someone will have the time to try this.

------------------
History is written by the victor.

heardie is offline heardie
Prince

Aug 1999
time: 15:14
Post  Old Post 06-01-2001 16:05
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Lose 30 kilos (of popups)

I'm back now, and ready to code. I hope you dont mind me asking 1 million questions though, eventually. That sucks if you cant change the cities food production, now I need to learn how to make a building. I thought I was so smart too:

code:
for(m = 0; m <= player.cities; m = m + 1) { CityFoodDelta(city[m]) = .75 * CityFoodDelta(city[m]) }


Oh Well!

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 06-01-2001 18:54 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Inflate your Upload Space

Heardie,
Well, at least it's original Most people would try to use variables to change in-game values (something like city[0].netcitygold = 2 * city[0].netcitygold), never saw anyone using functions for it before

One other thing to be aware of is that SLIC only works with whole numbers, everything after the dot will simply be cut off, so even if your example trigger would have worked, it would have made the CityFoodDelta 0. If you want to say x = .75 * x, you'll have to say x = (x * 3) / 4, or something like that.

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 06-01-2001 21:47 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#28 Report this post to a moderator
Support Apolyton buy from Amazon

Now I know why I'm leaving the SLIC coding to you guys. ZOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMMMMMMMMMMMMM
MM

------------------
History is written by the victor.

colorme is offline colorme
Warlord

Nov 2000
time: 05:14
Post  Old Post 07-01-2001 00:06
Edit/Delete Message Reply w/Quote
#29 Report this post to a moderator
Increase the size of your Attachments



On Slic mathematics, my observation is that if something in a command is not an integer, Slic may simply ignore that command (it won't complain)! I don't know if that's a fact, but that was the effect I seemed to be getting.

Harlan is offline Harlan
Civ3 Scenario Haven Admin
Berkeley, CA, USA
Aug 2005
time: 21:14
Post  Old Post 07-01-2001 02:31
Edit/Delete Message Reply w/Quote
#30 Report this post to a moderator
Suffering from ads?

Alpha,
If its like CTP1, any file that starts with a number can be changed, but you have to change that number too. So if it was the Units.txt, add three new units and then add three to that start number.

Luckily, many files now no longer use that number, which is great, cos it was a real pain to keep that straight.

 
Pages (4): [ 1   2   3   4   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0526 seconds (92.85% PHP - 7.15% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net