Jump to content


Photo

Research Schema


  • Please log in to reply
49 replies to this topic

#1 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 03 September 2004 - 10:45 AM

Just a conversion to xsd at the moment.

Attached Files


Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#2 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 03 September 2004 - 12:57 PM

Oh man :o

This schema requires explanation. Definitely requires explanation. :)

Guyver
Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#3 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 03 September 2004 - 01:15 PM

Well, as explained in the docs, hopefully (if I managed to translate the DTD right :D )

Edited by centurion, 03 September 2004 - 01:15 PM.

Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#4 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 03 September 2004 - 02:48 PM

Oh, that's link that I had to have :). Thanks

Guyver
Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#5 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 04 September 2004 - 11:58 AM

As I looked thru the schema I found out that it can be done easier :). By eliminating cross-references. In example: Blaster Bomb Launcher research topic needs Blaster Bomb Launcher item in inventory of base. After researching it, launcher becomes available to manufacture. The thing we don't need in research topic is that it's available for manufacturing after this has been research. We don't need info about what XNet entry becomes available after research. All we need is requirements of that research topic, since all other infos can be added to their places: to item's description. We just mark in items properties what researches need to be done to be able to use/produce that item. And to XNet entries goes what stuff is to be researched to show entry in XNet.

That's all there is to it.

So here goes my simple schema. Feel free to ignore it, change it, ignore me etc. :D

Attached File  research.xsd   3.22K   22 downloads
Attached File  researches.xml   600bytes   24 downloads

EDIT: this schema is based on what CptBoxershorts written and on schema by centurion. Oh, and I'm looking at items schema to add my idea in there also.

EDIT2: In this schema you can also find simple type named "xenoId". That's my proposition for unifing identifiers. And no, I couldn't use xs:ID and xs:IDREF just becouse xs:IDREF (used by me to reference to another topics/items) requires that referenced xs:ID is in the same XML file, so when you reference in example "itm0001" as requirement for research topic to be available, then XML file doesn't validate right. And when I use xs:ID type in reference type, then there can't be more than one id's in file, so researches couldn't be referenced.

BTW, there's no need for idType attribute anymore (in code type of referenced identifier could be recognized by prefix like "res" - resource, "itm" - item, "xnet" - selfexplanatory).

Guyver

Edited by guyver6, 04 September 2004 - 12:09 PM.

Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#6 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 04 September 2004 - 12:22 PM

Your implications hold in the original UFO, but might not hold in v1+; say, you could find plasma cannons from UFOs and produce/use them after you researched heavy plasma and at least one of the clips. This can easily be incorporated in the original schema, while not so in yours. I know, the example is forced, but I don't feel that the item production=its own research identification is general enough. Also, the bonus is forced to be in one specific form (same in the original DTD), I think using CNFs or DNFs could be better; wait a bit and I'll post those.

edit: . . . done.

Attached Files


Edited by centurion, 04 September 2004 - 12:38 PM.

Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#7 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 04 September 2004 - 12:39 PM

I cannot agree with you, becouse it's possible to do with my schema and here's how:

assume:
res0001 - heavy plasma research topic
res0002 - heavy plasma clip research topic
res0003 - plasma rifle clip research topic
res0004 - plasma pistol clip research topic
res0005 - plasma cannon research topic

now here's research entry for cannon:
<topic id="res0005" name="STR_PLASMA_CANNON">
<requires><req id="res0001"/><req id="res0002"</requires>
<requires><req id="res0001"/><req id="res0003"</requires>
<requires><req id="res0001"/><req id="res0004"</requires>
</topic>

This gives you researchable plasma cannon, after you research heavy plasma and one of plasma clips. Have I understood your forced example correctly? :)

EDIT: It's also easier to code that kind of relations, while searching forward and backward (like in your schema) could be more complicated (since looking for information if we can use/produce some item, we have to walk thru research tree to see if it's possible to use/produce that item while in my case you just look for particular research if it has been completed).

Guyver

Edited by guyver6, 04 September 2004 - 12:44 PM.

Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#8 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 04 September 2004 - 12:41 PM

I couldnt check the schemas yet, but dont worry about future additions, specify what we need, we dont know what we may do in V1+.

Greetings
Red Knight
Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.

#9 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 04 September 2004 - 12:53 PM

My point was the absence of a specific PLASMA_CANNON research topic; example: if research of heavy plasma gives you both the weapon and the clip production ability, you don't have a heavy plasma clip research topic, and you get the ability to manufacture clips without the need to research them.

Oh well, if we're for v1 only ...

edit: flaw: plasma hovertank is enabled w/o need for a hovertank;
the XNet reference would have to be gathered from the items given?
for v1 we only need whether the topic obsoletes itself, not a list.

Edited by centurion, 04 September 2004 - 01:03 PM.

Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#10 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 04 September 2004 - 01:26 PM

That's why we need information in item's data about what are research dependencies to use it and/or produce it. And i think we can assume that research topic obsoletes itself (becouse why we should research the same thing twice?). Exception are live aliens, but those aren't to be placed in research tree I think. This has to be solved within aliens data and XNet (xnet entry can be enabled by researching aliens, and becouse other researches can require xnet entry to be enabled, this solves the problem).

Guyver
Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#11 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 04 September 2004 - 01:35 PM

Always remember that Research entries requires (most of the time) that you have some item in posession, let it be dead alien, live alien, clip, or weapon. So in short that has to be explicit as you cannot code that in game logic.

Greetings
Red Knight
Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.

#12 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 04 September 2004 - 02:02 PM

And i think we can assume that research topic obsoletes itself (becouse why we should research the same thing twice?). Exception are live aliens, but those aren't to be placed in research tree I think. This has to be solved within aliens data and XNet (xnet entry can be enabled by researching aliens, and becouse other researches can require xnet entry to be enabled, this solves the problem).

<{POST_SNAPBACK}>

Live alien research is a research, it's not worth hardcoding special behaviour for this special case; you'll still have to get the same research after finishing it. Researching a grey medic may give you the cloak XNet entry, but will not give the other benefits of live cloak research. Btw, we should incorporate undeterministic research results.

Ok, so research requirements go to items *scribbles mental note*; do the XNet entries behave in the same way?
Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#13 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 04 September 2004 - 04:24 PM

Ok guys, I've came to a conclusion that neither my nor Centurion's schema aren't good enough.

LONG (boring :)) POST WARNING

I want to specify requirements that research data has to meet.

This are basic data/functions we want research xml file to give us:
1. How long research of topic takes?
2. We want topics to be dependant on possesing particular items in base storage.
3. Same as above but for live aliens.
4. Topics depend on completed researches of other topics.
5. Research time bonus when completed similar research topics (see V1+ and CptBoxershorts docs).
6. We want items to be usable depending on completed researches.
7. We want items to be manufacturable depending on completed researches.
8. Manufacturing items takes resources (another items) which makes dependancy between them.
9. We don't want to overload other xml data files with unnecessary data (like items with data on required researches and ships on required researches etc.)
10. We want to have it clear :).
11. Entries in XNet are dependant of researches.
12. Accessing data have to be as quick as possible - thou simple.
...... add more please :)

As you can see, this research thing takes all elements of the game under it's wings. This makes it complicated (Centurion's schema). From the other side any simplification of that schema ends up being not flexible.

Here goes my propositions:
1. Gather all that data mentioned above in one schema - this means having manufacturing and xnet with researches in one place (don't worry, my plan isn't so bad as it seams to be).
2. Create lookup tables for items and xnet to connect them to researches.
3. Name it all development (research and manufacturing ;)).

Here's why lookup tables. Assume we have situation like we want (in program, in code) to check if Heavy Plasma can be used by a Soldier on field. If we have Centurion's schema, we first search for a research topic, that gives us (grants) access to Heavy Plasma. When we have it, then we check ingame (dynamic) data if it's researched. That's all. With my schema, we don't have to walk through all research topics, we just check items requirements for use (which isn't implemented in items schema yet, and won't be becouse of overhead). Then we have research topic name, and we only check dynamic data if this topic is researched. This solution removes the need of searching research tree for topic that grants access to heavy plasma (and with all our imaginary examples that heavy plasma use can depend on more researches and something else, we would need to search for all topics that grants heavy plasma, so we end up with traversing whole research tree, which could take some precious cpu time). Using my schema isn't good either, becouse it depends on out-of-research-xml-file data (which is more natural btw, becouse items have requirements of research to use/produce).

This is where lookup tables could help keep data in one file, like manufacturing table could have manufaturable item name and then list of required researches and other items required to production (with amount). Use table could hold similar data but only for use. Or gather those in one table (ie. items table) and for each item name assign researches needed for production, ingredients and researches needed for use of it. Another table could be for live aliens. This could contain research name, and required alien/rank of alien. The same with xnet: xnet entry name and required research. This gives up forward lookup which is more natural than backward (search for a research that grants something).

Feel free to kick me :).

Guyver

PS. I know that when I'm tired I talk too much :).

EDIT: PS2. I'll try to show what I'm thinking of next time, not tell it, becouse it looks like I'm not a good writter (experience in english ain't so good :)).

Edited by guyver6, 04 September 2004 - 05:10 PM.

Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#14 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 04 September 2004 - 05:25 PM

I would restate those to the following.

For Research Schema...

1. How long research of topic takes?
2. We want topics to be dependant on a certain condition.
2.1 Dependency over Item posession.
2.2 Dependency over Research completed.
2.3 Dependency over Logic Triggered condition (as for example time based).
3. Research topics have a cost and it MAY involve special researchers abilities.
4. A research topic can signal conditions on completion (unlock certain item, unlock ability, etc... all that logic dependant and handled by code)
5. We don't want to overload other xml data files with unnecessary data (like items with data on required researches, ships on required researches, manufacturing with research data, etc.)
6. We want to have it clear :), simple, and easy to modify.
7. Accessing data as quickly as possible is not a requirement, cause the runtime representation may not be a one to one mapping with the XML specification, information can be crossreferenced, other classes that handle interdependencies based on reference may appear, etc.
8. All dependencies and condition have to be referenced by identifiers so they can be referenced in the runtime objects model.

For Manufacturing Schema...

1. What condition must be met to have the item unlocked for manufacturing (Dependency on research)?
2. Manufacturing items takes resources (another items) which makes dependancy between them.
3. Manufacturing topics have a cost in money and time and it MAY involve special manufacturing facilities.
4. We don't want to overload other xml data files with unnecessary data (like items with data on required researches, ships on required researches, research with manufacturing data, etc.)
5. Accessing data as quickly as possible is not a requirement, cause the runtime representation may not be a one to one mapping with the XML specification, information can be crossreferenced, other classes that handle interdependencies based on reference may appear, etc.
6. All dependencies and condition have to be referenced by identifiers so they can be referenced in the runtime objects model.


The important difference is that we are specifing the items and stuff in here, the runtime implementation (after we load all of this) is another different thing, if we need to speed up (something that I bet there isnt going to be needed) we can do whatever we want to. The static model is a model that has to be easily modificable so that everyone can tamper with it to test inside Xenocide... changing the power of a Plasma weapon power, or rounds, or anything... or even the research scheme.

The runtime model is generate from the XML DOM model, but after the loading process nothing of the XML DOM model remains in the runtime model.
Runtime Model = Plain C++ Objects
Static Data Model = Plain XML Schema objects 
Loading Process = XML DOM Model

Well I hope this helps. Tell me what do you think.

Greetings
Red Knight

Edited by red knight, 04 September 2004 - 05:26 PM.

Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.

#15 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 05 September 2004 - 02:34 AM

This only proves how code-oriented my thoughts are :rolleyes:.

Anyway, research schema requires modifications to meet this requirements, but I'm not the one who will undertake this task (/me looks at Centurion ;)). I can try to do manufacturing schema.

The other thing is I'm looking forward on coding this static models as classes :D.

Guyver

PS. I'm curious what we will use to get data from xml files. I know that xerces's is being involved, but Yake also has some parsing stuff in there, and Yake's becoming more and more useful (as I'm following it all the time).

EDIT: typos corrected

Edited by guyver6, 05 September 2004 - 02:38 AM.

Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#16 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 05 September 2004 - 05:16 AM

Well, the research-item, research-craft, research-manufacturing links still have to be put somewhere; I think that having this information in the respective item/craft .xmls is appropriate. I'll do the research schema with that in mind, tell me if it shouldn't be so.
Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#17 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 05 September 2004 - 06:48 AM

But I'm sure that those aren't necessary anymore, as RK explained, those links can be done ingame while loading xml data, and having this type of data in items/crafts/facilities xmls overloads them and makes harder to tweak researches. From what RK said I understand that we stay with your schema modifying it more or less to suit requirements that RK posted above :)

Guyver
Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#18 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 05 September 2004 - 07:27 AM

But I'm sure that those aren't necessary anymore, as RK explained, those links can be done ingame while loading xml data, and having this type of data in items/crafts/facilities xmls overloads them and makes harder to tweak researches.

<{POST_SNAPBACK}>

And how would that be done in-game? Read from a config file? Hard-coded?

edit: anyways, attached is a modified schema. Eliminated names since ids determine them and they will get processed through the translator. Topic grants are cut out to have prerequisites handled as prerequisites only. Cost is added, IDs are put in; no spaces in IDs because they will be xsd:IDs in some other .xml, and those don't contain spaces.

Attached Files


Edited by centurion, 05 September 2004 - 08:46 AM.

Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#19 guyver6

guyver6

    Captain

  • Xenocide Programming Department
  • 599 posts

Posted 07 September 2004 - 10:23 AM

The only thing that makes me wonder is that there won't be any combatants static data (means no XCorp soldiers data - all generated dynamiclly in-game). There are going to be some aliens statistics thou, so maybe combatants schema has some sens...

Another thing is to eliminate ids, since names will be used :) (see PM from Red Knight). Well, as a matter of fact it's only changing "id" attribute name to "name" but it has to be done to keep all schemas/xml files in the same "style" :rolleyes:

Guyver
Posted Image
Sourceforge: guyver6
LinkedIn: Andrzej Haczewski
"A good business idea, they say, can be explained in one sentence. Similarly, each program entity should have one clear purpose."

Join #xenocide at irc.freenode.net.

#20 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 07 September 2004 - 11:18 AM

The only thing that makes me wonder is that there won't be any combatants static data (means no XCorp soldiers data - all generated dynamiclly in-game). There are going to be some aliens statistics thou, so maybe combatants schema has some sens...

Another thing is to eliminate ids, since names will be used :) (see PM from Red Knight). Well, as a matter of fact it's only changing "id" attribute name to "name" but it has to be done to keep all schemas/xml files in the same "style" :rolleyes:

Guyver

<{POST_SNAPBACK}>

Given that the game should be more or less symmetric wrt the two sides, I think there will be human entries as well; the 'soldier' (or a special 'recruit') data could be used for units you recruit (human also have one, TU 40..50, etc). An asymmetric version could also work, with recruits being of a given type on the alien side. Oh, and there could even be an "alien training facility" at alien bases which would produce different rank aliens (with base values from the combatants schema) from the basic type.
What PM? No prob, will browse through the xsds anyway.
Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#21 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 07 September 2004 - 01:32 PM

Update.

Attached Files


Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#22 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 07 March 2005 - 03:39 PM

To pass the HTML Tech Tree I have to XML I'm afraid I'll need some help, as my XML knowledge is... null, I'll just toy with the research schema Centurion posted as much as I can :), but I do need some clarifications please.

Topic Names: All topics have a RES_* prefix, do all of them need to have this?, is there any other prefixes I should be aware of?
+ <topic name="RES_PlasmaWeaponry">

Research Time: Do we know how many hours does it take to complete a certain topic?
- <research>
  <time>400</time>

Reference Itemids: I got this.
<reference itemid="ITEM_item1028" /> 
- <!--  itemid references id in config.items.xml 
  -->
And, in Cpt. Boxershorts' folder, I found Item Configuration.rtf, so I got this from there.
Due to the complexity of the layout, the uniqueidentifier codes for items have been divided into categories, as described below.

item id        1 to  1000 'deadweight
item id     1001 to 10000 'weapons
	item id    10001 to 15000 'equipment
	item id    15001 to 20000 'inert items
	item id    20001 to 25000 'heavy equipment
	item id    25001 to 40000 'invisible items
Now, how do I know which item has which Id?, or should I just pick an Id myself?
I could not find config.items.xml where they are supposed to be.

Cost Type: Are cost types associated with research or with manufacturing? And also, how many types are there?
 <cost type="ITEM_Plasma_Pistol">1</cost> 
  <cost type="money">2000</cost>
It is under "prerequisites".

Research Bonus Topic:
<researchbonus topic="RES_Plasma_Pistol_Ammo">10</researchbonus> 
  <researchbonus topic="RES_Plasma_Cannon">15</researchbonus>
What is this?, is it a bonus to research a certain topic when you have already researched another? like a bonus for plasma pistol ammo when you research plasma pistol?

Grants:
- <grants>
  <reference itemid="ITEM_item1028" /> 
  <reference xnetid="XNET_Plasma_Pistol" /> 
  </grants>
I assume "xnetid" means it gives you the x-net entry, but what about "itemid"?

This is pretty much it for now, if someone feels like giving me further instructions into XML, feel free... PLEASE :D, though I can handle myself with few directions, but XML tutorials I found so far are chinese to me. I can't deny though that it's fun to learn by toying around :P

Edited by Azrael, 07 March 2005 - 03:41 PM.


#23 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 07 March 2005 - 04:25 PM

Hi,

I'll try to put down what I can gather from it. Looking at this thread, I think guiver6 played around with it, so maybe he can add something.

Topic Names: All topics have a RES_* prefix, do all of them need to have this?, is there any other prefixes I should be aware of?


XNET_* is for XNET entries, ITEM_* is for items you can have in your inventory.
Don't know of anything else, yet.

These symbolic names should always be all upper case and have underscores instead of spaces, so it would be RES_PLASMA_WEAPONRY

Research Time: Do we know how many hours does it take to complete a certain topic?

- <research>
  <time>400</time>


If you don't have the right values yet, always put in a special value like 1234. This way they are easy to find and still validate as correct values for the schema.

Reference Itemids: I got this.

<reference itemid="ITEM_item1028" /> 
- <!--  itemid references id in config.items.xml 
  -->
And, in Cpt. Boxershorts' folder, I found Item Configuration.rtf, so I got this from there.
Due to the complexity of the layout, the uniqueidentifier codes for items have been divided into categories, as described below.

item id        1 to  1000 'deadweight
item id     1001 to 10000 'weapons
	item id    10001 to 15000 'equipment
	item id    15001 to 20000 'inert items
	item id    20001 to 25000 'heavy equipment
	item id    25001 to 40000 'invisible items
Now, how do I know which item has which Id?, or should I just pick an Id myself?
I could not find config.items.xml where they are supposed to be.


As far as I know, we no longer have numeric item-ids so for now, I would just leave it out.

Cost Type: Are cost types associated with research or with manufacturing? And also, how many types are there?

 <cost type="ITEM_Plasma_Pistol">1</cost> 
  <cost type="money">2000</cost>
It is under "prerequisites".


Costs are for manufacturing only

Research Bonus Topic:

<researchbonus topic="RES_Plasma_Pistol_Ammo">10</researchbonus> 
  <researchbonus topic="RES_Plasma_Cannon">15</researchbonus>
What is this?, is it a bonus to research a certain topic when you have already researched another? like a bonus for plasma pistol ammo when you research plasma pistol?

I don't have the slightest clue... Guiver6? Centurion?

Grants:

- <grants>
  <reference itemid="ITEM_item1028" /> 
  <reference xnetid="XNET_Plasma_Pistol" /> 
  </grants>
I assume "xnetid" means it gives you the x-net entry, but what about "itemid"?


itemid is for stuff like ITEM_PLASMA_CANNON.

This is what I thought I could add. Maybe one of the original authors can enlighten us further...
Thanks Azrael for taking the effort. Code that has been lying around untouched always seems to get a bit dusty. :wink1:

Greetings,

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.

#24 Beetle

Beetle

    Programming Department

  • Xenocide Inactive
  • 350 posts

Posted 07 March 2005 - 04:40 PM

XNET_* is for XNET entries, ITEM_* is for items you can have in your inventory.
Don't know of anything else, yet.
Rincewind

<{POST_SNAPBACK}>


What about:
- Base modules
- Aircrafts
- Ufos

Greetings,

Beetle
Posted Image

#25 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 08 March 2005 - 04:50 AM

Cost Type: Are cost types associated with research or with manufacturing? And also, how many types are there?

 <cost type="ITEM_Plasma_Pistol">1</cost> 
  <cost type="money">2000</cost>
It is under "prerequisites".


Costs are for manufacturing only

<{POST_SNAPBACK}>

Actually, that is supposed to be the research's cost, that is, the research on Plasma Pistol will use up an instance of Plasma Pistol and 2k money (it's there just to show off the capability, actually).

Research Bonus Topic:

<researchbonus topic="RES_Plasma_Pistol_Ammo">10</researchbonus> 
  <researchbonus topic="RES_Plasma_Cannon">15</researchbonus>
What is this?, is it a bonus to research a certain topic when you have already researched another? like a bonus for plasma pistol ammo when you research plasma pistol?

I don't have the slightest clue... Guiver6? Centurion?

<{POST_SNAPBACK}>

That'd be used to make the research progress more logically; if you research Plasma Pistol and research the ammo later, it'd take less time (-10 whatever, % or absolute value, we'll have to specify that later) than if you'd start Plasma Pistol Ammo research without having the Plasma Pistol researched; so, say, if we hardlink Plasma Cannon to Heavy Plasma only, having the lesser stuff researched would give you a bonus to that research and make you feel bad if you just jump to the important points in the tree :)

Grants:

- <grants>
  <reference itemid="ITEM_item1028" /> 
  <reference xnetid="XNET_Plasma_Pistol" /> 
  </grants>
I assume "xnetid" means it gives you the x-net entry, but what about "itemid"?

itemid is for stuff like ITEM_PLASMA_CANNON.

This is what I thought I could add. Maybe one of the original authors can enlighten us further...

<{POST_SNAPBACK}>

This means the research grants you the ability to manufacture ITEM_item1028 (btw yes, we don't use any numeric coding, it would be something like ITEM_PLASMA_PISTOL <- the reason to mark the types with the ITEM_, RES_, etc prefixes), and you get the xnetid.

Should I just add a readme to the schemas I co-wrote?

edit: The prefixes used are in
Attached File  basic.xsd   3.36K   29 downloads
that gets incorporated everywhere; those are ITEM_ (item, duh, including dead aliens), RES_ (research topic), XNET_ (XNet entry), FAC_ (facility), CRAFT_ (craft) and LIVE_ (live specimen).

Edited by centurion, 08 March 2005 - 05:03 AM.

Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#26 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 08 March 2005 - 11:38 AM

Great, thanks :) , I'll post here if I have further problems :D

#27 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 08 March 2005 - 11:50 AM

Great, thanks :) , I'll post here if I have further problems :D

<{POST_SNAPBACK}>

You might also want to download XMLSpy if you don't have it already (just google for it). It's a pretty nice XML-Editor and it also validates the XML you write to see if it validates against the schema.

Greetings,

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.

#28 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 08 March 2005 - 01:36 PM

Cost Type: Are cost types associated with research or with manufacturing? And also, how many types are there?

 <cost type="ITEM_Plasma_Pistol">1</cost> 
  <cost type="money">2000</cost>
It is under "prerequisites".


Costs are for manufacturing only

<{POST_SNAPBACK}>

Actually, that is supposed to be the research's cost, that is, the research on Plasma Pistol will use up an instance of Plasma Pistol and 2k money (it's there just to show off the capability, actually).

<{POST_SNAPBACK}>

So, where do I get the costs from?, or should I just leave it blank for now?

Edit: got a validation error with XMLSpy (great stuff btw :))
The file is not valid:
Unable to load schema with target namespace " from basic.xsd'.
What should I do about this?

Edited by Azrael, 08 March 2005 - 02:20 PM.


#29 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 08 March 2005 - 03:11 PM

So, where do I get the costs from?, or should I just leave it blank for now?


Just leave it blank for now, I would say.

Edit: got a validation error with XMLSpy (great stuff btw :))

The file is not valid:
Unable to load schema with target namespace " from basic.xsd'.
What should I do about this?

<{POST_SNAPBACK}>

Try to put the basic.xsd from further up this thread in the same directory as you xml and research.xsd.

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.

#30 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 08 March 2005 - 03:37 PM

Thanks, that did it, but now I get this:
This file is not valid:
Cannot resolve declaration or definition 'craftREF' in namespace 'ResearchConfig'
In basic.xsd there are listed a bunch of what the program calls simpleType, these are
itemID
researchID
xnetID, etc
I think the problem is that the items [...]REF are not defined. Maybe I'm completely wrong, I'm just pretty much guessing here. Maybe I should add them as simpleType as well?
Sorry for all the stupid questions, there is so much about this I don't know :Blush:

#31 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 08 March 2005 - 03:44 PM

Thanks, that did it, but now I get this:

This file is not valid:
Cannot resolve declaration or definition 'craftREF' in namespace 'ResearchConfig'
In basic.xsd there are listed a bunch of what the program calls simpleType, these are
itemID
researchID
xnetID, etc
I think the problem is that the items [...]REF are not defined. Maybe I'm completely wrong, I'm just pretty much guessing here. Maybe I should add them as simpleType as well?
Sorry for all the stupid questions, there is so much about this I don't know :Blush:

<{POST_SNAPBACK}>


If the REF-stuff is not defined, you should probably really just add the simpleType definitions for them.

Edit: I just saw that they are already in the basic.xsd, so it's probably something else.

If you want, post all three files you are using (the .xml you have so far, the basic.xsd and research.xsd) I'll take a look at them, then.

Rincewind

Edited by rincewind, 08 March 2005 - 03:46 PM.

Posted Image

I love boost!!! The next best thing since the invention of C++.

#32 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 08 March 2005 - 03:57 PM

Fixed, now I get this
This file is not valid: Simple Type definition 'money_const' is already declared on schema document :\basic.xsd
And highlights this
<xsd:simpleType name="money_const">

Here, I'll post all three files.

Attached Files



#33 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 08 March 2005 - 04:07 PM

Fixed, now I get this

This file is not valid: Simple Type definition 'money_const' is already declared on schema document :\basic.xsd
And highlights this
<xsd:simpleType name="money_const">

Here, I'll post all three files.

<{POST_SNAPBACK}>

Weird, it's validating perfectly here.

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.

#34 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 08 March 2005 - 04:16 PM

It is weird, I tried deleting all files and downloading it again, in different folders, nothing works, keeps giving me that, maybe I can work around it?

Edit: If I delete the line about money_constant it validates fine...

Edited by Azrael, 08 March 2005 - 04:19 PM.


#35 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 08 March 2005 - 04:20 PM

It is weird, I tried deleting all files and downloading it again, in different folders, nothing works, keeps giving me that, maybe I can work around it?

Edit: If I delete the line about money_constant it validates fine...

<{POST_SNAPBACK}>

That line is in what file?
Posted Image

I love boost!!! The next best thing since the invention of C++.

#36 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 08 March 2005 - 04:24 PM

This line
<xsd:simpleType name="money_const">
in basic.xsd

#37 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 08 March 2005 - 04:32 PM

This line

<xsd:simpleType name="money_const">
in basic.xsd

<{POST_SNAPBACK}>

Really, Really Weird :KooKoo:

Can someone else download the files, put then in a separate folder and see how they validate with XMLSpy?
Posted Image

I love boost!!! The next best thing since the invention of C++.

#38 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 09 March 2005 - 03:38 AM

No XMLSpy, checked with MSXML 4.0; and it's really a double definition, I'd rather remove the one in the research schema, since the type is (IIRC) needed in other places as well. Simply removing the

<xsd:simpleType name="money_const">
  <xsd:restriction base="xsd:string">
<xsd:enumeration value="money"/>
  </xsd:restriction>
</xsd:simpleType>

bit from config.research.xsd was OK here.
Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#39 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 09 March 2005 - 05:23 AM

That did it, thanks Centurion :D

#40 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 09 March 2005 - 03:08 PM

Should I add entries which you have when you start the game?, like the XC-11 (Skyranger)? If so, what do I have to specify to make them "starting" and "free"?, assigning research time 0 I guess, is that enough?
Edit 2: Can't assign time=0 <_<

Edit: also, to get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?, here's what's been written.
 <prerequisite>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
  	</either>
  </prerequisite>
I suppose that means that having either one of those gives you the entry, but how do I specify that you need a pair? (weapon+that weapon's clip)

Edited by Azrael, 09 March 2005 - 04:34 PM.


#41 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 10 March 2005 - 02:52 PM

Ok, converted nearly everything, I'll post here my progress just to keep a backup and so if someone wants to see and point any mistakes :)
There are some issues I'll need help with still:
- How to make a certain entry "free" (i.e. when you meet certain prerequisites, it just pops as completed, no research hours)
- Do I have to make an entry for every single alien rank?, like an entry for a Grey Soldier, Squad Leader, Navigator, Leader, Commander?
- Do I have to include the starting entries? like all the rest of the facilities and weapons?
- The Plasma issue from my previous post.

Attached Files



#42 Beetle

Beetle

    Programming Department

  • Xenocide Inactive
  • 350 posts

Posted 10 March 2005 - 03:08 PM

- Do I have to include the starting entries? like all the rest of the facilities and weapons?

<{POST_SNAPBACK}>


I'm not sure, but propably no. I think that it will be enough if you make topic called "starting tech" or something like it and put there grants to all starting items/facilities/xnet entries...

Beetle
Posted Image

#43 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 11 March 2005 - 11:36 PM

Follow Beetle's advice create a dummy starting technology that grants an specific tech. And then we will code the special case ;)

Greetings
Red Knight
Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.

#44 centurion

centurion

    Programming Department

  • Xenocide Programming Department
  • 800 posts

Posted 12 March 2005 - 03:29 AM

To get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?

<{POST_SNAPBACK}>

 <prerequisite>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
  	</either>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL_CLIP" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE_CLIP" />
    <reference itemid="ITEM_HEAVY_PLASMA_CLIP" />
  	</either>
  </prerequisite>
or so I hope.

edit: checked, works fine. However, it caught my eye that there are a lot of XNET_ prerequisites, and that seems wrong; yes, we probably won't get XNet entries for those items, but why introduce this potential bug source? Just require the appropriate RES_ instead.

Edited by centurion, 12 March 2005 - 03:36 AM.

Endure; in enduring, grow strong.
- Dak'kon

Help us getting Civ2 code: http://forums.civfan...p...age=1&pp=20 !

#45 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 12 March 2005 - 09:31 AM

To get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?

<{POST_SNAPBACK}>

 <prerequisite>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
  	</either>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL_CLIP" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE_CLIP" />
    <reference itemid="ITEM_HEAVY_PLASMA_CLIP" />
  	</either>
  </prerequisite>
or so I hope.

edit: checked, works fine. However, it caught my eye that there are a lot of XNET_ prerequisites, and that seems wrong; yes, we probably won't get XNet entries for those items, but why introduce this potential bug source? Just require the appropriate RES_ instead.

<{POST_SNAPBACK}>


That I wasn't sure of, having a RES prerequisite means that you have to research it first, right?, not just have it available for research? I used XNET as prerequisites since you obtain them when you finish the research, but I'll change it.
So far we have xnet entries for all of them :naughty:
Thanks for the plasmas :D

#46 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 12 March 2005 - 02:49 PM

To get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?

<{POST_SNAPBACK}>

 <prerequisite>
 	 <either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
 	 </either>
 	 <either>
    <reference itemid="ITEM_PLASMA_PISTOL_CLIP" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE_CLIP" />
    <reference itemid="ITEM_HEAVY_PLASMA_CLIP" />
 	 </either>
  </prerequisite>
or so I hope.

edit: checked, works fine. However, it caught my eye that there are a lot of XNET_ prerequisites, and that seems wrong; yes, we probably won't get XNet entries for those items, but why introduce this potential bug source? Just require the appropriate RES_ instead.

<{POST_SNAPBACK}>


That I wasn't sure of, having a RES prerequisite means that you have to research it first, right?, not just have it available for research? I used XNET as prerequisites since you obtain them when you finish the research, but I'll change it.
So far we have xnet entries for all of them :naughty:
Thanks for the plasmas :D

<{POST_SNAPBACK}>


RES prerequisites mean you have to have the RES_WHATEVER researched before you can start researching the entry. I think requisites should be limited to ITEM_, LIVE_ and RES_ (did I miss one?)

Greetings,

Rincewind

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.

#47 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 16 March 2005 - 05:35 PM

To get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?

<{POST_SNAPBACK}>

 <prerequisite>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
  	</either>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL_CLIP" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE_CLIP" />
    <reference itemid="ITEM_HEAVY_PLASMA_CLIP" />
  	</either>
  </prerequisite>
or so I hope.

edit: checked, works fine. However, it caught my eye that there are a lot of XNET_ prerequisites, and that seems wrong; yes, we probably won't get XNet entries for those items, but why introduce this potential bug source? Just require the appropriate RES_ instead.

<{POST_SNAPBACK}>


About that, to change the XNET prefix to RES, I need to change also the xnetid part, but change to what?
<grants>
 	 <reference xnetid="XNET_ALIEN_INFILTRATION"/>
  </grants>
this is an example, there is no resid or something like it. Which *id should I use?

#48 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 16 March 2005 - 06:29 PM

To get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?

<{POST_SNAPBACK}>

 <prerequisite>
 	 <either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
 	 </either>
 	 <either>
    <reference itemid="ITEM_PLASMA_PISTOL_CLIP" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE_CLIP" />
    <reference itemid="ITEM_HEAVY_PLASMA_CLIP" />
 	 </either>
  </prerequisite>
or so I hope.

edit: checked, works fine. However, it caught my eye that there are a lot of XNET_ prerequisites, and that seems wrong; yes, we probably won't get XNet entries for those items, but why introduce this potential bug source? Just require the appropriate RES_ instead.

<{POST_SNAPBACK}>


About that, to change the XNET prefix to RES, I need to change also the xnetid part, but change to what?
<grants>
 	 <reference xnetid="XNET_ALIEN_INFILTRATION"/>
  </grants>
this is an example, there is no resid or something like it. Which *id should I use?

<{POST_SNAPBACK}>

Actually, this is the only place where the XNET_ prefix has to stay. As this actually means, doing this research will grant you that XNet-Entry.

Greetings,

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.

#49 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 16 March 2005 - 07:03 PM

To get Plasma Weaponry, you need a Plasma Weapon+Clip, how do I write that in the XML?

<{POST_SNAPBACK}>

 <prerequisite>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE" />
    <reference itemid="ITEM_HEAVY_PLASMA" />
  	</either>
  	<either>
    <reference itemid="ITEM_PLASMA_PISTOL_CLIP" /><!-- itemid references id in config.items.xml -->
    <reference itemid="ITEM_PLASMA_RIFLE_CLIP" />
    <reference itemid="ITEM_HEAVY_PLASMA_CLIP" />
  	</either>
  </prerequisite>
or so I hope.

edit: checked, works fine. However, it caught my eye that there are a lot of XNET_ prerequisites, and that seems wrong; yes, we probably won't get XNet entries for those items, but why introduce this potential bug source? Just require the appropriate RES_ instead.

<{POST_SNAPBACK}>


About that, to change the XNET prefix to RES, I need to change also the xnetid part, but change to what?
<grants>
  	<reference xnetid="XNET_ALIEN_INFILTRATION"/>
  </grants>
this is an example, there is no resid or something like it. Which *id should I use?

<{POST_SNAPBACK}>

Actually, this is the only place where the XNET_ prefix has to stay. As this actually means, doing this research will grant you that XNet-Entry.

Greetings,

Rincewind

<{POST_SNAPBACK}>


That's what I was thinking, we do have texts for every topic anyway (and if we don't, that can be fixed very easily :naughty:)
I just realised instead of making ONE dummy topic which grants all starting tech, I make one dummy topic for EVERY one of them :OhBrother: (or do you want the starting tech to have different dummy topics?)

Edited by Azrael, 16 March 2005 - 07:05 PM.


#50 Guest_Azrael_*

Guest_Azrael_*
  • Guests

Posted 18 March 2005 - 09:55 PM

Added dummy topic. Updated names. Fixed plasma.
I still need to add some Xenocide-specific topics, and think where there should be some research bonuses.

Attached Files