ScottTykoski ScottTykoski

Boogie's Moding Class #2: Random Events

Boogie's Moding Class #2: Random Events


// ********************************************
// CREATING YOUR OWN RANDOM EVENTS
// ********************************************

Originally created to be as edit-friendly as possible, the Random Event files can be daunting to someone that wants to create their own. There’re a lot of numbers, with not a lot of feedback as to what those numbers actually do. What I’ll try and do today is step through the EVENT file type and explain each field as painlessly as possible.

//------------------------------------------------------------------------
EVENT UniqueEventName01
//------------------------------------------------------------------------

-this is the header for the event. Give it any name you’d like…as long as it dosent conflict with another event’s name.

Title “Name of Event” //this is another place to name your event, but as of right now it’s unused

Description “A paragraph describing the situation.” // this will be the large paragraph above the options

Image “gfx//your_events.pcx” // file name (from the galciv root) of the image you want to use. Image should be 640x360, 8bit Indexed (256 colors).

EventType 0 // is the event a colonization event or a random event? 0 = colonize, 1 = random


GoodOption, NeutralOption, and EvilOption
// ok, this is where things get…well…messy. The random event that you make will always have random #’s generated for the user. In order to display this, and other information, these entries reference the values “GoodOptStr01”, “GoodOptStr02”, “NeutralOptStr01”, ect. These values tell the game what data to enter in place of the %s placeholders within the text you enter. There are several values that the game will accept….

0 = Display nothing. Use this by default.
1 = Player’s name..uses the value the player typed in at the start of the game. (ex> Alan Bradly)
2 = Player’s empire name. Name of the human race (ex. Terrans)
3 = Name of Player’s ships that triggered the event. Right now only works with colonization events…will display the name of the colony ship.
7 = Name of the planet.
8 = Name of the star system.
9 = Random value of the EVIL option.
10 = Random value of the NEUTRAL option.
11 = Random value of the GOOD option.

Example…

GoodOption "%s is here for all forms of life to share. Let us all live in harmony, no matter what the cost. (%s%% Planet Quality bonus)"
GoodOptStr01 7
GoodOptStr02 11

Using the “GoodOptStr” values, GalCiv will display the name of the planet in place of the first %s, and display the percentage value of the good option in place of the second %s. Also, you’ll see two consecutive %%’s. That’s to indicate where you want a % symbol to appear. Just a small quirk ;)

The above method of inserting game-specific text into paragraphs is as well used with the Description field. Values for “DescStr01” through “DescStr04” indicate any text you want to appear in the description in place of %s.


GoodAttribute, NeutralAttribute, and EvilAttribute
Indicates what aspect of the game you want to change, based on whether it’s a random event or a colonize event. Colonization Event’s will alter aspects of that planet. Random Events alter player abilities (global change). The following list will explain the different options:

// Colonization Options – bonuses on a per-planet basis
0 – changes nothing
1 – max population growth bonus
2 – morale bonus
3 – social production bonus
4 – planet quality bonus
5 – economic bonus
6 – not used
7 – star influence bonus
8 – defense bonus
9 – research bonus
10 – starship quality bonus

// Random Event Options – these up the players ability
100 – economic
101 – ship weapons
102 - ship defense
103 – ship speed
104 - morale
105 – population growth
106 – social production
107 – military production
108 - research
109 - incluence
110 – trace
111 - diplomacy
112 – ship hit points
113 – ship repair
114 - sensors
115 - espionage
116 - soldiering
117 – interest rates
118 – planet quality
119 – number of trade routes
122 – ship range
123 – luck
124 - courage
125 - creativity
126 - government
127 – loyalty

GoodValue, NeutralValue, EvilValue

This is that value that is applied to the corresponding attribute. It will be randomized so it’s not the same number all the time.

MoralityWeight 1 through 5 // where 1 is a less morally defining situation, and 5 is a major issue that will easily change the way others perceive the player

Probability 1-100 // likelihood of the event occurring

DescStr01 through EvilOptStr02 were all discussed in the above area dealing with the Description and Option text fields.

ENDEVENT // used to indicate the end of the event.


Well, that’s about it. There’s a lot going on within these files, but finely crafted random events can add fun and variety to GalCiv. As always, I’ll be happy to answer any questions on the above documentation. :) Have fun!

ScottT
GC Development Team
8,155 views 44 replies | Pinned
Reply #26 Top
I'm not BoogieBac, but I'll take a swing at this and if I'm wrong he can correct me.

100 is the Economics ability, use percentages.
200 is straight BCs, that will be immediately deducted/added from the player's treasury.
Reply #27 Top
Okay, that makes sense... but that means there are about 73 unused entries in between 127 and 200?

Geeze... :)

Bill

~SDC~
Reply #28 Top
How's your proggy coming along? I'm going to finish UP Issues and then take a little break. I'm spending more time on writing my program than playing the actual game at this point...
Reply #29 Top
I've been away for two days, so I haven't done much but read the variables in and display them. Next will come actually saving changes that you make. Makes a lot of use of dropdown menus. The attribute dropdown menu is actually two dropdown menus - the one that displays depends upon whether you choose your event to be a colonization or a random event. (I did that mostly to save space.)

Thanks for all your support and all the ideas on how to dance around VB limitations! When I get a bit further on, could I send you the source code so you can go through it and rip it apart for me?

Bill

~SDC~
Reply #30 Top
Of course, when I decide I don't want to work on the Writer any more, I'll give the source code away so someone else in the community can pick up the ball for future updates.

I don't see that happening any time soon, but that's my expectation if I ever get tired of working on it.
Reply #31 Top
HawaiiFive-0:

I think you misunderstood me; I actually wanted to SEND my source code to YOU to review and criticize. :)

And a few more questions:
Colonization options 8 and 9... switched at birth?

Both types of options:
Which are in percentages and which are straight points?

Thanks, guys - thanks for everything!

Bill

~SDC~
Reply #32 Top
Heh, actually I went back and re-read it afterwards and came to that conclusion as well. Of course that's fine too. :)

Yes, 8 and 9 switched at birth. 8 is supposed to be Defense Bonus but the bonus doesn't show up on the Planet Details screen. I think this doesn't work as advertised. 9 is Research Bonus, and this bonus does show up on the Planet Details screen.

Everything is percentages, save the BC option which is cold hard cash straight out of your treasury (or into your treasury if you write the event that way).
Reply #34 Top
Could somebody please clarify the MoralityWeight variable for me? I had a game I was playing with several weight 1 events where I picked the good path, and about three weight 5 events where I picked the evil path. Yet the UI turned evil on me! But according to BoogieBac's last post (which contradicts his first), weight 5 is supposed to have almost no effect on your morality! So now I'm quite confused here.

And is there any way to tell in-game what your current morality score is?

[Message Edited]
Reply #35 Top
The Morality Weight interacts with the randomized % strength of the choice you take. So even though an event might have a Morality Weight of 1, if the random Good Value is only 1% or 2%, you will not move much at all towards good.

Moreover, Evil choices have a greater effect on your morality than Good choices.

It is very hard to become Saintly. Comparatively, it is quite easy to become Diabolical (is that right? I always play Good so I don't know what the counterpart to Saintly is, maybe its Demonic?).

For your second question, go to Domestic Stats >> Society. Your current morality will be shown in the upper left.

~SDC~
Reply #36 Top
Is there any further information on how the "Probability" field works? Or is there some other reason behind the following phenomenon: it seems that the few new events I downloaded and installed from the Library have accounted for about 80% of the event occurrances that I've seen since I installed them.
Reply #38 Top
How do I change a file to EVENT? I'm making an event that basically can either
+ Morale 1-6
+ Influence 1-4
+ Diplomace 1-7

so, it's a .txt now, but how to change it to EVENT and an image to PCX?
Reply #39 Top
First post on this thread in 147 days... Are you still waiting for an answer to your question, LavaLampMaster? This is not the answer. This is a summary of the findings I posted on the Prancing Pony empires thread.

from BoogieBac
*Edit - Hawaii caught me on this one...MoralityWeight is 1 - 5 where 1 == a major moral event and 5 == a non-important event. Numbers can be over 5, but, as it increases, the likelyhood if it having an impact on your morality standings decreases.
End of quote


from HawaiiFive-O's GalCiv Writer documentation:
FIX: As clarified by BoogieBac, Morality Weight of 1 will greatly affect the civ's Morality, 5 will hardly affect it, this program has been updated to reflect this new information.
End of quote


Notice something odd there? They each claim to have got their information from the other.
My own tests have come to the conclusion that this information is wrong. Morality weight 5 leads to big changes in your alignment. Morality weight 1 leads to small changes. The only other relevant factor is the numerical change in your stat - not the maximum change, the randomly generated actual change. So a change of 50 (in diplomacy, economics, or whatever) will lead to a ten point alignment shift (the maximum) and a change of 7 will lead to a 1 point shift. Between those values, the scale of the alignment change depends a lot on weight. So, for a fair event, something like a PQ penalty or a diplomacy penalty should have a weight of five. A penalty like population growth on a single planet or money should have a low weight.
(I like my events to be big and dramatic - a player should have a decent change of getting to pure good or pure evil in a relatively short game.)

~SDC~
Reply #40 Top
Do you have any idea how the random change is calculated? I've noticed that it's often larger than the value in the file, so that small negatives become positives and vice-versa.

Highly annoying... >:(
Reply #41 Top
The bonuses seem to be any number between 1 and the value in the file. I've never seen it larger than the value in the file. Of course, if the file has a positive value for the good choice or a negative value for the evil choice the game will switch the sign.

~SDC~
Reply #42 Top
The bonuses seem to be any number between 1 and the value in the file. I've never seen it larger than the value in the file. Of course, if the file has a positive value for the good choice or a negative value for the evil choice the game will switch the sign.
End of quote


Hmmm... I'd forgotten about that. That might explain what I'm seeing. It's still annoying, but I have a feeling I know why they did it that way... oh well...
Reply #43 Top
My own tests have come to the conclusion that this information is wrong. Morality weight 5 leads to big changes in your alignment. Morality weight 1 leads to small changes. The only other relevant factor is the numerical change in your stat - not the maximum change, the randomly generated actual change. So a change of 50 (in diplomacy, economics, or whatever) will lead to a ten point alignment shift (the maximum) and a change of 7 will lead to a 1 point shift. Between those values, the scale of the alignment change depends a lot on weight. So, for a fair event, something like a PQ penalty or a diplomacy penalty should have a weight of five. A penalty like population growth on a single planet or money should have a low weight.
End of quote


I've done some of my own testing, and not only confirmed your findings, but come up with some (fairly) hard numbers to go with them.

The change in your alignment (good or evil) is roughly equal to: ActualBonusValue*MoralityWeight/10. It doesn't seem to matter what the bonus actually is.

I say 'roughly' because there were a few examples that were off by one, but the vast majority fell right into this formula (considering the maximum change of +/- 10, and I believe a miniumum of +/- 1).

Incidentally, I haven't been able to get the following ones to actually work: bonus 0 (assumed to be BCs), bonus 7 (supposed to be Influence) or bonus 8 (supposed to be Planet Defense), although they are counted for morality adjustments.
Reply #44 Top
you may find this useful

0=Economy
1=Weapons
2=Defence
3=Speed
4=Moral
5=Pop. Growth
6=Soc. Production
7=Mil. Production
8=Research
9=Influence
10=Trade
11=Diplomacy
12=Hit Points
13=Repair
14=Sensors
15=Espionage
16=Soildering
17=Interest Rates
18=Planet Quality
19=Trade Routes
20=Crime
21=Cabinet
22=Range
23=Luck
24=Courage
25=Creativity
26=Goverment
27=Loyalty
28=Logistics

Federalists

0=Economy +20

Industrialists

6=Soc. Production +20
7=Mil. Production +20

Mercintile

10=Trade +20
15=Espionage +20

Pacifists

11=Diplomacy +20
4=Moral +20

Technoligists

8=Research +20
14=Sensors +1

Universatilists

0=Economy +5
2=Defence +10
5=Pop. Growth +10
23=Luck +25