Resource icon

[BNW] Rhye's Catapult 2020-06-02

I just sent you a PM :)

Quick edit: Left Catapult running the bkg and came back to this crash. The call stack indicates the crash came from the lua function City:SetDamage(), which I'm 99% I don't use in my mods outside of my faux nuke function, and this couldn't have been that bc too early for nukes, which means it's somewhere in Catapult. Luckily it actually gave an error tho :)
 

Attachments

  • Untitled.png
    Untitled.png
    230.9 KB · Views: 54
Last edited:
I just sent you a PM :)

Quick edit: Left Catapult running the bkg and came back to this crash. The call stack indicates the crash came from the lua function City:SetDamage(), which I'm 99% I don't use in my mods outside of my faux nuke function, and this couldn't have been that bc too early for nukes, which means it's somewhere in Catapult. Luckily it actually gave an error tho :)

great! That's fixed in v45.
 
hey rhye, one quick request- will you please turn down the warmongering penalty in your mod?
 
haha, if i knew how to do it wouldve done it already. Im not a modder bro but i always thought that there would be some xml value somewhere
 
haha, if i knew how to do it wouldve done it already. Im not a modder bro but i always thought that there would be some xml value somewhere
Can you explain me where do i do that?

The issue isn't the warmongering penalty, but the scaling of warmonger penalty vs the amount of cities on the map (and I think the number of civs), there is few lines defined in the "Defines.xml" file as well as some scaling factors per Era in the "Eras.xml" file though.
 
The issue isn't the warmongering penalty, but the scaling of warmonger penalty vs the amount of cities on the map (and I think the number of civs), there is few lines defined in the "Defines.xml" file as well as some scaling factors per Era in the "Eras.xml" file though.

So if i lower WarmongeringPercent for all eras will it work as intended?
 
Not entirely sure but it wouldn't hurt, but then when the world is filled up there'd be no warmongering penalties to begin with.
 
Played another game as Aztecs, set the difficulty too high and got smoked.

After that I wanted to code, and I was super inspired by Catapult, so I wrote my own Historical-Spawn-Dates code for use in my own mods:

Code:
g_DidSpawn = Modding.OpenSaveData();

GameEvents.PlayerDoTurn.Add(function(ePlayer)
    for ePlayer, pPlayer in ipairs(Players) do if pPlayer:IsEverAlive() and not pPlayer:IsAlive() and not g_DidSpawn.GetValue(ePlayer) then
        local CivilizationType;
        if pPlayer:IsMinorCiv() then
            CivilizationType = GameInfo.MinorCivilizations[pPlayer:GetMinorCivType()].Type;
        else
            CivilizationType = GameInfo.Civilizations[pPlayer:GetCivilizationType()].Type;
        end;
            
        if GameInfo.Civilization_SpawnDates[CivilizationType].StartYear then
            local PlayerStartYear = GameInfo.Civilization_SpawnDates[CivilizationType].StartYear;
            if Game.GetGameTurnYear() >= PlayerStartYear then
                print("Spawning: " .. CivilizationType  .. " (Year "..  PlayerStartYear .. ")");
                g_DidSpawn.SetValue(ePlayer, 1);
                local pStartPlot = pPlayer:GetStartingPlot();
                if pStartPlot then
                    if pStartPlot:GetPlotCity() == nil then
                        pPlayer:InitCity(pStartPlot:GetX(), pStartPlot:GetY(), 1, 0);
                        LuaEvents.IskaCityFounded(ePlayer, pStartPlot:GetX(), pStartPlot:GetY());
                    else
                        local pCity = pStartPlot:GetPlotCity();
                        pPlayer:AcquireCity(pCity, 0, 0);
                        pCity = pPlayer:GetCapitalCity();
                        pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_COURTHOUSE"], 1);
                        pCity:SetPuppet(0);
                    end;

                    pPlayer:ChangeGold(250);

                    if GameInfo.Civilization_SpawnDates[CivilizationType].NoFreeTech ~= 1 then
                        for pTech in GameInfo.Technologies() do
                            if GameInfo.Eras[pTech.Era].ID < Game.GetCurrentEra() then
                                Teams[pPlayer:GetTeam()]:GetTeamTechs():SetHasTech(pTech.ID, true, ePlayer, false, false);
                            end;
                        end;
                    end

                    if GameInfo.Civilization_SpawnDates[CivilizationType].UnitType1 then pPlayer:AddFreeUnit(GameInfoTypes[GameInfo.Units[GameInfo.Civilization_SpawnDates[CivilizationType].UnitType1].Type]); end;
                    if GameInfo.Civilization_SpawnDates[CivilizationType].UnitType2 then pPlayer:AddFreeUnit(GameInfoTypes[GameInfo.Units[GameInfo.Civilization_SpawnDates[CivilizationType].UnitType2].Type]); end;
                    if GameInfo.Civilization_SpawnDates[CivilizationType].UnitType3 then pPlayer:AddFreeUnit(GameInfoTypes[GameInfo.Units[GameInfo.Civilization_SpawnDates[CivilizationType].UnitType3].Type]); end;
                    if GameInfo.Civilization_SpawnDates[CivilizationType].UnitType4 then pPlayer:AddFreeUnit(GameInfoTypes[GameInfo.Units[GameInfo.Civilization_SpawnDates[CivilizationType].UnitType4].Type]); end;
                    if GameInfo.Civilization_SpawnDates[CivilizationType].UnitType5 then pPlayer:AddFreeUnit(GameInfoTypes[GameInfo.Units[GameInfo.Civilization_SpawnDates[CivilizationType].UnitType5].Type]); end;
                    if GameInfo.Civilization_SpawnDates[CivilizationType].UnitType6 then pPlayer:AddFreeUnit(GameInfoTypes[GameInfo.Units[GameInfo.Civilization_SpawnDates[CivilizationType].UnitType6].Type]); end;
                    
                    if ePlayer == 0  and not (Game.IsOption(GameOptionTypes.GAMEOPTION_AI_ONLY)) then
                        Game.SetActivePlayer(0);
                        PreGame.SetSlotStatus(pPlayer, SlotStatus.SS_TAKEN)
                    end;
                else
                    print(CivilizationType  .. " was not assigned a StartPlot.");
                end;
            end;
        end;
    end; end;
end);

Events.SequenceGameInitComplete.Add(function()
    for Victory in GameInfo.Victories() do
        PreGame.SetVictory(Victory.ID, false);
    end;

    for ePlayer, pPlayer in ipairs(Players) do
        if pPlayer:IsAlive() and ePlayer ~= 63 then
            local CivilizationType;
            if pPlayer:IsMinorCiv() then
                CivilizationType = GameInfo.MinorCivilizations[pPlayer:GetMinorCivType()].Type;
            else
                CivilizationType = GameInfo.Civilizations[pPlayer:GetCivilizationType()].Type;
            end;

            print("Looking up Civilization_SpawnDates for CivilizationType " .. CivilizationType .. "...");

            if GameInfo.Civilization_SpawnDates[CivilizationType].StartYear then
                local PlayerStartYear = GameInfo.Civilization_SpawnDates[CivilizationType].StartYear;
                if Game.GetGameTurnYear() < PlayerStartYear then
                    if (pPlayer:IsMinorCiv()) then
                        print(GameInfo.MinorCivilizations[pPlayer:GetMinorCivType()].Type .. " Despawned | Spawn Date: " .. PlayerStartYear);
                    else
                        print(GameInfo.Civilizations[pPlayer:GetCivilizationType()].Type .. " Despawned | Spawn Date: " .. PlayerStartYear);
                    end

                    if pPlayer:IsHuman() then
                        Events.LoadScreenClose();
                        Game.SetPausePlayer(-1);
                        Game.SetAIAutoPlay(999);
                    end;

                    for pUnit in pPlayer:Units() do
                        pUnit:Kill();
                    end;
                end;
            end
        end;
    end;
end);
 
Uploading v46 now!

This is a robust update. A lot of issues have been solved, there should be less crashes and the overall balance is improved.
I had to postpone the addition of new stuff (rebel factions) to the next release, as this alone already required a great amount of work.
Many thanks to bc1 who gave a great hand in reengineering the mod files.
We have spent a lot of effort in understanding how come settlers disobeyed to our code. They must have developed some kind of consciouness. It reminded me of Westworld. Anyway they should behave properly now.
Enjoy!
 
  • Like
Reactions: PiR
You can find this info in the readme file, but anyway here's the changelog:

Spoiler :

Rhye’s Catapult v39

- integrated changes of autoplay (debug mode)

- integrated changes of popups

- integrated code fixes

- integrated code for trading cities

- integrated code for readding barbarian camps

- camera stopped moving around during autoplay

- removed file causing bugs of workers

- set additional forbidden buildings to barbarian cities

- reinforced city defences

- tundra produces 0 food

- tundra not accessible to pikemen

- capitals cannot turn barbarian (preventing possible crash)

- added setting for flipping cities peacefully (not working)


Rhye’s Catapult v40
- integrated changes of A*

- integrated changes of settlers manager

- integrated changes of city flip code

- integrated additions of strategic resource quantities

- deleted double entry in pedia

- fixed minor civs tech level for modern starts

- major update of city names and settlers maps


Rhye’s Catapult v41
- fixed current era estimation

- fixed cities acquired by trade on spawn

- fixed removal of Iroquois hidden unit

- modified American and Brazilian spawn area

- fixed settlers being given to dead civs

- fixed tundra forest plots labelling as bad plots

- when less than 2 AI civs are colonising, they get an immunity period from collapse

- city state will not spawn I the plot is owned or in the middle of a route (Timbuktu problem)

- added ice to block passages in the Arctic (to avoid AI ship wasting time wandering)

- fixed minimap problem while having workers of major civs correctly working


Rhye’s Catapult v42
- added modifiers for settling at far distance

- added logarithmic formula for distance

- fixed some incorrect flip areas

- added map changes to Peru

- unlocked passages through marshes in Russia

- European AI settlers get an escort unit

- European AI won’t be given settlers when dead

- respawned civs should be immune for collapse for a while

- added city states in Asia

- changed priorities of Dutch settler map

- Fragmentation of overseas colonies won’t assign ownership to the Celts

- Unhappy civs more likely to collapse

- fixed bug of double civ (major and minor) alive at the same time


Rhye’s Catapult v43
- fixed incorrect calculation of settlers path due to marshes

- set resistance turns to 0 when city is traded

- tweaked barbarians

- added set of rebel civs for each major player

- added possibility of civil war for the human player

- Barcelona does not spawn when major Carthage is alive

- Huns and Mongols now convert barbarian units in a larger area at spawn

- Huns have 3 horse archers spawn on city captured (disbanded)

- Huns starting location moved closer to south-west, in Pannonia

- Huns overridden units: settler added

- Fixed bug of city naming


Rhye’s Catapult v44
- barbarian camps will not spawn on mountains

- weakened the Celts

- added different gold amounts at each civ’s spawn

- (temp) rebel disabled

- jungle produces less food

- farming flood plains disabled again

- major revision of resources

- added map changes to Mexico

- Huns wandering AI units gets cleared after the timer expires

- clean map routine for barbarian settlers and barbarian units wandering in Siberia (no more Hunnic cities)


Rhye’s Catapult v45
- integrated changes for map pre-processing

- integrated changes for ensuring clean minimap

- workers now all working correctly

- fixed some city renamings

- fixed most xml invalid references

- Turkey starts with Gunpowder; fixed Austrian starting units

- changed Israeli colour

- added name updates based on era (Tokyo, Seoul)

- temporarily replaced Mongolian settler overriding entry (cause of crash) with another unit

- disabled minor civs workers (as they are buggy and don’t work anyway)

- added compensation of population and buildings for later civs spawning when the game starts early



Rhye’s Catapult v46
- settlers will now found cities already packed with population and buildings regardless of game start era: later civs compensation for disadvantage will be more uniform across the game start turns (era settings are dynamically changed); removed previous compensation

- increased population bonus for later eras

- era does not get reset to 0 after loading a savegame

- city names do not get re-processed when loading a savegame

- all barbarian cities religions set to 0 (will avoid crashes)

- improving/cutting marshes and jungle requires Biology (except for plantations)

- civ respawns (even if minor) subject to 100 turns interval from latest collapse

- lowered and revised tech costs to adapt to the new changes

- reduced warmongerPercent in era infos

- additional changes to the map to reduce India, China and Egypt superpowers
 
if i understand it right, this is going to be rhye's and fall from civ4 to civ5. Would it be possible to have an updated list of what features are finshed(not considering balancing) and which are not. Will be very helpful:):)
 
if i understand it right, this is going to be rhye's and fall from civ4 to civ5. Would it be possible to have an updated list of what features are finshed(not considering balancing) and which are not. Will be very helpful:):)

Rhye's Catapult is the working title. At some point I will switch to a final title.
As for the features, read the readme!
 
I can't seem to download v46. rhye.civfanatics.net/civ5/Catapult(v46).zip shows me the main page of the site, and I can't seem to save the link... not sure how I downloaded v34. Probably something really obvious, how do I do it?
 
Really enjoying the update, but I was wondering if vassalage would be a thing? It would be cool to me if you start out playing America has a vassal of England until you rebel, or playing has Spain and you can use vassalage has a way to colonize the Americas and subjugate the Aztecs and Incas.
 
I've observed a strange behaviour while playing as the Incas (who, btw, that is a horrible starting location if you settle where they spawn xD) - also I've noticed sometimes a unit or two (in my case a Spearman and a Worker) will spawn OUTSIDE of the territory beyond the Andes, so they become useless except for exploration

Anyway, I've noticed that on certain turns, ancient wonders become available to build, and if I start building them, they disappear from the menu and cannot be built all of a sudden. Just something to investigate in your backlog.

There's no rhyme or reason to it, it's just random.
 
playing as the Incas (who, btw, that is a horrible starting location if you settle where they spawn xD) -

Could you please suggest how to improve it?


I've noticed sometimes a unit or two (in my case a Spearman and a Worker) will spawn OUTSIDE of the territory beyond the Andes, so they become useless except for exploration


you're right, I just notice that too. Easy fix

Anyway, I've noticed that on certain turns, ancient wonders become available to build, and if I start building them, they disappear from the menu and cannot be built all of a sudden. Just something to investigate in your backlog.

that's hard to catch: see if you have 2 savegames, one before and one after disappearing; it would be helpful
 
Really enjoying the update, but I was wondering if vassalage would be a thing? It would be cool to me if you start out playing America has a vassal of England until you rebel, or playing has Spain and you can use vassalage has a way to colonize the Americas and subjugate the Aztecs and Incas.

Good idea.
Is there a standalone vassallage mod that can be implemented without dll?
 
Back
Top Bottom