Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2018-05-20 07:03:18

Race the Hedgehog
Member
From: Sao Bernardo do Campo, Brazil
Registered: 2010-12-16
Posts: 163
Website

Sonic Studio Fan Project

xclSdl4.png
Sonic Studio is a project with ambition to create an accessible slope-based level editor, being developed by Lapper.
Below includes a tech example and the latest video of his channel.

https://www.youtube.com/watch?v=R4-DrpkSGig
https://www.youtube.com/watch?v=rVpr1MijdtE

Copying directly from Sonic Retro, with some parts in bold that I think is important to highlight for the development of Open Surge Engine.

The challenge of making a 'slopeable' Sonic level editor (which is primarily fun!) has been on my mind since then. I definitely knew the answer was not tiles. Tiles are fast and simple but lack ease of creation and limits customisability, something the average user will want. Polygons were the obvious choice.
However the only reason I even began making a new version of this idea is because a 'Sonic Maker' in the same vein as Mario Maker is an extremely flawed idea. Because slopes. It's either to rigid and limited, or too customisable and unlimited. I wanted a challenge, and finish what I started nearly 10 years ago. That and... I had just made a nice Sonic engine and wanted to use it.

Insider info:
*Sonic Studio is made in GMS 2, and is fully developed by me (although there may be other credits for other parts when released)
*It's built to be as accurate as needed for an enjoyable experience. So, pretty darn accurate.
*The engine uses vectors and line intersections to perform its collision checks, and a Spatial Hash will load these near the player while playing. Any shape is possible. This essentially makes every level 100% customisable. Nothing to stop the player constructing a level that will break the engine - but I don't care. Go nuts I suppose.
*The art is all by me, going for a Mania/Tyson style. Though there's some place holder stuff you'll see, everything is subject to change.
*I'm currently just adding features and art. Lots of features and art.

I fully agree with the quote, because at least for me, the least user-friendly part of Open Surge is in creating the bricksets. Even a simple task like recreating Green Hill Zone from the first game (which also uses bricks as a method by the way) becomes highly complicated because the lack of collision masks that the engine does not support at the moment.
I don't know much about programming in general to suggest using polygons, but I thought it was a good idea to highlight his design ideas.

Last edited by Race the Hedgehog (2018-05-20 07:07:25)


PunBB bbcode test
Creating and Editing Sprites.

Offline

#2 2018-05-20 14:38:17

CharlyTx
Member
From: Wesnoth
Registered: 2011-01-15
Posts: 144
Website

Re: Sonic Studio Fan Project

That looks like very easy to design levels.

Offline

#3 2018-05-20 21:36:13

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,274
Website

Re: Sonic Studio Fan Project

Hey Race, thanks for showing up. smile

Indeed, creating bricksets for Open Surge in the present date is not as user-friendly as it could be. Even with the tools we currently have, it takes work. The current result is not optimal either, as in user-made levels you consistently see visual gaps in the bricks. This is a problem I've thinking about just the other day (and I thought about it before), and it has to be addressed.

One idea I had thought about before is to create a standard brickset as a template, and let everyone skin it. This could work, but has limitations. Another idea I thought about a few days ago was to create a new brickset tool, but I didn't know what that could be.

The idea you bring is very interesting. Let me emphasize, however, that Open Surge is not tile-based. It's brickset-based, and bricks can be of any size or shape. The idea of letting the user design levels via polygons is rather interesting. In Open Surge, bricks can be thought of as independent entities - and, in the first version of this engine, they were exactly that - polygons. Nowadays we have a more sophisticated system. When you're creating your brickset, what you're doing is specifying a set of polygons that cover the image. This has been the case since I started this project in 2008, but you write the specification in a script rather than visually, so it's not that obvious.

Bringing the polygons to the level designer makes things really easy it seems. Why don't we adopt a similar approach here? The good news is that we already have a system that is fully compatible with it - bricksets! A new tool for designing bricksets could do that. The starting point would not be the bricks, but rather the image you want to apply in your level. Then you could design your polygons in front of the image, and the tool generates the brickset for you.

What do you think?

Race the Hedgehog wrote:

because the lack of collision masks that the engine does not support at the moment.

Our engine does support collision masks. It has been a underground feature, I guess? tongue

Offline

#4 2018-05-20 23:14:47

Race the Hedgehog
Member
From: Sao Bernardo do Campo, Brazil
Registered: 2010-12-16
Posts: 163
Website

Re: Sonic Studio Fan Project

Thanks for clarifying this technical part about the idea, the suggestion I gave was given more like a user/player than someone who is part of the programming team.

Alexandre wrote:

Bringing the polygons to the level designer makes things really easy it seems. Why don't we adopt a similar approach here? The good news is that we already have a system that is fully compatible with it - bricksets! A new tool for designing bricksets could do that. The starting point would not be the bricks, but rather the image you want to apply in your level. Then you could design your polygons in front of the image, and the tool generates the brickset for you.

What do you think?

Wow, that would be perfect! big_smile
That's because, my creative process to make a level starts with building it the layout through an image, and the frustration that comes with it is in how to transform thousands of different shapes into bricks and having to calculate the angle of each one totally by hand.
I believe an engine called "Sonic World" does the same method you described.

Alexandre wrote:

Our engine does support collision masks. It has been a underground feature, I guess?

Wait, it does? I had no idea! I read KZR mention it on the forum once, but I've never seen a stage make functionality of it, I can't find anything about it on the wiki either.
I would be more than grateful to know how to make use of this! It's the key I need to make progress on a MOD I'm working to bring attention to the engine! smile


PunBB bbcode test
Creating and Editing Sprites.

Offline

#5 2018-05-21 01:23:33

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,274
Website

Re: Sonic Studio Fan Project

Race the Hedgehog wrote:

Wow, that would be perfect! big_smile

Cool! smile What do you think such a tool looks like? What does it look like and how would you use it?

Race the Hedgehog wrote:

the frustration that comes with it is in how to transform thousands of different shapes into bricks and having to calculate the angle of each one totally by hand.

Hey man, at least you learn some trigonometry roll hahaha (just kidding)

Race the Hedgehog wrote:

Wait, it does? I had no idea! I read KZR mention it on the forum once, but I've never seen a stage make functionality of it, I can't find anything about it on the wiki either.

Maybe it has gone into the Deep Web, who knows? lol

Anyway, here's how it works: you have an image for your brickset and another image for your collision mask. The collision mask can be an image (.png) of two colors only: black and magenta, representing solid and non-solid, respectively. Imagine that in your brickset file, you have an entry like this:

brick 51
{
    type                OBSTACLE
    behavior            DEFAULT
    angle               45
    
    sprite
    {
        source_file     images/desert1.png
        source_rect     555 60 24 24
        frame_size      24 24
        
        animation
        {
            repeat      TRUE
            fps         8
            data        0
        }
    }
}

You're gonna add a collision_mask block specifying two parameters: source_file and source_rect.

brick 51
{
    type                OBSTACLE
    behavior            DEFAULT
    angle               45
    
    sprite
    {
        source_file     "images/desert1.png"
        source_rect     555 60 24 24
        frame_size      24 24
        
        animation
        {
            repeat      TRUE
            fps         8
            data        0
        }
    }

    collision_mask
    {
        source_file     "images/desert1_mask.png"
        source_rect     555 60 24 24
    }
}

Please let me know if you're successful using this. Do you have any questions?

Race the Hedgehog wrote:

It's the key I need to make progress on a MOD I'm working to bring attention to the engine! smile

Yes. I remember you once wrote a MOD about chemistry. It was awesome, and so different smile

Offline

#6 2018-05-21 09:32:57

G.E.R.
Member
From: Russia, Krasnodar
Registered: 2017-12-26
Posts: 177

Re: Sonic Studio Fan Project

Here the illustration of "brick + collision" complex from Sonic Mania engine:
illust_1_210518.jpg

White is obstacle floor zone, red is wall (for Knuckles), white rectangle is breakable.

Offline

#7 2018-05-22 08:03:52

Race the Hedgehog
Member
From: Sao Bernardo do Campo, Brazil
Registered: 2010-12-16
Posts: 163
Website

Re: Sonic Studio Fan Project

Thank you so much for explaining! I just need to get some extra things done first, then I can test it. I'll explain more about the idea that I'm trying to achieve later on this post too.

Alexandre wrote:

Cool!  What do you think such a tool looks like? What does it look like and how would you use it?

I think the ideal method would look similiar like the tech example shown above: start by importing a image into the tool, followed by drawing the lines and slopes, and finishing with the program converting the lines into a collision brickset, being possible to edit the conditions (passable, cloud, etc.) of the bricks too, while the angles would be calculated automatically. I don't know how possible a tool like this would be, but I believe it would make level creation much more versatile and fun.

G.E.R. wrote:

Here the illustration of "brick + collision" complex from Sonic Mania engine
White is obstacle floor zone, red is wall (for Knuckles), white rectangle is breakable.

unknown.png
The Retro engine also uses yellow to indicate platforms with the "cloud" behavior. This same method was used in the original trilogy.


I'm trying to achieve a perfect Green Hill Zone recreation from the first game, complete with each brick with its respective angle.I've already been able to export each individual brick (those with low opacity are the new ones from Sonic Mania). I am currently exporting the collision.

One obstacle I found is, in Sonic's original engine, it was possible to horizontally flip the bricks without having to create a new one. I believe the same is not possible in Open Surge, so I will have to reverse them manually.

Sadly enough, I had managed to achieve this all before with another method, but a glitch on my computer made me lose a few files, leaving some screenshots back:

unknown.png
unknown.png
unknown.png

In the pictures above, I converted every possible 16x16 collision into a brick, and threw an image object above the entire level. Which was not very smart, since certain bricks still appeared behind the layout sometimes.


PunBB bbcode test
Creating and Editing Sprites.

Offline

#8 2018-05-22 15:02:50

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,274
Website

Re: Sonic Studio Fan Project

Race the Hedgehog wrote:

In the pictures above, I converted every possible 16x16 collision into a brick, and threw an image object above the entire level. Which was not very smart, since certain bricks still appeared behind the layout sometimes.

Cool. cool You can simulate a collision mask using a combination of solid and passable bricks. However, the native feature makes things a lot easier.

--

This is a question for G.E.R, Race and anyone who might be interested: what is the best way to design levels?

Is it best to use an image editor to build the entire level and then import it into the engine? Or is it best to design clusters of reusable bricks and put them together in the level editor?

Offline

#9 2018-05-22 21:36:08

Race the Hedgehog
Member
From: Sao Bernardo do Campo, Brazil
Registered: 2010-12-16
Posts: 163
Website

Re: Sonic Studio Fan Project

Alexandre wrote:

This is a question for G.E.R, Race and anyone who might be interested: what is the best way to design levels?
Is it best to use an image editor to build the entire level and then import it into the engine? Or is it best to design clusters of reusable bricks and put them together in the level editor?

I personally prefer the image editor idea, precisely because it can bring more creativity freedom when designing a stage. The only problem I see with this method is to visualize a level and not conceive well with the game physics when testing it, but nothing that trial and error doesnt fix.


PunBB bbcode test
Creating and Editing Sprites.

Offline

#10 2018-05-24 08:38:03

G.E.R.
Member
From: Russia, Krasnodar
Registered: 2017-12-26
Posts: 177

Re: Sonic Studio Fan Project

what is the best way to design levels?

The our system of levels creating is quite good, but one drawback, with which I come across, it is a straight roads and walls. I should to draw every slopes, arcs and ramps with each angle separately and set it in brickset as separates blocks. It cause difficulties when I want create undulating roads. I think that this opportunity (demonstrated here in the first post) would be very useful for developing levels. We point out one big block with pattern, ground, walls, ceiling, and set the regoi, there this block should be placed. And next, engine set above the ground, the side of the wall, ect.
We point out one big block with pattern, ground, walls, ceiling, and set the regoi, there this block should be placed. And next, engine setting automattic: where is the ground, the side of the wall, ect.

I drew bricksets in Photoshop by simillary method:
https://www.youtube.com/watch?v=tS5-wZo3nfg

Last edited by G.E.R. (2018-05-24 10:20:32)

Offline

#11 2018-06-22 17:40:12

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Sonic Studio Fan Project

I suggest that we add a feature to the editor. drawing tools. brush, line, and fill.
which as you have probably guessed work like in an image editor, using the selected brick to paint along the mouse's position, snapping bricks to the grid and to each other. This would spare us some clicks and allow one to lay out the level's structure pretty fast.


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#12 2018-06-22 18:44:03

TheSeventhEmerald
Member
From: Spain
Registered: 2010-04-19
Posts: 302

Re: Sonic Studio Fan Project

Nice discussion you have here.

When I saw Sonic Studio I thought that it could be more attractive than OpenSurge in the very beginning in the level editor aspect. It looks really easy to create a level, using simply lines and slopes, and filling the polygons with the images after.

The problem it has, of course, it is lack of flexibility right now. Not *every* brickset is possible, only the few ones hardcoded by the programmer. And, in addition, items are not scriptable as they are in Open Surge.

However, I do agree that the weak point of OpenSurge is the creation of bricksets + creation of levels. Bricksets are difficult to make. And even when you have a perfect brickset, it is VERY slow to consctruct an entire level, since you have to go brick by brick, and you can have literally hundreds of them.

As I see, the new paradigm that is being discussed here is to detach collision from bricks. In my mind, that would be simply putting the bricks as simple sprites and letting the user to draw the collision polygons after. Some thoughts on this:

(1) This system will make easier to use complicated bricks such as slopes and loops (that before needed to be carefully split, setting all the angles... sad ), since with the new system we would be able to put a slope and draw a polygon over it.
(2) Still, I have to put A LOT of bricks, and this is still slow.

This can be even improved in my opinion. Some ideas I suggest to improve the level creation:

1. Allow copy-paste, including collision polygons. Static groups are nice, but still they may be complicated to use.
2. Tiling brush: we could have a sprite configured to fill a region, so the region may be selected and then filled with this brick. One of the things I hate of the current editor is that I put a floor and then I have to write a loooot of bricks below to make it aesthetically pleasant. If I simply could put a rectangle and fill all that space with the texture, would save a lot of time. The same for making walls. And it can simply has its collision layer if it needs to collide.
3. Line tool: select a line and auto-place bricks (or entire groups!) along the line as suggested by KZR.

This three tools may speed up the level creation in an impressive way.

I hope I will be able to compile OpenSurge in my own when 0.5.0 is ready. Once I do that, I think I will try to help in some aspect in the programming... I would like to.

Last edited by TheSeventhEmerald (2018-06-22 18:54:48)


Piece of cake...!

Offline

#13 2018-06-23 11:48:17

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Sonic Studio Fan Project

for me the biggest problem with the current level creation system starts with the brickset, and its image.

there is no standard for brick sizes, and while that allows a lot of flexibility, it is also a problem when defining bricksets and laying out levels.

I've been working a lot with Tiled in the last times, and that is an amazing piece of software.

This is a test level I built with Tiled for OpenBOR . Click image for video

Image2.png

Major advantages:

*Each tile has a predefined size, which is the same for all tiles, meaning bigger things are actually many tiles together. This allows for small variations on background textures, breaking the monotony. It allows precise placement of platforms without the need for brick/group variations. They will always fit together, unless the graphics don't (for example one piece of floor being a pixel too big or too small is not the grid's fault)

*supposing we have a reliable tool to create and export bricksets, which one is easier? manually defining the size of each brick, then adding its properties, or having all tiles/bricks laid out in an orderly grid, only needing you to define the properties for each grid space, defaulting to 0 degree passable if undefined?

*using this image division method, combined with the flexibility of bricks, allows you to lay stuff on top of more stuff (or behind) without the need to reserve one editor grid space for each tile/brick or using layers to effectively overlap tiles/bricks. In Tiled I had to use 4 or 5 layers to achieve all the detail, plus using sprites for any animated bits. something where Open Surge clearly wins.

*Open Surge has a grid, but optional. While it is a good Idea to use it in order to keep platforms laid out consistently, you don't have to. meaning you could still use these tiles anywhere you want.

Downsides:

*Using this approach without a palette is tedious and very time consuming. Using the mouse wheel to scroll through tens, hundreds, thousands of bricks is impractical, that's why large bricks and brick groups have been so emphasized through the last decade. Unless there is a brick palette, building levels with lots of fine details is a chore more than a pleasure.


to sum it up, let's say you can tell a brk file to do this

tile_size = 32

then a brickset editor would read the image, read this info and automatically generate bricks for each grid. A second tab of the editor would let you design groups.

another pitfall I found when using many bricks, is that you CAN load multiple bricksets, but their bricks will conflict if a number is taken. sure, you can make bricket A go 0-100, brickset B 101-200 and so on, but again, very time and patience consuming manual labor.

automatic re-referencing of loaded bricks should be a feature too. that way you could have brickset A operate with 32x32 tiles, brickset B with 64x64 and so on, saving you time when laying out either big and coarse structures, or when fine tuning your floors or backgrounds.  Each brickset containing its own groupings, and being selectable on a tab of the palette.


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org