Vincentz Infinite Projects [VIP MOD]

Discussion in 'Civ4 - Modpacks' started by vincentz, Nov 16, 2010.

  1. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    Thanks :) and same to you and yours :D

    Note to self:
    Tradepost build next to resource only. Will get gold bonus for each resource adjacent to it, and a limit of 3 spaces (like city) between each tradepost. Perhaps get tradecaravan each x turns or when it develops.

    Unit limit: Each city allows x units. Barracks increase x. Stable increase x for mounted. Resource arrows, bronze weapons, iron weapons increase for respective units etc etc.
     
    Last edited: Dec 25, 2018
  2. BTS+

    BTS+ Chieftain

    Joined:
    Sep 24, 2018
    Messages:
    10
    I like your mod. But would you consider adding the module 'Revolution' at some point in the mod?
     
  3. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    Thanks :)
    Regarding the revolution mod: Its not just a module, as it have been integrated with lots of other modules. I do like parts of it, but the work to implement it, and also customize it to fit the VIP mod would take a lot of work. In some regards the VIP mod is one of the most modified mods as it have taken steps away from vanilla BTS that even most other heavy kitchen sink mods haven't.
    I do wish to have some sort of revolution effect, as right now when I capture new cities, even with the "culture limiter", it is: capture city, "Spread Culture" and then add a huge building queue with the basic buildings, where it will just be left alone doing its thing.
    I have a couple of ideas I might implement in other places first though, and its been awhile since I modded on the VIP, but my current game is actually quite good, and unless they take new drastic steps with civ7, it seems that civ4 is the end station for me, which at least is good for the VIP mod development ;)
     
  4. BTS+

    BTS+ Chieftain

    Joined:
    Sep 24, 2018
    Messages:
    10
    Adding a "Separatism" component would be awesome, just to 'break' huge empires and also to add more dynamism to the game. I think if there was some sort of wars of independence that would be great.

    I know what you mean. I hate Civ5 and played Civ6 only twice. Having land units just go in the ocean is just ridiculous!
     
  5. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    I think maybe I can make a check on captured cities depending on foreign culture from captured civs. If the check fails, then other cities with same culture will get an "independance boost" and the cities could change owner. Civ6 rise and fall had something similar, though it was a bit annoying tbh, and I doubt the AI would be able to handle it. Ill put it on my todolist ;)

    I have changed the maxCombatRounds from 10 to AttackingUnitMovesLeft + GlobalDefinesAlt.xml (<DefineName>MAX_COMBATROUNDS</DefineName>) which I set to 5 for now.
    Makes sense? prolly not ;)

    If an archer with 5 moves attacks a unit there will be 10 combat rounds. If the same archer only have 1 move left there will only be 6 combatrounds.
    If a horseman with 11 moves attacks it will result in 16 combatrounds, and most likely the death of either attacker or defender unless withdrawal comes into play.

    Update: Trying, experimental, with ranged archers. If aircombat is bigger than combat strenght, then it cannot direct attack (sieges, archers) but if smaller then can both direct and ranged (javelineer)
     
    Last edited: Dec 27, 2018
  6. arkguy

    arkguy Warlord

    Joined:
    Jun 9, 2010
    Messages:
    165
    Location:
    Arkadelphia, AR
    Great Mod so far! Wasn't able to finish game on gigantic + as game shut down in late game, lack of memory is my guess. Started 2nd game at transhuman era on gigantic and so far is working good. The only minor glich I have found is that in the late game phase sometimes the unit graphics get mixed up and you may get an assault mech or something for something else for a transport or infantry or militia at first but then finds the right one so isn't really a problem as far as game play goes. Is defiantly a fun one to play and is going to be one of my favorites it looks like. Thank you for a job very well done, the work put into it and the wait for the finished product to date has been worth it.
     
    vincentz likes this.
  7. Pomphis

    Pomphis Warlord

    Joined:
    Sep 22, 2010
    Messages:
    289
    Location:
    Berlin, Germany
    A question: if I use the worldbuilder to change a map, how do I do that? I have found the map mode, but how do I tell it to for example to change a tile to Desert?
     
  8. Pomphis

    Pomphis Warlord

    Joined:
    Sep 22, 2010
    Messages:
    289
    Location:
    Berlin, Germany
    Sorry. Found it.
     
  9. Pomphis

    Pomphis Warlord

    Joined:
    Sep 22, 2010
    Messages:
    289
    Location:
    Berlin, Germany
    But another question: can I change the way Information for a tile or about another civ is shown, so that I get text instead of a Picture ? If yes, how?
     
  10. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    No, unfortunately not, as the info is in the gamecore.dll :(

    --------------------------------------------------------------------------------------

    Changed the way units upgrade:
    It will take 3 turns until unit is finished upgrading
    The XP cap is changed to soft cap, but lowered to 4xp / era.
    so xp is cap * era plus half above the cap * era.
    The soft cap can be changed : MAX_EXPERIENCE_AFTER_UPGRADE in GlobalDefines.xml
    IE:
    1) unit have 16 xp in medival era. upgrades to (16 - 3 * 4) / 2 + 3 * 4 = 14 xp
    2) unit have 20 xp in medival era. upgrades to (20 - 3 * 4) / 2 + 3 * 4 = 16 xp
    3) unit have 10 xp in Ancient era. upgrades to (10 - 1 * 4) / 2 + 1 * 4 = 7 xp
    Units below the cap x era doesnt suffer any loss
    IE:
    unit with 4xp in ancient, 12xp in medieval, 24xp in modern etc.
    Neo = 0 , Anc = 4, Cla = 8, Med = 12, Ren = 16, Ind = 20, Mod = 24, Tra = 28, Fut = 32

    Regarding the limited attack rounds. Not really sure it works as intended, as it gives attacker a "free" withdrawal.

    I changed the Militia units. They now basically works like Snipers, meaning they got invisible and AttackAI instead of defenseAI, as I thought it was weird they "ran home" after being spawned by a city capture. Now they work a bit like partisans/resistance/terrorists which was their intended purpose.

    The MAXUPT is now based on Era. STARTUP is basenumber (altGlobalDefines.xml)
    so... in neolithic the maxupt is now 3 (STARTUP) and increases by 3 per era (MAXUPT)

    Neo = 3 , Anc = 6, Cla = 9, Med = 12, Ren = 15, Ind = 18, Mod = 21, Tra = 24, Fut = 27

    Ie. in medieval era the maxUPT is 3 + 3 x 3 = 12
    in modern era the maxUPT is 3 + 3 x 6 = 21

    UPDATE:
    Changed the Limited Combat Rounds so it withdraws as before, though if successful withdraw the attacker gets XP, but if unsuccessful the defender gets an extra attackround and XP.
     
    Last edited: Jan 22, 2019
  11. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
  12. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    I have wanted to do this since beginning of playing Civ IV.

    When an AI dies their remaining units are now converted into barbarians.

    Now, I used an existing function that was, as far as I can see, only used for killing remaining units when ai is defeated, but but also for when a map is regenerated ingame (i personally never use this, as it can only be done on the first turn) and when using aiAutoplay (a debug way of running a game with no human players).

    Since it converts the units there might be some places where they cannot coexist with their previous positions, f.ex in friendly cities, o it might glitch out a bit (havent tested thoroughly).

    PHP:
    void CvPlayer::killUnits()
    {
        
    CvUnitpLoopUnit;
        
    CvUnitpBarbUnit;
        
    int iLoop;

        for (
    pLoopUnit firstUnit(&iLoop); pLoopUnit != NULLpLoopUnit nextUnit(&iLoop))
        {
            
    //Vincentz DEAD2BARB START
            
    UnitTypes eUnit pLoopUnit->getUnitType();
            
    pBarbUnit GET_PLAYER(BARBARIAN_PLAYER).initUnit(eUnitpLoopUnit->getX_INLINE(), pLoopUnit->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
            
    pBarbUnit->convert(pLoopUnit);

            
    //pLoopUnit->kill(false);
            //Vincentz DEAD2BARB END
        
    }
    }

    upload_2019-2-3_19-43-8.png


    upload_2019-2-3_19-43-42.png

    Fun Fact : I tested this in my current game, and thought about what would happen if there was a couple of missile submarines that was converted, so checked out my neighbor Zara in cheatmode.
    In this game he have been a warmongering lunatic, dropping nukes everywhere. The scoreboard shows he isnt exactly a very popular guy, but who needs to be popular when you build Nuclear subs with 47 XP!

    The fun part is that the nukedropping came the turn after he became UN SecGen (I lost by something like 17 votes iirc). The crazy part is he still out-techs me.

    upload_2019-2-3_20-20-2.png

    update:
    Digging a bit deeper it shows that he is a force to be reckoned with. Besides these, he also had a bunch of nukes as well as 47 mobile artillery.
    I would be in no position to combat him, except for perhaps a preemptive nuclear strike, but even if I did hit him hard, he have 4 or 5 vassals with nukes too.

    Game have turned into a stalemate, with no chance of domination....
    TBH im quite pleased with this, as usually in vanilla it is very rare to have a game with this kind of difficulty and opposition this late in the eras. The spacerace is literally a race! :)

    upload_2019-2-3_20-47-55.png

    For comparison here are mine ;)
    upload_2019-2-3_21-2-16.png
     
    Last edited: Feb 3, 2019
    Thorvald of Lym likes this.
  13. Noyyau

    Noyyau Privateer Captain

    Joined:
    Jun 9, 2012
    Messages:
    1,443
    Location:
    Italy
    I have always dreamed of this. What is this sorcery?
     
  14. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    Well, its pretty simple code, and it will probably cause some, ehm, unexpected results ;)
    It doesnt take stacks into account as it runs each unit in a loop. So a stack will be spread out if Im not mistaken. Donno about full transports either. Have to test a bit, but better than "the rapture" where all the units disappears.

    I was considering an alternate version where the units would check their position, and if in occupied territory join the owner instead of going rouge (using the gift()).

    I optimised the code a bit:


    PHP:
    void CvPlayer::killUnits()
    {
        
    CvUnitpLoopUnit;
        
    int iLoop;

        for (
    pLoopUnit firstUnit(&iLoop); pLoopUnit != NULLpLoopUnit nextUnit(&iLoop))
        {
            
    //Vincentz DEAD2BARB START
            
    CvUnitpBarbUnit GET_PLAYER(BARBARIAN_PLAYER).initUnit(pLoopUnit->getUnitType(), pLoopUnit->getX_INLINE(), pLoopUnit->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
            
    pBarbUnit->convert(pLoopUnit);
            
    //pLoopUnit->kill(false);
            //Vincentz DEAD2BARB END
        
    }
    }
    edit : Yup, need atleast 2 checks:
    1) is it in stack/cargo
    2) is it city only unit (planes/ICBMs)
     
    Last edited: Feb 3, 2019
  15. Drakarska

    Drakarska Epic Dadness

    Joined:
    Jan 4, 2010
    Messages:
    2,586
    Location:
    Twilight Zone
    Sooooo, Barbs officially Gandalf now :D
     
  16. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    extended it a bit, but still missing stack support.
    If unit is in foreign city, it will try to give it to the owner of city.
    else it check if only unit on tile and convert it
    else it will look at surrounding tiles
    else it will kill unit
    PHP:
    void CvPlayer::killUnits()
    {
        
    CvUnitpLoopUnit;
        
    int iLoop;

        
    //Vincentz DEAD2BARB START
        
    int iI;
        
    CvPlotpPlot;
        
    CvUnitpBarbUnit;
        
    CvPlotpLoopPlot;
        
    bool canFindAPlot;

        for (
    pLoopUnit firstUnit(&iLoop); pLoopUnit != NULLpLoopUnit nextUnit(&iLoop))
        {
            
    pPlot =  GC.getMapINLINE().plotINLINE(pLoopUnit->getX_INLINE(), pLoopUnit->getY_INLINE());
            
    canFindAPlot false;

            
    //IF UNIT IS IN CITY ASK AI OWNER IF HE WANTS IT (HUMAN GETS UNIT AUTOMATICALLY IF POSSIBLE)
            
    if (pPlot->isCity() && pLoopUnit->canGift())
            {
                
    pLoopUnit->gift();
            }
            
    //IF NOT THEN TRY TO FIND A SPOT TO PLACE UNIT
            
    else
            {
                if (
    pPlot->getNumUnits() == 1)
                {
                    
    pBarbUnit GET_PLAYER(BARBARIAN_PLAYER).initUnit(pLoopUnit->getUnitType(), pPlot->getX_INLINE(), pPlot->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
                    
    pBarbUnit->convert(pLoopUnit);
                    
    canFindAPlot=true;
                }  
                else
                {
                    for (
    iI 0iI NUM_DIRECTION_TYPESiI++)
                    {
                        
    pLoopPlot plotDirection(pPlot->getX_INLINE(), pPlot->getY_INLINE(), ((DirectionTypes)iI));

                        if(
    pLoopUnit->canMoveInto(pLoopPlotfalsefalsetrue))
                        {
                            
    pBarbUnit GET_PLAYER(BARBARIAN_PLAYER).initUnit(pLoopUnit->getUnitType(), pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
                            
    pBarbUnit->convert(pLoopUnit);
                            
    canFindAPlot=true;
                            break;
                        }  
                    }
                }
       
                
    //IF CANNOT FIND A SPOT, KILL UNIT
                
    if (!canFindAPlot)      
                {
                    
    pLoopUnit->kill(false);  
                }
            }
            
    //Vincentz DEAD2BARB END
        
    }
    }
    quickedit...; TODO
    the check to see if canmoveonto is with old dead civ, not barb as it should be. need fix
     
    Last edited: Feb 5, 2019
  17. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    Think I got an acceptable solution for now. Still doesn't do a good job with transports, but will drop them on land if possible:
    PHP:
    void CvPlayer::killUnits()
    {
        
    CvUnitpLoopUnit;
        
    int iLoop;

        
    //Vincentz DEAD2BARB START
        
    int iI;
        
    CvPlotpPlot;
        
    CvUnitpBarbUnit;
        
    CvPlotpLoopPlot;
        
    bool canFindAPlot;

        for (
    pLoopUnit firstUnit(&iLoop); pLoopUnit != NULLpLoopUnit nextUnit(&iLoop))
        {
            
    pPlot =  GC.getMapINLINE().plotINLINE(pLoopUnit->getX_INLINE(), pLoopUnit->getY_INLINE());

            
    //IF UNIT IS IN CITY ASK AI OWNER IF HE WANTS IT (HUMAN GETS UNIT AUTOMATICALLY IF POSSIBLE)
            
    if (pPlot->isCity() && pLoopUnit->canGift())
            {
                
    pLoopUnit->gift();
            }
            
    //IF NOT THEN TRY TO FIND A PLOT TO PLACE UNIT
            
    else
            {
                if (
    pPlot->getNumUnits() == 1//ON THE SAME SPOT
                
    {
                    
    pBarbUnit GET_PLAYER(BARBARIAN_PLAYER).initUnit(pLoopUnit->getUnitType(), pPlot->getX_INLINE(), pPlot->getY_INLINE(), pLoopUnit->AI_getUnitAIType());
                    
    pBarbUnit->convert(pLoopUnit);
                }   
                else 
    //OR AROUND THE PLOT
                
    {
                    
    pBarbUnit GET_PLAYER(BARBARIAN_PLAYER).initUnit(pLoopUnit->getUnitType(), 00pLoopUnit->AI_getUnitAIType());
                    
    pBarbUnit->convert(pLoopUnit);
                    
    canFindAPlot false;

                    for (
    iI 0iI NUM_DIRECTION_TYPESiI++)
                    {
                        
    pLoopPlot plotDirection(pPlot->getX_INLINE(), pPlot->getY_INLINE(), ((DirectionTypes)iI));
                        if(
    pBarbUnit->canMoveInto(pLoopPlotfalsefalsetrue))
                        {
                            
    pBarbUnit->setXY(pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE(), truetruefalsefalse);
                            
    canFindAPlot=true;
                            break;
                        }   
                    }
                    
    //IF CANNOT FIND A SPOT, KILL UNIT
                    
    if (!canFindAPlot)       
                    {
                        
    pBarbUnit->kill(false);   
                    }
                }
            }
        }
        
    //Vincentz DEAD2BARB END
    }
     
  18. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    Added a new domain : Space.
    Not entirely sure how its going to play out yet though, but basically the space-units should be invisible as well as unattackable from the surface with some exceptions.
    Maybe even a switch between surface and space for the units, so multiple layers...

    edit: Might do a "If unit a can see invisible_space then it can attack" while a space unit will be able to hit everything.

    Added a few new invisibilities and promotions:
    Militia with a infiltrator promotion
    Sniper with a sniper promotion

    Added new Upkeeps, though havent edited the civics
    Lowest (used to be double of none iirc)
    Highest
    Low Pop / High City (Good for tall empires)
    High Pop / Low City (Good for wide empires)


    Added 3rd and 4th radius to bfcat refined and legendary.
    upload_2019-2-10_20-23-14.png
     
    Last edited: Feb 10, 2019
  19. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
  20. Zeta Nexus

    Zeta Nexus <{[(Nexus)]}>

    Joined:
    Jan 23, 2014
    Messages:
    4,480
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Wait! What?!?!
    Your cities can work the 4th ring?
    How? I thought that it was impossible.
     

Share This Page