Announcement

Collapse
No announcement yet.

Events for Freeciv 2.0

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

  • Events for Freeciv 2.0

    Ok folks, the Freeciv developers have taken to heart some of the ideas we had for Freeciv that had to do with creating a more scenario modding friendly version or add-on to the game.

    In short, they have started work on a Freeciv Events language!

    So yes, in addition to all the other neat things about Freeciv it will, in a while, be possible to create events for the game, very similar to the kinds of events we have in Civ2 and Civ 2 ToT.

    CapTVK and Vasc, proponents and designers of the game, have asked for our input as to what sort of events to include with Events language. The language will be in Lua.

    To quote Cap's PM:

    The main wikipage for FC events is listed below. Any ideas/suggestions for events can also be posted on the discussion page at this site. At the start we'll only have a limited set of events but later on this could be expanded.



    Some general thoughts and ideas about events.


    The full list of Civ2 events (we also need the extra ToT events and functions to this)
    Now these threads can be used to post ideas about the events, but I think we can come up with some ideas pretty quickly here in this thread, just to make things simpler.

    They already have a list of Civ2 MGE events, but we need a list of the Civ2 ToT events. If anyone can provide this it will be much appreciated!

    Also, and let your mind abound in the possibilities, we need some additional ideas for events. Yes, events beyond the constraints of the Civ engine!

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

    My ideas:

    1) A schism (a civil war, ie. seperation of a civ's cities into two different civs) is created in Civ2 almost by chance when a capital city is captured. I propose an event that would designate any city in an empire to be that trigger. In fact, why not expand on that. Have the trigger be anything, from the death of a certain unit, to a tech discovered, to a certain date or game turn, to a specific city being captured. Also, in that event certain cities can be designated as being seceding cities, allowing for a true depiction of an historic Civil War.

    2) In certain utilities made for Civ2 (Civswap) it is possible, upon an autosave for a seperate BAT file to be run, which switches out certain files in a directory. An event that would cause a program to be run on a computer would be wonderful.

    3) Keystone triggers, similar to the events in Civ 2 ToT. Once numerous triggers have been satisfied a "keystone" trigger is tripped, causing an event. For example: "Brits capture New York, Brits capture Boston, Brits gain War Funds tech ---> Americans lose war, GAME OVER" This would simplify the events string and would free up time and space for scenario designers by making the triggers leading to GAME OVER much shorter and compact.

    4) Creating mulitple spawn points for units when event is triggered.

    5) A captured unit event. This has always been a pain when dealing with diplomats. Diplomats in civ2 can bribe just about anything as long as the bribing Civ has cash. How about an event that knows when a unit or Civ has been bribed. This trigger would allow other triggers to be satisfied.

    6) A MACRO event that designates the overall path that a civ will take in war. Let's say: "Upon tech gained "Barbarosa", the German civ will attack these cities first, with these kinds of units only.

    7) An event that will designate civ behavior during a certain time period, from tech to tech, unit killed, etc... For example: During Game Turn 10 - 20, Spanish civ will be passive. Game Turn 11-30 Spanish civ will be aggressive. This would depict doctrine during certain Monarchies.


    In all, I think that an open tree structure would do well when creating the events. If it is possible, allow for a scenario designer to create his own triggers upon a large number of variables and allow a large number of possible outcomes. Examples of events that allow a designer to designate:

    - Macro economic conditions (forest terrain gets +1 shield after "Saw Blade" tech acquired)

    - Unit Spawn area polygons (Tiles 33, 10 by 55, 15)

    - War Plan conditions (Attack Boston, Attack New York, with Musketeers)

    ...would be much appreciated.

  • #2

    If they do this right, I'll bet that FreeCiv will become the platform of choice for us.

    Some quick ideas...

    Triggers:
    • UnitKilled with a x,y map coordinates argument
    • SquareEntered with a x,y map coordinates argument, a unit argument, and a civ argument
    Actions:
    • RemoveUnit (e.g. out of supply)
    • ChangeDamage (weaken or strengthen a unit)
    • SpawnUnit like a CreateUnit but instead of absolute x,y coordinates, use a parent unit (e.g. a catapult spawns a rock).
    • ConvertUnit (i.e. same effect as Leo's, but you designate specific unit(s) by type and locations)
    • BestowImprovement like ToT's, but you specify the cities
    • A GoTo that really works
    El Aurens v2 Beta!

    Comment


    • #3
      Some way to destroy specific units?

      Teleport units? (ie, when 'teh HERO!!one1!' reaches 'the cave', transport all units in the cave and surroundings to 'inside the cave')


      Also, be able to filter most triggers by unit type / domain / role / civ / whatever (and combinations.. such as yellow civ + (air units . 'flak batteries') )
      Indifference is Bliss

      Comment


      • #4
        Re: Events for Freeciv 2.0

        Thanks for nicely summing it up Harry.

        You also made lots of interesting suggestions I will comment here. Before however, I would like to once again mention you can find the current work in progress Events scripting specification here:


        You can edit the "Talk" page to put your comments, questions or ideas here:


        It is a Wiki, just like Wikipedia. If you can post on this board, you can easily edit there as well.

        To make Freeciv Events more clear, because you use probably use different names for similar concepts...

        In Freeciv Events:
        * a "signal" is something like "unit_death", "city_conquered", "tech_discovered", etc.
        * a "callback" is a function (i.e. list of actions or commands) invoked when that "signal" is emited.

        * You may have several "callbacks" attached to a "signal".
        * A "callback" can destroy itself. This is useful for something you wish to only happen once or twice for example.

        * There is a mini database ('store' module), which you can use to store or retrieve numbers. It will be persistent across load/saves.

        Now to the matter at hand...

        Originally posted by Harry Tuttle
        My ideas:

        1) A schism (a civil war, ie. seperation of a civ's cities into two different civs) is created in Civ2 almost by chance when a capital city is captured. I propose an event that would designate any city in an empire to be that trigger. In fact, why not expand on that. Have the trigger be anything, from the death of a certain unit, to a tech discovered, to a certain date or game turn, to a specific city being captured. Also, in that event certain cities can be designated as being seceding cities, allowing for a true depiction of an historic Civil War.
        This is a very nice idea! We can make a schism action which can be triggered by any signal (e.g. city capture, unit death, tech discovered, etc).

        Originally posted by Harry Tuttle
        2) In certain utilities made for Civ2 (Civswap) it is possible, upon an autosave for a seperate BAT file to be run, which switches out certain files in a directory. An event that would cause a program to be run on a computer would be wonderful.
        I am not sure of the utility of this. In Freeciv the graphics format is veery flexible. You can define in the tilespec files exactly on which file and which rectangle some image is. Could you give an example where this feature would be useful?

        Originally posted by Harry Tuttle
        3) Keystone triggers, similar to the events in Civ 2 ToT. Once numerous triggers have been satisfied a "keystone" trigger is tripped, causing an event. For example: "Brits capture New York, Brits capture Boston, Brits gain War Funds tech ---> Americans lose war, GAME OVER" This would simplify the events string and would free up time and space for scenario designers by making the triggers leading to GAME OVER much shorter and compact.
        This is very interesting. I had not considered the usefulness of having something triggered by multiple signals. Using the current concept this is possible, although it could be easier. We will try to figure out some way to make it easier for you to write something like this.

        Originally posted by Harry Tuttle
        4) Creating mulitple spawn points for units when event is triggered.
        The idea we were having was to allow you to create a unit in any point of the map you wish, anytime you wish.

        Originally posted by Harry Tuttle
        5) A captured unit event. This has always been a pain when dealing with diplomats. Diplomats in civ2 can bribe just about anything as long as the bribing Civ has cash. How about an event that knows when a unit or Civ has been bribed. This trigger would allow other triggers to be satisfied.
        Also very interesting.

        Originally posted by Harry Tuttle
        6) A MACRO event that designates the overall path that a civ will take in war. Let's say: "Upon tech gained "Barbarosa", the German civ will attack these cities first, with these kinds of units only.

        7) An event that will designate civ behavior during a certain time period, from tech to tech, unit killed, etc... For example: During Game Turn 10 - 20, Spanish civ will be passive. Game Turn 11-30 Spanish civ will be aggressive. This would depict doctrine during certain Monarchies.
        This sort of interaction would require messing with the AI behaviour. I will ask the people responsible for that.

        Originally posted by Harry Tuttle
        In all, I think that an open tree structure would do well when creating the events. If it is possible, allow for a scenario designer to create his own triggers upon a large number of variables and allow a large number of possible outcomes. Examples of events that allow a designer to designate:

        - Macro economic conditions (forest terrain gets +1 shield after "Saw Blade" tech acquired)
        This will be possible in the next version using a different mechanism than Events. We call that Effects. Effects allow any government, nation, technology, or building to grant bonuses like that. We currently use it for building bonuses (think Colossus trade bonus or Marketplace bonus, etc) and are moving governments to use it as well.

        Originally posted by Harry Tuttle
        - Unit Spawn area polygons (Tiles 33, 10 by 55, 15)
        I am not sure I understand this concept very well. Like I said, we were thinking about allowing you to create a unit in a specific tile. How would something like this work?

        Originally posted by Harry Tuttle
        - War Plan conditions (Attack Boston, Attack New York, with Musketeers)
        Requires AI interaction, will ask.

        Originally posted by Harry Tuttle
        ...would be much appreciated.
        We will try our best, even if it may take a while, since we work on our spare time, but we do it with passion, just like you do. Hopefully we will have something out before the summer. Thank you for all the nice ideas!

        Comment


        • #5
          Re: Re: Events for Freeciv 2.0

          Originally posted by Vasc
          I am not sure of the utility of this. In Freeciv the graphics format is veery flexible. You can define in the tilespec files exactly on which file and which rectangle some image is. Could you give an example where this feature would be useful?
          The main reason why batch files are used is to change graphics, rules and/or events.

          A good events language should not need to run any external program, as long as it gives us the desired functionality internally.

          One typical example for changing the graphics during a game is to emulate seasons. All graphics have summer and winter alternatives and every N turns (or triggered by some event) those graphic files are swapped.

          Something similar goes for swapping rules files. Using the same summer/winter example again, the attack/defense/movement factors of units or terrain types can also be made different for the summer and winter settings.

          The main reason for swapping events files is simply the limited amount of memory Civ2 has for events.
          Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

          Comment


          • #6
            Seems the brainstorming session is full swing! Better add some of my ideas as well

            Events:
            "pay gold penalty" If a specific type of unit is killed you have to pay an amount gold from your treasury. ( e.a if one of your "convoy units " is destroyed you lose 200 gold ) This can also work the other way, you could get an event call to pay 200 gold to receive a special unit

            pay gold to Civ XXX The same as above but now another civ gets that gold.


            Functions:
            Multipe choice event options. One of the things I would like to see is the ability of a multiple choice options within the game. If a certain event is triggered you would be presented with a couple of options from which you have to choose one.


            "Nov 1941,Winter arrives early!" Do you :

            1) press on with your current troops;
            2) set camp at your current location and wait for reinforcements 10 turns from now;
            3) pay 1000 gold to get those reinforcements now
            Skeptics should forego any thought of convincing the unconvinced that we hold the torch of truth illuminating the darkness. A more modest, realistic, and achievable goal is to encourage the idea that one may be mistaken. Doubt is humbling and constructive; it leads to rational thought in weighing alternatives and fully reexamining options, and it opens unlimited vistas.

            Elie A. Shneour Skeptical Inquirer

            Comment


            • #7
              Thanks for your response Vasc and also to everyone else who has contributed. Vasc I'll try to explain the items that you had questions on:

              2) As with any game some users like to use utility programs to accomplish large tasks at once or to keep a running tally of units destroyed, etc, etc. While many of the features that Civ2 utilities perform are already incorporated into Freeciv there may come a time where tournament players or scenario designers might want to incorporate something beyond Freeciv's engine into the "gameplay experience". Creating a "callback" that can run a program on a desktop leaves the door open to addition, without having to edit the code. In this way Freeciv can be modulized for easy expansion, allowing for further additions, in case a scenario designer or tournament player wants to do something new and crazy.

              Also, and I may be guessing here, but this sort of thing would allow for an easy way to increase the playability of Freeciv with other applications...

              - Unit Spawn Polygons. This idea is a bit of a stretch, but in the Civ2 event engine an action that can be performed is "change terrain". This event changes the terrain in a four point diagonal polygon on the game board. All terrain within the four point coordinates, upon the event being triggered, is changed to the type of terrain specified. A Unit Spawn Polygon would create specified units within a four point area, creating multiple units, at once, without having to designate each tile that a unit will appear on. For example, if the scenario "Red Front" were remade for Freeciv, the German civ (played by the AI), would have whole armies of units created at once, instead of having each unit spawn point spelled out in the event file. This is just a quick and dirty expansion of the singular unit creation event.

              Comment


              • #8
                Some more ideas:

                1) A Callback that plays an audio file or video file.

                2) A Signal that activates when a certain civ has such an amount in its treasury.

                3) An addition to the create unit Callback that allows for a caravans commodity to be set.

                4) I don't know if Freeciv has this, but a Callback that eliminates food/trade routes (Yeah, working on a big problem with this one for a scenario of mine).

                Comment


                • #9
                  Logical operatives such as AND, OR plus compratives like GREATER THAN
                  .
                  This is a link to...The Civilization II Scenario League and this is a link to...My Food Blog

                  Comment


                  • #10
                    Hello folks,

                    Lots of interesting ideas. I will try to elaborate some more by giving you an example of how this will work in practice using Freeciv events.
                    For example: imagine you wanted the first player to enter a certain hut in your scenario to get a free Armor unit and a custom text message:

                    Code:
                    function my_callback(unit)
                      if unit.tile == find.tile(25, 22) then
                        create_unit(unit.owner, unit.tile, "Armor", FALSE, unit.homecity, 0)
                        notify.player(unit.owner, "Guderian's lost Panzer division joins you.")
                      end
                    end
                    
                    signal_connect("hut_enter", "my_callback")
                    Using the specification at:


                    signal_connect connects the my_callback callback function to the hut_enter signal. This means whenever a unit enters a hut, my_callback will be invoked.

                    create_unit is an action.

                    Comment


                    • #11
                      Vasc, what's the deal with huts? Are these random easter eggs on the game board? Can they be placed by a scenario designer? Can they be disabled?

                      Comment


                      • #12
                        Originally posted by Harry Tuttle
                        Vasc, what's the deal with huts? Are these random easter eggs on the game board? Can they be placed by a scenario designer? Can they be disabled?
                        Huts aka villages are the goody huts we have had since the original Civilization where you usually get a free technology, free mercenary unit, free city, free gold, or unleashed a barbarian horde.

                        I used this as an example, because we intend to make their behaviour implemented as much as possible using only the events system instead of hard-coding it in C as we do now.

                        On Freeciv they can be randomly placed by the map generator, or selectively placed by a scenario designer on a custom map.

                        This is just one example of a signal you will be able to hook into and unleash an action. More signals could be start_turn, end_turn, unit_destroyed, city_destroyed, player_destroyed, tech_discovered, building_finished etc (I am just giving examples, but the final names may be different).
                        Last edited by Vasc; April 30, 2005, 15:04.

                        Comment


                        • #13
                          Originally posted by Vasc
                          On Freeciv they can be randomly placed by the map generator, or selectively placed by a scenario designer on a custom map.
                          Ah, I see! Good. Being able to control all the aspects of the hut is important.

                          Would entering huts be able to be used as a generic signal for a good majority of the callbacks in the game? So if I wanted to create an "Indiana Jones" scenario a hut could theoretically be used to "spring a trap" if one of my units walked on the tile it inhabited?

                          EDIT: Ok cool. Multiple options as you just wrote.

                          Comment


                          • #14
                            Parameters are important, too. Take unit_destroyed for example. In Civ2 we're restricted to destroyed_unit_type, winning_civ, losing_civ, defense_only, and map_number. It'd be helpful to expand the list to include map_coordinates (can be >1 square), home_city, and victorious_unit_type? Simply expanding the params of your existing events can greatly increase our options. Is that straightforward programming?
                            El Aurens v2 Beta!

                            Comment


                            • #15
                              Originally posted by Harry Tuttle
                              Some more ideas:

                              1) A Callback that plays an audio file or video file.

                              2) A Signal that activates when a certain civ has such an amount in its treasury.

                              In relation to 1), also the ability to show images (PNG, MNG, JPG,GIF, animated GIF's etc..)

                              And for 2) the ability to set a signal for any of the ndicators on the demographics screen. This would allow for some alternative victory conditions. Like the first one to reach a certain population level, literacy, income etc...
                              Skeptics should forego any thought of convincing the unconvinced that we hold the torch of truth illuminating the darkness. A more modest, realistic, and achievable goal is to encourage the idea that one may be mistaken. Doubt is humbling and constructive; it leads to rational thought in weighing alternatives and fully reexamining options, and it opens unlimited vistas.

                              Elie A. Shneour Skeptical Inquirer

                              Comment

                              Working...
                              X