Announcement

Collapse
No announcement yet.

SLICers please read: Alexander the Great Scenario

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

  • SLICers please read: Alexander the Great Scenario

    A few months ago, Harlan and I worked together on creating an improved version of the Alexander the Great Scenario that came with CtP2 (actually, we already started doing this even before CtP2 was released). Due to time contraints and technical difficulties we gave up on this after a while. Now, with most of the MedMod work done and with Harlan once again motivated to work on this, we decided to continue our work (actually, this was already a few weeks ago but school and other stuff kept me rather busy). Our plans are not nearly as ambitious this time as they were last time, mainly because Harlan plans on having this finished before Civ3 comes out but we still have some technical difficulties to work out and could use all the help we can get, esp. from SLIC coders. If anyone wants to help out with the project, please let us know, we would be very grateful.

    Failing that, I'm would also be very happy if some of you could take a moment to look at the main problem we're currently dealing with and let us know what you think. Stray thoughts, suggestions, complete solutions, anything is welcome, 'cause quite frankly I'm bummed Here it is:

    The problem has to do with large stacks. If in CtP2 an army is moving from A to B and it along the way encounters another of the same civ, one of two things can happen. If the size of both armies combined is smaller or equal to 12, the moving army continues along its way without disruptions (no problems here). However, if both armies combined are larger than 12, the moving army stops right in front of the second army and does nothing. It will fortify and wait until the blocking army moves out of the way. However, if this other army is standing in that position because it's defending a city or some other defensive point, the army that was moving to a target will be stuck behind this defensive army forever (unless the goal it was trying to achieve no longer exists). The moving army never decides to deviate from the shortest path and continue via a detour or split up and send the army through in parts, it simply sits there and does nothing. In the Alexander the Great Scenario this is quite a problem because there are a lot of road chokepoints surrounded by desert or mountains and a defensive army in or near FE Tarsus can block any Persian reinforcements from reaching the Ionian cities when the Macedonians are conquering these. This is not the only case though and overall it really decreases AI performance (it's not unusual to have 3 or more stacks stuck behind a defensive chokepoint), in Harlan's eyes it even makes the scenario unplayable. Problems in solving this is 1) there is, as far as I can see, no proper way of detecting when units are stuck like this and 2) actually getting the units passed the blocking stack. I have no idea how to deal with the first problem and as far as the second problem goes, I can come up with some radical things such as teleporting the stack or destroying the blocking stack, but it's still difficult to detect where the stack was going in the first place and working out the details.

    Any help anyone could give us would be very much appriciated...
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  • #2
    What about:
    1) Swiching positions between moving and defending units
    2) Forcing defending units to move on random square outside city or fort
    3) Invisible RAILROADS alongside cities & forts, so moving units won't go
    through cities or forts

    Comment


    • #3
      But, I don't know how to slic that.

      Comment


      • #4
        It all depends on finding out which stack is defending, and which is trying to move...
        How about something that fires when a unit is fortified outside a city, which keeps a record of how long the units have been there. Then, after 10 turns or so, however long seems to work best, to create invisible railroads like player1 suggests, next to the tile the stack is in.
        The enemy AI shouldn't be able to use it, because it can't move into the enemy ZOC, but the reinforcements behind the defensive stack will. Once it attempts to use it, you can reset the fortification turn counter, and pillage the railroads. Maybe you could pillage before the reinforcements use it, but so they still complete the move Then the route would be changed, but the goal the same. If not, then the AI gets a small movement bonus each time. (Its not like it will use it to cheat on the human...)
        Concrete, Abstract, or Squoingy?
        "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

        Comment


        • #5
          Problems in solving this is 1) there is, as far as I can see, no proper way of detecting when units are stuck like this and 2) actually getting the units passed the blocking stack. I have no idea how to deal with the first problem and as far as the second problem goes, I can come up with some radical things such as teleporting the stack or destroying the blocking stack, but it's still difficult to detect where the stack was going in the first place and working out the details.
          For the stack that stops on a road before a city if an unit or an army can be detected in the inner city radius than it is also possible to detect if it is fortified on that road, and if you can dedect if it is on a road that is in the inner city radius you can detect in that radius another road tile. So all what you have then to do is to teleport the stack from the one side to the other side. Of coarse that could be causing some unnecessary teleportation, because it doesn't detected if it is fortified, because it is stucked or for defence.

          -Martin
          Civ2 military advisor: "No complaints, Sir!"

          Comment


          • #6
            OK here is my first trial of a unit teleporter around the city so far I have no idea why it doesn't work probably. So far it teleports a unit to the goal location, but it seems that the unit now have two locations on the one hand the old location were you can see the unit and the new location were you can click and gets the unit, too. Maybe a bug could be located in the GetUnitFromCell function I have no idea how to use the index I just set the index to 0. And there is another problem if you disband know the army that was teleported you get a crash. Maybe someone else could find a sollution I would like to use the teleport order that would be a improvemnt of diplomod as well.

            -Martin
            Attached Files
            Civ2 military advisor: "No complaints, Sir!"

            Comment


            • #7
              Thanks for all the ideas, guys, those are all very usefull! I think I'll give player1's and IW's ideas of invisible railroads a try first. Martin's idea is probably more elegant but, looking over the code, it seems to only work for cities and it assumes that there are at most two road tiles next to the tile that blocks the units, while this is not always the case. I'll keep you guys posted on my testresults (but I got a new batch of schoolwork coming up so it could take a week to implement)...
              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

              Comment


              • #8
                Go, Locutus, go! We're rooting for you. And thanks for the suggestions from everyone.

                Comment


                • #9
                  Okay, I give up, I'm gonna need your help once again guys: can anyone tell me why the code below doesn't work? I'm probably overlooking something really stupid but I can't get the game to produce tile improvements (rest of the the code works fine)...

                  Code:
                  HandleEvent(EntrenchUnit) 'AG2_CreateRailRoad' post {
                  location_t	tmpLoc;
                  unit_t	tmpUnit;
                  int_t	i;
                  	tmpUnit = unit[0];
                  
                  	Message(g.player, 'AG2_GotHere');		// test code
                  	for (i = 0; i < 8; i = i + 1) {		// check all neighbours
                  		Message(g.player, 'AG2_GotHere2');	// test code
                  		GetNeighbor(tmpUnit.location, i, tmpLoc);
                  		Terraform(tmpLoc, 1);			// test code
                  		Event:CreateImprovement(0, tmpLoc, 1, 0);	// this doesn't work!!!
                  	}
                  }
                  
                  
                  // messages are for testing purposes only, string ripped from info_str.txt
                  Messagebox 'AG2_GotHere' {
                  	Text(ID_IA_PILLAGE_SUICIDE);
                  }
                  
                  Messagebox 'AG2_GotHere2' {
                  	Text(ID_IA_TERRAFORM_DEAD_TILE);
                  }
                  Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                  Comment


                  • #10
                    Those tile improvements have been a pain all year . I think maybe you need to give the enabling advance to the tile's owner before you can place the improvement, and make sure they have enough PW as well (as railroads aren't otherwise used, you could just make their cost 0).

                    Martin's goodmod places an invisible time imp. under each good in the game, so take a look at that for a reliable code.
                    Concrete, Abstract, or Squoingy?
                    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                    Comment


                    • #11
                      Actually, I based my code on Martin's mod. I'm may be stupid but I'm not that stupid Unfortunately Martin's mod contains a huge amount of SLIC code and I didn't check it all out very thoroughly, quite possible that I missed something.

                      I did give the Barbarians all advances through the cheat-window but that didn't help. I totally forgot about PW cost though, I will certainly give that a try...
                      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                      Comment


                      • #12
                        And there is another problem with the tile improvements you can't place them on neutral tiles. You have first to build a fort or a fort like tile improvement. In the neighbourhood of that tile were you whish to place the final tile improvement afterwards this auxilary tile improvemnt will be pillaged. Unfortunatly it is not good for your goal, because you can't pillage a neutral tile improvement without causing a crash. So your road should have some characteristics of a fort. This fort tile should become a part of the owners territory if you have a choke point on neutral territory. Maybe you should reconsider my idea instead of the BeginTurn event you could use the EntrenchOrder event. That would make the code independent from cities.

                        -Martin
                        Civ2 military advisor: "No complaints, Sir!"

                        Comment


                        • #13
                          Thanks for the info, Martin, that is something else I hadn't considered yet. For now I'm still playing around with an adapted version of IW's solution but if that proves too troublesome I'll switch to your solution or the solution Peter (Triggs) emailed me about.
                          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                          Comment

                          Working...
                          X