Hey, we have forums!

Author Topic: Aquaria Editor Changes  (Read 18067 times)

0 Members and 3 Guests are viewing this topic.

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Aquaria Editor Changes
« on: May 22, 2010, 11:00:21 pm »
When Aquaria goes open source, I would like to add some features to the editor so it is easier to use.

I think the most needed features would be :

- Being able to create a new map from the editor menu (specify map name)
- Being able to resize the map (specify new height/width)
- Being able to modify the terrain directly in the editor. For example press F8 to go in map edit mod, left clic to paint terrain, right clic to erase.

The following features would also be very cool to implement :

From the menu :
- Change the back color (top and bottom colors)
- Set the music
- Set the waterlevel

Something maybe a bit more difficult to do would be able to modify the tileset.

Any other ideas of cool modifications we could do ?

Offline Lady-Succubus

  • Hero Bit
  • *********
  • Posts: 538
  • Aren't I cuuuutee? =^.^=
    • View Profile
    • Woefully Outdated Blog
Re: Aquaria Editor Changes
« Reply #1 on: May 22, 2010, 11:04:14 pm »
Wouldn't the latter three be easier to do than the former? xD
Bored little neko, pouncing along, scattering posts everywhere. =^.^=

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: Aquaria Editor Changes
« Reply #2 on: May 22, 2010, 11:20:09 pm »
I'm not sure, because we need to create a color picker for the color. But I did put them in the bottom because the 3 first seem more important ;)

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: Aquaria Editor Changes
« Reply #3 on: May 22, 2010, 11:24:24 pm »
And of course I would like to enable the debugger ! :)

Offline Gobbo

  • Bit
  • ***
  • Posts: 15
    • View Profile
Re: Aquaria Editor Changes
« Reply #4 on: May 22, 2010, 11:34:46 pm »
I'd make it an out-game editor, like doombuilder is, and change the shortcuts to the more common ones, like Ctrl-c and Ctrl-v for copying stuff rather than shift-click or something. The layers could be easy tabs on the top of the screen. Alas, even simple stuff as lua is like portugese to me right now.

Offline Lady-Succubus

  • Hero Bit
  • *********
  • Posts: 538
  • Aren't I cuuuutee? =^.^=
    • View Profile
    • Woefully Outdated Blog
Re: Aquaria Editor Changes
« Reply #5 on: May 22, 2010, 11:44:41 pm »
I think leaving the editor in game is better. :3

What's the debugger? :3
Bored little neko, pouncing along, scattering posts everywhere. =^.^=

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: Aquaria Editor Changes
« Reply #6 on: May 23, 2010, 02:22:17 am »
I'd make it an out-game editor, like doombuilder is, and change the shortcuts to the more common ones, like Ctrl-c and Ctrl-v for copying stuff rather than shift-click or something. The layers could be easy tabs on the top of the screen. Alas, even simple stuff as lua is like portugese to me right now.

Yeah, I thought about creating an external editor in C# for example, but that would definitely take me too much time ^^. Now that we are able to change the editor code, that's perfect.

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: Aquaria Editor Changes
« Reply #7 on: May 23, 2010, 02:26:02 am »
What's the debugger? :3

There is a debug.txt file in the Aquaria directory where you have all the things the engine does and the errors. It is possible to have those information displayed directly in the game in real time but this feature is disabled in Aquaria for now.
« Last Edit: May 23, 2010, 02:30:49 am by Yogoda »

RoadCrewWorker

  • Guest
Re: Aquaria Editor Changes
« Reply #8 on: May 23, 2010, 03:09:45 am »
Enabling the onscreen debug would be easy if you could inject the code of setControlHint in the debugLog function. I'd be more interested in enabling the Editor Gui in the main game (instead of working on the native mod and manually copying altered files back to the main game), but i fear the frameworks vary too much to easily be conjoined.
- Being able to create a new map from the editor menu (specify map name)
This is just a trivial file create, since an empty level contains nothing but the <level/> element.
Quote
- Being able to resize the map (specify new height/width)
Nothing in the map files contains specific maxwidth or maxheight. There is an obstruction layer containing all black unpassable areas of the map as "Row Line Length" segments which are generated from the maptemplate png using a simple loop over lines/rows of the image (using SDL hence requiring powers-of-two images im assuming). Ingame coordinates seem to be roughly 10*10 units per 1 template pixel (a 2048x2048 image results in a map from 0,0 top left to ~20000,20000 as the bottom right corner) so the mapsize is technically limited by the coordinate datatype (probably 32bit signed int). I'm not perfectly certain how well the game culls rendering/processing offscreen tiles,entities and nodes, so performance may take a huge dive.
Quote
- Being able to modify the terrain directly in the editor. For example press F8 to go in map edit mod, left clic to paint terrain, right clic to erase.
Considering the features of image editing software and the map storage format ("Terrain" itself is actually stored on two layers)  it's honestly easier to just alter the template file and regenerate the obstructions and attached border tiles (on layer 4) than build a brush based editor into the game.
Quote
- Change the back color (top and bottom colors)
- Set the music
- Set the waterlevel
These are all trivial plaintext values in the header section. A full blown HSV colorpicker would be considerably more effort than a simple "R G B" float string.
Quote
Something maybe a bit more difficult to do would be able to modify the tileset.
Well, you can easily switch out the tileset in the header of the level since its just a plaintext name of the referenced .txt file. Reading both old and new tileset lists and matching strings to identify the new IDs would be more difficult though. For most of my testing im using a complete tileset containing every png in the gfx folder and as far as i can tell the performance hasn't suffered too much. So you could theoretically allow the complete tileset in the editor and cull unused tileids while saving.
« Last Edit: May 23, 2010, 03:12:31 am by RoadCrewWorker »

Offline Lady-Succubus

  • Hero Bit
  • *********
  • Posts: 538
  • Aren't I cuuuutee? =^.^=
    • View Profile
    • Woefully Outdated Blog
Re: Aquaria Editor Changes
« Reply #9 on: May 23, 2010, 06:11:00 am »
Showoff. :3

but it's nice to see how im/possible everything on the list is. Well done! ^.^
Bored little neko, pouncing along, scattering posts everywhere. =^.^=

Offline Dolphin's Cry

  • Bit Bit
  • ****
  • Posts: 61
    • View Profile
Re: Aquaria Editor Changes
« Reply #10 on: May 23, 2010, 06:39:01 pm »
Ingame coordinates seem to be roughly 10*10 units per 1 template pixel (a 2048x2048 image results in a map from 0,0 top left to ~20000,20000 as the bottom right corner) so the mapsize is technically limited by the coordinate datatype (probably 32bit signed int).
I've researched the map file format for a private project, and I determined the scaling factor for the obstruction layer to be 20. Basically, I extracted the obstruction mask from the map file and plotted it against the node coordinates. Factor 20 makes everything line up nicely. ;)

By the way, the code that generates the obstruction mask seems to ignore the rightmost column of the source images. So if you use an image with 256 by 256 pixels, the obstruction mask only covers 255 by 256 units...

Can you hear the dolphin's cry?

Offline Guy

  • Bit Bit
  • ****
  • Posts: 62
    • View Profile
Re: Aquaria Editor Changes
« Reply #11 on: May 23, 2010, 11:47:01 pm »
That looks like a sweet program. Please tell me it's cross-platform :)

Offline Dolphin's Cry

  • Bit Bit
  • ****
  • Posts: 61
    • View Profile
Re: Aquaria Editor Changes
« Reply #12 on: May 24, 2010, 12:21:31 am »
It's written in Java, so it should run on Windows, Mac and Linux. Also the user must configure the path to the Aquaria installation and mod folder. ;)

As far as code quality goes it's not up to par with my usual code. I wrote it to learn SWT while exploring the Aquaria file formats. Right now it can display the contents of tile sets and (partially) of maps.
Can you hear the dolphin's cry?

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: Aquaria Editor Changes
« Reply #13 on: May 24, 2010, 12:59:43 am »
Looks great :) Will you share it with us when it is ready ?

RoadCrewWorker

  • Guest
Re: Aquaria Editor Changes
« Reply #14 on: May 24, 2010, 03:45:40 am »
Yeah you're correct, i think i mixed my testfiles 1024 and 2048 up.

Thats really damn cool.

As an aside, Entities are stored as [ent_id+" "+x+" "+y+" "+r+" "+groupid+" "+scene_id+" "]* in the mapfile.
ent_id is a reference to the scripts/entities/entities.txt list,
x y r are coordinates and rotation (0-360 degrees = 0 to 12 o'clock) as used in tiles or nodes,
scene_id seems to be a unique id in the map.
Not sure what the groupid is used for ingame, or where the flags are stored.

For benchmarking reasons i've been able to populate maps with roughly 500 entities, although that predictably brought the game to it's knees. (Here's a hint: Generating a map that contains every boss entity in the game 25 times is a bad idea.)
Runs fine for me with up to ~300 though.

« Last Edit: May 24, 2010, 04:16:51 am by RoadCrewWorker »