FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: About the Map Editor  (Read 4941 times)

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
About the Map Editor
« on: July 21, 2009, 06:19:03 am »

 Hello guys, its me again :P .

   I wish to know if there is any improved  Map Editor version around the community, I dont mean that the current trunk version is bad,Its cool already,but  I wish to handle more deeply (a bit more technically) and easily the object and map editing, I had a lot of objects with position offsets to correct, and I have a lot of issues while rotating objects like walls and others than need to be rotated (and also created with a specific rotation)in mass. Ive noticed that maybe there is a bug concerning the rotation editing of instances, has anyone managed to fix that ?.I thought  that maybe the guys at Zero, PARPG or Unknown Horizons had an improved map editor, or at least some other plugins or tools to handle the object editing more graphically and less "textically"  ;D .

I also want to know how is that FIFE choose default actions for an instance . Ive noticed that when working with the editor, It chooses an action without allowing to change it with a tool, and I haven't seen on the object.xml file an option to select an action as a default one.




« Last Edit: July 21, 2009, 06:54:50 am by Fallouturama »
Logged
War... war never changes... ,but  chosen ones does

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: About the Map Editor
« Reply #1 on: July 21, 2009, 09:00:21 am »

Moin Fallouturama ;-)

About the editor in general:

The current version of the editor is the result of a massive rewrite (made by CheeseSucker) - and was made to provide a basic tool to edit FIFE (xml) maps.

There is a plugin API which allows projects which are using FIFE to extend the editor without editing the editor core. So any lacking functionality can be added by writing the proper plugin.

This version of the editor is pretty young - so there are less to no plugins available. The LayerTool and the ObjectEdit Plugins are Zero plugins, ported from the old editor.

About FIFE and rotations:

I tried once to provide a plugin to allow rotation manipulation (=> ObjectEdit Plugin) but this topic is a very tricky one.

While I was able to make it work for static images, I don't understand the way animations are handled.

The whole rotation issue also is tied to the way FIFE handles geometry. So the rotation always depend on the geometry of your map. If you e.g. define a object to be available in 90° and 180° via XML file, these angles have nothing to do with the internal representation in FIFE. I'm unable to provide a solution which works for every geometry, so I only work on plugins which work for the Zero-Projekt geometry. Thus the current ability of the ObjectEdit plugin is a very basic one - and probably won't work for you or any other project.

Until there is no one who documents the way how rotation really works internally in FIFE, there will be no such plugin.

The plugin situation

As already said, the current editor version is pretty young. I don't know exactly about UH and parpg - but AFAIK UH is using the editor for creating islands only and parpg is miles away from using the editor beyond it's current functionality. So I doubt that there are custom Plugins available at all.

About default animations, have a look at this example:

Code: [Select]
<?fife type="object"?>
<object id="windmill" namespace="zp.net/buildings" blocking="1" static="0">
<image source="windmill0001.png" direction="0" x_offset="90" y_offset="-331"/>
<action id="default">
<animation source="animation.xml" direction="0" />
</action>
<action id="stop">
<animation source="animation.xml" direction="0" />
</action>
</object>

  • The image tag specifies the image which will be used by the editor to display a preview
  • The action with the id "default" will be used by the editor to display the mapobject

AFAIK the first action will be used if no default action is defined.
« Last Edit: July 21, 2009, 09:04:42 am by chewie »
Logged

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
Re: About the Map Editor
« Reply #2 on: July 21, 2009, 09:01:22 pm »

Moin Chewie  ;)

Thanks for the replay, Is always good to learn new things from you. :) :)  :) I was thinking that maybe an improvement to the editor, and the Object Selector plugin, would be the idea of treat instances or generate instances based on other instances, and no just based on objects , because If im not wrong, the rotation in the map I think that is just implemented with the xml instance rotation tag, and is not obtained in the object.xml  files.

I wish to know more about FIFE to help to improve the editor, and not just point what is not properly working on it  :-[ . But for now I  can just point my ideas and the problems I encountered while working with the editor without offering much contribution, but  remember, my intention is to also help you all :).

I had the chance to rotate the lil girl of Rio The Hola by changing the rotation tag of it instance in the map xml file, and i had her moving around the game with a constant rotation of that value i modified, added to her current rotation whatever the action her was showing . For example, if i make her walk to east, she had to point east, but with a rot = 90 she was actually pointing north, an so on... So that rotation value I guess is always added to the current rotation of the instance action being drawed.

I am very interested on this rotation setting because I want to make fully rotating capable maps, i have for example ,walls that are not a single cardinal headed image per object (i mean  not  4 objects = 1 wall), instead of that, i have a wall being an object action with 4 degrees animations (sometimes animations of just 1 frame,sometimes not). Using the map editor I currently cant create already rotated walls , and besides of that I cant even rotate a wall instance with the editor, because i actually need to rotate the default action.

I mean that It would be very useful ,for example to add a rotation combobox in the editor, to make every selected or about to be created instances to modify their rotation value automatically to the one selected in the rotation combobox. Another idea is to add to the function of the "pick the object of an instance" button (Lol I dont know the proper name  ;D ) to not just pick the object info, instead of that, to pick the instance info too, (for example the rotation of the selected instance) .

« Last Edit: July 21, 2009, 09:06:16 pm by Fallouturama »
Logged
War... war never changes... ,but  chosen ones does

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: About the Map Editor
« Reply #3 on: July 22, 2009, 07:01:41 am »

Moin :)

About rotating the map:

Once FIFE receives the call to rotate a map, it looks up all objects if they provide a rotation for the new angle of the map. Therefore the object definitions are important.

Code: [Select]
<?fife type="object"?>
<object id="barrel_metal_rusty" namespace="zero-projekt.net/environment" blocking="1" static="1">
<image source="000.png" direction="0" x_offset="3" y_offset="-21"/>
<image source="090.png" direction="90" x_offset="3" y_offset="-21"/>
<image source="180.png" direction="180" x_offset="3" y_offset="-21"/>
<image source="270.png" direction="270" x_offset="3" y_offset="-21"/>
</object>

I'm not that familiar with map rotation as Zero isn't using that feature - but FIFE should also take care about to rotate rotated instances to the next fitting angle. E.g. if an instance is placed with 90° on the map, FIFE should rotate this instance to 180° too - while an instance with 0° is rotated to 90° (covering the aspect that the map is rotated in 90° degree steps). FIFE picks the next fitting rotation (which e.g. is important for animated characters - due to their facing location, the proper animation direction is chosed and so on).

object-instance relation

Another hint about the the instance-object relation: an object defines the basic settings an derived instance has. Placing an object on the map will result in an instance - which can be edited individally. So you can set the rotation or the offsets. To work with the instances scriptwise, they also should receive an id (so that you can get them via script).

Rule of thumb - first set up your object definition, then import them to the editor and place your instances.

Contributing to the editor

Writing own plugins / editing existing ones isn't that hard. Plugins are only files in the plugin directory - which are loaded by the editor according to the settings in settings.xml. You can tell the editor on plugin start what it have to tell your plugin - e.g. if you click an instance, you can fire a callback of your plugin to update.

I suggest that you start playing around with the existing plugins - it's really not that hard. The LayerTool is an example for that - it's code is simple. but the resulting feature is really helpful.  :D

cheers,
chewie

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
Re: About the Map Editor
« Reply #4 on: July 22, 2009, 07:48:33 am »

Moin Chewie!  :)

Thanks for your help. Actually I have already made a map capable of being rotated, but my major obstacle was to correct the offsets of the frames of the animations and to create rotated instances. Ive noticed that the instance x and y  values are not offsets the way the animation-frames offsets are, It seems to be that they are like a float representation value of the instance position in the map, and the real offsets on each frame are graphical offsets.Those ones are the ones I had to set up by hand. Well, ill keep working on this, i hope to develope some kind of plugin for my needs, if its good enought, Ill share it to the comunity.

Cheers Fallouturama.
« Last Edit: July 22, 2009, 07:57:54 am by Fallouturama »
Logged
War... war never changes... ,but  chosen ones does

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: About the Map Editor
« Reply #5 on: July 22, 2009, 08:02:07 am »

Well, ill keep working on this, i hope to develope some kind of plugin for my needs, if its good enought, Ill share it to the comunity.

Good to hear that :) FIFedit needs some love from the community :)

Try this plugin as a start:

http://fife.zero-projekt.net/zero_FIFedit_plugins.zip