[MOD] More Naval AI

We have been testing multiplayer with 1.8 beta5 a bit. It is working nicely :)

Excellent!

I noticed that when you look at the mouseover text of the build Adept button when you don't have a Mage Build it says "Requisites: NONE".

OK. Turns out this was an easy fix. Just a missing reference to the text. Fix will be in the next version. Thanks for the report!

items should be giftable.

That is a possibility. I'll consider it.

I agree items sitting in barbarian space tagged for another Civ shouldn't be a declaration of war to pick them up (let alone picked up at all).

Picking up someone else's property without their permission is known as stealing. I admit that it is kind of weird from a real world logic perspective that you can't pick up an item that's lying around, but I think it works from a gameplay perspective so I dont have any plans to change that.

Plus, I think it would be fun to have more items available such as the other mods have, like boots of speed for example

Adding new items is easy. Just make new entries in unitinfos.xml. The trick is getting them into the game, which would require some editing of python to add them to the possible lair results. Again, not something I plan on doing, but pretty easy for someone to mod, even if they dont have any experience.
 
Freesmog: I think that taking items that are owned by other civilizations should count as a declaration of war. My issue is that currently that's the only way to change the controller of an item, making it impossible to share items between teammates.

I have been playing the scenarios and I found two additional XML issues. In the "Gift of Kylorin" scenario a popup that only says "TXT_KEY_GIFT_OF_KYLORON_TREASURE_LOCKED" appears all the time. I'm guessing that it is a typo somewhere :)

EDIT: I found the culprit. Check Assets\python\ScenarioFunctions.py

The tooltip description of the Ljosalfar world spell says: "Transforms all forests in your empire into Treant[/LINK]'s".
 
if we are talking about item gifting perhaps we should consider unit gifting as well.

Unit gifting and river commerce on ice are two things I think could be universally agreed upon to be useful for the game/mod.

For myself, I vastly prefer the addition of unit gifting (being re-added) as it is something I cannot do myself. (well, once I have a gaming computer again ...) my current laptop won't even install BTS properly >.>
 
I have coded a solution for the Illian issue. I first checked the issue from the XML side. For buildings we can only define a commerce bonus that affects all river tiles, regardless of their type. This would allow Illians to scorch the ice tiles near rivers to get additional commerce, and we don't want Illians thawing their lands on purpose :)

Terrain-wise the only solution would be to add a commerce bonus for ice tiles near rivers for all civilizations, because civilization-specific bonuses for terrain types can only be defined for a given terrain, regardless of it having a river or not.

I decided to code a small patch that adds a new XML tag to terrains, CivilizationYieldRiverChange. This allows to adjust the civilization yield changes depending on the tile having a river or not. Since I don't have the source for More Naval AI 1.8beta5, I decided to code it against the stable 1.7 version. I'm uploading a diff file that shows the changes nicely, but if you prefer I can upload all the modified files.

By the way, are you planning to release code for any of the future betas?

EDIT: I have made another patch that allows to gift items, workers and work boats only.

EDIT2: Patches removed, see my next post for an updated version.
 
I have coded a solution for the Illian issue. I first checked the issue from the XML side. For buildings we can only define a commerce bonus that affects all river tiles, regardless of their type. This would allow Illians to scorch the ice tiles near rivers to get additional commerce, and we don't want Illians thawing their lands on purpose :)

EDIT: I have made another patch that allows to gift items, workers and work boats only.

Cool. I'll have to check out your changes! Might be a few days before I get to it though.

By the way, are you planning to release code for any of the future betas?

You can always get the latest version of my code from Sourceforge. Up through revision 690 should be everything from the last beta release (I've added a couple of things since then).
 
Great to hear about that repository. It is a lot easier to work with them :)

I have updated my patches as subversion patches against the last revision of your repository. That should make reviewing them easier. Both of them can be found attached to this post. I guess that the exact types of units that can be gifted is open to discussion, so I only implemented the bare minimum.

EDIT: The Illians commerce fix patch is probably wrong. I think that I forgot to check that the tile is truly snow in the part where the yield bonus is applied. I'll upload a fixed version this evening.

EDIT2: The patch seems to be fine :)
 

Attachments

Obviously it seems the AI doesn't excel at plot upgrading (vitalizing, sun/water I, sanctify), but in addition especially later in the game my cities always grow larger, and I've noticed many Civs create workshops over farms (for example the Sheaim). Anyone else agree that these effects should be addressed?
 
/edit

I went back to the base code for reqPirateCove and went through and edited one thing at a time, testing, switching, read some python primers, apparantly my editor was not handling the tab key well, or something, i had to cut and paste a tab that was already in the file, :confused: ( a way old copy of SciTE )

I changed the blue stuff to the green stuff, allowing pirate coves to replace fishing boats, and to be placed on seafood or pearls. I did not have to make any changes to allow fishing boats to replace pirate improvements.

Spoiler :
Code:
def reqPirateCove(caster):
	pPlot = caster.plot()
	if pPlot.isWater() == False:
		return False
	if pPlot.isAdjacentToLand() == False:
		return False
	if pPlot.isCity():
		return False
	if pPlot.getOwner() != caster.getOwner():
		return False
[COLOR="DeepSkyBlue"]# 	if pPlot.getImprovementType() != -1:
# 		return False
# 	if pPlot.getBonusType(-1) != -1:
# 		return False[/COLOR]
[COLOR="Green"]	iImprovement = pPlot.getImprovementType()
	if iImprovement != -1:
		iFishingBoats = gc.getInfoTypeForString('IMPROVEMENT_FISHING_BOATS')
		if  iImprovement != iFishingBoats:
			return False
	iBonus = pPlot.getBonusType(-1)
	if iBonus != -1:
		iBonusFish = gc.getInfoTypeForString('BONUS_FISH')
		iBonusClam = gc.getInfoTypeForString('BONUS_CLAM')
		iBonusCrab = gc.getInfoTypeForString('BONUS_CRAB')
		iBonusPearl = gc.getInfoTypeForString('BONUS_PEARL')
		if iBonus != iBonusFish and iBonus != iBonusClam and iBonus != iBonusCrab and iBonus != iBonusPearl:
			return False[/COLOR]
	iPirateCove = gc.getInfoTypeForString('IMPROVEMENT_PIRATE_COVE')
	iPirateHarbor = gc.getInfoTypeForString('IMPROVEMENT_PIRATE_HARBOR')
	iPiratePort = gc.getInfoTypeForString('IMPROVEMENT_PIRATE_PORT')
	iX = caster.getX()
	iY = caster.getY()
	for iiX in range(iX-2, iX+3, 1):
		for iiY in range(iY-2, iY+3, 1):
			pPlot = CyMap().plot(iiX,iiY)
			if not pPlot.isNone():
				iImprovement = pPlot.getImprovementType()
				if iImprovement == iPirateCove:
					return False
				if iImprovement == iPirateHarbor:
					return False
				if iImprovement == iPiratePort:
					return False
	return True
 
Tholal, i'm curious why did you make the barbs show up much later than before?


- FreeTacos, why do you want Pirate coves on fishes: they are already too good!
 
1.8beta5

Python Exception: see attached save. Move Scout 1 tile northwest of Goblin Fort and hit enter. Sorry, my Print Screen key is not functioning.

You bug replication directions are a little confusing. The scout starts 1 spot east of the fort, and cannot move to the NW of it in one turn due to terrain. I tried moving N of it, NE of it, SW of it. I played several turns with several different variations and never saw a python error. Do you remember what it said?
 
I have updated my patches as subversion patches against the last revision of your repository.

I'm not familiar with editing files this way and actually find it a little awkward. Can you just send me your edited files so I can do the compare myself? I usually use Beyond Compare when doing merges so that I can easily spot where in the code the differences are and just copy over the relevant parts with a couple of button clicks.
 
No problem :)

Patches work more or less the same, but they are integrated directly with Subversion/TortoiseSVN.
 

Attachments

Obviously it seems the AI doesn't excel at plot upgrading (vitalizing, sun/water I, sanctify), but in addition especially later in the game my cities always grow larger, and I've noticed many Civs create workshops over farms (for example the Sheaim). Anyone else agree that these effects should be addressed?

I think the problem lies with the automated workers, I believe that as the AI cities change their focus, they change the improvements.
 
Back
Top Bottom