Jump to content
XCOMUFO & Xenocide

Issue #168: Player And World Landtype


red knight

Recommended Posts

Ok here we go... this is a very important task in the planning. Come on guys lets put a green in that space in the planning. This is the space for discussion.

 

--------------

Description: A completed null state for the design of the following class cluster.

 

- Player

- World -> To query for LandType

- LandType

 

The planification can be grabbed from: Planetscape Planning

 

Always remember that those are the final required classes, but other secondary classes in the cluster may be required.

 

Expectations: A well defined and intuitive interface for those entities.

---------------

 

Greetings

Red Knight

Link to comment
Share on other sites

Ok, where should I begin.. :blink:

 

Player is an Entity, that's a good start :)

 

Here are the things :Coffee: which are unique for a single player entity.

- List of bases -> entry point to every base which the player has

- Research system: What technology the player already has and what's on the progress

- List of personnel. this includes soldiers, engineers, scientists etc

- Money

- Monthly incomings from all countries

- PDL (Player Detection Layer), what the player currently sees in the planetscape

 

I'm thinking that the Player class in the main entrypoint to all items in that list.

I know that overplanning is a sin, but I think we should try to keep the Player class behave not like a Singleton, so that we reserve the possibility that we could have multiple player class instances in the future. And I'm not talking about alien instances.

 

After all, mainly only "List of bases" and PDL are the only common thing to a Human player (a Player class instance) and to the Overmind AI. Every else is relevant only to a human player: The aliens dont have money, they don't get money from goverments and they have infinite resource of new alien soldiers but not engineers or scientists. Also the aliens develop new tech by some sort of triggers and not by researching (member, the humans are researching alien tech and not the opposite way)

 

So, the Player class:

- Utilities to iterate over all bases.

- Entry point to the research subsystem, which has methods to query currently available tech etc.

- Entry point to the Personnel class, which contains all personels which the player owns.

- Simple long POD (Plain Old Data) which holds the current money

- Entry point to a class/subsystem which holds the amounts what each country gives each month.

- Entry point to the PDL, which holds the view to the Globe (what player can see)

 

 

The LandType:

 

Possible land types include something like forests, jungle, arctic, farmland, desert, rocky terrain. LandTypes like "city" and "mars" should also be in this list, but they are threat a bit differently (see World)

 

I think that the LandType should also contain other parameters, like "how much rocks", "how dense jungle" etc, so that these parameters could also be used to make the world areas more diverse (like that in the middle of antarctica, there's only snow and snow and snow, but in 1/3 from the coast towards the south pole, you could also see some holes in the snow where the cold sea shows it's deep mysteries)

 

The world

 

This is a Singleton; There's only one Globe (The Earth) and that's enough.. or is it?

For now, I'll just assume that it is enough.

 

I memeber reading about some region subsystem planning, or was it with rincewind over icq (don't remember). Anyway, one possible way is to define the country borders with a poly, so that we define a list of geoposition coordinates and draw lines between them to describe the actual borders. These lines can also be rendered (and should in the close zoom!) It should be (easily) possible to use these poly lists to calculate in what country the target geoposition is.

 

The world class would load these coordinate lists from a xml file and then provide methods to query country labels by geoposition coordinates.

 

Among that, the World class is used to query the LandType by a geoposition. The same xml data would contain also landtype regions, and in the optimal stage, other data which will be used to finetune the LandType (like "how deep we are in the jungle").

 

 

Ok, what do you think? Please post feedbacks :)

 

- Garo

Link to comment
Share on other sites

I think that for a base implementation for Landtype the polygonal query is good enough, but think about using sort of data structure composed of processed textures ;) (You just draw where stuff is and process it to create the Data Structure with all that data) all the information is composed there and stored in a file and read then by the game. (This gives you a better control over parameters, but it is out of scope of base implementation, let alone null ;) where you only define the responsabilities and interface prototype).

 

- Entry point to the Personnel class, which contains all personels which the player owns.
About player... well I think to be able to query all the scientist/soldiers/engineers a Player has is more than enough from the player standpoint.

 

Greetings

Red Knight

Link to comment
Share on other sites

Are we not going to put an inventory manager inside of the player class? Or where are we going to handle that?

 

Also, regarding the bases - I have a request for a couple of methods...specifically, I would eventually like methods that return SharedPtrs to a base by number (i.e. base 1, base 2, base 3) but return null pointers (SharedPtr.get()==0...or ==NULL if you prefer) if such a base does not exist. That way baseview can query the player class and get along better. In the end, of course, what I'm saying is could you add the responsibility of knowing "Base N" where N is an integer?

Link to comment
Share on other sites

×
×
  • Create New...