Welcome, Guest. Please login or register.

Pages: [1]
Print
Author Topic: Map Editor hacking  (Read 5428 times)
superfluid
Community member

Posts: 90


Just another Python Hacker


View Profile Email
« on: October 07, 2009, 08:45:38 AM »

Quick progress report on my map editor hacking. After talking to CheeseSucker and the UH guys and having a look around the UH codebase, I think I have a very rough hack of an implementation for the PARPG editor. Right it's just a wrapper script that calls the FIFE editor. It monkey-patches the FIFE editor via PYTHONPATH and gets it to use our "special" editor loaders/savers.

The custom loader does what the loader usually does, but sets up a global variable to stash instance attributes. I know a global is not the most elegant way to do it, but I wanted to get it done quickly and then correct it afterwards.

The saver does what the saver did before, but also looks up the objects via their ids and populates the attributes out of the global dict.

I also did a big refactor on the FIFE savers.py to use etree rather than crufty SAX.

Anyways, the code needs to be heavily cleaned up as it is in a sorry state from all my experimentation and quick attempts. I have a lot of hardcoded paths too.



But if anyone wants to have a look, check out my github branch: http://github.com/orlandov/parpg-game/tree/editor In particular the editor/ directory and parpg-editor.py


PS

BTW Yes that is PARPG runnings in OSX in Snow Leopard, thanks to Prock!  Cool
« Last Edit: October 07, 2009, 08:53:27 AM by superfluid » Logged

aka or1andov on IRC
mvBarracuda
Admin
Community member

Posts: 1308



View Profile Email
« Reply #1 on: October 07, 2009, 09:02:31 AM »

Sounds great to me :-) Keep up the good work or1andov, can't wait to create a nice looking map for the techdemo.
Logged
superfluid
Community member

Posts: 90


Just another Python Hacker


View Profile Email
« Reply #2 on: October 08, 2009, 06:30:52 PM »

Okay, I think i've gotten to a halfway good point with the editor work. I'd like to have the editor able to be used by the guys who are going on a plan/hackathon, but I won't be around this weekend due to a wedding I'm being subjected to.

The patch is here http://2wycked.net/parpg-patches/fix-map-editor.patch have a look over it if you're interested, and let me know if anything can be improved. I'm aware that it's missing some docstrings, but hopefully it should be obvious what does what (if in doubt, look at the corresponding FIFE files, loaders.py and savers.py). If it looks good to everyone I'll probably check it into trunk tomorrow (Friday, Oct 11).

Some possible improments at this time:
- unit tests
- docstrings
Logged

aka or1andov on IRC
mvBarracuda
Admin
Community member

Posts: 1308



View Profile Email
« Reply #3 on: October 09, 2009, 11:35:51 AM »

Nice work superfluid :-)

Unfortunately TortoiseSVN doesn't like git patches indeed :-/ Could some linux-based developer please apply the patch for testing purposes on his system and post a (Tortoise)SVN-compatible patch of it here? Thanks in advance :-)
Logged
saritor
Guest
« Reply #4 on: October 09, 2009, 02:27:28 PM »

Nice work superfluid :-)

Unfortunately TortoiseSVN doesn't like git patches indeed :-/ Could some linux-based developer please apply the patch for testing purposes on his system and post a (Tortoise)SVN-compatible patch of it here? Thanks in advance :-)

If no one beats me to it, I will  by the end of the day so we can have one for this weekend.

Superfluid patched it in for us.
« Last Edit: October 09, 2009, 06:24:31 PM by Saritor » Logged
superfluid
Community member

Posts: 90


Just another Python Hacker


View Profile Email
« Reply #5 on: October 09, 2009, 07:02:18 PM »

Woo, the editor is now in!

Run it like so from the parpg directory: ./parpg-editor.py maps/map.xml or ./parpg-editor.py

Here are a few known issues:
- the parpg directory has to be next to the fife editor directory in the clients directory
- FIFE apparently has issues with an UPPERCASE parpg directory name (fife/clients/PARPG) - lowercase it and it should work

Please post in this thread or in trac with errors or nopaste links if something goes b0rk

Thanks guys!
Logged

aka or1andov on IRC
superfluid
Community member

Posts: 90


Just another Python Hacker


View Profile Email
« Reply #6 on: October 09, 2009, 08:16:42 PM »

I should also mention that if you want to add an NPC you will have to edit the xml file once manually to set the id="the_objects_id"  and object_type="NonPlayerCharacter" attributes on the character. Once this has been set, you should be able to edit and run the map as usual.

Eventually we'll probably want to build a plugin for the editor to configure PARPG-specific NPC/instance attributes.
Logged

aka or1andov on IRC
mvBarracuda
Admin
Community member

Posts: 1308



View Profile Email
« Reply #7 on: October 18, 2009, 04:26:55 PM »

For the ones who don't get commit emails: the map editor is finally fixed on win32, thanks to kaydeth for working out the path seperation issue. I'll look into fleshing out the map editor tutorial at Monday.
Logged
Pages: [1]
Print
Jump to: