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-07-16 15:58:02

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

Physics update: automatic angles

Physics update

I'm very excited to share this update with you cool

  • Automatic angle detection

  • Improved brick system

This update changes everything!

surge-demo.gif

How to test: get the development version, go to the stage select, open the new template level and press F12 to open the editor. Enjoy!

Creating new bricksets has become easier than ever before! An update of the physics engine has just made Open Surge much more flexible in terms of level design. It's really exciting and the possibilities are endless!

Take a look at the new template brickset that I made:

brickset.png
https://github.com/alemart/opensurge/ra … ickset.png

It took me only a few minutes to write the brickset .brk script for this image! I did not need any tools smile

The physics engine can now handle more complex brick shapes. You don't need to calculate any angles. You don't need to specify any polygons for collisions. You just place your bricks on the level. It's so simple! A curvy road can be implemented with a single brick. The loop that you see in the video is made with only 3 bricks. One could say that the brick system is now becoming what it was always capable of being. cool

// This is a slope
brick 16
{
    type                OBSTACLE
    behavior            DEFAULT
    mask                "images/brickset_mask.png"

    sprite
    {
        source_file     "images/brickset.png"
        source_rect     16 224 128 64
        frame_size      128 64

        animation
        {
            repeat      TRUE
            fps         8
            data        0
        }
    }
}

Notice that there are no angles in this definition. Of particular interest is the new "mask" attribute, that associates a collision mask to the brick. A collision mask is an image that says which parts of the bricks are solid (recommended to have): https://github.com/alemart/opensurge/ra … t_mask.png

With this new update, the surface normals are calculated automatically, based on discussions we had before and on some additional insights. Also, there is a more sophisticated data structure working behind the scenes, so bricks can now take more complex shapes. And finally, I'm ditching the older levels. To access them for now, highlight "stage select" in the options screen, press right 3x and open.

With this update and with SurgeScript, I feel that we are taking a giant leap forward! big_smile

I'm really excited to see what kind of new bricksets you are going to create. It's so simple now! cool

Offline

#2 2018-07-17 01:18:34

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

Re: Physics update: automatic angles

This looks fantastic! This looks a lot like how the classic Sonic games did it and one of the most interesting updates to Open Surge in years.

Here's my two cents on things that can make this even better:

- My biggest criticism is that there's still a lot of sliding around on super shallow slopes, like in previous versions. You can't stand still on anything but a completely flat surface. Maybe there can be a threshold set so the character doesn't slip down small hills as a statistic in .chr files? While rolling, this behavior is fine because you sacrifice control for speed, but when the character is out of ball form, they need to be capable of coming to a standing stop on angles that between 0 to ~35 degrees (just as an estimation). This is probably the only critical thing that needs to be adjusted, but it's extremely important.

- Surge and friends feel just a bit heavy in a clunky way, I think amping up the acceleration and deceleration will help things feel a bit better. I know that can be done with the .chr files, but I think that the defaults could use some small tweaks.

- I know this may be a bit difficult, but having the characters' sprites not rotate angles while rolling around loops and slopes would also look a bit better.

This approach is actually much more tile-based from what I can tell, so perhaps bricks isn't the appropriate word anymore... at least, unless you make super small parts and combine them together. tongue

Really looking forward to seeing what comes out of this! Designing bricksets and levels never looked easier. smile

Offline

#3 2018-07-17 13:36:25

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

Re: Physics update: automatic angles

Aha, so this is what has been cooking big_smile

Silver, I remember trying to work around the slope slipping issue, which required a couple changes to the source code, and a script to fine-tune and effectively changing the parameters to that without needing to rebuild the sources every time. It's a sub-optimal way to do it, but it worked. So it is possible.

on a technical note, it is important that characters have 2 thresholds for stopping - one is the minimum speed (anywhere under 32 worked best in my experience) and one for the minimum angle to slide even when stopped (I'd say anything over 45º)

another thing I noticed, both acceleration and deceleration are linear, they always increase or decrease by the same amounts, except when terrain or items have influence on that. It helps to set 3 speed levels and give them different values for acc/dec, being that deceleration is visibly faster at lower speeds, for example.

All this exists as proof of concept in one of the last releases of Shinobi Densetsu here in the forums.

Even if ported to SurgeScript, I don't believe it would work as well without the modified code, since this sliding, if I remember correctly, is hard-coded.


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

Offline

#4 2018-07-17 15:05:14

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

Re: Physics update: automatic angles

Only one comment: you are amazing big_smile

With this, and any simple tool to do alpha-cut in rectangles and export to bricksets, you can do the BRK file automatically. It is absolutely awesome, I love it!


Piece of cake...!

Offline

#5 2018-07-17 15:47:24

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Physics update: automatic angles

Hey, Alex!

I tested both your new version of Open Surge and SurgeScript and I admit it...

They are awesome!

I had no idea it was TOO easy learning to program with SurgeScript! And the Open Surge engine looks more smooth and better!

Offline

#6 2018-07-18 14:30:11

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

Re: Physics update: automatic angles

Hey guys, thank you for your comments. big_smile

SilverstepP wrote:

there's still a lot of sliding around on super shallow slopes, like in previous versions.

It's already fixed on the code and will be available on the next build. smile

SilverstepP wrote:

This approach is actually much more tile-based from what I can tell, so perhaps bricks isn't the appropriate word anymore... at least, unless you make super small parts and combine them together. tongue

Think of it this way: a tile is a block of fixed size, like 16x16, that is placed within a matrix. A brick, on the other hand, is a free-form entity that you place anywhere in 2D space (which happens to be our case). Compared to tiles, programming bricks is more difficult. However, it leads to better user experience (it's easier to deal with) and more flexibility (like the ability of having overlapping bricks, for example). I designed the Template brickset within a grid for convenience, but the system makes no such restriction. In my brickset, it's like each brick is a set of tiles with added flexibility.

Offline

#7 2018-07-21 05:44:12

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

Re: Physics update: automatic angles

This is amazing! I've been waiting for this!
I did a very quick test with it, I imported the Green Hill Zone collision from Sonic Mania, with two bricks, one with the solid parts (white tiles), and other one with the cloud parameter (yellow), without much manual repair.
You can download it here. It's super useful for testing and finding bugs.

Right off the bat, it's easy to see that:

  • As SilverstepP said, the way characters can't stand at smaller angles is a problem.

  • If the player hits a cloud brick in a certain way, he is transported down immediately and dies. This is a major glitch.

  • The giant tile makes the loading bigger, this isn't a bug, it's just something to notice.

Included in the files are the Green Hill Zone tiles, but I decided to make the collision more apparent so we could see where the errors are coming from.

Last edited by Race the Hedgehog (2018-07-21 05:45:08)


PunBB bbcode test
Creating and Editing Sprites.

Offline

#8 2018-07-21 12:04:07

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

Re: Physics update: automatic angles

Hey Race, thank you for trying it out smile

Race the Hedgehog wrote:

If the player hits a cloud brick in a certain way, he is transported down immediately and dies. This is a major glitch.

It seems that you imported the whole level as a single cloud. I do not expect this to work.

Race wrote:

The giant tile makes the loading bigger, this isn't a bug, it's just something to notice.

Yes, it's not designed for the use case of importing one giant brick as a whole level. Please split the image into usable parts and place them together in the level editor smile

If you don't mind, I would ask you to actually create a brickset (with many bricks) and test it out. A brick is an individual piece that you put in your level; not an entire level, nor a single 16x16 tile. This would help us greatly with the testing and I believe this would help you on your mod as well. smile

Race wrote:

This is amazing!

It is amazing indeed! big_smile

Offline

#9 2018-07-21 17:25:27

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

Re: Physics update: automatic angles

Let me add that the bricksets page on the wiki has just been updated:

http://opensnc.sourceforge.net/wiki/index.php/Bricksets

If you guys find any errors or any information that could be improved, please improve it smile

Offline

#10 2018-07-21 18:47:55

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Physics update: automatic angles

Alexandre wrote:

Let me add that the bricksets page on the wiki has just been updated:

http://opensnc.sourceforge.net/wiki/index.php/Bricksets

If you guys find any errors or any information that could be improved, please improve it smile

I try to go to the link using my mobile but it says: "LocalSettings.php not readable.

Please correct file permissions and try again."

Offline

#11 2018-07-21 21:01:09

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

Re: Physics update: automatic angles

Never mind, it's just sourceforge being unstable at the moment.

I want to move to servers of our own, but we need funding.

Offline

#12 2018-07-21 23:24:07

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

Re: Physics update: automatic angles

Alexandre wrote:

Yes, it's not designed for the use case of importing one giant brick as a whole level. Please split the image into usable parts and place them together in the level editor

If you don't mind, I would ask you to actually create a brickset (with many bricks) and test it out. A brick is an individual piece that you put in your level; not an entire level, nor a single 16x16 tile. This would help us greatly with the testing and I believe this would help you on your mod as well.

The purpose of this was to test how far we can push the engine limits with a gigantic brick alone. And I was very surprised to see that it worked with the solid bricks!

Later today I'll optimize it, separating the bricks by sections, and individualizing the clouds to see if the glitch still persists.


PunBB bbcode test
Creating and Editing Sprites.

Offline

#13 2018-07-22 22:06:42

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

Re: Physics update: automatic angles

The sliding on shallow slopes (and other things) - fixed on the update released today
http://opensnc.sourceforge.net/forum/vi … hp?id=1931

Offline

#14 2018-07-22 23:44:48

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

Re: Physics update: automatic angles

Oh cool! It's kinda off to not be able to duck and spindash while stopped in these smaller slopes, but i guess it is like that in sonic games too, if I recall correctly?

Also, the caracter collisions seems to be always showing in this update for me. (I know it's a glitch but it makes me slightly excited over the possibility to have custom collision for the characters tongue)
wcZfwynHi6FgAAAABJRU5ErkJggg.png


PunBB bbcode test
Creating and Editing Sprites.

Offline

#15 2018-07-23 09:05:37

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

Re: Physics update: automatic angles

Race the Hedgehog wrote:

Oh cool! It's kinda off to not be able to duck and spindash while stopped in these smaller slopes, but i guess it is like that in sonic games too, if I recall correctly?

I don't think so. worst case the acceleration is slower uphill, but no restriction on movement.


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

Offline

#16 2018-07-24 01:02:52

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

Re: Physics update: automatic angles

It's fixed. Will be available on the next build.

Thanks for reporting.

Offline

#17 2018-07-24 11:53:13

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

Re: Physics update: automatic angles

wait, let us toggle collisions on/off for debugging. letting us manipulate their sizes and positions would be a big plus for custom sized characters

Last edited by KZR (2018-07-24 11:54:32)


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

Offline

#18 2018-07-24 13:43:55

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

Re: Physics update: automatic angles

I've heard this request before; to be able to customize the sizes.

I do not allow direct control of the collision sensors. These sensors are carefully positioned. If they are wrong, there will be glitches. Users then will say "this is bugged". It's not bugged; it's just that sensors need to be correctly positioned.

I thought before about letting users customize a collision box instead. Sensors would be positioned accordingly. Since these things are so sensitive, it might not be that easy to get this calculation right.

Offline

#19 2018-07-25 00:29:12

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

Re: Physics update: automatic angles

I understand and totally agree. just allow us to set width and height as character parameters, and let the sensors do the mathemagic


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

Offline

#20 2018-07-27 22:53:15

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

Re: Physics update: automatic angles

Taking level editing to the next level

Today's update brings improvements to the physics system and a new exciting Demo Level: Sunset Paradise. Based on my Template Brickset, it's a full level with multiple routes, many types of slopes, and so on. Think that's hard to do? No!!! In fact, I was delighted to see how simple it was to build it! cool

screen4.png
Enjoy!

Download: http://opensnc.sf.net/forum/viewtopic.php?id=1931

Offline

#21 2018-07-28 02:20:08

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

Re: Physics update: automatic angles

Oh nice! The physics system really did get better! It's definitely more fluid now.
Are we going to have a new camera system? I noticed that this one is always focused on the player, and the script says the old one is obsolete now.

Is there somewhere to see a changelog? I'm super excited about the changes! big_smile


PunBB bbcode test
Creating and Editing Sprites.

Offline

#22 2018-07-28 02:40:50

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

Re: Physics update: automatic angles

Yes, it's getting better'n better cool

Best way to follow the changes is to watch / star the project on GitHub:
https://github.com/alemart/opensurge

note: legacy objects will eventually be replaced by SurgeScript objects.

Offline

#23 2018-07-29 14:41:11

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

Re: Physics update: automatic angles

I'm liking the new physics a lot and I've noticed the slipping off of shallow angles issue is completely gone too! I do still think the characters are just a bit heavy and have a little too much weight to them though; I find myself slipping off of platforms a bit too easily.

The level design isn't bad at all though, the only thing about it to criticize is that there isn't any enemies or threats to hit, but I figure those will be added in eventually.

Offline

#24 2018-07-29 17:08:03

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

Re: Physics update: automatic angles

Thank you for the comment, Silver.

SilverstepP wrote:

I do still think the characters are just a bit heavy and have a little too much weight to them though; I find myself slipping off of platforms a bit too easily.

I'll take a look at it. Do you mean the acceleration?

SilverstepP wrote:

The level design isn't bad at all though, the only thing about it to criticize is that there isn't any enemies or threats to hit, but I figure those will be added in eventually.

Indeed, the baddies will be added after the SurgeScript integration.

I also would like to have a new art style for those sprites. Something similar to the art style of Knuckles Chaotix.

Offline

#25 2018-07-29 21:44:43

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

Re: Physics update: automatic angles

Alexandre wrote:

Thank you for the comment, Silver.

SilverstepP wrote:

I do still think the characters are just a bit heavy and have a little too much weight to them though; I find myself slipping off of platforms a bit too easily.

I'll take a look at it. Do you mean the acceleration?

Actually both the acceleration and deceleration values. It feels just a bit sluggish to get going and difficult to stop once you do start moving.

Aerial control feels especially difficult because you can't really correct yourself once you're airborne. This can make it pretty easy to miss those moving platforms and fall back down to the lower path in the level. Having very little jump control is fine when jumping out of a rolling animation, but if you're standing, walking, or running, it probably should be a bit easier to manage your momentum.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org