Export Room to XML?

Started by Clarvalon, Wed 15/04/2009 14:49:01

Previous topic - Next topic

Clarvalon

I've searched the forums and not been able to find anything to suggest this is possible, but thought it worth asking anyway - is there any way of using the AGS Editor to export a room (*.crm) to XML?  I notice that the main game content in the .agf file is XML, but the rooms are not.

The reason being is that I'm writing a tool to convert AGS projects to XAGE, to help reduce the amount of effort required in porting a completed AGS game to the Xbox360 (a quick video of Demo Quest 3-1 running in XAGE can be found: here).  Without the room information the automated conversion can only go so far.
XAGE - Cross-Platform Adventure Game Engine (alpha)

GarageGothic

Wow, that's some damn impressive work, clarvalon. I personally see much more potential in your converter than in the recent discussion about a Nintendo DS or Wii compatible AGS version. You say that structural differences prevent a perfect automatic conversion, what areas in particular does this relate to? Is it just the art that needs to be exported manually, or does it limit any AGS script functions?

Unfortunately I can't answer your question, but keep up the good work, and please keep us posted!  :=

Clarvalon

Thanks.  I've not spent a huge amount of time with AGS, but the main differences are to do with scripting.  AGS seems extremely versatile - the fact that people have made wolfenstein 3d clones, platformers et al is very impressive.  XAGE on the other hand is a lot less mature and much more focused on creating SCUMM-type games (for now), with the scripting limited to a small set of actions.  Simplicity vs Versatility.  Features of AGS will therefore not necessarily map to XAGE, and will have to be implemented by other means.

Converting the art assets is all handled automatically and is reasonably pain-free, thanks to AGS Editor's handy sprite export functionality.  There's a small problem in that 8bit sprites seem to be exported as 32bit, so the palette information is lost (hence why Cris has no hair in the video).  This shouldn't be an issue if people point XAGE to their original 8bit bitmaps.

Walkable areas in AGS are harder to port over automatically as XAGE uses geometric walkboxes rather than a mask.  This may be moot though, as this information is presumably stored in the aforementioned room.crm files which I can't get my mits on.
XAGE - Cross-Platform Adventure Game Engine (alpha)

Dualnames

To ask of this slowly..can I complete a game and make it available for Xbox360?
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Pumaman

Room data is stored in a proprietary binary file format, mainly because it includes a lot of graphics data which wouldn't be efficiently stored as XML.

It's something that I may change at some point, but there's no strong reason to do it at the moment.

And yes, that's some impressive initial work with your converter :)

Clarvalon

DN:  No, not yet.  XAGE is still incomplete - the two main missing parts are Dialogue Trees and GUI customisation, both of which I've been putting off until I've fully thought through the design.  But what currently works in Windows also deploys and runs fine on the 360.  Linux/Mac support is MUCH flakier at the moment, but this is a lower priority (and dependant on third party technologies - Silverlight & Silversprite).

The AGS conversion is, at this stage, mostly superficial.  The basic game structure is ported (rooms, characters and associated textures) over but not a whole lot else. 

CJ:  Cheers - having the .crm data in XML would undoubtedly be extremely useful, but there's still plenty for me to get my teeth into.  Maybe when XAGE and the conversion is more mature I'll be able to put forward a stronger case for its inclusion. 
XAGE - Cross-Platform Adventure Game Engine (alpha)

Dualnames

Oh, so it's mostly the effort of doing it as far as it is. Man I really hope you finish it..
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Monsieur OUXX

Maybe I'm missing something, but wouldn't it be possible to create an AGS module that would act as a converter? (add the module to the game, run the game, the loads all its ressources , and the module saves everything into files)
What about the scripts? Are they still saved in the "rooms" files?
 

Gilbert

No, it's not possible, and even if it's possible, it's not practical.

What you can do in a module is just what you can do in AGS text scripting.

Monsieur OUXX

Quote from: Gilbet V7000a on Tue 21/04/2009 13:25:21
No, it's not possible, and even if it's possible, it's not practical.

What you can do in a module is just what you can do in AGS text scripting.

Yes, but what data exists in the room that is not accessible in the text scripting?
I said "module", but I might as well have said "plugin". My whole point is : if the structure of the files is not known, what prevents the developer to load the data using the available official tools and then save it in his own file format?
 

subspark

Wow great timing clarvalon! It's about time AGS covered other platforms.

I ask the same question as OUXX. Wouldn't it be easy to write a plugin for AGS that bridges the gap in the conversion process?

Cheers,
Sparky.

monkey0506

Quote from: Pumaman on Wed 15/04/2009 18:26:42Room data is stored in a proprietary binary file format

To answer OUXX and subspark, in short this means no.

The data is saved in a proprietary format. That means the only way to access the data would be to either load the AGS Editor or run the game itself and load the data via the AGS engine.

It would then be a timely and (system resource) costly operation to perform any type of conversion (having to save all room data from backgrounds, walkable areas, walkbehinds, objects, regions, hotspots, etc. to external files) and in the event that even the slightest change is made to the room, the entire process would have to be repeated.

The way it stands clarvalon is reading the primary game data directly from the available plaintext files (such as Game.agf which is written in XML). This means that it can interpret the data directly, any changes would be automatically handled.

Since the rooms are saved to a proprietary format it's simply not reasonable to have to go through every room and export the data (especially in games with high numbers of rooms!).

Unfortunately at this point the best solution here would simply be for clarvalon to work around it, and if/when the time comes, he can negotiate rights with CJ to try and write some type of interpreter for the CRM files.

Great job so far by the way clarvalon, it's looking very impressive and I definitely wish you the best of luck. AGS games on the Xbox 360 would be one of the best possible things to ever happen in the history of mankind. :=

Stee

 :o

This is brilliant! I've tinkered with XNA a little bit as part of a course I was doing. Its good to see people starting to develop useful tools with it. Its a shame M$ are so arsey about publish XBLA stuff. I guess the solution would be that everyone would have to invest in a CC subscription to run on 360, which isn't a terrible thing.

Good Luck!
<Babar> do me, do me, do me! :D
<ProgZMax> I got an idea - I reached in my pocket and pulled out my Galen. <timofonic2> Maybe I'm a bit gay, enough for do multitask and being romantical

Clarvalon

Many thanks the positive comments.  As a result of the interest, I'm continuing to work on the AGS -> XAGE project conversion.  I've started work on a simple parser to pull out the basic information from the scripts associated with the dialogue options, so hopefully I'll have something new to show in the next week or two.

Due to my general lack of knowledge of AGS, I'm not sure whether exporting the room information in-game is viable.  Likewise, interpreting the .crm file seems like the long way around.  Having the room information in XML format would be ideal - if AGS stores rooms as individual objects then it should be trivial to serialize it, minus the textures, via the editor into XML.   Whether CJ ever implements this however is completely his prerogative - I certainly won't gripe if it never happens.
XAGE - Cross-Platform Adventure Game Engine (alpha)

Trent R

I don't see how making an XAGE room editor would be so hard? Granted, if you had tons of rooms it'd be a pain to go through and recreate each of them, but I'm gonna guess that games like that will have scripted features that XAGE (at this point at least) would be unable to replicate.

I don't mean to put XAGE down at all with this post, rather the contrary, I would love to port AGS games to the Zune :) (not an Xbox fan)


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Clarvalon

Essentially XAGE already is one big room editor, as that is how it is structured internally.  You can already do all the important things - create room objects, walkable areas, create scripts etc. 

The reason for requesting the room XML is to minimise duplication of effort.  Anything that can be automated should be automated.  The rest is down to the game's developer to work around, re-engineer or drop as they see fit.
XAGE - Cross-Platform Adventure Game Engine (alpha)

Clarvalon

I've been making some further progress on the AGS to XAGE converter.  Ben304 very generously sent me a copy of the source to his latest game, Awakener.  It has helped me iron out a lot of issues and also has proven to be a prime candidate for conversion for three reasons: 
  1)  The code is simple, clean and doesn't rely on modules.
  2)  It is light on GUIs.
  3)  It is predominately character driven, as opposed to room object-driven (as previously mentioned in the thread, XAGE is currently incapable of of accessing most room and object data due to the custom *.crm file format).

Youtube video:  Awakener running on the Xbox360.

There are various things yet to do and work on the converter is ongoing, but it is possible to recreate the above from scratch in around about thirty minutes:
  1)  Some minor pre-preparation (exporting sprites to specific folders, manually converting audio etc.) - approx 20 minutes.
  2)  Automatic AGS to XAGE conversion - approx 3 minutes.
  3)  Five manual changes to the XAGE version of the game - approx 5 minutes.

The five manual changes required to get Awakener running: (& reason why)
  1)  Change Fadi's starting room (unable to use intro screen as it uses objects - *.crm)
  2)  Add action to invoke room_Load (unable to get room events from *.crm)
  3)  Add action to invoke room_AfterFadeIn (unable to get room events from *.crm)
  4)  Add action to focus camera on cFadi (XAGE scripts not yet stacking)
  5)  Add action to play music (unable to get PlayMusicOnRoomLoad event from *.crm)

Not being able to access to room and room object data remains a major obstacle.  Hopefully the above demonstrates the potential in preparing AGS games for new audiences.  It would be incredibly useful to have either:
  • A button in AGS editor that allows for exporting room data in XML format (preferable).
  • A spec/file format/codesnippet detailing how to read *.crm files.

Massive thanks to Ben Chandler, and for putting up with my inane questions!
XAGE - Cross-Platform Adventure Game Engine (alpha)

Denzil Quixode

#17
Hi clarvalon, I've created an editor plugin that dumps room information for you. I'm afraid I have no idea how good the performance is on a large game, because I don't have the source files for one to try it out on. I made it quite quickly and wouldn't be surprised if it has problems, but I hope it is of some help to you.

Download it from:

If all goes well the plugin in that folder should add an "Export" menu to the AGS editor with a "Room Data" option. I developed this plugin against version 3.1.2SP1, I don't know whether it works on other versions.

The backgrounds are dumped as Base64-encoded PNG image data blocks in the XML.

I've included the C# project source code as well as the DLL in the zip in case you or anyone else want to take a look at it.

Ryan Timothy B

Wow, that's excellent to see Awakener on the 360.
I'm hoping this playing around works out, and we can get any AGS games to work on the 360. :P

subspark

Its a marvellous movement towards crossplatforming ags. Spectacular plugin, denzil! Youll make clarvalon really happy with that!

Cheers,
Sparky

SMF spam blocked by CleanTalk