**tough guys only** begre1929's workshop

begre1929
2012-12-10
2013-01-10
  • begre1929
    begre1929
    2012-12-10

    Hi there!

    you know freecol is one of very few games I really enjoy to play. I have a lot of features in my (metal)head… so yesterday I wanted to get my fix (…) I grab the svn version, then I started to code some features…. well it was my first time with java so….

    …but now I want to share with you some stuffs I did :

    - I removed the build queeu of a new built colony (for personal convenience, and I wanted to start by something really easy)

    - I added a new action : "scorches the land", every tile improvement, except the road, can be remove (in one shot). Is working yet, but all unit can do it even the wagons, so I'm going to add/change some parts like : scorching only on your own territory and in enemy territory, requiring some tools to do it, maybe addin a new unit like military-engineer (not for pioneering but for putting the mess).

    - building a new colony requires 60 tools. formely only a colonist with the role of pioneer can do it yet. I always wondered why we can (already in colonization) just back to europe a treasure by building a one-turn-colony…. want more ? well you have to cut the forest before installing a new colony (I have severals reasons for doing that, but don't speak now). so technicaly you should need up to 80 tools just for build a new colony on a forest tile, you'll have to think twice….

    - maybe you already try to build a line of colonies just in the way to use them as a canal for your shit-ships… I added some pieces of code who deny that, you can't move a ship to a landlocked town. Moreover you can't enter with a ship to a coastal town who hasn't a dock (yeah baby dat's right, tough guys only). I changed the panel "goto" for stay consistent. I did that because in a later game I always feel lame when I try to send my ships and I have hundreds and hundreds (…) of ports…

    - some few other stuffs coded but not ready… like improvment for the limitation… and a lot in my head…

    - I modified specification.xml too. I won't speak about that now, it's far to be over.

    hope my english isn't too crappy… because I know I'll can't edit the topic after posted…

     
  • begre1929
    begre1929
    2012-12-13

    my limitation improvement works. I'm using it for ship limitation yet. Each drydock has an ability to support one naval unit, so every drydock built allow to get one more ship. I think giving 3 ships per drydock in hte futur. unfortunately I try to add the same modifier to the shipyard, but it seems when a building is updated (drydock->shipyard) he doesn't got double ability. I'm going to think more about that. My aim is to adding this limitation also for terrestrial units, like having barracks for support infantry…
    is working even in europe, it's not possible to buy more ships than support capacity.

    I also started to adding my food system. All europeans will need 2foods per turn. Unit outside of town will die if they run out of food. Isn't ready yet, but people started to die here XD… it will be a more complicated system, I'm gonna adding the ability to hunt, to plunder. My big question is how to handle people in europe. I need to think… because I don't want allowing people to use the european port as a "storage-freefood-space"….

     
  • begre1929
    begre1929
    2012-12-22

    Hi there!
    so… looks like the world didn't disappear… but my screen computer is dead… so I can't continue to code on my main computer for now. Too shame because I started to code my own goodies transports between towns/ports…

    about my food system, I decided to giving foods to each colonist who appears in europe, but each turn he gonna eat too, so if you'll don't bring him to a colony to get some fresh foods, when he'll out of food, he'll live the port and go back to his house… means he disappears…

    but on my old laptop I started and finished today to change the time scale, now I have 1 year = 12 turns, means 1 turn = 1 month. Why I did this? because I want to make the map more dynamics, take into account  the temperature of a tile, then adding a temperature value for each tile changing during a year (also taking into account if you are in south or north hemisphere). So each tile production will be affected by temperature. Colonies will too, I plan to add wood need for each colonist in a town when temperature is low….

    told you… many ideas…

     
  • begre1929
    begre1929
    2012-12-24

    ladies,

    today the map becomes dynamic!
    my production is now a function of temperature, date and latitude. Better to boring you with equation, I'm gonna show you an example : I built four colonies, each has only one colonist who farms food. First colony was built at the north edge, the colonist works on a tile at a latitude -90. A second colony is near the equator, the colonist works on a tile a latitude 0. I built two other colonies, one in south hemisphere, the colonist works at latitude 33, and the last one in north hemisphere, the colonist works at latitude -50.

    Now I'm gonna add the table of the production over a year. Notice that the production value isn't important here, because I didn't mess with specifications.xml, so it's not balanced! the important thing is to watch how the production changes. I added the temperature of the tile too.

    Latitude TileTemperature Production
    feb-----------------------------------
    -50 4 0
    -90 -4 0
    0 33 2
    33 21 3
    mar-----------------------------------
    -50 7 1
    -90 -4 0
    0 33 2
    33 18 3
    apr-----------------------------------
    -50 11 2
    -90 -4 0
    0 33 2
    33 14 2
    may-----------------------------------
    -50 14 2
    -90 -4 0
    0 33 2
    33 11 1
    jun-----------------------------------
    -50 26 2
    -90 -4 0
    0 33 2
    33 0 0
    jul-----------------------------------
    -50 26 2
    -90 -4 0
    0 33 2
    33 0 0
    aug-----------------------------------
    -50 20 3
    -90 -4 0
    0 33 2
    33 6 1
    sep-----------------------------------
    -50 14 2
    -90 -4 0
    0 33 2
    33 11 1
    oct-----------------------------------
    -50 4 0
    -90 -4 0
    0 33 2
    33 21 3
    nov-----------------------------------
    -50 -2 0
    -90 -4 0
    0 33 2
    33 26 2
    dec-----------------------------------
    -50 -8 0
    -90 -4 0
    0 33 2
    33 32 2
    jan-----------------------------------
    -50 -8 0
    -90 -4 0
    0 33 2
    33 32 2
    feb-----------------------------------
    -50 -2 0
    -90 -4 0
    0 33 2
    33 26 2

    as you can see, colonies near "north pole" and on equator haven't their temperatures fluctuating, but others have. Moreover the colony at 33 produce more when it's winter for hemisphere north, and less when it's winter for hemisphere south. I hope this point makes sense. For this example I added a new attribute to grain, grain prefers to be produce at a temperature of 22°C (this choice was made totaly arbitrary).

    I did severals simulations, I'm happy with results. But I will have to think how to balanced the production. Has you can see during some months colonist doesn't produce anything, I expected that, but I will have to be sure that doesn't make the game unplayable…

    I have now to clean the code, then I'm gonna add some new attributes to colonists… like the need of wood when it's cold…

     
  • begre1929
    begre1929
    2012-12-28

    I worked on the need of wood, my first idea was to make a new class called "need", I did it and added to specification.xml some pieces of code :

        <!-- Needs not like consumes, are 'needed' only if a condition is meet -->
        <needs>
            <!-- need.wood.for.heat, below 5(°C) in the colony, colonists will beg for woods... -->
            <need id="need.wood.for.heat" />
        </needs>
    

    and add the need to colonist unit type:

        <unit-type id="colonist" abstract="true" offence="0" defence="1" movement="3" lineOfSight="1">
          <ability id="model.ability.person" value="true"/>
          <ability id="model.ability.foundColony" value="true"/>
          <ability id="model.ability.canBeEquipped" value="true"/>
          <ability id="model.ability.canBeCaptured" value="true"/>
          <downgrade unit="model.unit.undead" undead="100"/>
          <downgrade unit="model.unit.freeColonist" clearSkill="100"/>
          <consumes id="model.goods.food" value="2" />
          <consumes id="model.goods.bells" value="1" />
        <need id="need.wood.for.heat"/>
        </unit-type>
    

    honestly wasn't easy to get this worked, (I remind you I'm not a programmer…), but now this part works. I started to change the production informations, but I think i'm gonna remove my need class and update the consumer/consume (i don't know his name actually) and adding some conditions options, like ALWAYS meaning every turn (default option, especially if nothing set in specification.xml like the food consummation), or for me when temperature is below a value (I want to add operators like lower than a value, greater, equal… same as <limit> have)… then I will add effect if requirement isn't satisfy, in the case of the wood need, I plan to divide the production of the colonist by 4 (like always value will be balanced later). Later It will affect more your colony… but this part is not for today…

    after that I plan to improve my dynamical production system. First I want to take into account the humidity of the case. This one will also fluctuating by month. For now I think to take the inverted value of the temperature fluctuation, for example when it will be warm on a tile, humidity will fall. Each plant will have a favorite temperature and favorite humidity. After I plan to change the informations of tile panel information. Better reading grain : 5, toboco : 3, whatever… i will add soil fertility, so each plant will have a certain amount of production calculated by the difference between is favorite temperature and the tile temperature, by the difference between the favorite humidity and the tile humidity, and multiply by the soil fertility. More a soil will be fertility more you'll produce. Some want to know about wood/ore/silver/fish/babies, (huh babies?? no no it's a joke) , these ones will change too, but I don't want to speak about that now… I have ideas… XD…. and I think you'll love my fishing system… XD…

    I don't want to speak a lot about others things I want to add or change. There's one i would like to discuss with people, it's about a new naval system. This is my present thoughts :

    Ship attributes : each ship type will have specific attributes : speed , space , maneuverability
    example : merchant ship, speed =4, space=400, maneuverability=0.3 (values are just for example…)

    Space : each unit of good will take 1 unit of space, in that way you will be able to load 150 foods and 250 woods for example. BUT ship will need a crew to move, a crew is a colonist, each colonist will take 50 space plus is equipment. For example if you use a soldier, it will take 100 units of space (50 for colonist and 50 for muskets), actually it will take more, you'll have to take in account my food system, you will have to give space for food.

    speed : is the number of case-movements can be done when the ship is full, means when all 400 spaces are taken. But less you used space, more the ship will be faster. Maybe using maneuverability (here for my example if you to do a multiplication that gives 400*0.3 = 120, that a "bit" too much movements I guess), or adding another attribute like "speedVariation" by type ship or a global attribute, meaning same for all ships…

    Maneuverability : this is for naval battle system. One can ask where is defense/offense attributes. Well In my system, I also plan to add naval canon, if you'll plan to use a ship as a military unit you will have to board canons, the offense/defense attributes would be a multiplication between the number of canons and the maneuverability. The thing I don't know now, is how to set difference between defense and offense.

    Crew : I plan to take in consideration the crew skill (that means if you board more one unit you will be allowed to chose which one is the crew) for ship attributes.

    I still hope my english isn't too crappy, because I can't edit my post… If it's too crappy, please tell me what's wrong I want to improve my english…

     
  • begre1929
    begre1929
    2013-01-02

    hello folks!
    I don't have finished my need of wood system yet. Because I have restarted again and again until I was satisfied by what I got. Moreover was first time for me to mess with array,map and other stuffs like that… and the hell was the xml parser… I restarted almost ten times… but I'm on a good way now. Actually I rework the consumption for unitType. Before consumes look like :

    <unit-type id="colonist" abstract="true" offence="0" defence="1" movement="3" lineOfSight="1">
          <ability id="model.ability.person" value="true"/>
          <ability id="model.ability.foundColony" value="true"/>
          <ability id="model.ability.canBeEquipped" value="true"/>
          <ability id="model.ability.canBeCaptured" value="true"/>
          <downgrade unit="model.unit.undead" undead="100"/>
          <downgrade unit="model.unit.freeColonist" clearSkill="100"/>
          <consumes id="model.goods.food" value="2"/>
          <consumes id="model.goods.bells" value="1"/>
        </unit-type>
    

    and this is I want to get working :

    <unit-type id="colonist" abstract="true" offence="0" defence="1" movement="3" lineOfSight="1">
          <ability id="model.ability.person" value="true"/>
          <ability id="model.ability.foundColony" value="true"/>
          <ability id="model.ability.canBeEquipped" value="true"/>
          <ability id="model.ability.canBeCaptured" value="true"/>
          <downgrade unit="model.unit.undead" undead="100"/>
          <downgrade unit="model.unit.freeColonist" clearSkill="100"/>
          <!-- priority must be defined and unique -->
          <consumes id="model.goods.food" value="2" priority="0" ifCant="die"/>
          <consumes id="model.goods.bells" value="1" priority="1"/>
          <consumes id="model.goods.lumber" value="1" priority="3" ifCant="halfProduction">
            <limit id="need.wood.for.heat" operator="LT">
              <!-- need wood to heat my house -->
              <leftHandSide scopeLevel="SETTLEMENT" method-name="getTurnTemperature"/>
              <rightHandSide value="7" />
            </limit>
          </consumes>
          <consumes id="model.goods.lumber" value="1" priority="2" ifCant="noProduction">
            <limit id="need.more.wood.for.heat" operator="LT">
              <!-- dude, it's really cold there... -->
              <leftHandSide scopeLevel="SETTLEMENT" method-name="getTurnTemperature" />
              <rightHandSide value="0" />
            </limit>
          </consumes>
        </unit-type>
    

    everything is coded excepted the ifCant call, maybe this week, but I have lot of work during the next 10 days, so it will maybe has to wait. Here some explanations, priority is the order in which a consumption will be consumed. 0 is the first, if consumes fail, ifCant will be called, in this case for killing the colonist.

    For my need of wood system I decided to add a second level of need of wood system. The most important is priority=2, in this case if you don't have wood, the colonist won't work. for the priority=3 it will work for half production. In the future I will to add more effects… but this is future…

    As you can see I added the limit already coded, so it allow people to change these datas easily.

    I think to add _ifCant _ methods on the version of colony on server, and update how the production is calculated…