Announcement

Collapse
No announcement yet.

"Public works"? Is this possible?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Public works"? Is this possible?

    Well, not really, but something like that. I liked the Public works system in CtP, was a great idea to reduce MM. And it's the reduction of MM that i have in mind here, not cloning the CtP PW system.

    Soo...how did it work in CtP.
    In an empire management screen you set a PW slider, much like the research slider in Civ4, the PW slider assigned a % of your production to the public works pool. The public works pool was essentially a stackable resource, like gold. These PW points were used instead of workers to build tile improvements. You'd select a tile, and you could select an item from a list of available improvements. It would cost some amount of PW points and a couple of turns to finish the improvement.

    Now this had some gameplay advantages, like not having to move around single workers, but it also had a UI advantage. To build an improvement anywhere, you simply selected the tile and build it. No need to find a free worker or diverting one them from its current job.

    So...how could something like this work in Civ4? First off, i don't think a full PW system is even posisble without the SDK, so i won't even bother going there. But i think a UI improvement is possible however, which wouldn't require any AI changes, only worker automation changes.

    Here's the idea:
    1. Allow tiles (or plots?) to be selected. When selected a list of available tile improvements is shown in the interface below (similar to that of a worker, without the move/sleep/automate/etc orders)
    2. Selecting one of these improvements will add it to some list.
    3. The worker automation algorithm is altered so that improvements on the list will be given priority over other improvements.

    A new type of worker automation would also be added that only builds improvements on the list, and nothing else.

    There are still be many details that have to be worked out, mostly for the automation algorithm and how the list is maintained. But what i'd like to know now, is this possible with the python scripts?
    I think the most crucial things are the following:
    Can tiles be made selectable?
    Is the worker automation algorithm implemented in the python scripts or in the SDK?
    <Kassiopeia> you don't keep the virgins in your lair at a sodomising distance from your beasts or male prisoners. If you devirginised them yourself, though, that's another story. If they devirginised each other, then, I hope you had that webcam running.
    Play Bumps! No, wait, play Slings!

  • #2
    Looking through the python scripts i found two files that might be relevant..

    Python/EntryPoints/CvGameInterface.py
    Code:
    def AI_unitUpdate(argsList):
    	'AI moves units - return 0 to let AI handle it, return 1 to say that the move is handled in python '
    	#CvUtil.pyPrint( "CvGameInterface.AI_unitUpdate" )
    	return gameUtils().AI_unitUpdate(argsList)
    and Python/CvGameUtils.py
    Code:
    	def AI_unitUpdate(self,argsList):
    		pUnit = argsList[0]
    		return False
    I'm guessing i can implement my own worker automation algorithm in this last method. I'd check if a worker-type unit is selected and if my own algorithm should apply it, if so run this algorithm and return 1/true, else return 0/false and let the AI code in the SDK handle it?
    <Kassiopeia> you don't keep the virgins in your lair at a sodomising distance from your beasts or male prisoners. If you devirginised them yourself, though, that's another story. If they devirginised each other, then, I hope you had that webcam running.
    Play Bumps! No, wait, play Slings!

    Comment


    • #3
      Originally posted by Lemmy
      and Python/CvGameUtils.py
      Code:
      	def AI_unitUpdate(self,argsList):
      		pUnit = argsList[0]
      		return False
      I'm guessing i can implement my own worker automation algorithm in this last method. I'd check if a worker-type unit is selected and if my own algorithm should apply it, if so run this algorithm and return 1/true, else return 0/false and let the AI code in the SDK handle it?
      That's how it work. You can override any default AI behaviour with Python.
      Creator of the Civ3MultiTool

      Comment


      • #4
        Hmm, still don't know how to select tiles...i guess i could do it similar as in the world builder. Have a seperate window with the tile improvements, select an improvement, then click on the tiles to add it to the list...

        Another detail that would be required is to show which improvement will be built on a specific tile..
        <Kassiopeia> you don't keep the virgins in your lair at a sodomising distance from your beasts or male prisoners. If you devirginised them yourself, though, that's another story. If they devirginised each other, then, I hope you had that webcam running.
        Play Bumps! No, wait, play Slings!

        Comment


        • #5
          another option would be to have a unit, similar to spy, that is invisible, with 100 movement that youcan move anywhere you want to build improvements

          Comment


          • #6
            I think that you should be able to create a fale unit, and warp it to the tile you click on, and then have that unit do the work. More or less a worker with no art.
            Creator of the Civ3MultiTool

            Comment

            Working...
            X