Regarding the CSunParser object

Regarding the CSunParser object

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Regarding the CSunParser object

Post by Buggi »

Can this object be modified to read XML files?

I think this engine would GREATLY benefit from a strong XML schema design.

For example, a build menu for a unit:

Code: Select all

<menuentries buildmenu="ARMLAB">
	<menuentry menu="1" button="1" unitname="ARMFLEA"/>
	<menuentry menu="1" button="2" unitname="ARMCK"/>
	<menuentry menu="1" button="3" unitname="ARMBLAH"/>
</menuentries>
Even for the map SMD files...

Code: Select all

<map>
	<settings>
		<description>En karta</description>
		<tidal>20</tidal>
		<gravity>100</gravity>
		<maxmetal>0.02</maxmetal>
		etc...
	</settings>
	<atmosphere>
		etc
	</atmosphere>
	<water>
		etc
	</water>
	<light>
		etc
	</light>
	<teams>
		<team id=0 startx="3500" startz="2500"/>
		<team id=1 startx="5200" startz="7000"/>
		etc...
	</teams>	
</map>
I would love if this were implimented. HPI 3 will use XML for all text-based configurations.

-Buggi
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

While standards-compliant formats are nice, in this case, something like XML would be horrible overkill and would result in a lot of extra work for modders.

I actually wrote a DTD for TA unit FBI files a few months ago. It worked, I posted it, and then i realized that it was a huge expenditure of effort for something that only complicated an already-well working system.
User avatar
Redfish
Posts: 289
Joined: 27 Feb 2005, 16:12

Post by Redfish »

I agree there aren't that many of options for maps so without tags and a bit of comment it still is quite easy to get the entire picture, especially when we have a map loader/editor.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

See, that's the problem.

Right *now* it's an okay system.

What about when things get more complex? Then you're stuck.

-Buggi
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Comeon, its a map. Its not GOING to get more complex :P
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

That xml exemple you posted is unreadable with bare eye. And the more complex the less easy it will be to read and write such overbloated xml files. I'd rather stick with current system where I can use notepad to read and write .tdf and .smd.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

Actually I can read it just fine.

And I typed it in note pad. :shock:

-Buggi
Xon
Posts: 33
Joined: 07 May 2005, 17:07

Post by Xon »

Dragon45 wrote:Comeon, its a map. Its not GOING to get more complex :P
Wait till someone adds support for arbitary triggers and scripting.

Then the map format will get a tad more complex.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

That still doesn't mean you need useless structure in terms of tags. TA had script-triggers in the map fiels themselves as well, and it worked wonderfully well. XML is overcomplex for this purpose.

I actually did ask the SYs if they were going to use XML for anything unit/map related and they said the same thing i am now: The current system is readable, and it works.
Post Reply

Return to “Engine”