1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Download Latest Version

Discussion in 'Civ4 - Star Trek Mod' started by deanej, Aug 26, 2008.

  1. kiwitt

    kiwitt Road to War Modder

    Joined:
    Jan 11, 2006
    Messages:
    5,548
    Location:
    Auckland, NZ (GMT+12)
    I must say I am enjoying this mod. Not exactly sure what the optimum amount of players are on huge maps. Playing as Cadet, I played with teams (3 klingons, 2 romulans, 2 cardassians etc.)

    Some minor things I would like to change are;

    1) Experience Points should be based on the size of the opponent
    2) Radiation clouds should be able to be cleaned up by workers (albeit slowly)
    3) Buildings should have a restricted path. i.e. you can't build building 2 if you don't have building 1, etc.
    4) The scale of the units, should give a better indication of the strength of the unit.
     
  2. Tschuggi

    Tschuggi SNAFU

    Joined:
    May 8, 2010
    Messages:
    493
    Location:
    Teutonia
    some quick question: how can I turn off city growth and where can I manage my specialists?
     
  3. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    There is no manual specialist management in Star Trek due to interface constraints; you still get the free ones though (which is more than Final Frontier had). City growth is probably manually; the avoid growth button got switched to disable something else I believe.
     
  4. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    The avoid growth button should work (unless it was changed for ST).

    When it is active, the population will just not grow when it should. All food will be retained up to the amount needed to grow, anything over that is thrown away (very wasteful, don't you know there are starving children over in the Klingon Empire?). Activating it doesn't reassign any population, which is why it does not initially seem to do anything, so if you want to switch population to lower food planets to get more production or commerce you have to do it manually (it affects the population distribution for the AI when a full population reassignment happens, in the seemingly rare event that an AI has activated it, since v1.4 of FFP).
     
  5. Tschuggi

    Tschuggi SNAFU

    Joined:
    May 8, 2010
    Messages:
    493
    Location:
    Teutonia
    I do not even find it... in other mods it used to be next to automate production, there on the right box. Where is it here?
     
  6. kiwitt

    kiwitt Road to War Modder

    Joined:
    Jan 11, 2006
    Messages:
    5,548
    Location:
    Auckland, NZ (GMT+12)
    On the messages window in the middle it comes up as "dicovered" instead of "discovered" for a number of discoveries by nations.

    Also there appears to be an odds message error as well when I am attacking - see screenshots.
     
  7. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    It is at the usual location, here:
     

    Attached Files:

  8. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    In Star Trek it remained with the Final Frontier system of using it to disable the auto-assignment of population.
     
  9. kazapp

    kazapp Chieftain

    Joined:
    Apr 2, 2006
    Messages:
    1,058
    Just a suggestion - post your downloads at another site than Atomic Gamer. It makes you wait before a download starts, it contains adverts, and it features very slow dl speeds (34 minutes to download your mod).

    Why not upload to something like mediafire to provide alternatives? :)
     
  10. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Since the discarding of food that would make you grow is in the DLL, it should still do that (unless changed for ST).

    I have just looked at the ST Python code relating to population assignment a bit and I think it has some issues. Some of it is just a preference, but some of it is more serious and is likely to be having a significant adverse effect on the AI players.

    I prefer the fix FFP has to the updateHumanCityTurn Python that makes it ignore the avoid growth setting so that it is allowed to assign population points even when this is active. It is relevant mainly for two situations. The first is when the borders expand, it allows formerly unassigned population to be assigned to any newly available planets. The second is when you gain happiness so that formerly unhappy population can work. In ST (and the original FF, as I recall) they are not automatically assigned in either case if you have the avoid growth turned on - you have to do it manually or they do not work, which is just a waste of production and commerce. With the FFP adjustment those now happy people (or people with newly available planets to work) will automatically go to work on a planet that it picks. I just checked and in FFP even for the human player if avoid growth is on it prioritizes (randomly) either production or commerce for the newly assigned population, so that isn't done just for the AI like I was thinking it was. I also checked ST and this particular priority adjustment is not in there (it is a comment and two lines of code after the "Barebones Production" lines in doCityAIUpdate, so it would be around line 199 of ST's CvAI.py if it was in there).

    I also see that ST is only doing anything in updateHumanCityTurn for the human. This will tend to leave the AI with unassigned population points for various reasons. If the city loses happiness (perhaps a happy resource was plundered or there was some unhappiness from the war weariness effect, for example) and then regains the happiness, the population that was deassigned for being unhappy will not get reassigned unless there is a full reassignment (which only happens for getting nuked or captured). If the population grows, only one population point gets added to a planet - it does not do not a full reassignment for that, so if there was already a point or more unassigned from a temporary loss of happiness it will still have the same amount not working the planets. In effect, if you plunder a civs last copy of a specific happy resource you can permanently reduce the working population of any star system that was, at that time, at the happy cap or below it by less than the amount of happiness you just reduced them by. Each of those newly unhappy population points will never work for that AI player again even if they regain the happiness resource or build happy producing buildings. I also think that any population point that a city grows by that is over its happy cap will also never get assigned at any time in the future either, no matter how much more happiness they get in that city. Once it is unhappy for any reason, it looks like it will never get reassigned to a planet by anything short of being nuked (which tends to reduce the population, as well as wipe out a planet, so most of them probably won't be working after that either since they will probably be dead).

    Since the border pop code in onCultureExpansion is using updateHumanCityTurn and in ST that does nothing if the player is an AI, it will also not assign any unassigned population points (if there are any) to work the newly available planets from the cultural expansion if the player is an AI (but will do so for the human, if they do not have avoid growth turned on). They will just keep being unassigned even though there are now places for them to work, so a system with sufficient food to grow the population over the inner zone planets' total population limit before the borders pop is actually a bad thing (ideally, it would go over that limit right after the borders pop, so the new population point has a place to work), and ditto for the second border increase. It looks like this is also an effectively permanent condition since it would take a full reassignment to get them reassigned which, again, only happens when getting nuked or captured. But when getting captured the cultural borders are almost certainly only going to cover the innermost zone unless it is recapturing a system that was taken from it. So it looks like the best way for the AI to get fully productive star systems in a lot of cases is to have them captured by someone else and then recapture them...

    I'm pretty sure you should have the updateHumanCityTurn actually do its thing for any player, not just the human (in spite of the function name). Alternatively, the onCultureExpansion function could directly run AI.doCityAIUpdate(pCity) (no second parameter specified gives it the default of -1, forcing a complete reassignment of all population) instead of calling updateHumanCityTurn, and the onCityGrowth function could remove the second parameter to also force a full reassignment if it is an AI controlled city. Just making updateHumanCityTurn work for everybody is easier.

    One of the more significant AI alterations in FFP was to make sure the AI was always assigning all available population to work, up to the current limit. This improved its performance significantly and the performance cost is small (and easily worth it for the better AI).
     
  11. thadian

    thadian Kami of Awakened Dreamers

    Joined:
    Sep 27, 2006
    Messages:
    2,288
    Location:
    Indiana, USA
    too bad that romulan daughter of tasha yar is not a playable romulan, i mean she had a lot of influence in various episodes including the duras scheme.
     
  12. BSPollux

    BSPollux Chieftain

    Joined:
    Apr 7, 2006
    Messages:
    2,209
    Location:
    Germany
    I'd like to try this, but atomicgamer limits my DL speed to 5k/sec (18h download time).

    Isnt there any alternative DL available?
     
  13. jfby

    jfby Chieftain

    Joined:
    Jun 17, 2008
    Messages:
    196
    God-Emperor, these changes you are talking about is there a way to implement them now? Something of a patch that could be added to the current game?
     
  14. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,080
    Location:
    In orbit
    Wow, that's... incredibly slow.

    I'm afraid not. :dunno:
     
  15. jjake101

    jjake101 Chieftain

    Joined:
    Mar 30, 2012
    Messages:
    105

    Commander Sela?
    http://en.memory-alpha.org/wiki/Sela
     
  16. Trekkieciv

    Trekkieciv Chieftain

    Joined:
    Oct 5, 2009
    Messages:
    6
    Location:
    Usa
    Love this Mod guys is there any plans on merging or updating the MODMOD for theversions?
    I dig the turn speed and the more specialized units / buildings but not the slow turn speeds.


    Thanks for making such a great mod :goodjob:
     
  17. jfby

    jfby Chieftain

    Joined:
    Jun 17, 2008
    Messages:
    196
    How hard would this be to implement for Star Trek? I haven't played this mod in some time, but if the AI were made better I'd fire this mod right back up.
     
  18. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Pretty easy. It's just a few changes to the Python. The ST mod is actually multiple mods, so you'd need to do the same thing in each of them (except the one that is on a normal map, as I recall).

    To get almost everything I mentioned, just open up the CvFinalFrontierEvents.py file in the specific actual mod you are trying to modify (like the one in the main "Star Trek" mod - Star Trek\Assets\Python is the folder it is in for that mod), find the updateHumanCityTurn function, and replace it with this (fun with cut'n'paste, remember that the leading tabs on each line are important):
    Code:
    	def updateHumanCityTurn(self, pCity):
    		pSystem = self.getSystemAt(pCity.getX(), pCity.getY())
    		
    		printd("\n\n\nWheeeee: Checking City System at %d, %d" %(pCity.getX(), pCity.getY()))
    			
    		iMax = pSystem.getPopulationLimit(true)#pCity.getPopulation()
    		printd("Max Pop is %d" %(iMax))
    		iUnassigned = iMax
    		for iPlanetLoop in range(pSystem.getNumPlanets()):
    			iUnassigned -= pSystem.getPlanetByIndex(iPlanetLoop).getPopulation()
    			
    		printd("Population which should be assigned on cultural expansion: %d" %(iUnassigned))
    			
    		if (iUnassigned > 0):
    			AI.doCityAIUpdate(pCity, iUnassigned)
    		elif (iUnassigned < 0): # for 1.81 - if the system has "gone negative", do a full reassignment
    			AI.doCityAIUpdate(pCity)
    		elif (not pCity.isDisorder()): # post v1.81 - try to avoid starvation:
    			# If the city is not in disorder, check to see if the food produced is less than the food consumed.
    			# note: If the city has serious happiness or health issues it may do this every turn to no avail.
    			#		Especially if it is The Forge with its -1 food per city. Oh well.
    			iSurplusFood = pCity.getYieldRate(0) - (pCity.getPopulation() * gc.getDefineINT("FOOD_CONSUMPTION_PER_POPULATION"))
    			if (iSurplusFood < 0):
    				printd("updateHumanCityTurn: detected starvation in %s, net food = %d" % (pCity.getName(), iSurplusFood))
    				AI.doCityAIUpdate(pCity)
    Make a backup copy of the file first, just in case.

    This is a slightly modified version of what is in my local version of FFP (well, it is on the SVN too; it has a few things not in the current v1.81, like that last "elif" section of that code). I had to modify this from what FFP uses because ST does not have the changes to the code that were done when BUG was merged into FFP (which changes one line of code: the first one that gets the star system). I don't think I missed anything but I did not test it...

    Mostly, it just makes this function do everything in it for the AI players too and has some checks to see if it should do a full reassignment of the population.

    The only thing I mentioned before that this one change doesn't do for you is the random picking of commerce or production as the priority if growth is turned off, over in doCityAIUpdate. Getting it to keep the population assigned at all is the most important thing, making it not be as concerned with food when growth is shut off is a less important factor.

    This should help the AI some. Not necessarily a huge amount, but some. It will keep more of their population working and therefore tend to lead to them having some more production and commerce, but it won't help it make better use of that. (It may just build the wrong things faster, but it also opens up the opportunity to maybe get around to building the right things sooner. It should also give them a small increase to their research rate from the extra commerce.)
     
  19. jfby

    jfby Chieftain

    Joined:
    Jun 17, 2008
    Messages:
    196
    I haven't had a chance to try this out, but will let you know when I've had the chance... I play about in a month what I used to play in a few days haha, work and life... Anyhow thanks!
     
  20. jfby

    jfby Chieftain

    Joined:
    Jun 17, 2008
    Messages:
    196
    Still haven't had more than 10 minutes to play any game recently let alone this one, but this next weekend looks up...

    I can't remember exactly what release of Star Trek it was, 2.x or 3.x, but I remember a very challenging game in which towards the end game research wise, I had multiple civilizations more than equaling me in power and on the warpath, a very fun game indeed.

    The latest version is faster performance wise, and I do run into powerful enemies, but towards the end of the research tree there are multiple larger empires with descent fleets tech wise, but they seem to be underbuilt compared with what I've seen in the past.

    If this change will make them build more of said ships, and be more productive in general, I think it will be a big win. Again thank you very much for taking the time to put this out, it's much appreciated.
     

Share This Page