level painter ... problems in construct

Discussion and feedback on Construct 2

Post » Wed Apr 16, 2014 9:10 pm

Hey all,

Does anyone know of a way to paint levels (non tile based level editors for non retro graphics). Think of games like braid and aquaria where you select an object and click and drag to produce a series of objects in the line you drag your mouse. Maybe I just don't understand construct but I find actually designing levels to be a bit cumbersome. Using tile maps is all well and good if you plan to stick to the rigid requirements for displaying them right.

I would be happy for a tile map that could display properly with arbitrary scales and rotations... as it is, it can't. I have invested alot of work in my game using contruct 2 (after porting from xna / C#) and i feel in order to get what I want I may have to switch to unity. it also seems that SCIRRA has no plans for improving the tile map.

Don't get me wrong, contruct2 is a great tool with great support... But unless somebody knows some hack arounds that won't take hours of tedium I may have to switch...

Any input?
Image
B
33
S
11
G
2
Posts: 563
Reputation: 5,141

Post » Wed Apr 16, 2014 9:57 pm

I'm not sure if I understand exactly what you are asking.
"Painting levels" ?

The references you give are Braid and Aquaria, which, to my knowledge, use simply sprites of "organic" shape.
So I guess, you could make instances of sprites in C2 holding down the ctrl key and drag-dropping the sprite to make a new instance and change the starting frame of an animation of speed 0.

If this doesn't help, please try to detail a bit more exactly what you are looking for.
As far as I can tell, in Braid you don't design levels as you play, so your mention of "select an object and click and drag to produce a series of objects in the line you drag your mouse" seems to refer to something I'm not aware of.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Wed Apr 16, 2014 10:42 pm

It's possible (I've got it working for my game), but you'll have to make the level editor yourself.
Moderator
B
93
S
33
G
33
Posts: 3,006
Reputation: 27,719

Post » Thu Apr 17, 2014 6:19 pm

Kyatric - To clarify. I have seen level editors (even followed a tutorial on making one with indielib and C++) that apply sprites in similar fashion to how, photshop applies a paintbrush texture. Thus, this is why I called it level painting. You select a sprite, set the desired spacing, rotation setting, whether the object should be rotated to correspond to the direction of the brush stroke, etc. It's much the same as a tile editor except that it doesn't follow a grid. Ultimately, using the an absolute spacing setting and rotation only on 90 degrees one can turn this "painter" editor into a normal tile map if one desired. Does this make sense?

Arima - Did you end up making your own level editor? I have heard of doing this ( Konjak said he made a custom editor in his blog) and was curious how involved it is. I have been hesitant thus so far because I don't know JS. I have worked with c++,C#,VB but I am trying to stay focused on spending my time in "useful" things. As it is I am prone to distraction and learning a new language wouldn't speed up the development time which has already been lengthy)

All and all, I might try taking the tile map plugin and"fixing" it to my needs... but I was really hoping to avoid that. On an entirely separate note.... If I were to replace a tile map with a bunch of sprites (I would do this via events at start up)... would that be less efficient than the tile map is?
Image
B
33
S
11
G
2
Posts: 563
Reputation: 5,141

Post » Thu Apr 17, 2014 8:12 pm

Yes, I made my own level editor. It's not something you need to learn JavaScript to do at all, my level editor is all in C2 via events. I can press a button while playing the game, edit the level, press the button again and I'm back to playing the edited level.

I really don't recommend editing the tile map plugin for a couple reasons - first, it would be far more complex and Ashley has talked about why that's not a good idea because achitectural changes might be made to C2 which could invalidate the plugin you made.

Second, while I'm almost entirely sure the tile map plugin is more efficient, that I'm also almost entirely sure that that efficiency depends on it being snapped to a grid. To get the effect you want would undo those optimizations.

A level editor isn't the easiest thing in the world to make, but it's far fom the hardest. Basically you need to recreate the ui needed for placing, moving and deleting objects as well as selecting them and editing their parameters and variables that C2's editor gives you. You also need to come up with a system for saving and loading data when editing, and a way for your game to delete a level when you leave it, and to know what data to load and create at the start of a new area.

I decided to have my editor in game, but you might consider making an external level editor, which might be easier to reuse and make work for multiple game types.

It does take some work, but man is it smooth when you've got it working.
Moderator
B
93
S
33
G
33
Posts: 3,006
Reputation: 27,719

Post » Thu Apr 17, 2014 9:30 pm

Thanks, Arima.

I will take your advice on the editing the tilemap. It seems to me that the level editor would be quite hard to make, I didn't even know such a thing was possible in construct... How does it affect the files and actually produce changes in the layout you are working on? Any tips on where to begin with something like this? I would really like to make changes in game , as the game I am making is a precision platformer and it gets difficult switching back and forth all the time between running the game and tweaking the level.

Also, I have a side question: do you know, Is it possible to create a sprite map the same as the tile map and have the tiles indexed on there so that a tilemap could be replaced quite easily with sprites in the other sprite sheet? Would I have to use frames in an animation where the frame corresponds to the tile index?
Image
B
33
S
11
G
2
Posts: 563
Reputation: 5,141

Post » Thu Apr 17, 2014 11:01 pm

I'm not sure the proper advice to give here. If you're not comfortable enough with construct yet, trying to make a level editor could prove frustrating. I'd recommend just learning how to get the components of the idea working first before making the editor itself. Some examples - here the basic game and editor code structure:

If variable 'mode' = "game"
- Game code as subevents
If variable 'mode' = "edit"
- editor code as subevents

Structuring things this way isolates the editor from the game itself.

You can store all instances in an array or dictionary named 'levelData'. Then store that array or dictionary as a json string inside a key such as "level 1" of another dictionary named 'allLevelData' and save that to disk via the node webkit plugin. Then basically do the reverse for loading, getting the type of object to create and where from the saved data.

Again, learn, read the manual, and get a good understanding of how each piece works before trying to make the whole thing.
Moderator
B
93
S
33
G
33
Posts: 3,006
Reputation: 27,719


Return to Construct 2 General

Who is online

Users browsing this forum: dwtiger, tarek2 and 1 guest