Thread Tools
Old October 15, 2002, 11:19   #1
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
SLIC syntax
Just wanted to check something - am I correct in thinking that square brackets [] are used in SLIC only for accessing array members?
J Bytheway is offline  
Old October 15, 2002, 11:34   #2
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 11:23
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
So far as I know in Slic2 you use quare brackets to access members of arrays and indicate that the just definded variable is an array. From the Slic1 documentation I have this:

Quote:
Regions

There are a number of functions above which act on regions. A region is a parallelogram or union of parallelograms on the map. They can be defined in two ways.

A simple region:

Region name [ x1,y2, x2, y2];


Or a complex region built from a union of any number of simple regions:

Region name = name1 + name2 [+ ... + namen]


WARNING: Regions have not been thoroughly tested, they may not work as advertised!
It looks that the quare brackets in the first of the two examples are part of the syntax, don't know if this can be used in CTP2. I don't know either if you can use in CTP1 arrays.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old October 15, 2002, 11:42   #3
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
I know you can't use arrays in CTP1, and I know of noone who even tried to use regions in either game, but I suspect that they are not in CTP2. Regardless, that's all fine for the purpose I was concerned about.

Thanks.
J Bytheway is offline  
Old October 15, 2002, 12:03   #4
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Weren't the regions part of the fuzzy-logic AI coding? As that isn't used in CtP2, it'd be a fair bet that regions are not used either.
__________________
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
Immortal Wombat is offline  
Old October 15, 2002, 12:12   #5
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 11:23
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
The CTP1 region functions are also present in CTP2 but I guess it is very unlikely that they do something, of course this has to be tested, but than I have to find out how to create a region. Of course these regions could be usefull for some stuff.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old October 15, 2002, 13:38   #6
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 09:23
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
I have a very faint recollection that Locutus either used or tried to use regions for something or other. AFAIK, he was the only one who looked at them.
Peter Triggs is offline  
Old October 15, 2002, 14:03   #7
SMIFFGIG
Call to Power II Democracy GameCall to Power II MultiplayerCTP2 Source Code Project
Prince
 
SMIFFGIG's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Great Britain
Posts: 684
what is AI-fuzzy logic ?

dont answer if its like a massive explanation need not waste your time
__________________
Oxygen should be considered a drug
Tiberian Sun Retro
My Mod for Tiberian Sun Webmaster of
http://www.tiberiumsun.com
SMIFFGIG is offline  
Old October 15, 2002, 14:12   #8
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
Fuzzy logic is a means by which AI (Artificial Intelligence) can make decisions. It was used in CTP1, but not 2. It essentially entails a mathematical interpretation of statements like:

IF I'm at war AND I have few troops THEN I should build more troops.

The good thing about fuzzy logic is that it allows for statements to be partly true - they all have a truth value between 0 and 1 inclusive. This is very useful for interpreting "real world" statements, combining them and so forth. The only places where the fuzziness was really used in CTP1 was in the diplomacy (the rest used only the most crisp form of fuzzy logic it could), but it could have been applied to almost all of the decisions made.

WesW and some others spent hundreds of man-hours tweaking the CTP AI for the MedMod, but noone knows exactly what's going on since we don't know what implication rules and defuzzification methods were used (though we can make a fair guess).
J Bytheway is offline  
Old October 15, 2002, 14:16   #9
SMIFFGIG
Call to Power II Democracy GameCall to Power II MultiplayerCTP2 Source Code Project
Prince
 
SMIFFGIG's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Great Britain
Posts: 684
I understand what your saying and can see definite advantages with using it (or the possibilities of using it) But then why did ctp not make much use of it and why was it tottaly excluded from ctp2. Is there so problems with it that we dont know about or something, surely they should have developed upon the system for ctp2????
__________________
Oxygen should be considered a drug
Tiberian Sun Retro
My Mod for Tiberian Sun Webmaster of
http://www.tiberiumsun.com
SMIFFGIG is offline  
Old October 15, 2002, 14:23   #10
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
I would guess because they hadn't actually made much use of the fuzziness before, they decided it was an unnecessary complication, but you'd have to ask those Apolyton members more intimately involved in the development.

In a way it's a shame they stopped using it because it's very powerful if used correctly, but on the other hand it's easy to get very confused as to what's going on, and it fairly complex to use.
J Bytheway is offline  
Old October 15, 2002, 16:40   #11
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 11:23
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Yes, I vaguely recall trying to use regions but failing. IIRC (but my memories on this are very vague and I lost any notes I made at the time) they're not even implemented in CtP2 (they barely were in CtP1 either).

IIRC fuzzy logic was thrown out to make things easier for the modmakers. It's great that they thought of us, but personally I think I would have preferred it if they had kept it in...
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old October 15, 2002, 17:09   #12
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
In case anyone was wondering why I cared, it's for the next generation of my SLIC template system. My target was to have a system able to auto-generate the unit-updater code arrays, and I have now achieved this goal (more or less). Just to demonstrate, this template:

Code:
[*units.ces [?ObsoleteAdvance|
OLD_UNIT_TYPE[[##]]=UnitDB([.Name]);
[~ObsoleteAdvance enadv[[##]]=Advance_DB([.Name]);
NEW_UNIT_TYPE[[##]]=UnitDB([~Consequences [?[.DB]=DATABASE_UNITS|[.Name]);
PER_UNIT_UPDATE_COST[[##]]=[.ShieldCost];|][![?[.DB]=DATABASE_UNITS|!|]]][!!]]
|][#[?ObsoleteAdvance|+|]]]
Generates the required SLIC, starting with the following sample output (based on the default rules):

Code:
OLD_UNIT_TYPE[0]=UnitDB(UNIT_ARCHER);
enadv[0]=Advance_DB(ADVANCE_CANNON_MAKING);
NEW_UNIT_TYPE[0]=UnitDB(UNIT_CANNON);
PER_UNIT_UPDATE_COST[0]=1200;

OLD_UNIT_TYPE[1]=UnitDB(UNIT_BOMBER);
enadv[1]=Advance_DB(ADVANCE_ADVANCED_COMPOSITES);
NEW_UNIT_TYPE[1]=UnitDB(UNIT_STEALTH_BOMBER);
PER_UNIT_UPDATE_COST[1]=3375;

OLD_UNIT_TYPE[2]=UnitDB(UNIT_CANNON);
enadv[2]=Advance_DB(ADVANCE_CYBERNETICS);
NEW_UNIT_TYPE[2]=UnitDB(UNIT_WAR_WALKER);
PER_UNIT_UPDATE_COST[2]=3500;

OLD_UNIT_TYPE[3]=UnitDB(UNIT_CARAVAN);
enadv[3]=Advance_DB(ADVANCE_GLOBAL_ECONOMICS);
NEW_UNIT_TYPE[3]=UnitDB(UNIT_Z_FREIGHT_TRANSPORT);
PER_UNIT_UPDATE_COST[3]=1200;

OLD_UNIT_TYPE[4]=UnitDB(UNIT_CARRACK);
enadv[4]=Advance_DB(ADVANCE_INTERNAL_COMBUSTION);
NEW_UNIT_TYPE[4]=UnitDB(UNIT_TROOP_SHIP);
PER_UNIT_UPDATE_COST[4]=1200;

OLD_UNIT_TYPE[5]=UnitDB(UNIT_CATAMARAN);
enadv[5]=Advance_DB(ADVANCE_HULL_MAKING);
NEW_UNIT_TYPE[5]=UnitDB(UNIT_LONGSHIP);
PER_UNIT_UPDATE_COST[5]=630;

OLD_UNIT_TYPE[6]=UnitDB(UNIT_CATAPULT);
enadv[6]=Advance_DB(ADVANCE_EXPLOSIVES);
NEW_UNIT_TYPE[6]=UnitDB(UNIT_ARTILLERY);
PER_UNIT_UPDATE_COST[6]=1500;

OLD_UNIT_TYPE[7]=UnitDB(UNIT_CAVALRY);
enadv[7]=Advance_DB(ADVANCE_FUSION);
NEW_UNIT_TYPE[7]=UnitDB(UNIT_FUSION_TANK);
PER_UNIT_UPDATE_COST[7]=5250;

OLD_UNIT_TYPE[8]=UnitDB(UNIT_CLERIC);
enadv[8]=Advance_DB(ADVANCE_MASS_MEDIA);
NEW_UNIT_TYPE[8]=UnitDB(UNIT_TELEVANGELIST);
PER_UNIT_UPDATE_COST[8]=1200;

OLD_UNIT_TYPE[9]=UnitDB(UNIT_DESTROYER);
enadv[9]=Advance_DB(ADVANCE_PLASMA_WEAPONRY);
NEW_UNIT_TYPE[9]=UnitDB(UNIT_PLASMA_DESTROYER);
PER_UNIT_UPDATE_COST[9]=4500;

OLD_UNIT_TYPE[10]=UnitDB(UNIT_DIPLOMAT);
enadv[10]=Advance_DB(ADVANCE_EUGENICS);
NEW_UNIT_TYPE[10]=UnitDB(UNIT_EMPATHIC_DIPLOMAT);
PER_UNIT_UPDATE_COST[10]=1500;

OLD_UNIT_TYPE[11]=UnitDB(UNIT_FIGHTER);
enadv[11]=Advance_DB(ADVANCE_SUPERSONIC_FLIGHT);
NEW_UNIT_TYPE[11]=UnitDB(UNIT_INTERCEPTOR);
PER_UNIT_UPDATE_COST[11]=2500;

OLD_UNIT_TYPE[12]=UnitDB(UNIT_FIRE_TRIREME);
enadv[12]=Advance_DB(ADVANCE_MODERN_METALLURGY);
NEW_UNIT_TYPE[12]=UnitDB(UNIT_IRONCLAD);
PER_UNIT_UPDATE_COST[12]=1500;

OLD_UNIT_TYPE[13]=UnitDB(UNIT_FRIGATE);
enadv[13]=Advance_DB(ADVANCE_PLASMA_WEAPONRY);
NEW_UNIT_TYPE[13]=UnitDB(UNIT_PLASMA_DESTROYER);
PER_UNIT_UPDATE_COST[13]=4500;

OLD_UNIT_TYPE[14]=UnitDB(UNIT_HOPLITE);
enadv[14]=Advance_DB(ADVANCE_GUNPOWDER);
NEW_UNIT_TYPE[14]=UnitDB(UNIT_INFANTRYMAN);
PER_UNIT_UPDATE_COST[14]=1000;

OLD_UNIT_TYPE[15]=UnitDB(UNIT_INFANTRYMAN);
enadv[15]=Advance_DB(ADVANCE_ADV_INFANTRY_TACTICS);
NEW_UNIT_TYPE[15]=UnitDB(UNIT_MARINE);
PER_UNIT_UPDATE_COST[15]=1400;

OLD_UNIT_TYPE[16]=UnitDB(UNIT_INTERCEPTOR);
enadv[16]=Advance_DB(ADVANCE_AI_SURVEILLANCE);
NEW_UNIT_TYPE[16]=UnitDB(UNIT_SPY_PLANE);
PER_UNIT_UPDATE_COST[16]=2815;
Which is mostly pretty good (though the last one is obviously a bit wrong, and there are a couple of others in a similar vein).

Now, from that, can anyone work out the template syntax? .

Edit: Some strange new-lines and spaces have appeared in that which shouldn't be there...
J Bytheway is offline  
Old October 15, 2002, 17:17   #13
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Should there be an _ in Advance_DB ?
__________________
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
Immortal Wombat is offline  
Old October 15, 2002, 17:22   #14
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 10:23
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
Nope. But that's trivial to fix. I was confusing it with DATABASE_ADVANCES .
J Bytheway is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:23.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team