XML downside

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderators: Oberlus, Oberlus

Current FO XML vs SE4 TXT techs: who wins?

FO XML are ok, I understand them.
17
77%
KISS. Go for TXT.
5
23%
 
Total votes: 22

Message
Author
User avatar
Prokonsul Piotrus
Space Kraken
Posts: 154
Joined: Fri Jun 04, 2004 9:20 pm
Location: Poland, Europe, Earth, Sol

XML downside

#1 Post by Prokonsul Piotrus » Fri May 06, 2005 8:36 pm

Techs.xml has one very, very big problem: it is in XML.

Now, before you rant on me, think about this: how many ppl contribute here, in brainstorming, and how many contributed WORKABLE, XMLed ideas to the tech design thread? Very few. And when the SE4 finally goes live, how many mods do you expect will be created? Very, very few. By limiting the modding and such to people with XML skills we cut of the vast majority of people. Why?

I wouldn't be writing this if I didn't know another, simple way: Space Empires. The techs (and many, many other things, like game settings, racial traits...tons of stuff) are contained in simple txt. They are much, much simpler to learn how to edit, and apparently it is possible to write the game that the executable files can read txt without the need for xml. See this good site for more info on the details of Se4 moding. And we could definelty use a nicely written guide to FO inners, like there is for SE4.. Sure, it would take some time, but it would save much time for our programmers as well. And yes, I know we have some partial guide, and a wiki, but to actually find an information one is looking for fast...it is hard. But I am getting OT. What was I ranting about...ah, yes, XML is bad, TXT is good.

The proof? Hundreds (ok, dozens) of playable mods availalbe to download, including Star Trek and Babylon 5 mods, to name a few, hundreds (yes, hudreds) of shipsets, dozens (again) scenarios and maps (map creator is very user unfriendly, hence it is sometimes easier to make a mod then a map - something to keep in mind when designing eventual FO map maker). And if SE4 required the modders to know XML and such, I bet you 9/10 of the current modders and other contributors would just go away.

As much as I wish for FO project to succeed, I *know* that if you keep the XML knowledge requirement, the game is unlikely to beat SE4 or the soon-to-come-beta-testing-started SE5.

Here, some examples from the data files, first of a tech area, then of a ship comonent (weapon).

Name := Satellites
Group := Applied Science
Description := The construction of satellites to be dropped in space.
Maximum Level := 3
Level Cost := 50000
Start Level := 1
Raise Level := 0
Racial Area := 0
Unique Area := 0
Can Be Removed := False
Number of Tech Req := 0

Name := Ripper Beam I
Description := Short range high intensity fusion beam.
Pic Num := 21
Tonnage Space Taken := 20
Tonnage Structure := 20
Cost Minerals := 50
Cost Organics := 0
Cost Radioactives := 40
Vehicle Type := Ship\Base\Sat\WeapPlat\Drone
Supply Amount Used := 5
Restrictions := None
General Group := Weapons
Family := 2009
Roman Numeral := 1
Custom Group := 0
Number of Tech Req := 1
Tech Area Req 1 := High-Energy Discharge Weapons
Tech Level Req 1 := 1
Number of Abilities := 0
Weapon Type := Direct Fire
Weapon Target := Ships\Planets
Weapon Damage At Rng := 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Weapon Damage Type := Normal
Weapon Reload Rate := 1
Weapon Display Type := Beam
Weapon Display := 5
Weapon Modifier := 0
Weapon Sound := ripbeam.wav
Weapon Family := 9
Image

drek
Designer Emeritus
Posts: 935
Joined: Thu Jun 26, 2003 8:07 am

#2 Post by drek » Fri May 06, 2005 9:37 pm

I very much agree. But, unless a coder with the skill and desire to change the format decides to take up the problem, the XML format is "good enough".

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12453
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#3 Post by Geoff the Medio » Sat May 07, 2005 12:18 am

XML does not require some obscure impossible to learn secret "knowledge" to use. I had no idea what XML was before contributing to FreeOrion, and by XML, I mean the actual format known as XML, not just the FreeOrion-specific structure of XML required. Yet somehow I've managed to figure it out, and did so before we had a guide to help in the process.

The reason nobody made XML formatted tech suggestions is because it's more work to conform to any format than just freestyle text, and it's more limiting to use the available effects we have provided than to use whatever nebulously defined term you want to add +5% too for your tech. This project, like any other with public forums, has lots of people with ideas, and not so many people willing to actually work to implement them.

drek
Designer Emeritus
Posts: 935
Joined: Thu Jun 26, 2003 8:07 am

#4 Post by drek » Sat May 07, 2005 2:19 am

Agreed with that Geoff. Even if the tech descriptions were super-easy to conjure, I doubt very many people would bother. There's this notion that ideas are important--90% of the ideas posted to this forum will never be in any game anywhere because there's no follow-through.

But I also see the point of people who think the XML descriptions are hard to read/write....because they are. Something like the list posted above would be easier, but the descriptors as they stand are "good enough".

If a would-be game designer really cares about making an useful contribution they could figure out the XML descriptors.

/feeling snarky/grumpy :twisted:

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

#5 Post by pd » Sat May 07, 2005 7:38 am

XML is a worldwide standard and much more suited for what we need then plain .txt. if you think it's hard to read/write/understand then you should possibly use a xml editor.

the main benefit of XML is imo that you can easily create a hierarchy, instead of just a list. it may seam a bit more effort but it pays off.

edit: i don't see much sense in making this a poll, btw
Last edited by pd on Sat May 07, 2005 11:31 am, edited 1 time in total.

User avatar
noelte
Juggernaut
Posts: 872
Joined: Fri Dec 26, 2003 12:42 pm
Location: Germany, Berlin

#6 Post by noelte » Sat May 07, 2005 11:01 am

the main benefit of XML is imo that you can easily create a hierarchy, instead of just a list. it may seam a bit more effort but it pays off.
Yes that's one good thing, the other is you can access items in a very simple manner. And parsing a unstructured text-file is hell. Parsing XML is already done. The only drawback i can see goes along with the file size.
Press any key to continue or any other key to cancel.
Can COWs fly?

solrac776
Space Floater
Posts: 33
Joined: Sat Aug 14, 2004 1:01 am
Location: Dublin, Ireland

#7 Post by solrac776 » Sat May 07, 2005 5:38 pm

With my vote, the XMLers take the lead! Boo-yah!

User avatar
Daveybaby
Small Juggernaut
Posts: 724
Joined: Mon Sep 01, 2003 11:07 am
Location: Hastings, UK

#8 Post by Daveybaby » Mon May 09, 2005 10:36 am

I see no poll option for 'encrypted binary'.

:twisted:
The COW Project : You have a spy in your midst.

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

#9 Post by pd » Mon May 09, 2005 10:38 am

haha, good one :)

User avatar
Pasi
Space Squid
Posts: 52
Joined: Mon Feb 09, 2004 3:35 pm
Location: Finland

#10 Post by Pasi » Mon May 09, 2005 12:48 pm

XML all the way... It's modular and ... well... good :wink:

If someone has the time, why not make a FO XML tech editor with userfriendly GUI :roll: :wink:
I'm not a programmer... but I play one at Microsoft!

User avatar
Rapunzel
Pupating Mass
Posts: 99
Joined: Tue Apr 27, 2004 3:11 pm
Location: Germany

#11 Post by Rapunzel » Mon May 09, 2005 1:22 pm

just a little qustetion:
who is edition the tech.xml anyway?
I suppose I can't simply add some tech to the file, simply because i like it, there aught to be some restrictions on that way, arn't there? :?:

So then the otehr question must be who ist chnging that file and under which condition, and what files do the shortcutnames refere to? Better would be, "is there a how-to tech.xml?" :wink:
Dieser Text basiert ausschließlich auf frei erfundener Interpunktion und Orthographie. Jegliche Uebereinstimmungen mit geltenden Regelungen sind rein zufaellig und wurden nicht beabsichtigt.

User avatar
Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#12 Post by Tyreth » Mon May 09, 2005 2:19 pm

The "real" techs.xml is located in CVS which only developers have access to. The public one is on the wiki which anyone can edit.

Basically, if you add things to it, then others will see and will review it. There might be a better way to manage this, but few people have expressed interest in formatting their contributions properly so until now it hasn't been a problem.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12453
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#13 Post by Geoff the Medio » Mon May 09, 2005 4:22 pm

Rapunzel wrote:who is edition the tech.xml anyway?
I suppose I can't simply add some tech to the file, simply because i like it, there aught to be some restrictions on that way, arn't there? :?:
If you want to suggest techs for the official version of the game, then do it on the tech tree design forum. If they're accepted, I and/or someone else will arrange to have it uploaded to CVS, and put into the the techs.xml on the wiki. If you just edit the wiki for something other than a typo fix, it'll probably be reverted. If you want to play around and make some techs for fun, run the latest CVS version on your own machine and edit techs.xml all you want.
... what files do the shortcutnames refere to?
Don't know what you mean...?
Better would be, "is there a how-to tech.xml?" :wink:
There is a tutorial on how to write techs with effects, if that's what you mean.

User avatar
Dreamer
Dyson Forest
Posts: 228
Joined: Sun Mar 13, 2005 6:44 am
Location: Santiago, Chile

Re: XML downside

#14 Post by Dreamer » Mon May 09, 2005 11:40 pm

I haven't looked tech.xml so far, but I don't see the problem. A valid XML notation for you example is in fact:

<tech
Name = 'Satellites'
Group = 'Applied Science'
Description = 'The construction of satellites to be dropped in space.'
Maximum Level = '3'
Level Cost = '50000'
Start Level = '1'
Raise Level = '0'
Racial Area = '0'
Unique Area = '0'
Can Be Removed = 'False'
Number of Tech Req = '0'
>

Witch is not really different to what you want. Plus you have a standard definition of how to handle comments and other stuff, you have parsers everywhere, you can nest information in a tree structure for more complex stuff and you already have several XML editors/creators out there to make it even easier for someone ignorant to writte techs. So as far as I see XML rocks for this!

drek
Designer Emeritus
Posts: 935
Joined: Thu Jun 26, 2003 8:07 am

#15 Post by drek » Tue May 10, 2005 3:30 am

The XML for FO techs ends up looking more like this:

Code: Select all

 <Tech>
      <name>LEARN_DREK_TUTORIAL</name>
      <description>LEARN_DREK_TUTORIAL_DESC</description>
      <type>TT_APPLICATION </type>
      <category>LEARNING_CATEGORY</category>
      <research_cost>10</research_cost>
      <research_turns>5 </research_turns>
      <prerequisites>
          <prereq>LEARN_THEORY_OF_DREK</prereq>
      </prerequisites>
      <effects>
        <EffectsGroup>
          <scope>
            <Condition::And>
              <Condition::EmpireAffiliation>
                <empire_id>Source.Owner</empire_id>
                <affiliation>AFFIL_SELF</affiliation>
                <exclusive>1</exclusive>
              </Condition::EmpireAffiliation>
              <Condition::Type>OBJ_POP_CENTER</Condition::Type>
              <Condition::Or>
                <Condition::FocusType>
                  <primary>1</primary>
                  <FocusType>FOCUS_RESEARCH</FocusType>
                </Condition::FocusType>
                <Condition::FocusType>
                  <primary>0</primary>
                  <FocusType>FOCUS_RESEARCH</FocusType>
                </Condition::FocusType>
              </Condition::Or>
            </Condition::And>
          </scope>
          <activation><Condition::Self></activation>
          <stacking_group>STACK_DREK_TUTORIAL</stacking_group>
          <effects>
            <Effect::SetMeter>
              <meter>METER_RESEARCH</meter>
              <value>Target.MaxResearch+2</value>
              <max>1</max>
            </Effect::SetMeter>
          </effects>
       </EffectsGroup>
     </effects>
  </Tech>
That's for a pretty simply tech.

I'd somewhat prefer something more like a scripting language. It would be easier to read/write and debug. Syntax errors would, I suspect, drop dramatically.

If anyone's taking unreasonable requests, I'd also prefer world peace and a harem of pretty girls at my beck and call.

Code: Select all

 Tech=Game.addEffect()  //returns a handle to the Tech added
 Tech.name=LEARN_DREK_TUTORIAL
 Tech.description=LEARN_DREK_TUTORIAL_DESC
 Tech.type=TT_APPLICATION
 Tech.category=LEARNING_CATEGORY
 Tech.research_cost=10
 Tech.research_turns=5 
 Tech.add_prerequisite(LEARN_THEORY_OF_DREK)
 
 Effectgroup=Tech.add_effectgroup ()  
 Effectgroup.ActivationCondition="Self"
 Effectgroup.ScopeCondition= ("EmpireAffilation=Source.Owner && PopulationCenter=True && (FocusType=PrimaryResearch || FocusType=SecRessearch)")  
 Effectgroup.StackingGroup=STACK_DREK_TUTORIAL

 Effect1=Effectgroup.add_Effect ("SetMeter (METER_RESEARCH, Target.MaxResearch+2, 1)") 
...

...


btw: world peace is the least important of the requests, if you can only do one.

Post Reply