BTS Unaltered Gameplay Project

Status
Not open for further replies.
Alt-O is taken "ALT+O = Change perspective". What was wrong with Alt-J :rolleyes:

O as in Options, and in civ ctrl and alt with the same letter/action are usually related. That's my only reason, but since Alt-O is taken (wow that looks bizarre!), I withdraw my statement.

Is that info available on some other screen? If not, then it is additional info.

Yes, on the graph (demographics) screen, you can see the power of civs with whom you have enough espionage points. While you can't see the actual number, it's a graph and so you can get close. We could normalize it, meaning show % of your score, but that's basically the same thing.

Better I think would be to show the ranking -- #1 #2 #3, etc. -- rather than the power number. That assumes the AI's only take rank into consideration.

I would also like to include an alert when a AI goes "we have enough on our hands already" - this is an indication that the AI is going to war.

Yes! I thought of this the other day and forgot about it. Thanks. It would make a great alert. The information is probably semi-available. You should certainly be able to check if they'll trade "go to war...", but I don't know what kind of answer the API gives you -- probably just "no".

Code:
BOOL canTradeItem(PlayerType eWhoTo, TradeData item, BOOL bTestDenial)

However, maybe you can get the reason as a string some other way. I don't see it, though. You could at least have an alert to tell you when one AI will agree to a war with another, or revokes the ability. That's not exactly what you wanted, but it's still something.
 
I spoke too soon. It looks like the reason is available on CyPlayer:

Code:
DenialType getTradeDenial(PlayerType eWhoTo, TradeData item)

DenialType has value DENIAL_TOO_MUCH which sounds promising.

To do this, you'd have to check each AI against some other AI on each onBeginGameTurn. So far, whenever I see an AI that has too much on its hands, it says the same thing for a war against every other AI, so you shouldn't have to check them all.
 
Great - that sounds like something we should add to civlerts. Maybe with a special pop-up box option. Normally civlerts puts the alerts into the info pane but that gets boring having to scroll thru them. We might want to add the option to have the alerts come up as dialog boxes. In this way, alerts could be 1 of 3 states (OFF, Info, Dialog).
 
I looked over ConfigObj and your use of it in RuffModControl. It doesn't go back to the file after reading it once, so it should be very fast setting/retrieving options. Given that, I'm inclined to start with that as a base.

What I've done so far is create a wrapper class (Facade in Design Patterns terms) around RuffModControl, just as RuffModControl wraps ConfigObj. Each facade will group access to related options. Here's the one for the scoreboard options.

Code:
class BugScoreOptions(BugOptions):

	def isHideDeadCivs(self):
		return self.config.get_boolean('Dead Civ Scoreboard Mod', 'Hide Dead Civilizations', False)

	def isShowDeadTag(self):
		return self.config.get_boolean('Dead Civ Scoreboard Mod', 'Show Dead Tag', False)

	def isGreyOutDeadCivs(self):
		return self.config.get_boolean('Dead Civ Scoreboard Mod', 'Grey Out Dead Civilizations', False)
	

	def isShowPower(self):
		return self.config.get_boolean('Scoreboard', 'Power', False)
	

	def isShowAttitude(self):
		return self.config.get_boolean('Attitude', 'Enabled', False)
	

	def getShowNameEnum(self):
		"""0 = Leader, 1 = Civ, 2 = Both"""
		return self.config.get_int('Dead Civ Scoreboard Mod', 'Show Name', 1)

	def isShowLeaderName(self):
		return self.getShowNameEnum() != 1

	def isShowCivName(self):
		return self.getShowNameEnum() != 0

	def isShowBothNames(self):
		return self.getShowNameEnum() == 2

Then to use it, CvMainInterface does things like

Code:
import BugScoreOptions
BugScore = BugScoreOptions.BugScoreOptions()

...

if (BugScore.isShowAttitude()):
    ...

If later we decide to replace how we store options, the facades won't change and thus CvMainInterface won't have to be changed.

Did any of you have some other idea in mind? If not, we could start adding together the mods we want using this scheme.

The next task for me is to make the options screen itself more easily extensible, but Ruff's done a good job with it, and I don't want to duplicate effort that works. My main idea is to break out the different tabs into separate classes (and thus modules) so they're easier to edit by multiple people.
 
Oh yeah, I added a feature to Raw Commerce so you can toggle between it and Raw Production on the city screen. The only sticky point is the production multiplier.

The only Commerce multiplier in the epic game is 50% for Capital under Bureaucracy. If you are running that civic, your capiltal always gets that modifier.

Production is different. Specifically, some units and buildings receive modifiers depending on your leader traits and civics. What this means is that the total modifier for any given city depends on what you're building.

What I have so far ignores those extra modifiers, since I'm trying to show "Raw Production," meaning what you'll get no matter what you build. This means that the total may differ from that shown in the production bar. Will this be too confusing?

Code:
            25 [-------102/120--------]

Plots:                13
Specialists:           2
Buildings:             2
Total:       17 + 4 = 22    ( != 25 b/c +25% for building under religion not included)

In the case above, you're building a building, running OR, and have the state religion in that city. The city also has a forge. Thus, you get a +25% for the forge and a +25% for OR. The "Total" line excludes the OR bonus b/c it depends on what you build. I can include it, but that makes the values difficult to compare between cities.

Here is the latest version of it so you can try it out yourself. See if you can figure out how to switch views. I'm hoping it's obvious. I may need to reverse the button.
 
Any thoughts on releasing split-out versions of the various mods we port to BtS? For example, YAGCM will require a lot of work as much of it is included in BtS already. Do we release a BtS version of YAGCM separate from BUG?

I'm inclined to say no simply because of the extra work involved. If someone wants to extract it from our code, they're welcome to do that. As long as we mark the sections with comments consistently, it shouldn't be too hard.
 
I looked over ConfigObj and your use of it in RuffModControl. It doesn't go back to the file after reading it once, so it should be very fast setting/retrieving options. Given that, I'm inclined to start with that as a base.
If it doesn't re-read the ini file, how do any of the alt-j (option screen) changes that get written to the ini file get back to the game?
What I've done so far is create a wrapper class (Facade in Design Patterns terms) around RuffModControl, just as RuffModControl wraps ConfigObj. Each facade will group access to related options. Here's the one for the scoreboard options.
That is simply beautiful! Very elegant. I guess you get paid the big bucks for these types of ideas. Me - I'm just a hack.

Oh yeah, I added a feature to Raw Commerce so you can toggle between it and Raw Production on the city screen.
I sometimes wonder why I want to know raw commerce as it depends upon the tiles currently being worked. Ditto with raw production. What I would like to know is how to look at a group of 21 tiles and think GP Farm, Production powerhouse or commerce. If we can add a raw production column to the F1 screen, I will be happy (help me decide where to put the production multipliers).

Any thoughts on releasing split-out versions of the various mods we port to BtS? For example, YAGCM will require a lot of work as much of it is included in BtS already. Do we release a BtS version of YAGCM separate from BUG?
I say NO - lets minimize the work we have to do and let the smuck that wants this stand alone feature do their own laundry.
 
Haven't had a change to look at what you upload today yet, but will look at it now.

As for releasing the different mods on their own, I think that would be biting off more then we can chew for now. I'm sure someone will use BUGS and want to change something about an individual mod, and will put it out anyway. With the naming scheme we decided on, it should be fairly easy for people to pull out the mods they want.

Let me take a look at what you put together so far. We really need to figure out some sort of task system guys, so we're not all adding the same things.

And what have we decided on the PLE additions? There are a few that I find are critical. Anyway, going to take a look at what EF has put together so far.
 
Let me take a look at what you put together so far. We really need to figure out some sort of task system guys, so we're not all adding the same things.
Well - that is easy for me. I am currently doing NUTTIN because I don't have BtS. Ok, I am doing something - throwing in ideas.

And what have we decided on the PLE additions? There are a few that I find are critical. Anyway, going to take a look at what EF has put together so far.
I like the 'highlight unit with promotions available' and 'unit actions'. I would also like to be able to highlight units that are injured (easy to see when really injured, harder to see if only slightly injured), but apart from that, I can live without the other PLE items.

On the other hand, highlight movement range might be nice.
 
Just took a look at it... Beautiful! I think we have it.:)

The only thing I think we should do is expand the menu options. Instead of just having one MOD to pick, can we have multiple ones? An example would be using CivAlerts or ShowInfo, instead of having both. Or being able to choose your advisor. You seem to like the Special Domestic Advisor, while I like the Custom Domestic Advisor. This way we won't have to pick and choose which mods are added, but can add them all and let the player choose.

Any news on getting the subforum?
 
If it doesn't re-read the ini file, how do any of the alt-j (option screen) changes that get written to the ini file get back to the game?

ConfigObj holds all of the INI file's values in a dictionary in memory. When you change an option, that dictionary is changed. When you close the options screen, the dictionary is written to the INI file. This is very efficient.

That is simply beautiful! Very elegant. I guess you get paid the big bucks for these types of ideas. Me - I'm just a hack.

:blush: Thanks! Hack or not, you essentially did the same thing by wrapping ConfigObj with RuffModControl. Give yourself some credit, too!

I sometimes wonder why I want to know raw commerce as it depends upon the tiles currently being worked.

It helps me to see the breakdown to decide whether or not a harbor is useful yet, for example. Or how much I'll lose by switching out of Bureauracracy.

Ditto with raw production.

For production, I'm always wanting to know what the base production is (ignoring chops and overflow) to determine whether or not it's worth it to build a forge/factory yet.

What I would like to know is how to look at a group of 21 tiles and think GP Farm, Production powerhouse or commerce. If we can add a raw production column to the F1 screen, I will be happy (help me decide where to put the production multipliers).

These civ-wide decisions are best done in the DomAdv as you say. SpecDomAdv had a base production column you can turn on, and we'll definitely want to include it. HoF mod is released for BtS, and they punted on SpecDomAdv for now, likely because it's going to take the most work to port to BtS.

I'm definitely in agreement about not releasing separate updated mods. Since I'm new to the mod community, I wanted your guys' take on it to make sure we don't step on toes. I'm very glad to hear it's cool to leave it to others. :)
 
The only thing I think we should do is expand the menu options. Instead of just having one MOD to pick, can we have multiple ones? An example would be using CivAlerts or ShowInfo, instead of having both. Or being able to choose your advisor. You seem to like the Special Domestic Advisor, while I like the Custom Domestic Advisor. This way we won't have to pick and choose which mods are added, but can add them all and let the player choose.
Agreed.

Any news on getting the subforum?
No. Have sent follow up PMs to moderators and told to give thunderfall a week-ish to respond. I will look a bit more at the other sub-forums and make some suggestions on the threads we start / sticky.
 
ConfigObj holds all of the INI file's values in a dictionary in memory. When you change an option, that dictionary is changed. When you close the options screen, the dictionary is written to the INI file. This is very efficient.
Sure - no prob with that. However, when maininterface wants an ruffmodoption after exiting the option screen, does it know that the ini file has changed? I thought that you implied that it kept all of that stuff in memory.

:blush: Thanks! Hack or not, you essentially did the same thing by wrapping ConfigObj with RuffModControl. Give yourself some credit, too!
Hey - I stole it from the HOF guys and wasn't 100% sure what it was actually doing. It worked so that was good enough for me.
 
The only thing I think we should do is expand the menu options.

Agreed. Keep in mind that I lifted the option screen straight from Ruff's mod and haven't changed anything in it yet. I just wanted to verify that I could still change the options and see the results. Some of course require refreshing the screen (open a city screen, close it to see any scoreboard changes). I think I can find a simple workaround for that so the user sees the changes immediately.

Any news on getting the subforum?

News to me, so I hope you weren't asking me. ;) That would be very handy!
 
However, when maininterface wants an ruffmodoption after exiting the option screen, does it know that the ini file has changed?

The new options are in memory. The problem is that the screen doesn't know to redraw itself. I can add a workaround as I did for the Commerce/Production toggle button. Basically, if any MainInterface options change, the screen will be forced to redraw when the options screen closes. Hackish, but maybe I can make it less so. :)

Since the MainInterface is the only screen that can be open when the options screen is brought up (because it's always open), only this screen needs to be told to redraw.

Hey - I stole it from the HOF guys and wasn't 100% sure what it was actually doing.

Fair enough. You did a great job packaging all that stuff together. I'm curious, what is your previous programming experience? I can't imagine jumping in to Python in this context without my background. It's hard enough trying to figure out what the Firaxis code is doing, let alone code written by many different people of varying skillsets.
 
I have ported Not Just Another Game Clock. This makes the list of complete (minus cleanup of options) ports:

  • NJAGC
  • Dead Civs on Scoreboard
  • Attitude Icons
  • Power Score
  • Better Espionage Screen List
  • Raw Commerce
  • Civ4lerts and More Civ4lerts
  • Reminders
Next up: AutoLogger?
 
I'd also like to fix the Foreign Advisor's Glance page, add page up/down buttons to its Tech and Resource pages, and add the little additions on the Info page that I had put into Ruff's mod (shows and * when you have same religion and/or favorite civic of other civs).

The bug happens whenever you play a map with setup civs and pick any but the first civ. It draws the rows and columns incorrectly, making it impossible to see the attitude of the first civ and the attitudes of the other civs toward the first civ. This isn't really mod territory, but since it's a bug in a mod they incorporated, I figure what the heck. As long as I'm adding a minimod to it (page up/down, extra info), might as well fix a bug!
 
I hate to sound like an idiot here, but would it be to much work to give me an overview of how to add mod options to the BUG Options menu? Remember, I'm not a coder really. If you can give me some before and after snippets I can probably figure it out though.

OR, I could add the MODs and let you guys put the options in... but I'd rather be able to do it myself.

And we really need some kind of file repository guys... CVS or Source Forge? edit - Alright, so I registered on Source Forge, just because I know that better. I'm setting up the project, and want to just set the Unix name as civ4bug. (bug is taken) Is that cool with you guys? Also, I'm going to put it under GNU... is everyone okay with that?
 
civ4bug is fine with me. Thanks for taking care of that. Here is the latest so far.

I have yet to make the changes I'd like to the options screen itself, so if you're okay with changing options through the INI file for now, I can describe here how to use BugOptions.

Each logical group of options go into a single BugOptionsFoo file, similar to grouping items into [sections] in an INI file. So far I have

  • BugNJAGCOptions
  • BugCityScreenOptions
  • BugScoreOptions
Take one of those files and make a copy. Rename as you like (BugFooOptions.py) and make sure to change the "class BugFooOptions" line.

Remove all the existing functions from the class and add the ones you want. My convention is that boolean options start with "is" and others start with "get".

Then to use the options, import the module into your mod file and create an options object.

Code:
# MyMod.py

import BugFooOptions

BugFoo = BugFooOptions.BugFooOptions()

... later in your code ...

if (BugFoo.isSomeOptionEnabled()):
    ...

I've been dropping the Options for the name of the object to keep it different from the module name and to shorten the code where you use it.

Finally, add the values to the INI file. If you're unfamiliar with INI files, ask and I'll describe them. Google should be able to give you the score as well as they're pretty standard.
 
Status
Not open for further replies.
Back
Top Bottom