Announcement

Collapse
No announcement yet.

A quite difficult problem...

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

  • A quite difficult problem...

    I have 3 questions to begin with:

    1. After I have created a unit(hopefully I'll manage) what should I do so that the game knows about it(including AI) and actually to be able to play with that unit?

    2. Where can I modify the "global warming" occurence chance?

    3. Where can I download an ANSI C compiler, the gmake program and everything else that I need to compile the game? (I know this sounds stupid but I'm hoping that there is a site which contains all of this stuff... for free ).
    P. Bogdan

  • #2
    1. If the unit is in the ruleset, the the game and the AI will know about it and use it.

    2. Don't know. I think this is hard-coded in the source code.

    3. Depends on your platform. If you are a Windows user, then you should try http://www.cygwin.com/ - press 'Setup' and choose to install everything. Compiling on Windows is hard. If you are a Linux user, then in all likelihood your system already has all the tools you need :-)

    Comment


    • #3
      2. You can do it by editing the default value of game.warminglevel in common/game.c, and then recompiling .
      http://www.hardware-wiki.com - A wiki about computers, with focus on Linux support.

      Comment


      • #4
        Thanks for your help! I owe you one...
        P. Bogdan

        Comment


        • #5
          Yup, it's there (I love browsing the source)



          PHP Code:
          189 ***************************************************************/
          190 void game_init(void)
          191 {
          192   int i;
          193   game.is_new_game   = TRUE;
          194   game.globalwarming = 0;
          195   game.warminglevel  = 8;
          196   game.nuclearwinter = 0;
          197   game.coolinglevel  = 8;
          198   game.gold          = GAME_DEFAULT_GOLD;
          199   game.tech          = GAME_DEFAULT_TECHLEVEL;
          200   game.skill_level   = GAME_DEFAULT_SKILL_LEVEL;
          201   game.timeout       = GAME_DEFAULT_TIMEOUT;
          202   game.timeoutint    = GAME_DEFAULT_TIMEOUTINT;
          203   game.timeoutintinc = GAME_DEFAULT_TIMEOUTINTINC;
          204   game.timeoutinc    = GAME_DEFAULT_TIMEOUTINC;
          205   game.timeoutincmult= GAME_DEFAULT_TIMEOUTINCMULT;
          206   game.timeoutcounter= 1;
          207   game.tcptimeout    = GAME_DEFAULT_TCPTIMEOUT;
          208   game.netwait       = GAME_DEFAULT_NETWAIT;
          209   game.last_ping     = 0;
          210   game.pingtimeout   = GAME_DEFAULT_PINGTIMEOUT;
          211   game.pingtime      = GAME_DEFAULT_PINGTIME;
          212   game.end_year      = GAME_DEFAULT_END_YEAR;
          213   game.year          = GAME_START_YEAR;
          214   game.turn          = 0;
          215   game.min_players   = GAME_DEFAULT_MIN_PLAYERS;
          216   game.max_players  = GAME_DEFAULT_MAX_PLAYERS;
          217   game.aifill      = GAME_DEFAULT_AIFILL;
          218   game.nplayers=0;
          219   game.researchcost = GAME_DEFAULT_RESEARCHCOST;
          220   game.diplcost    = GAME_DEFAULT_DIPLCOST;
          221   game.diplchance  = GAME_DEFAULT_DIPLCHANCE;
          222   game.freecost    = GAME_DEFAULT_FREECOST;
          223   game.conquercost = GAME_DEFAULT_CONQUERCOST;
          224   game.settlers    = GAME_DEFAULT_SETTLERS;
          225   game.explorer    = GAME_DEFAULT_EXPLORER;
          226   game.dispersion  = GAME_DEFAULT_DISPERSION;
          227   game.cityfactor  = GAME_DEFAULT_CITYFACTOR;
          228   game.citymindist = GAME_DEFAULT_CITYMINDIST;
          229   game.civilwarsize= GAME_DEFAULT_CIVILWARSIZE;
          230   game.contactturns= GAME_DEFAULT_CONTACTTURNS;
          231   game.rapturedelay= GAME_DEFAULT_RAPTUREDELAY;
          232   game.savepalace  = GAME_DEFAULT_SAVEPALACE;
          233   game.natural_city_names = GAME_DEFAULT_NATURALCITYNAMES;
          234   game.unhappysize = GAME_DEFAULT_UNHAPPYSIZE;
          235   game.angrycitizen= GAME_DEFAULT_ANGRYCITIZEN;
          236   game.foodbox     = GAME_DEFAULT_FOODBOX;
          237   game.aqueductloss= GAME_DEFAULT_AQUEDUCTLOSS;
          238   game.killcitizen = GAME_DEFAULT_KILLCITIZEN;
          239   game.scorelog    = GAME_DEFAULT_SCORELOG;
          240   game.techpenalty = GAME_DEFAULT_TECHPENALTY;
          241   game.civstyle    = GAME_DEFAULT_CIVSTYLE;
          242   game.razechance  = GAME_DEFAULT_RAZECHANCE;
          243   game.spacerace   = GAME_DEFAULT_SPACERACE;
          244   game.fogofwar    = GAME_DEFAULT_FOGOFWAR;
          245   game.fogofwar_old= game.fogofwar;
          246   game.borders     = GAME_DEFAULT_BORDERS;
          247   game.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE;
          248   game.notradesize    = GAME_DEFAULT_NOTRADESIZE;
          249   game.fulltradesize  = GAME_DEFAULT_FULLTRADESIZE;
          250   game.barbarianrate  = GAME_DEFAULT_BARBARIANRATE;
          251   game.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN;
          252   game.nbarbarians = 0;
          253   game.occupychance= GAME_DEFAULT_OCCUPYCHANCE;
          254 
          255   game.heating     = 0;
          256   game.cooling     = 0;
          257   sz_strlcpy(game.save_name, GAME_DEFAULT_SAVE_NAME);
          258   game.save_nturns=10;
          259 #ifdef HAVE_LIBZ
          260   game.save_compress_level = GAME_DEFAULT_COMPRESS_LEVEL;
          261 #else
          262   game.save_compress_level = GAME_NO_COMPRESS_LEVEL;
          263 #endif
          264   game.randseed=GAME_DEFAULT_RANDSEED;
          265   game.watchtower_vision=GAME_DEFAULT_WATCHTOWER_VISION;
          266   game.watchtower_extra_vision=GAME_DEFAULT_WATCHTOWER_EXTRA_VISION,
          267   game.allowed_city_names = GAME_DEFAULT_ALLOWED_CITY_NAMES;
          268 
          269   sz_strlcpy(game.rulesetdir, GAME_DEFAULT_RULESETDIR);
          270 
          271   game.num_unit_types = 0;
          272   game.num_impr_types = 0;
          273   game.num_tech_types = 0;
          274 
          275   game.government_count = 0;
          276   game.default_government = G_MAGIC;        /* flag */
          277   game.government_when_anarchy = G_MAGIC;   /* flag */
          278   game.ai_goal_government = G_MAGIC;        /* flag */
          279 
          280   sz_strlcpy(game.demography, GAME_DEFAULT_DEMOGRAPHY);
          281   sz_strlcpy(game.allow_take, GAME_DEFAULT_ALLOW_TAKE);
          282 
          283   game.save_options.save_random = TRUE;
          284   game.save_options.save_players = TRUE;
          285   game.save_options.save_known = TRUE;
          286   game.save_options.save_starts = TRUE;
          287   game.save_options.save_private_map = TRUE;
          288 
          289   game.load_options.load_random = TRUE;
          290   game.load_options.load_players = TRUE;
          291   game.load_options.load_known = TRUE;
          292   game.load_options.load_starts = TRUE;
          293   game.load_options.load_private_map = TRUE;
          294   game.load_options.load_settings = TRUE;
          295 
          296   init_our_capability();    
          297   map_init();
          298   idex_init();
          299   cm_init();
          300   
          301   for(i=0; i<MAX_NUM_PLAYERS+MAX_NUM_BARBARIANS; i++)
          302     player_init(&game.players[i]);
          303   for (i=0; i<A_LAST; i++)      /* game.num_tech_types = 0 here */
          304     game.global_advances[i]=0;
          305   for (i=0; i<B_LAST; i++)      /* game.num_impr_types = 0 here */
          306     game.global_wonders[i]=0;
          307   game.player_idx=0;
          308   game.player_ptr=&game.players[0];
          309   terrain_control.river_help_text[0] = '\0';
          310 }
          311 
          312 /*************************************************************** 
          
          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


          • #6
            Yeah, I found it myself, but thanks anyway for your effort
            Anyhow, I think it's better to make the AI manage pollution better rather than changing the game.globalwarming variable...
            P. Bogdan

            Comment


            • #7
              Originally posted by CMaster2003
              Yeah, I found it myself, but thanks anyway for your effort
              Anyhow, I think it's better to make the AI manage pollution better rather than changing the game.globalwarming variable...
              I had no doubt you already found it yourself. But I was adressing the casual reader here.

              My statement is meant to show of the fun things things that FC offers to the average public/forumgoer.reader/lurker. You can browse the source directly at the website! Is this relevant to programmers or someone who is already into Freeciv? The answer is no.

              So nothing new for coders and FC players. True, but it's also important for others (who are not into FC) to know that these features exist . You have to show your stuff if you want people to get interested.
              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