Senior Member
Posts: 606
Threads: 67
Joined: 2010-11
How powerful is XML as a language for programming games? Previously I was looking into C# and C++, but I've been on another forum and they've been talking about using XML to program stages and levels. Exactly how does it compare to python, C#, C++ and Java? I never realized that I'd missed noticing XML.
Senior Member
Posts: 383
Threads: 16
Joined: 2011-09
XML is just a markup language used to represent data. There is no "programming" to it.
Did you perhaps mean "XNA" for the XBox?
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
Or to put it another way, you just asked how powerful GIF is compared to Photoshop.
The closest literal interpretation of what you said is that they're using XML to define the levels / stages of the games so they're easily readable and modifiable. That's no different than how most games store their data though. The XML isn't actually "doing" anything, it's just representing data that the game engine, written in a real programming language, then digests and acts upon.
It's not having what you want - It's wanting what you've got.
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
If you can't calculate 1+1 with it, it's not a programming language.
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
Fiel Wrote:If you can't calculate 1+1 with it, it's not a programming language.
Wouldn't "If you can't evaluate boolean conditions it's not a programming language" be more accurate?
It's not having what you want - It's wanting what you've got.
Posting Freak
Posts: 3,524
Threads: 151
Joined: 2011-01
Gender: Male
Sexual Orientation: Bi
Country Flag: New_Jersey
IGN: Rebootycall
Server: Reboot
Level: 173
Job: Wild Hunter
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
MuscleWizard Wrote:I think OP meant XNA.
It's equally plausible to have misunderstood the using XML to store data. Until the OP replies we'll never know.
It's not having what you want - It's wanting what you've got.
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
@Eos - Where does my definition fail?
Posting Freak
Posts: 4,171
Threads: 58
Joined: 2010-09
Gender: Male
Sexual Orientation: Bi
Country Flag: venezuela
IGN: xxxxFenixR
Server: Bera
Level: Mix
Job: Severals
Guild: None
Guild Alliance: Nada
Farm: Wut?
Fiel Wrote:@Eos - Where does my definition fail?
He was just narrowing down your answer me thinks.
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
Fiel Wrote:@Eos - Where does my definition fail?
A calculator is not a programming language but can do 1+1.
It's not a language till you can ask "if"
It's not having what you want - It's wanting what you've got.
Senior Member
Posts: 606
Threads: 67
Joined: 2010-11
I'm positive that the guy on the other forums said they're 'using XML to script maps' when I asked what programming language they're using lol. I even gave them examples (is it C++? C#? Java?) I guess I'll go ask again.
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
It's possible the person has no programming knowledge whatsoever and is just creating/modifying area files and similar in XML for whatever engine he's working with.
It's not having what you want - It's wanting what you've got.
Senior Member
Posts: 606
Threads: 67
Joined: 2010-11
Do game engines use XML all that frequently? What are the advantages to it?
Posting Freak
Posts: 6,070
Threads: 229
Joined: 2008-07
Eos Wrote:A calculator is not a programming language but can do 1+1.
It's not a language till you can ask "if"
Uh okay... Excel is a programming language, a scientific calculator is a programming language. Chemistry is a programming language. Well okay other than the fact that DNA can solve NP-complete problems, it probably isn't xD
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
It's no different from using a .wz or a .package
In fact, most of those now days are just containers to bind and compress multiple XML files or files or various formats.
There honestly is no real advantage to it other than it's an actual documented format with libraries to read and write to it and standards.
It's no more or less effective from writing out everything to flatfile in a proprietary format or directly serializing it to disk.
It's just a means of saving it dynamically outside of the executable.
KajitiSouls Wrote:Uh okay... Excel is a programming language, a scientific calculator is a programming language. Chemistry is a programming language. Well okay other than the fact that DNA can solve NP-complete problems, it's not xD
Both of your first examples are true, yes.
You can in fact write full fledged applications in both.
No idea where you were going with the chemistry one, but you can create biological logic circuits, so yes, you could use chemistry to write an application technically.
It's not having what you want - It's wanting what you've got.
Senior Member
Posts: 606
Threads: 67
Joined: 2010-11
Eos Wrote:It's no different from using a .wz or a .package
In fact, most of those now days are just containers to bind and compress multiple XML files or files or various formats.
There honestly is no real advantage to it other than it's an actual documented format with libraries to read and write to it and standards.
It's no more or less effective from writing out everything to flatfile in a proprietary format or directly serializing it to disk.
It's just a means of saving it dynamically outside of the executable.
I'm not familiar with libraries, flatfiles and direct serialization. What are those, and how do they factor into things?
I'm also not sure what a proprietary format is.
EDIT: You can write programs with excel and a calculator? How? If it's a graphing calculator I think I might have an inkling, but a normal calculator? And excel?
Posting Freak
Posts: 6,070
Threads: 229
Joined: 2008-07
2011-12-09, 01:51 PM
(This post was last modified: 2011-12-09, 01:56 PM by KajitiSouls.)
wat.
Posting Freak
Posts: 6,070
Threads: 229
Joined: 2008-07
Eos Wrote:Both of your first examples are true, yes.
You can in fact write full fledged applications in both.
No idea where you were going with the chemistry one, but you can create biological logic circuits, so yes, you could use chemistry to write an application technically.
Suit yourself. Install D&D on my scientific calculator plz.
The chemistry example shows how it 1ups circuits and their electrons, as the latter cannot solve large NP-complete problems in a reasonable amount of time. On the other hand, the former requires lots of upfront time costs, but can solve NP-complete problems exponentially faster.
Administrator
Posts: 17,191
Threads: 2,153
Joined: 2008-09
Gender: Male
Sexual Orientation: Gay
IGN: Aesilyn
Server: Mardia
Level: 200
Job: I/L ArchMage
Guild: Animus
Writing a program is simple with excel. Excel has VBA built into it so you just write whatever you want it to do just as if you were writing a VBA app from scratch more or less.
For calculators; http://en.wikipedia.org/wiki/TI-BASIC
A library is someone else's code that's been precompiled and released as something you can include in your own code and benefit from the work they've already done. For example if I wrote my own XML parser I could release it as a DLL and any person who wanted to parse XML files could include my DLL in their application and directly call the functions I've already written instead of doing the work themselves. Since XML is a mature system there are hundreds if not thousands of XML parsing libraries out there as well as more than a few "standard" libraries with each language.
Serialization is generally just directly outputting a binary representation of data in memory to a file and then later reading that image back into active memory to recreate it exactly as it was. Game saves used to work like that more or less, just writing a snapshot of RAM to disk then reinstating it. The problem with that is that it's not exactly something you can edit and work with without a very clear understanding of what you're doing. If you've ever edited a save game manually you'd have some understanding of it already.
A proprietary format is just that; It's some crap you invent yourself. I could for example decide that I wanted to write users to flatfile as:
[USER]
Name: Bob
Email: Here@there.com
[USER]
Name: Fred
Email: Something@Somewhere
And then I'd have my own little routine that knew that was the format to expect users to be in and to load them.
It's easier to read, easier to edit, but only I know how to read/write it and what to expect and what it's required to conform to.
With XML on the other hand, it's a standard. Any XML library can read it and form it's own representation and do something with the data.
You still need your own routines to convert the result of that to end state, but it's more portable and you can for example open up one of the XML files in any XML editor to make changes and have it confirm that you haven't made the file unreadable by breaking the required format.
It's not having what you want - It's wanting what you've got.
Senior Member
Posts: 606
Threads: 67
Joined: 2010-11
Excel has visual basic? That's cool. o.0
I knew about the TI calculator, my friend tried to install pokemon gold on his once. But in this case, is it possible to program directly using the calculator's keys, or would you need to transfer code you made on a computer into the calculator?
Quote:A library is someone else's code that's been precompiled and released as something you can include in your own code and benefit from the work they've already done. For example if I wrote my own XML parser I could release it as a DLL and any person who wanted to parse XML files could include my DLL in their application and directly call the functions I've already written instead of doing the work themselves. Since XML is a mature system there are hundreds if not thousands of XML parsing libraries out there as well as more than a few "standard" libraries with each language.
Wouldn't that cause copyright issues? What with all the patent trolls running around...
Thanks for answering the questions, I'm still a bit unclear on the XML and proprietary format bit though. I think I get what a proprietary format is, but what do you mean by 'form its own representation'?
|