Celtic Mod Beta Release

I downloaded and ran autoplay (if you enable the debuggning features in Civilization.ini you can actually watch the autoplay, not merely wait until the Civ has spawned and then look at the result in the World Builder) until the game crashed at turn #110 or so.

I wouldn't know what causes it but I don't think you can rule out Python either, because the C++ in the DLL communicates with the Python stuff, and if the game engine gets bad results from Python that might well cause a crash. (Rhye has actually commented on C++ exceptions in his Python code.)

One thing I notice going through your files is that the text formatting hasn't carried over all that well from Mac. The paragraph character (usually invisible) is shown as a square in Notepad for instance, revealing exactly where you've copy-pasted in more than one line of code at once... I guess it works nonetheless (depending on whether the game can read it proper) but its hard to see if indentation is right, for instance. (And if the game isn't reading it right, that could be your problem right there.)

So, you could just paste in stuff one line at a time, but you can't use Enter to create a new paragraph... I think you need to use encoding that works on both platforms (Unicode or something like that) but I'm no expert.

This is also prevalent in Barbs.py, where city spawns appear to be all on the same line and the like. If the game isn't reading the code right (as separate lines of code) its no wonder the Carthaginian cities aren't showing up.

Also, I've noticed you refined the first UHV and while I'm somewhat impressed of how simply you pulled it off, you should probably know that the code also allows for the Celtic player to found a city in the specified area. (I'm guessing its the tiles adjacent to Rome's tile.) So if Rome gets raized (by the Celts or by anyone else) the Celtic player could still get the UHV by resettling the area.

There are other ways to do it if you don't like this outcome. Right now you maybe shouldn't try and do any Python of you own, since its a bit hard to debug stuff with all the crashes and all.

About the second UHV being zeroed at the first turn, I believe it has to do with line #681 in Victory.py. Change it to:
Code:
                                if (iGameTurn [COLOR="Red"]=[/COLOR]= i200AD):
This will make the UHV become achieved on turn #154 and not before this (regardless of how many cities the Celts have in the British Isles). Only then will it go 0 (zero) if the condition isn't met.

I'll look further to see if I can spot any irregularities in the Python files.
 
Furthermore, I noticed this bit of code in RiseAndFall.py (#757-758) that maybe shouldn't be there:
Code:
                if (iGameTurn == [COLOR="Red"]con.i400BC[/COLOR]):
                        self.giveEarlyColonists(iCeltia)
This is (was) the code that activates the Carthaginian free colonists (for the AI) and should actually provide the Celts with a free Galley containing a Settler and a Archer. If you change the date into a game turn (integer value) you could choose when this will occur. Otherwise you could delete or comment out those lines.

By the way, do you really want the Celts to get all those naval units once they spawn?

Line #352 in CvRFCEventHandler.py is commented out:
Code:
                    [COLOR="Red"]#[/COLOR]iOwner == con.iCeltia or \
It seems that it needs to be active for the third UHV to work!

This concludes my quick run-through of the Python files that have been changed. Not much more I can do, as it seems. I'll try and see what the game makes of my own changes (mostly commented out lines of code and reformatting of the copy-paste stuff). I'll also try and use the Consts.py file I posted earlier.

edit: Still no luck - game crashed at turn #98. No Python errors to be found.
 
I've found new problems with Victory.py (lines #879-883) concerning the second Arabian UHV. I've commented out those lines for now, but they will have to be rebuilt eventually to make the Arabian UHV work.

The problem is, of course, that you've simply replaced stuff without knowing what it will result in. I've also noticed that you've pretty much broken a potential 600AD start for your mod, but I'm guessing that's a non-issue.
 
In addition you've managed to create a bug on line #731 in Victory.py by deleting that reference to the Carthaginian area (Roman UHV).

I expect there to be more of this stuff...
 
I actually have some good news. :king:

I disabled all the spawns in Barbs.py - and no more crashes. I can run autoplay all through the middle-ages with no problems (after I commented out all that code in Victory.py...)

This makes me think that its not the Celts but rather the Carthaginians that are the root of your problem. Since I also disabled them from spawning cities - they're no longer a "major Civ" and thus have no regular spawn date, no Core Area or the like.

I'm not sure how you would go about making Carthage work as you intend, but you may very well have go back and edit the SDK. How did Rhye make the Celts work? Maybe you just have to change the turn they become "activated" or something? (It wouldn't be advisable to have them spawn cities or units or anything before they "exist".)

I'll try some more and see if I'm right about the Carthaginians.

On a related note its really not helpful if you add spawns and edit UHVs and whatnot at this point, as it makes the debugging even harder. No one except you knows what exactly you have done!

As for the autoplay I was running, there was some peculiar (but not necessarily bad) AI Celtic behavior. First of all, there was only one city (Bordeux, the capital). This may have been because I activated the War-On-Spawn function that you've never even touched (by using my own version of Consts.py). I don't know if it was because of there was no Barbarian spawns in the game, but the Celts actually survived all through the French spawn. The Celts took Paris two times (once before France flipped and once after) exiling the French from the game. Only after this did the Celts build/conquer another cities. But no colonizing the British Isles.

As it happened, the Romans were defeated by the Greeks, making the eastern Mediterranean a Greek Empire, while the Celts were by this time France. The proper French Civ did however respawn on turn #285 causing the Celts to collapse on turn #288 (1585AD!). (Had they had enough cities on Ireland they would have survived - at least for a while longer.)

I'll run some more autoplay as I enable some of the Barbs.py stuff again. I'll save Carthage to last to verify that the problem really is emanating from there.

We'll get there yet! :goodjob:
 

Attachments

  • Civ4ScreenShot0043.JPG
    Civ4ScreenShot0043.JPG
    280 KB · Views: 67
  • Civ4ScreenShot0044.JPG
    Civ4ScreenShot0044.JPG
    299.5 KB · Views: 71
Hm, I actually wanted the british UHV to register as achieved the turn it was done.

The Carthaginian cities weren't coming up because they had been commented in Barbs. Once I fixed that, up they came.

I'll have to try and fix the text formatting with a different program.

Honestly, at this point I don't mind them having the boats. Putting in a line to give them similar boat+settler was my original intention, but according to my testing, they won't settle on the british isles even if I put the settlers right there, and I don't know why (I've changed all the maps to make them *want* to do this, and they still don't)

All three UHVs work for me, even with that commented line. I'll have to look into the Arabian one. Line 731 was coming back as an exception for me, that's why I had to take it out until I could find a way around it. And you are correct, there's no need for a 600AD start with this mod, one can use Rhye's original for that.

Much thanks for the continued help. I'm off for now but will be back in a few hours. Since you can see the problems with the line breaks is it a big job to straighten them out on a pc or should I try to track down a python editing program for that (I think there's one on my Parallels XP)?
 
Another autoplay session completed all through the Celt's lifespan. :king:

I've enabled both the Barbarian spawns, the Independent cities and the Celtic city spawns in the British Isles. It all seems to work alright, but I haven't double checked if every single one actually did spawn. It should be noted that cities won't spawn inside any cultural area, and this is why one can't have a Celtic city spawn inside the Celtic cultural area either. Also, no foreign units can be adjacent the tile or the city won't spawn. So the results will vary between games.

The Celts managed to survive both the Roman, the French and the British spawns. They did however only seem to be at war with the Romans once that Civ spawns, but that's determined randomly in every game session. (I've logged the Celts as potential enemies of all the Western European Civs, with an elevated risk for war with the Romans, the French and the English. These settings can of course be changed.)

The Celts only collapsed in 1140AD because of simply too many cities lost due to secessions (but also conquest). See screen shots below.
 

Attachments

  • Civ4ScreenShot0045.JPG
    Civ4ScreenShot0045.JPG
    271.5 KB · Views: 55
  • Civ4ScreenShot0048.JPG
    Civ4ScreenShot0048.JPG
    271.5 KB · Views: 64
  • Civ4ScreenShot0049.JPG
    Civ4ScreenShot0049.JPG
    269.2 KB · Views: 67
  • Civ4ScreenShot0050.JPG
    Civ4ScreenShot0050.JPG
    258.4 KB · Views: 64
  • Civ4ScreenShot0051.JPG
    Civ4ScreenShot0051.JPG
    261.5 KB · Views: 56
  • Civ4ScreenShot0052.JPG
    Civ4ScreenShot0052.JPG
    167.5 KB · Views: 86
I can confirm that it really is the Carthaginian city spawns that are indirect cause of the instability. It doesn't seem to be the cities themselves but rather something to do with the Carthaginian Civ itself, as it has taken the place of the former minor Civ the Celts. The fact remains: if Carthage is in play the game will eventually crash - why exactly is anyones guess.

My best guess would be, though, that you have simply given the Carthaginians all the settings and dates and whatnot of the former Celts, and this is causing a conflict somewhere, at some juncture. (It seems to vary between sessions.) It could be as simple as the Celts (now the Carthaginians) having a starting date somewhere in the compiled C++ code, and that "activating" the Civ by giving them cities before this date will eventually lead to problems. It shouldn't be hard to fix, or so I hope.

So, don't bother with any of the Python stuff for now. I'll get to work setting up the coordinates for all the areas you defined earlier, and fixing all the issues with the various UHVs. Then I'll post my versions of all the files involved for further testing. Carthage will have to be represented by Independents for now, but once you clear that stuff up at your end we can go forward with some actual new Python code.
 
hm, looking at your screenshots reminds me that I have to move the "700" location for London one tile to the right so it has access to the sea (I extended Britian one square east in that area).

Could it be because I have the Carths enabled as a non-minor, non-playable civ?

Did you have to fix the line breaks to make those files work or was that a non-issue?
 
Well, I would like to confirm Baldyrs statement that indeed the catrrhaginians are causing the crashes, I erased all their cities once they spawned, and with them destroyed, my game is still going.

One minor yet silly bug, you accidentally placed a hit single resource in England, the resource looks like wheat, it is in a forest tile 1 south of the iron in scotland. You might want to fix that.

Also, the religions are working better, judaism in jerusalem, Indians founded their religions, although egypt founded confucianism and taoism.

One more thing, When Rome declared war on me, I decided to take my huge stack and attack Rome. I conquered the city, and although they eventually took it back, I did hurt them. I think that this is why Rome never was able to found Christianity, instead it was founded in Lutetium. I believe this is Rhyes own work, to have christianity founded in Europe at 1 AD. Now this is the problem I can guess would happen, if it were not for me capturing and defending the city against barb waves, they surely would have razed the city, spelling and end to Christianity. Maybe once the Carthage issue was fixed, you should consider how you could balance Romes ability to found Christianity or even make it so Barbarians cant raze the holy city.
 
I am sooooo glad we managed to figure out the problems. I'm going to make the Carths minor again and see if that alleviates the problem...that's the one thing about them that isn't the same as it was set for the Celts.

As for Christianity, I think I saw in the code that Christianity defaults to Jerusalem.

The hit singles were on purpose. They're in the vicinity of Liverpool and represent Beatlemania, but I'm assuming you mean that they're available in ancient times as well. I'll take it back out.

Now, in a prior version I had downloaded a patch on civfanatics that allowed for the reassignment of a holy city in the case the previous one was razed. I must have lost that patch when I scrapped everything and started from scratch. Anybody have a link for me to reinstall it? I haven't been able to find it since...
 
Ok, I've attached all the fixed Python files. I suggest you, antaine, use these as you go forward, as I believe I've found all of the Python bugs mentioned in this thread (and then some). If you make changes to Python files (and you will), be mindful of the paragraphing compatibility issues!

The different Celtic areas are now defined and I also took the liberty of deleting some of the additional tiles from the French Core Area in order to avoid a patchwork spawn area. All and any spawn areas can still be adjusted as mentioned previously.

Also, the city spawns made by you didn't include any units to defend the cities, so they were subject to invasions and secessions because of this. So I added some units. Also you might wanna take a look at city size's and the like.

The only issue I'm aware of with these edited files is that Carthage doesn't spawn and that the three cities that do spawn are Independents instead. This is of course only temporary until you can figure out how to get Carthage online proper. Also, the Arab UHV (the conquest themed one) is only temporarily fixed as the Arabs can't vassallize a minor nation. (They have to conquer the Carthaginian areas for now.)

Anyone who has installed antaines latest set of files can of course use my attached files to replace the buggy Python files contained in that release. I wanna remind everyone that this is only a temporary fix until antaine includes the changes in his next release.
 

Attachments

  • Python.zip
    134.8 KB · Views: 53
I'm going to make the Carths minor again and see if that alleviates the problem...that's the one thing about them that isn't the same as it was set for the Celts.
Yeah, sure, but the problem is likely the fact that you haven't adjusted the old settings. You need to think beyond simple search and change of names!

Look for anything to do with activating the former Celts (now Carthagians) and change the game turn to reflect the Carthaginians instead of the Celts. It could be as simple as that, but I wouldn't know since I'm yet to dabble with the C++ stuff myself.
 
alright, I think making the Carths minor has solved the problem. I've just had two successful tests to the vikings with my original files and no crash. I don't think the line breaks were the problem, but I will be more mindful of them in the future.

I do really want to get that patch that reassigns the holy city, however. I'd also like to know why the Celts refuse to settle on the Isles even when you give them settlers there...
 
I'm not sure what settings I might have missed...I checked the files when I did the original mod for every instance of Carthage and Celtia. Now that they're minor again, their settings are literally the same as the Celts' original ones were.

Anywho, I need to re-enable the Carthaginians in your corrected files and change the city spawn dates.
 
Could you post the file(s) you changed in order to make the Carthaginians working?

It could very well be that you simply can't have non-playable non-minor Civs in RFC. :confused:

As you seem to be on the right track now I could start work on any additional Python you'd like to add. We've mentioned UHVs for example. If you define these as precisely you can I might just be able to pull a fast one and code those for you. :king:

Also, I'm not very happy with spawning cities for the human player (the British ones) but I can always mod those out for myself if I wanna play the modmod. I do however suggest that you let those be for the AI only and let the human player do his or her colonization the hard way.

Instead, the human player could get random Settler spawns in the southwest parts of Britain and in the south of Eire. These could be made random so that they don't become an exploit, and that way they don't add up to the UHV either. (Plus that they could start late-ish so you still need to ferry over your own Settlers.)

It should be noted that no more Settlers will spawn on the shores as soon as the player uses the Settlers he's already gotten, because of the present culture will then prevent any further spawns.

Just an idea that would make things less scripted and perhaps even more interesting, as there is a real random element to it. If you go for the UHV you wouldn't even see any of these spawns, but if you don't or fail you'll still have some sort of presence outside of France once that Civ spawns. (The human player isn't subject to collapses caused by loosing cities either.)

If you like I could give it a try and let you (and others) check it out for yourself. I was also thinking about adding a message announcing the arrival of the settlers. This way it becomes more of an "random event" and won't break the inner logic of the scenario as much.

Still another approach could be to spawn independent (and maybe Viking) cities on the isles and then have sort of a second Celtic "spawn" happen on Ireland or thereabouts. No solution is really completely off the table, its merely a matter of figuring out how to achieve the desired effect. And this would be the challenge I was looking for. :king:
 
The only thing I did to make the Carthaginians more active was to toggle "Minor Civ = 1" to "0" in the WBSave. Since I put it back to "1," even with my original files, no crashing. I just had to comment out the parts of the Arabian UHV that required vassalizing Carthage.

Now, my big question, why don't the Celts settle the Isles even with free settlers? I'm going to plug in your new TL/BR coordinates for them and test that one next.
 
I'm going to plug in your new TL/BR coordinates for them and test that one next.
I'd strongly suggest you use my files instead, and work your future changes into them. Your files were full of bugs and stuff. I'm not gonna delouse them again...

Plus I've already fixed all the UHV issues for the Celts, Romans and Arabs. You don't even need to bother about that anymore. Everything should work exactly as you wished.

Because if you don't I won't use your files myself, and then it all becomes just one big mess...

Just because your files aren't crashing anymore doesn't mean that you or anyone else should use them, as they will cause other issues. If you build up from my work you should be good.
 
Yeah, I'd love to take out the city spawns, but I think even if we go through the trouble of setting up independent cities and give the celts units to attack them they won't. According to the core/normal areas, settlers maps, and war maps, they should want to settle there more than in France!

And I'll use your files instead, but I'll give the Carthaginian cities back to them now that I know it's the minor/major status and not the cities themselves that are the problem.
 
Yeah, I'd love to take out the city spawns, but I think even if we go through the trouble of setting up independent cities and give the celts units to attack them they won't. According to the core/normal areas, settlers maps, and war maps, they should want to settle there more than in France!
No, I'm talking about letting the Celtic Normal Area (Ireland) become a second spawn area at some predefined turn. It would work just like the Civ respawned without it having to be destroyed first. I could probably just reuse some code from the resurrections Python to make that happen. It would require some testing though...

If we go that route I believe that a "second spawn area" would equate to a new Celtic UP. Because that is something that no other Civs has. :eek: Call it "Power of the Green Isle" if you like. ;)

Also, I'm not sure about why you only want the Celts to begin in the Bordeux area, but I guess its a design choice. I would probably give them a spawn area that spans all the way to the Black Sea... So that city in Northern Italy that flips to the Romans would in fact be a Celtic city once they spawn, giving the Celtic player the option of opposing the spawn. The capitol could be in the Alps (the Hallstatt region), but Barbarian spawns might make it move around a bit.

As I've said on numerous occasions, the Core Area and the Normal Area can be defined more exactly than just have them as simple rectangles. Sure, its more work but its very possible.

As for scripting the AI to use units in a certain way I believe that you can forget about it altogether. I've put in many, many hours of work into stuff like that and it hasn't resulted in anything useful for me. If you need the AI to build cities on command you pretty much need to spawn cities...
 
Top Bottom