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 > Alternative Civs > Clash of Civilizations > Infrastructure and Resource Class OO Design
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
04.Sep: `FC` 2.0.5 COMPLETED AND RELEASED
27.Jul: `FC` 2.0.4 COMPLETED AND RELEASED
16.Jul: `FC` 2.0.3 COMPLETED AND RELEASED

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
F_Smith is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
Post  Old Post 19-10-2000 09:18
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Infrastructure and Resource Class OO Design Tired of ads?

Hi, all:

I'm going to have a lot of free time to code this weekend, so let's try and help me get a good understanding of what will have to go into these classes before I code them up!

Otherwise, who knows what I'll produce . . .




First, the background --

A 'MapSquare' has a 'Terrain' object. This 'Terrain' object will hold a collection of 'Infrastructure' objects, and a collection of 'Resource' objects. (Or a collection of 'pointers' to those objects, to be more accurate).

So what we need to do first is have a quick brainstorming session. Post any and all ideas for properties of each of these objects. Even post ideas that might seem silly -- we need to consider everything.

We need people willing to stretch the limits, push the boundaries, consider things that might seem a bit off. This is absolutely important. Most of the ideas might not make the cut into the final object, but if even one excellent new idea does come along, we've gained big-time.

I'll try and start this off. First, some definitions:

Infrastructure: any man-made structures/facilities. Structures with a single use but multiple buildings can be grouped, like 'housing' instead of one object for each house. Or 'factories' instead of one object for each factory. Examples of 'Infrastructure' instances are,

    [*]defenses
    [*]housing
    [*]large vehicles (tanks, ships, etc).
    [*]irrigation ditches/tractor/crop-dusting airplane
    [*]schools/factories/etc
    [/list]

    * * *

    Resource: anything that can be the input to a production function. Resources will be grouped by type, with an 'amount' variable -- one object for 'trees', instead of one object for each tree. Examples are,

      [*]trees
      [*]berry bushes
      [*]tin
      [*]iron
      [*]water
      [*]horses
      [*]sheep
      [*]wheat
      [*]cotton
      [/list]

      So the question now is, what 'properties' does each object need? For example, 'Resources' needs a 'units' integer, and a 'type' String.

      Have at it!

Richard Bruns is offline Richard Bruns
King
NC, USA
Nov 1999
time: 06:13
Post  Old Post 19-10-2000 02:13 Visit Richard Bruns's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Enter the AD-FREE zone

Here is something I posted in the last thread. It seemed like everyone agreed with it. It seems to fit in to this discussion as well. The text in bold is a change to the original post.
---

I have been thinking about the vegetation class being derived from the resource class. Simply for naming purposes, it would be good to call them different things. Right now, we don't know if "resourse" means the entire forest or just the medicinal herbs.

So I propose creating a derived class called "GroundCover." Originally I called it "Vegetation", but that definition wasn't broad enough. This class extends the resource class or the infrastructure class and adds the following functionality:

Defines the percent of land area of the terrain occupied by the ground cover.

Determines erosion, soil loss, water quality changes, global climate change effects, and other things needed by the ecology model.

Determines defense adjustment and travel time for land units. It also determines if it is even possible for a unit to cross the terrain. FE tanks could not cross a swamp but infantry could.

GroundCover classes include crops, natural vegetation, water, and human habitation.

So we have:


    [*]mapsquare

      [*]Climate ("Warm Temperate Zone")
      [*]Natural Water Rating
      [*]Ethnic Group ("3,000 Romans")
      [*]Ethnic Group ("200 Etruscans")
      [*]Task Force ("Fifth Legion")
      [*]terrain ("Mountains, 20%)

        [*]Potential Water Rating
        [*]Land Value
        [*]resource ("X tons of iron ore")
        [*]resource ("Y tons of non-ferrous ore")
        [*]GroundCover ("Barren ,99%")
        [*]GroundCover ("Human Habitation, 1%")

          [*]infrastructure ("Lookout Posts")

            [*]pointer to TF
            [/list][/list][/list]
            [*]terrain ("Hills, 70%")

              [*]Potential Water Rating
              [*]Land Value
              [*]resource ("X tons of coal")
              [*]resource ("Y tons of iron ore")
              [*]resource ("Z tons of non-ferrous ore")
              [*]GroundCover ("Scrubland, 30%")

                [*]resource ("Y tons of game")
                [/list]
                [*]GroundCover ("Forest, 68%")

                  [*]resource ("X cord feet of lumber")
                  [*]resource ("Y tons of game")
                  [*]resource ("Z pounds of medicinal herbs")
                  [/list]
                  [*]GroundCover ("Human Habitation, 2%")

                    [*]infrastructure ("Fort Valor")

                      [*]pointer to TF
                      [/list][/list][/list]
                      [*]terrain ("Valley, 10%")

                        [*]Potential Water Rating
                        [*]Land Value
                        [*]resource ("X tons of clay")
                        [*]resource ("Y tons of gravel")
                        [*]GroundCover ("River, 10%")

                          [*]resource ("X tons of fish")
                          [*]resource ("Y gallons of water")
                          [/list]
                          [*]GroundCover ("Human Habitation, 10%")

                            [*]pointer to EG's
                            [*]infrastructure ("Dock")
                            [*]infrastructure ("30 Fishing Boats")
                            [*]infrastructure ("Housing")
                            [*]and so on. . .
                            [/list]
                            [*]GroundCover ("Crops, 80%")

                              [*]resource ("X bushels of barley")
                              [*]resource ("Y bushels of wheat")
                              [*]resource ("Z bushels of vegetables")
                              [/list][/list][/list] [/list]

                              ---

                              I'm not sure how to approach the properties, but here is my shot at it:

                              Resource
                              [*]name
                              [*]total quantity
                              [*]available quantity determination (An equation or set of rules based on technology and infrastructure levels that determines what your civ is capable of extracting. FE you might only be able to get 30% of the availiable ore until you get a certain level of technology. This number would be defined once per resource type, and the individual resource objects would have a pointer to that definition.)
                              [*]quality/purity (Multiplies the effect of the resource)
                              [*]concentration/ease of extraction (Determines the effort needed to get a unit of the resource)
                              [*]effect of the resource (What it does and what it is used for. I am guessing that this should be defined globally for all resources of that type. FE we define what oil does and then put a pointer to that definition in the resource object.)

                              Infrastructure
                              [*]Name
                              [*]Pointer to infraclass (Defines what it does and how it works)
                              [*]Quantity
                              [*]Quality (Multiplies effects defined by the infraclass)

                              Ground Cover
                              Since this would probably extend the other two classes, I'll only list the added properties:
                              [*]Percentage of the terrain
                              [*]Pointer to global properties definition
                              [*]Density/Concentration (Modifies some global properties. FE a dense forest is harder to move through and gives better defense.)

                              The global properties list would have the following:
                              [*]Ecology Effects (Full Details not yet determined)
                              [*]Defense Modifier
                              [*]Movement cost defined seperately for each unit type. (Can be a number or "Impassable")
                              [*]Attrition effects on each unit type. (Rugged terrain wears down machines more.)

                              Is that what you were looking for, F_Smith?
                              [This message has been edited by Richard Bruns (edited October 18, 2000).]

Lord God Jinnai is offline Lord God Jinnai
Prince
St. Louis
Sep 1999
time: 23:13
Post  Old Post 19-10-2000 02:59 Visit Lord God Jinnai's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Lose 30 kilos (of popups)

quote:


Resource

name

total quantity

available quantity determination (An equation or set of rules based on technology and infrastructure levels that determines what your civ is capable of extracting. FE you might only be able to get 30% of the availiable ore until you get a certain level of technology. This number would be defined once per resource type, and the individual resource objects would have a pointer to that definition.)


Well the player should only see available quanity then.
quote:


quality/purity (Multiplies the effect of the resource)

concentration/ease of extraction (Determines the effort needed to get a unit of the resource)

effect of the resource (What it does and what it is used for. I am guessing that this should be defined globally for all resources of that type. FE we define what oil does and then put a pointer to that definition in the resource object.)


Another thing might need to be added...

renewability Speed at which the resource is replaced in game terms. This can be not at all also.

Do you want a list of the resources we need right now?
[This message has been edited by Lord God Jinnai (edited October 19, 2000).]

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 19-10-2000 06:31 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Browse Apolyton AD-FREE

First of all, I'm having some trouble with the definition of infrastructure as something that includes tanks and other military vehicles. Here is a definition I took off a web page, just because I was too lazy to think of my own definition for infrastructure:

the term "infrastructure" usually refers to public investment in constructing and maintaining roads, bridges, airports, railroads, communications networks, water supplies, solid waste management, electricity production and distribution systems, the legal system, police and fire protection services, etc.

Now we have agreed in another thread that we might treat things like capital in the economic model using an infrastructure class, seeing as its just essentially slightly mutilating a piece of nomenclature, and would keep down the number of unique game objects that we need. So I don't have a problem with you calling factories infrastructure for the game object model, even though it's technically wrong.

But it seems to me to be hopelessly confusing things to also add self-propelled military vehicles and ships as an infrastructure class. They are really completely different from the other things we are calling infrastructure, and the should be an object all their own called perhaps weapons, or weapons systems, or something like that.

Doesn't this almost all-inclusive definition of infrastructure seem wrong to anyone else?

So when putting together a military unit you would add people, weapons, and training to create the aggregate military unit. (Perhaps the training should be associated directly with the people in the object model for a military unit). But this is another topic, and we can cover it later.

Leaving the issue of tanks etc. as infrastructure aside for the moment, I agree with the things that Richard put down for the infrastructure class:

Infrastructure
Name
Pointer to infraclass (Defines what it does and how it works)
Quantity
Quality (Multiplies effects defined by the infraclass)

Each infraclass (describing the overall behavior of the type of infrastructure) should have the characteristics that axi outlined in Proposal for a Complete Infrastructure Model. I'll name them below, and provide a short definition, but you may need to look in the thread to see what the specific meaning of each is.

Infraclass:
- Persistant/Consumed. A dummy variable. An infraclass is consumed (0) when the amount that gets used is lost in the process (this is true for food and consumer goods; it might also be true for other classes too).
- Mobility. What % of this classes units is mobile and can be taken away from the mapsquare/province/civ the model is applied.
- Decay. What % of each classes units gets lost each turn.
- Backup. The % of a classes units that is kept unused, although it can be used. This has sense chiefly for making stores of consumed classes.
- Minimum Output. The minimum (per capita) # of each classes units that are needed for survival.

These definitions don't work really well with what I would call military infrastructure, at least for things like fortifications. So perhaps what we really need is an Infrastructure superclass, that then has EconomicInfrastructure, MilitaryInfrastructure and other objects that inherit from it.

Sorry, but that's all I've got time for tonight. I'll put more thoughts down as soon as I get a chance.

Richard Bruns is offline Richard Bruns
King
NC, USA
Nov 1999
time: 06:13
Post  Old Post 19-10-2000 06:34 Visit Richard Bruns's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Call to Power 2

I was listing everything in the guts of the model, not what the player sees.

The renewability attribute is a good addition. But rather than being an innate property, I think it should be determined by outside factors. FE the renewability of a particular patch of forest is determined by the ecology model and can change over time.

Richard Bruns is offline Richard Bruns
King
NC, USA
Nov 1999
time: 06:13
Post  Old Post 19-10-2000 06:47 Visit Richard Bruns's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase the size of your Attachments

Mark:

I didn't mean for the TF itself to be a part of the Fort infrastructure. The pointer in the Fort is simply a flag showing the location of the army. So when that TF moves, the pointer could move to the "Forest" or "Village". The TF itself is stored seperately and independently, at the square level.

axi is offline axi
Prince
Athens Greece
Sep 1999
time: 07:13
Thumbs up  Old Post 19-10-2000 13:53
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Increase Your PM Length

Hi guys! I think I will be probably able to help out too this weekend.

Please take extra care to have a sound definition of what is and what is not considered infrastructure. I feel that we should try to hold any manmade item in such a class. Of course food, consumed goods, military units and Kapital infrastructure are odd categories, but we could try to include them and if we don't like the way it gets done, we can exclude them from the investment machine only, or even from the preferences machine too.

Someone had said that military units are not just piles of "shields" (mil.units ifra units) put are also a whole "habitat" carrying people inside it. So #of infra units is only one element of a TF object, which covers the total amount of it's military equipment. This means that the characterisitics of a TF won't be defined singly by the infraclass's attributes.

F_Smith is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
Post  Old Post 19-10-2000 23:41
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Cool, lot's to digest.

I only have a little while, so I'll mull this over and comment tonight.

One thing --

Mark:

'Tanks' would not be 'infrastructure'. Unless it was a tank so large that it qualified. I was thinking 'tank yard' or somesuch would be an 'infraclass'. The individual 'tanks' would be 'tools', which we haven't really gotten to yet. All weapons are armor will likely be 'tool' subclasses/instances. So a military unit is a combination of men and tools. The men have training and experience with various tools.

Ships, I am not to certain about. Perhaps they should be 'tools' too. We should discuss this further.

Does that sound okay?

Similarly, 'horses' wouldn't be infrastructure. But a 'warhorse stable' would be. The stable, or tank yard, would contain a number of horses, or tanks. So those horses, or tanks, could be added to a 'TaskForce' when necessary. This does not work for 'ships', which are not necessarily tied to one port. Altho we could force all ships to have a 'home' port . . . that would simplify things. I'm open to that.

* * *

Richard:

I'm swamped at work today, so I can't really do justice to your post, but it looks okay on the whole. I'm sure I'll have one or two comments, later tonight, but for now, I'm sorry but time is short.


[This message has been edited by F_Smith (edited October 19, 2000).]

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Thumbs up  Old Post 20-10-2000 04:03 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton buy from Amazon

F_Smith:

Your take sounds basically ok. I hope to never use many of the things you talk about, like horse maintainence infrastructure, but to make them available in the OO design is fine .

axi is offline axi
Prince
Athens Greece
Sep 1999
time: 07:13
Exclamation  Old Post 21-10-2000 16:58
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Avatar Enlargement: We've got the solution

F_Smith: I think that you're too influenced by RTS games architecture. Your vision of the game reminds me of AOE, where you had buildings which produced units, hence your reference to "infrastructure" vs "tools". My vision is more like in civ2: infrastructure is considered anything that a province can build (what would have been in the build menu in civ). So it is both the actual immobile structures, mobile units, wonders and even consumable goods.

All differences between these categories can be expressed via the varius attibutes of infraclasses, such as "mobility" and "persistant/comsumed" and their commodity costs. You can of course make 2 or more kinds of infraclasses OO-wise, but they still have to be treated in the same way in what concerns the infrastructure model: the preferences and the investment machine. So whatever behavior you give your infraclass objects it must be expressed OUTSIDE the infrastructure model.

The infraclass units can be used generically (as we do with food, consumed goods and durable goods) or as the "equipment quantity" variable of an object, such as a certain building of a military TF, common or wondrous. In these cases the infra units will not belong to the economic unit that produced them (the province), but to the unit/object they are assigned (although many of these objects will be linked to/belong to a certain province: buildings even TFs in some cases). Please do not misunderstand my talking of buildings: Clash is and will continue to be a "NO BUILDINGS GAME", but, using infraclasses the way I prescribed, it's architecture allows for buildings to be used. Using the reverse logic, it allows generic warfare to be conducted, without the need for certain TF objects, but simply using the # of "military units infraclass" units that a province posseses, regardless of the fact that we still CHOOSE to develop the military model with the use of TF objects.

------------------
"In a time of universal deceit, telling the truth is a revolutionary act."
George Orwell
[This message has been edited by axi (edited October 21, 2000).]

F_Smith is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
Post  Old Post 22-10-2000 01:34
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Axi:

'Tools' will not be handled the same was as 'infrastructure'. They must be two different objects. And object behavior will not be handled outside outside of the object, each object type will have it's own behavior encapsulated within it. The basic difference between a tool and an infrastructure unit is a 'tool' will have the ability to be 'used' by a person/people.

One sign that we've ended up with a good object structure will be that it will be able to handle both the more detailed, 'RTS'-style level of detail and the more abstract, 'Civ 2' level of detail. So don't worry if all you want to do with tools is track their number. In your basic game, you don't have to use the ability to track tool attributes like tool quality, tool damage, etc. But others will want to use those.

Again, this is only data storage structure. Your game logic will be in the 'turnhandlers', and can treat tools and infrastructure in any way you want. This data structure already does what you want -- it just is capable of more, to please others, also.

Because I'll be honest with you, the abstract approach to infrastucture does not sound very "fun", to me. I'm willing to code it into the turn logic, but if/when it ends up "not fun" I do not want to be stuck with an object architecture that can only make a Civ clone. Which is what I think you're really making.

I want much more than that, personally.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:13.
Apolyton Time is 00:13.
    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.0433 seconds (91.13% PHP - 8.87% MySQL) with 30 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