Announcement

Collapse
No announcement yet.

Basic OO design - map, population, infrastructure, tech

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Well there's quite a few things I would like to say, which has resulted in another monster (post that is )

    To get some organisation to my response I will primarily answer Marks post, with comments on the rest along the way.

    And 'Thank You, Richard: You've seen the light.' I hope your comments will enable other members of the team thinking OO to have a new perspective to the idea (particularlyl Mark and F_Smith).

    Quotes are from Mark, unless otherwise stated

    SOCIAL

    Well it may be a case of me stating my case badly. What I meant is actually exactly what Mark said - up to a certain point . I was just trying to describe why it has to be so:
    quote:


    The Data Storage for ethnic groups is done at the square level. This says Nothing about what the standard game models support. …
    The code has the flexibility to track ethnic groups down to the square level. However, unless there is something I am unaware of, we are currently tracking ethnic group characteristics at the Civ Level. So all this talk about aggregation is premature IMO


    Well I'm not sure about that last part. Two points:
    It was my understanding that every single piece of data pertinent to EGs would be stored at the mapsquare level (sqEGs). I am aware that in the default game ethnicity will primarily be modelled at the province level (prEGs), but I understood that from the programming perspective prEGs would be an aggregate of sqEGs based on the attribute Nationality (if I understand Rodrigo correctly).
    Given the above, and the decision to model tech at the EG level that is a logical consequence of this approach, the discussion of aggregation and aggregation techniques are IMO unavoidable, at least from a programmers view. If the team members don't state their opininons on how to aggegate the basic objects, then it will be up to the programmers to decide how to do it, because it has to be done. The programmers might do it their own way anyway, but then at least we would know where the differences of opinion lay. The general comments on aggregating objects on attributes, is IMO very important in this context.

    On splitting of Nationality: I agree that this is not a cardinal point at the moment. The aggregation of EGs was just my point of entry into these considerations, and the necessity of being able to split Nationality was part of that discussion.


    OVERALL GAME

    I did read the thread Who is the player… and this was my opinion on the subject: I am 'controlling' an empire as a being with everlasting life, and limited omnipotens (if there can be such a thing )

    Nomadic civs, no land, military units, habitat idea:
    quote:


    …I think the civ needs to be defined as including land and people. People, or population groups, can belong to the civ, and yet not be on a map square controlled by the civ. This would be the case for either refugees before they have settled somewhere, or military units. So although a civ has no land, it can still have military units, and so still exist even if it has no land. If we modeled pastoralists as military units, or make them a special case of population units, then the civ can exist and fulfill functions such as diplomacy etc. even without land ownership. But in the most case nomads will control the land they are on anyway...
    A little bit more about nomads...
    I'd been planning on handling nomads just as a special type of military unit. The analogy would be that the pastoralists forage just as a military unit would when there were no supplies available. Pastoralist, when moving slowly enough, could essentially forage grass, in addition to this stuff that normal military units can find when living off the land. I think pastoralists are very closely analogous to military units that carry their own livestock with them for the campaign. We don't have explicit rules for this yet, but it seems fairly straightforward



    First I don't know what pastoralists are, although I get the general idea.
    Second, this is exactly the thing that can be handled by a Habitat object. (Alas, the name is not good. It does not cover the real essence, but the object first presented itself to me (weird concept, don't you think )as a basic infrastructure object capable of containing EGs, hence the name. If I were to rename it, I would probably choose something like production-population framework, ProdPopFrame)

    Let me restate what I think a habitat is: Importantly it is a programming concept, not a game concept. The player will never know habitats exist, since it is a deep layer object. The habitat is a basic infrastructure object: It represents the top layer of the present land mapsquare object: Population and sites, while the basic ressources of the present mapsquare will remain in a new more primitive object GeoSquare, that also stores other basic information as geographical position and maybe more.

    All people reside in habitats. Habitats are where the transformation of basic ressources from the geosquare into basic outcome (food, production, service, RPs etc) takes place. This transformation process takes place in sites, that are an integral part of the habitat. In early days the presence of population in the habitat is necessary to accomplish this transformation, but with increasing automation the number of people needed to perform the transformations falls, and in the end no people may be needed (fully automised production plants, cruise misiles etc): So production really takes place in infrastructure after all, since habitats are infrastructure. (Previously F_Smith and I agreed that production is done by people, catalysed and qualified by infrastructure: I have now changed my opinion. It was based on my previous view of population where I had in fact bestowed people with infrastructure capabilities, because there was no infrastructure interface between the ressources of the land and the people ). The sites represent the ability of the habitat to exploit ressources of underlying mapsquares.

    Another implication of habitats. The presence of habitats is what distinguishes land squares (having habitats) from ocean squares (not having habitats): If there is no habitat in a square, no people can live there, and no production can take place, unless you produce and place a special habitat on the square. Of course other squares could be modelled to be just as inhospitable: Dessert squares, Himalayan squares, arctic squares, off-map squares abstractly representing space, a fourth dimension or whatever. If you have the necessary tech it could be possible to produce Habitat-derived infrastructure objects making colonisation possible: Sea bases, underwater colonies, oil rigs, mountain cities, desert cities, colonies on the moon or colonisation of a parallel universe.

    From the habitat we can derive several other important game concepts, by deriving new classes based on the habitat, and inheriting these basic population-container and production facilities. One important capability that we could add would be mobility. A mobile habitat is an infrastructure object capable of containing an in principle unlimited number of people, moving from geosquare to geosquare while exploiting the land underneeth it (forraging, living of the land, exploiting ressources). Military units, nomads, pastoralists etc are all mobile habitats, of course with some additional capabilities, like military power, the ability to settle down, maybe even split, as suggested by Richard. So in a way military units and nomadic units are very alike, they are both derived from a common mobile habitat object. One might even be derived from the other, FE as Mark suggested it is possible that a Nomad obj is just a special military unit, or maybe is derived from a common military unit object.

    This combination of mobile and immobile habitats simplifies the definition of what a civ is - or rather what a civ controls (which is basically the same thing):

    As Mark, I also view the civ as consisting of both land and people. But making it consist of Habitats accomplishes exactly this. All people reside in Habitats, so controlling habitats (mobile or immobile) is equal to controlling the people in them. The population of your civ is the total population of the habitats you control. All geosquares have one matching immobile Habitat (the combination of the two is exactly like the present mapsquares, with some additional functionality added by the concept of having a maximum number of sites) so controlling the habitat is equal to controlling the land. The physical extent of your empire is the total number of controlled immobile habitats.

    Mobile habitats also makes fishing possible as Richard stated it:
    Given the proper tech you construct a fishing fleet unit of size 20, and hire the 1000 fishermen needed to man the fleet. The fishing fleet is derived from a habitat object and has room for 1000 people and 20 sites. The fishing fleet unit is of course also capable of crossing the sea, so you move your unit across the sea to a fishing bank. Here it settles and begins harvesting the sea. The beauty is - as Richard remarked - that this is done exactly like the farming/production of land squares. You don't need any special code. The habitat object knows how to harvest food sites and production sites, and doesn't give a d… if they are at sea or on land (or in space or in a parallel universe). The efficiency (decided by available tech) and the size (number of sites in the object) of the fishing unit determines how much of the ressources present the object will be able to exploit. Say the unit is capable of exploiting 20% of all available food ressources in a square. The square it is in has a potential maximum food site production of 170 sites. 20% of this is 34, but the unit only has 20 sites, so 20 is what gets produced. On the way to the fishing banks several sea squares were crossed, but they only had maximum food production capabilities of at most 75 sites - 20% of this is 15, so this wouldn't pay off with the present fishing fleet compared to the fishing bank. You could construct smaller fishing fleets to exploit the more meager fishing spots, but in the end maintenance of the unit would exceed the profit from exploiting such squares. Another way of exploiting the more meager sites is increasing the efficiency of the fishing fleet by acquirung more advanced technology (imagine improving fishing techniques or acquiring capability of expoliting a different ressource like kelp), that might be able to exploit 30% of the potential maximum (potentially yielding 22.5 sites at the 75max square).

    In other words it would be possible to design any number of different units capable of exploiting any combination of food and ressource sites in any mapsquare - on-map or off-map - that you can think of. And they would all be using the same production code! These units might have any other capabilities you see fit , like having military strength, capability to sail, fly or go into space. They could be immobile, invisible, large, smelling or whatever.

    A cruise-missile would be a habitat-derived object with large military power, no room for population and no production capability.
    A roman legion would be a habitat -derived object capable of holding up to 6000 people in the form of one or more haEGs (EGs at the habitat level). They would have some production and food sites, enabling them to forage. They would of course have military power, which in their case would be some fiunction of the manpower present (and other factors of course), but they would also have the ability to build roads or encampments. The amount of sites present might increase if they took more a more permant stand like in the fortifications along the Rhine, and some of the legionaires might be put on reserve, enabling them to work in the immobile habitat of the square the unit is in, which would probably increase production and maybe even spur the founding of a city (lets forget the possibility of having two or more immobile habitats in the square for the moment, that is just a spin-off).
    A carrier would be a habitat-derived object, holding upto 6000 people. There would be limited if any production capability, and tremenduous firepower, and of course it would be capable of sailing. It would be able to hold a number of fighter/bomber units, derived from airborne habitats objects, capable of holding 0 people (of course an abstraction, but for now I think the smallest EG is 1000 people), flying, no production and large firepower.
    A nomad unit would be a habitat-derived object capable of holding maybe 20000 people, with quite a few production sites and considerable military capability (or none, depending on what specific nomads we're modelling: We could have several different nomad units, if need be).

    Rodrigo had some thoughts on nomads as well:
    quote:

    Originally posted by Rodrigo September 24th in this thread

    For simplicity and for now, assume we add this characteristic to the EG OO-class as a dummy variable (nomad/settled). When Nomad=1 then the econ model doesn't allow investments in fixed infrastructure. The econ model works as usual, putting people in sites (that exist per se in the terrain) and creating the production using the mobile infrastructure. The EG can move (following a leader EG? controlled by the player?) and in every mapsquare they move to, the econ model simply puts people to work in the new sites. When Nomad=0, the EG works like always and the econ model allows for investment in fixed or mobile infra.



    This is very much like the habitat concept with some elements of the Roman Legion example above: When the Nomads are wandering ('Nomad =1') they are in a mobile habitat, using the sites of that habitat (which would probably be fewer than if the Nomads settled down, at least for production) to harvest the land they move across. Mobile habitats should not be capable of carrying 'fixed' infrastructure (see my remarks below). When they settle in a square they move from the mobile habitat to an immobile one, instead using the sites there. They would now be able to build infrastructure the normal way. Maybe the disbanding of the mobile habitat object would somehow give them some starting capital with which to build sites or something else in their new homeland. This would allow them to settle down in barren lands where there are really no sites in the immobile habitat present.

    Richard stated that he saw all man-made object as habitats. It has crossed my mind also, although I am not sure this is the case (This is the reason I put 'a basic inftrastructure object' instead of 'the basic infrastructure object' in the beginning). At the moment I am of the opinion that while certain habitat-derived objects might be able to hold other infrastructure (particularly other military units as in the carrier example above) most infrastructure should be placed at the geosquare level, not the habitat-level. It doesn't make a lot of sense having a roman legion carrying around a major library does i, so why should there be a slot for it? On the other hand other infrastructure always works on the output produced by the habitat and transforms this into something else, so it will always be dependent on the presence of a habitat to be able to do anything. Then again I would not like other infrastructure to be able to have sites, even at some scenario creators whim. I haven't thougt this out, but I think that there should be an even more basic infrastructure object from which habitats are derived: Maybe this infrastructure unit should be capable of containing just people? (In which case it should probably be called 'Habitat' while the objects I have been talking about all along should be renamed ProdPopFrame or something similar). There is still plenty of room for innovation at these very basic object layers. I'll have to give it some more thought.

    TECH

    On second thoughts I concur: Knowledge can deteriorate, it needs maintenance (This will strenghten my arguments vs F_Smiths tech-in-infrastructure idea: ))

    quote:


    If the square is conquered …



    This describes what would happen if tech was stored in infrastructure as suggested by F_Smith. Like you I don't think it should be like this, it is counterintuitive.

    Re the opening of F_Smith: Now we just have to hold him to it to get the knowledge out of that cursed infrastructure .
    The other points in this section has been answered above.

    CONCLUSION

    I hope this has helped clarifying my ideas. I sincerely believe that the splitting of the mapsquare object into two layers will yield tremenduous flexibility. Please consider it some more before you dismiss it. I'll just recap the main elements as I see them at the moment:

    Land: Presented as GeoSquares. Holds the maximum number of sites (ressources) that can possibly be exploited given all tech (potSites).

    Infrastrucure: Basically converts some ressource into another (input one or more object and output something else). The most basic transforming is done by the habitat-derived ojects containing actual sites (actSites=production facilities) that exploit the potSites in the square underneath turning out units(food, production etc). Other infrastructure converts these units or population into output of a large number of different varieties (military power, tech, happiness or whatever).

    People: Modelled as EGs. In early days people are necessary for infrastructure to function - they permit or catalyze the transformation process taking place in infrastructure. Later the function of infrastructure becomes less dependent on the presence of people. In theory, with increasing automation, people could get superfluous - at least in this respect. They are however needed for something else:

    Knowledge
    Knowledge qualifies the infrastructure, making infrastructure increasingly efficient, and permitting the construction of new types of infrastructure. Knowledge resides in people and only there - so if there are no people there is no knowledge.

    [This message has been edited by Beör (edited September 25, 2000).]
    [This message has been edited by Beör (edited September 25, 2000).]
    Civilisation means European civilisation. there is no other...
    (Mustafa Kemal Pasha)

    Comment


    • #17
      Beör:
      quote:


      It doesn't make a lot of sense having a roman legion carrying around a major library does i, so why should there be a slot for it?


      Actually it does make sense. If the legion has sacked a major library belonging to the enemy, then they would be hauling home as many books as they could carry. So the Habitat derived Legion object contains the library information just like a standard Habitat object would. Giving them that capacity would easily allow for this to be modeled.

      This Habitat system easily allows military units to sack and carry any infraclass object. Then, when they come home and recombine with their civ's habitat objects, thet plunder/infrastructure goes back to the home civ. That is the beauty of the system.

      I think it would seriously hurt the system if infrastructure is put in the geosquare rather than the habitat. For example, consider what the Russians did when the Garmans advanced in WW2. They loaded their factories into trains and moved them east. That can easily be modeled if factories are in the habitats, but it would be hard to do if they are a part of the mapsquare.

      I think that the only infrastructure that should be put on geosquares should be stuff that is a part of the land and absolutely cannot be moved. That would be things like dams, dikes, irrigation, terracing, and fertilization. But the habitats would contain all the functionality for creating those things. This would allow combat engineers to do fun things like build dams and divert rivers.

      Sorry for misstating myself. I should have said:

      All people and man-made objects should be a habitat object or a part of a habitat object.

      So if Information is part of the habitat object, it can be stored in a normal civ Habitat object, sacked and transferred to a military Habitat object, and then returned home and returned to the normal Habitat objects of another civ.

      Comment


      • #18
        Beör:

        quote:

        It was my understanding that every single piece of data pertinent to EGs would be stored at the mapsquare level (sqEGs). I am aware that in the default game ethnicity will primarily be modelled at the province level (prEGs), but I understood that from the programming perspective prEGs would be an aggregate of sqEGs based on the attribute Nationality (if I understand Rodrigo correctly).


        The data are Not stored at the MapSquare level in the sense I think you mean. What is at the MapSquare level in the code architecture is a "pointer" to the data characteristics of each EG. You should read my item 3.in my first post in the thread Overall Project Issues -- A Proposal for how to Proceed
        . That part describes pointers and how they relate to data storage. But what you need to know here is that pointers can be a many-to-one connection such that many pointers can all indicate the same data object. So in this case even though the pointers are at the square ethnic group level, if all the pointers indicated data object that represents an average characteristic at a province or civ level, no aggregation needs to be done, except in rare cases.

        Beör & (to some extent) Richard:

        On habitats...

        Personally, code architecture doesn't really interest me, and my shots at it, at least if you believe F. Smith, have been poor. I really think there isn't much purpose to people who aren't actually doing the programming discussing code architecture issues. F. Smith is going to use the architecture he wants, and he has enough information now on the habitat proposal. I'd just like to encourage you to switch over to discussing something else, since all previous efforts in us making suggestions for code architecture have been complete failures. You may be different, but I want to let you know what you are getting into . There are so many model, gameplay, and interface issues I would like to hear your opinions on.... I think those have a better chance of actually getting into the game.

        [This message has been edited by Mark_Everson (edited September 25, 2000).]
        Project Lead for The Clash of Civilizations
        A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
        Check it out at the Clash Web Site and Forum right here at Apolyton!

        Comment


        • #19
          I don't think this is actually a code architecture issue. I see it as a way we model the game world. As far as the game is concerned, I think it would be good for military units, nomads, and fishing fleets to do the same things as basic infrastructure. I think it would be good if factories could be moved around and military units can carry infrastructure home with them.

          So IMO i'm not saying anything about the code. I think this is a game design issue.

          Of course, that could be the source of some of the confusion. I think I'm talking about a game issue, and others think I'm trying to tell them how to code. I'm not trying to tell you how to code; I'm trying to be a game analyst and say how I think the game models should work.

          Comment


          • #20
            Guys:

            The 'habitat' idea is interesting, but I don't see what it's purpose is. All that functionality is in the existing architecture, and it's more simple and direct.

            An EG object doesn't in any way need a 'wrapper'. They are mobile, period. People can move. In fact, that's just one of the many reasons to model individual, square-level EGs. We can move individual EG objects from square to square without any added code.

            And the 'terrain' info should be stored in a 'terrain' object, shouldn't it? An 'ocean' mapsquare differs from a 'mountain' mapsquare only in it's 'terrain'. That way, later, we can have people living in/farming, etc, the ocean squares. It's more scalable.

            I still don't agree about 'infrastructure' doing the producing, either. People have to be able to produce on their own, without infrastructure. People have to be able to take a stick and scratch out a living from virgin land. A factory is a 'tool' that can increase their output. So an 'EG' must produce output by combining 'tools' (either/both infrastructure and mobile tools) with 'raw materials'.

            Artificial intelligence would be required to replace the people.

            Comment


            • #21
              So do military units and nomads already have the functionality to do anything that infrastructure can do? Can they hold and carry factories, books, and other infraclass wealth? Can they alter the terrain like infrastructure can?

              Also, is it possible to make infrastructure that acts like a military unit? Could a scenario designer make an "automated war factory" unit that moves and fights like a military TF and then uses internal factories to make new units and weapons from the terrain resources and the remains of the enemy?

              Can we make sure that doing things on the ocean works the same way as doing those things on land?

              That is basically what I'm asking for. I think the "Habitat" is a great way of providing that, but if the code already can do all of that, I'll be happy.

              Comment


              • #22
                Mark

                I am perfectly aware of the pointer thing. What I mean is that in principle every sqEG contains a pointer to it's own egTech objects. I know it can be a many-to-one relationship (after all I've been using relational databases for a decade ), but it isn't necessarily. So if you have two sqEGs pointing to two different egTech objects and you want to aggregate them into a two-square prEG, you should decide how these two egTech objects are aggregated into a new prTech object pointed to by the prEG. These are not trivial matters IMO. If the modellers don't consider it, the programmers will have to do it by themselves. Here lies the seed for long discussions, if it is not taken care of beforehand. In fact I think I'm thinking more like F_Smith here than you are, but then I may be wrong.

                F_Smith

                OK, I know I am on your turf here, and by no means will I insist on the habitat thing. I think it's neet, but if the existing code can provide the same functionality in a simpler and more scalable way, it's fine with me. It is not I who do the coding, so it's not my call. As has been frequently stated recently: If the code gets the job done, the coder is at liberty to code it anyway he wants.

                Instead see the proposal as an interest in exchanging views on the basic architecture of the game. I know it can be difficult sometimes to keep on coding without getting much feedback on the basic structure of things. I am by no means an OOA guru, but I know the basic lingo, and have one great advantage in this: I'm not prejudiced, since none of the existing parts of the game are mine .

                So F_Smith: I'm sure your basic architecture will work, but could you please share some of your thougths with us. I for one would like to learn how this can be done. You say we can judge your architecture by the scalability and flexibility. Then show us at least the general ideas. Is there a way you could forward some UML or similar - just for the basic elements. I wish we could draw this . One of the real pains of working in a forum like this is the lack of graphics. Objects are sometimes much better described with drawings. In fact I think many differences of opinion could be resolved if we had access to a drawing facility.

                To your comments.
                I agree that it seems silly to have people reside in infrastructure while they move. People are mobile by nature. The only reason I even thought of this was that military units as far as I can see will have to contain sqEGs. And as far as I can see military units are infrastructure. And if you think about it people also live in infrastructure (housing), eventhough the rudimentary housing of early days is not specifically modelled. So if people move they move from infrastructure in one square into infrastructure in another square. If they are military units or nomads they reside in infrastructure-like structures. It might streamline the object model if all people always belonged to infrastructure.
                We can probably argue for a long time whether infrastructure produces or people do. The truth is probably they both do. I agree that stating that a hunter/gatherer has infrastructure seems absurd (but then the whole site thing becomes absurd to me: I imagine sites as some kind of organised production capability FE farms or mines), but then you must grant that in principle fully automated infrastructure objects produce without people being present. I'm not talking AI here, simply robotic assembly plants and the like. Real AI, I mean really intelligent non-humans, should not be modelled as infrastructure but as population (a different race if you like). The adamant statements were just a way of simplifying things. This is what you do when you do analysis, right?
                Back to the mapsquare. You state that an oceanic mapsquare differs from a mountain mapsquare only by it's terrain. And this is not correct in my opinion, at least not when discussing from the point of view of the economic model. The interface that the economic model demands from the mapsquare doesn't give a d… about terrain. It needs: number of sites, number of people living there and the presence of production-modifying infrastructure. It couldn't care less if it was a swamp, a dessert or a crater on the moon. Of course there are other uses for terrain: during movement and combat FE, but as far as I can see, the production of a square does not depend upon the terrain of a square. It is probably right that terrain needs to be stored in a terrain object, but this IMO is of no consequence to the economic model. That is, unless you imply that the number of sites depends on the terrain and is stored in a terrain object.

                To avoid unnecessary discussion please do not answer the comment part unless you really want to, and you think that these considerations will bring us closer to an understanding of the OOD.

                I still would like your general idea on the basic elements though: I would particularly like to know your opinion on sites. What are they? How do they interact with the land and the people? What object are they part of - or are they objects by themselves? It seems to be the main 'connection' between people and land, but are they present independent of people? Independent of land? Independent of either? Can they be constructed or can they in some way be revealed when tech increases? Can they be destroyed? Can they move?
                Civilisation means European civilisation. there is no other...
                (Mustafa Kemal Pasha)

                Comment


                • #23
                  Took me awhile, but now I've deleted this doublepost
                  [This message has been edited by Beör (edited September 26, 2000).]
                  Civilisation means European civilisation. there is no other...
                  (Mustafa Kemal Pasha)

                  Comment


                  • #24
                    Hi Beör:

                    Sorry I misunderstood what you were saying... Personally for merging EGs, I think simple weighted averaging is sufficient for all the social components, and geometric averaging for Tech. At least that's a good first start. And as I think you were alluding above, the main question is deciding Whether two groups Should be aggregated, or have evolved away from each other sufficiently to be considered distinct. Any merging technique may be dangerous in the hands of players who are in mind to abuse the system. So we may need to wait for playtesting for the final answer anyway...

                    F_Smith isn't fully in support of the econ sites abstraction, so he might not be the best person to ask . Although in the connection between sites and land in the OO model I guess he's the only one we've got...
                    Project Lead for The Clash of Civilizations
                    A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                    Check it out at the Clash Web Site and Forum right here at Apolyton!

                    Comment


                    • #25
                      Beor:

                      Absolutely, please do ask these questions. I will get at least a dozen things wrong when I first try to design the hundred or so objects we're talking about.

                      Find 'em. Make me talk about 'em. Ask anything.

                      Besides, I could ramble on about this stuff forever.

                      First, how about this -- could "Habitat" be a subclass of 'infrastructure'? That's kind of the way I'd work it, I think.

                      Are you familiar with the old line "is a or has a"? The phrase is to help decide 'encapsulation' and 'inheritance'. If something 'has a' something, it encapsulates it. If something 'is a' something, it extends it.

                      Because to my mind, habitat "is an" infrastructure object. But housing objects don't "have a" people group. I would say it the other way around, people groups "have a" housing object. So that's how I'd code it -- EGs will contain pointers to the infrastructure object they live in, if any. And yet there can still be truly homeless EGs. Early man scenarios. Refugees. A moving 'civilization' like the barbarian nations that gave Rome so much trouble. An army in the field.

                      Here's the process I go thru when 'analyzing' a system to break it into an object hierarchy --

                        [*]Pick out the important nouns. "People". "Infrastructure". "Habitat". These are our objects.
                        [*]Define each noun. In this case, "Infrastructure" -- the basic, underlying features of something, esp. of a technological kind, as the military installations, communication and transport facilities, etc, of a country or organization.
                        [*]List all *relevant* properties of that object. I have not done this for infrastructure, so maybe ya'll would like to do it for me now, here, so I get it exactly the way you want it?
                        [*]Make a class (object) for each noun. Arrange the nouns in any hierarchy that presents itself using "is a" and "has a" logic.[/list=a]

                        This makes coding a system that represents those objects a snap. And by sticking to absolute realism with the object structure only to the "relevant" properties, we automatically control scope. And, we will be able to scale the system to any level up, since we stuck with reality.

                        Scaling down can be a problem. But that's why you must do things at the lowest level the first time -- otherwise, you never will be able to easily.

                        I'm not sure if this explains anything, but there's my stream of consciousness response to your query.

                      Comment


                      • #26
                        Oh -- 'sites' as I understand them are 'production sites'.

                        'Sites' are encapsulated in the 'terrain' object, at them moment. 'Terrain' "has a" number of 'production sites'.

                        It's a combination of the quality and the quantity of 'workable' land in the mapsquare. It assumes an unimproved area -- not a mine, just a mineral rich area.

                        So for the 'econ' system, the 'sites' come from the 'terrain'. Likely, the 'econ' system will get run from the 'EGTurnHandler', which will do something like a 'doProduction' method. That method will take the pop info from the group and the 'terrain' object as inputs. The 'site' and 'infrastructure' info is in the 'terrain'.

                        I can allow the player to add, remove or change in any way a 'site'.

                        I had suggested splitting 'sites' into the two different variables, but Mark had good reasons not to (I forget what that was all about, to be honest). Mark can fill you in better, I think.




                        About automated facilities, I would like 'EG' to implement an 'Intelligence' interface. And then an 'AI' could also implement 'Intelligence'. And a tool/infrastructure object would require an object with 'intelligence' to operate?

                        I would definitely say that any plant that can run for any length of time requires *seriously* advanced AI. It would have to repair itself, deal with supply (what happens if a shipment doesn't arrive?), that sort of thing. I wonder if we could build something like that, at least a simple one? Possibly, now. I don't know.

                        And by 'AI', I mean even a low-level 'expert' system that can make only a few simple decisions by itself. Even if it's a simple 'if this, then that'.




                        And finally, a military unit can be made more useful and effective thru infrastructure (certainly morale will be higher if they have a barracks to sleep in!). But it doesn't require an infrastructure object. Armies do sometimes sleep in the field.

                        Comment


                        • #27
                          For the sites discussion, please check out Demo 5 Economic Model starting with the post "posted July 27, 2000 15:31". (NOTE, I put up the wrong date and time for the post at which to start earlier) The discussion also branches to other threads, but there are links if you start where I indicated.

                          [This message has been edited by Mark_Everson (edited September 25, 2000).]
                          Project Lead for The Clash of Civilizations
                          A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                          Check it out at the Clash Web Site and Forum right here at Apolyton!

                          Comment


                          • #28
                            Richard:

                            First, to answer your post in the other thread --

                            Infrastructure is not 'tied' to a mapsquare, altho it does get stored in a mapsquare (with the option to only view those at the 'province' or 'civ' level).

                            Infrastructure objects can be moved from one square to another, as can EGs. Altho the infrastructure object will need a 'mobility' variable, because some infrastructure objects can move themselves (Mobile Army Surgical Hosptial), others can only be moved (a factory) and others can't realistically be moved at all (aqueduct).

                            Okay, now to answer the above post --

                            Military units and EGs will have to have 'carrying capacities'. This will be required for tools (farm implements, weapons, etc). This will be affected by the tools, in many cases (trucks will add carrying capacity, for example).

                            As far as 'altering terrain', that's why I say that pop groups must be able to 'produce'. If you mean 'cut down trees', yes. The pop group (military or EG) will need a 'tree cutting' knowledge object. This object will require two inputs ('tool' -- like an axe, and the 'terrain' object where the trees will be cut down).

                            Yes, an 'automated war factory' would require an 'Artificial Intelligence' object in place of the 'pop group' (military or EG) object. That factory could be made mobile, assuming of course all relevant abilities in the builders.

                            And the ocean/land thing is a perfect example of *why* it must be architected this way. The only difference between an 'ocean' square and a 'land' square is the terrain object.

                            And this architecture allows us to even easily change that terrain, when the player gets the tech (raise mountains, dig canals, fill in swamps, etc).




                            Note to all:

                            That's how ya'll will really judge the quality of my architecture. If it easily and quickly can be adapted to any functionality you request, then the architecture is good.

                            Comment


                            • #29
                              I wanted to quit this thread, but I just can't help it!

                              The truth is F_Smith's last post was clarifying to me in how to see OO-coding. I'm maybe still understanding all wrong, but I wanted to try to organize these elements we're talking about as if I was the coder. Please, please don't give any of you big importance to what I'm about to say. Even more, if your name is not F_Smith, you can skip this post freely!

                              This is more like asking a personal favor to F_Smith. Below there's a "proposal" to implement in OO-code the ideas we have. Could you F_Smith tell me if it sounds reasonable from an OO-perspective? I just want to see if I have understood anything about OO-coding... I just want to learn, so please be my teacher for a moment.


                              Using your "is a", "has a" approach, I would say People (EG?) and Mapsquare lie in the "is a" category. So I'd define them as the most important classes.

                              Among other info, People "has a":
                              -Knowledge
                              -Mobile Infrastructure

                              Mapsquare has:
                              -People
                              -Sites
                              -Immobile Infra

                              I'm trying with that to model at the same time settled peoples, nomads and military units. Assuming both types of infra can be divided in several sub-types and in particular assuming mobile infra has as sub-categories military equipment of several types like "swords+shields", "horses", "muskets", etc., then I think a military unit would be a People object having some amount of military equipment. If I understand correctly, People would be an OO-class that "extends" (is that the term?) a sub OO-class called "military unit".

                              The military unit sub-class would then have all the info needed in the mil model to perform a battle. The number of people, the amount and type of military equipment and tech level for that equipment is all the info needed to calculate the military unit's abilities and strengths and that info is completely held in the object itself.

                              Since other type of mobile infra can be there too, then "military engineers" can exist having the ability to change the terrain assuming the People class has procedures to use its mobile infra to do so whether the people conforms a military unit or not.

                              I presume also that mobile infra such as "sails" or "aircrafts" could give the object the abilities to move through sea or air respectively, or, in general, to change the behavior of the object.


                              On the production side, I imagine the Mapsquare OO-class would have something like a "DoProduce" procedure that makes all People objects in it produce the economic activity. Since People has the mobile infra and the techs to produce, and the sites and immobile infra are part of the mapsquare, then I see all the info is there to generate the economic activity.

                              This would be true for settled and nomadic People. I'm more and more inclined to model nomadism as a cultural attribute defining the chances for the People to migrate and their preference for investment. Nomads do not invest nor use (they don't know how to) immobile infra. So this cultural attribute plus the already mentioned info should be sufficient to know how to exploit the mapsquare and get production.

                              Of course, military units would also be allowed to exploit the land having the necessary mobile infra.

                              Other things mentioned like people being able to "run away with a factory" could be possible if mobile infra is held by the People object. Fishing fleets could be an extension of the People class having "boats" mobile infra and using the "fishing" tech level.

                              If People=EG then I guess all EG attributes could be used in the various processes. Aggressiveness could be used in the military unit and Asceticism in production, FE.

                              Is all this at least relatively correct? What is correct/wrong about all that? Have I learned something? I'd really appreciate it your comments, F_Smith.

                              Comment


                              • #30
                                I'd like to say that I'm so glad I started this thread. It gives us the opportunity to discuss basic level programming OOA without disturbing the flow of thought in other threads. If people come here they asked for it . Actually I think this might be very good opportunity for everyone to get a feeling for the basic design and learn some OOA/D.

                                However there is one thing I'd like to ask posters to consider. It is quite obvious that this is going to sort of a one-way thread. Us asking, F_Smith answering. So while I think any question is OK, really, please consider the time and effort F_smith puts into this while at the same time doing our main programming.

                                So, let this be a motto for this thread:

                                Ask anything, but accept that answers might only pertain to issues that will bring us along in our understanding

                                With that in mind I can ask away myself, without having a bad conscience. But I'll put that in another post
                                Civilisation means European civilisation. there is no other...
                                (Mustafa Kemal Pasha)

                                Comment

                                Working...
                                X