Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Source Code Project > DESIGN: Random ideas for improving SLIC/Modding
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
MrBaggins is offline MrBaggins
King

May 1999
time: 05:33
  Old Post 01-01-2004 21:29
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
DESIGN: Random ideas for improving SLIC/Modding Support Apolyton, buy Civilization III: Complete

Allowing "overloading" of various game data... city improvements, terrain improvements, units, wonders, pop, advances by government

Concept:

Allow for "overloaded" data files, for city improvements, units, terrain improvements, wonders and so on.

You'd optionally specify altered data for that specific whatever under that specific government.

You'd implement this by having some linked list or other data structure, with the extended data in. They get referenced by the original structure, and if there is appropriate data (for the "owners" government,) then its passed back.

Issue: We'd have to ensure that all data was referenced as it related to an owner (like a specific unit or TI,) and then subsequently to the DB, and not directly to a default db value.

Benefit: A lot of modding flexibility. It would be very simple to make costs different for a specific group of units and buildings, say, under a particular government type. You could do tech tree divergence... and a whole bunch of tricks, without SLIC. Would allow for more personality in governments in general.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 01-01-2004 21:41 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Alternativly you cold put into the government.txt modiferers, like a Building modifer and you could also use lists like the terrain effect list for the tile improvements, this way there would be less textfiles do deal with.

-Martin

MrBaggins is offline MrBaggins
King

May 1999
time: 05:33
  Old Post 01-01-2004 23:44
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Enter the AD-FREE zone

Well.. I think that the better solution is to put them in the original file. E.G. for a City improvements... you'd still have just one buildings.txt

If you wished to change say, the effect of the Courthouse in a city under Monarchy (due to a brutal, though effective regime of punishment, for terms of this discussion) you might do the following:

This is the original, and would be kept in the file.

code:
IMPROVE_COURTHOUSE { DefaultIcon ICON_IMPROVE_COURTHOUSE Description DESCRIPTION_IMPROVE_COURTHOUSE EnableAdvance ADVANCE_JURISPRUDENCE ProductionCost 330 Upkeep 1 LowerCrime -0.1 }



This would be an addition to the file:
code:
IMPROVE_COURTHOUSE::GOVERNMENT_MONARCHY { DefaultIcon ICON_IMPROVE_COURTHOUSE Description DESCRIPTION_IMPROVE_COURTHOUSE EnableAdvance ADVANCE_JURISPRUDENCE ProductionCost 300 Upkeep 1 LowerCrime -0.3 HappyInc -1 }



Which would be parsed as an 'extention' to the building record, and referenced, where appropriate.

Notice I've added a happiness penalty, increased the crime reduction and lowered the production cost.

I'm suggesting that you'd only include these where you wished to change the behavior for a specific government. Nothing is mandatory.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 02-01-2004 04:15 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Increase Your PM Length

I rather prefer such a format:

code:
IMPROVE_COURTHOUSE { DefaultIcon ICON_IMPROVE_COURTHOUSE Description DESCRIPTION_IMPROVE_COURTHOUSE EnableAdvance ADVANCE_JURISPRUDENCE ProductionCost 330 Upkeep 1 LowerCrime -0.1 GovernmentEffects { Government GOVERNMENT_MONARCHY Government GOVERNMENT_COMMUNISM Government GOVERNMENT_CORPORATE_REPUBLIC ProductionCost 430 Upkeep 3 LowerCrime -0.3 } }


This way you just have one entry per building and you can modify here very easily. For instace if you don't use one government listed in the government effect struct then the default block outside the struct is used, otherwise the values inside the struct are used, this way it would also be backwards compartible (you don't need to change anything if you want to add it to the *.exe in the text files) and it would alos be very easy to implent, as it is just a change in the database generation script file. Your sollution would be adding more buildings and we are already short of slots for buildings.

-Martin

MrBaggins is offline MrBaggins
King

May 1999
time: 05:33
  Old Post 02-01-2004 05:06
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton buy from Amazon

Yep... we're limited to 64 buildings.... but thats because of the flag used to store them in the city record. Subtypes wouldn't be limited this way...

We're limited, because a uint64 is used to store the flags. We should develop a small extensible flag class, that uses a bit array, perhaps.

This would allow us to extend building.txt as we wished, and just serialize the class instead of the uint64.

As for my example, it will essentially use the exact same parser behavior, with a modification to notice and redirect the data for the different governments.

Also, I think we should include all the record of the data in the GovernmentEffect... thus you can remove effects (by their absence) and change, say the icon, description or advance, in the case of a building.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:33
  Old Post 02-01-2004 05:29 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

I like the idea. From a modding point of view, I think Martin's method is easier, and cetainly more similar to the current way the textfiles handle things.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:33
  Old Post 02-01-2004 07:28
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Tired of ads?

I just took a closer look at this. (the newdb stuff.) As I've recalled, there were no structs within structs which would be the issue with doing it the second way. Thats not to say it won't work that way, and indeed, it would be preferable to do so. I'll do a test to check.

I also noticed the ready prepared bitarray class, that we should use instead of a uint64, for buildings and wonders...

MrBaggins is offline MrBaggins
King

May 1999
time: 05:33
  Old Post 03-01-2004 00:30
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Lose 30 kilos (of popups)

Update. What Martin has suggested isn't allowed by the parser at present... There seems to be a problem with having some array type dataclasses within a structure, in certain circumstances.

I'm working on the problem.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:33
  Old Post 04-01-2004 01:25 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton, buy Civilization 2

If possible a syntax more like Martin's is better because it removes redundancy - e.g. in the first syntax you would have to alter two entries if you changed the name of the icon, but in the latter you need only change a single entry.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:33
  Old Post 04-01-2004 01:47
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Put an end to popups!

Only for required elements.

If you have a non-required element, you wouldn't know if its absence means it should be removed or unchanged.

Even so... its becoming increasingly clear from the stuff I've been looking at that its exponentially more difficult to alter the db parser in that manner.

The strategy that I think we should persue is...

* Generate a link list datatyperecord class member variable, and an array to hold the list of governments in the class def for the datatype
* Use an alternate custom token in the generated parser code, that checks for the token (I.E. a colon) specified for the modified specification, or the opening brace, rather than just the opening brace
* Use a custom token seperator (I.E. a comma) to seperate a list of the governments that the modified specification applies to.
* In parsing, follow the linked list, until the pointer to the governmentmodifier member object is null, then create a new object, populate the list of governments and parse the actual data into it.
* Overload the base accessor function to include an int (?) in addition to the regular arguments, for the index of the government that you wish to access data for.
* That accessor would find the data, then traverse the linked list looking for a matching government, and if it found it, replace the data as appropriate.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 04-01-2004 03:16 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Increase Your PM Length

Well alternativly you could include in the government.txt for each government a list of buildings that are replaced by other buildings, we could store it in two lists. Provided we have the more then 64 Buildings support.

-Martin

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:33.
Apolyton Time is 00:33.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0473 seconds (89.36% PHP - 10.64% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net