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 2010-09-12 17:44:42

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

Ideas for the objects

Some actions that can improve a lot the actual system:

-Load_level: start a new level from levels/mylevel.lev. Useful for make something like Sonic CD, an act has 3 levels: past, present, future. This means that we need a level_completed (complete the level and close it) action and an act_completed (complete the act and close all the levels)

Syntaxis: load_level "level/levelyouwanttouse.lev"
                level_completed "nameofthelevelcompleted.lev"
act_completed no requires arguments

-Make_child / Make_parent: Transform the object in the parent or child of the actual.

Syntaxis: Make_child "object_name" "x_position" "y_position"

Load levels let us implement without problems special stages in 2D or in 3D (changing a bit the code), like the people prefer.
And the Make_child would improve a lot the actual child-parent system.


Piece of cake...!

Offline

#2 2010-09-18 22:17:11

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

Re: Ideas for the objects

The load_level idea is ok. smile

On the other hand, a decorator that "Transforms the object in the parent or child of the actual" will not be made. This is not good programming, my friend. Find another way to do what you want.

Offline

#3 2010-09-18 23:05:02

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

Re: Ideas for the objects

Alexandre wrote:

The load_level idea is ok. smile

On the other hand, a decorator that "Transforms the object in the parent or child of the actual" will not be made. This is not good programming, my friend. Find another way to do what you want.

Can't you just use 'change_closest_object_state' to achieve the whole parent-child thing?

And can we make 'load_level' seamless? It could allow Sonic 3 type transferrances!

Offline

#4 2010-09-19 01:33:57

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

Re: Ideas for the objects

I have yet to think better about 'load_level', because it breaks the normal flow of the game. A quest is a list of levels, and that's the normal flow.

Maybe a 'push_level' / 'pop_level' is a better approach. push_level will load a new level on the screen (like a bonus level - not a 3D one), and pop_level would return to the level you were before. That's a problem, though, because when you'd call pop_level, all the objects of the previous levels would be reloaded. If you touch a big ring to warp, then you pop the level to go back, you would touch the big ring again and warp again... and so on.

Offline

#5 2010-09-19 03:49:33

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

Re: Ideas for the objects

Can we have a command that makes the object dangerous to the player without having to change states? Like "enemy", only without the 'you can destroy it by attacking it' part. Like "danger_touch" or something. Maybe this could also make projectile attacks easier by taking it a step further and using something like "lightning_touch", "fire_touch", and "acid_touch".

I'm making a custom boss (You heard me right. I have figured out the concept... it's hard to explain, but I may well try to. Identity to be revealed... xD) and it has a state where it needs to be dangerous to touch without changing states... as it is attacking you with bombs at this time.

I'm gonna release a plethora of objects soon; missiles, multiple types of bombs (some even dud on you), laser beams, enemies that can use them (even a half-invisible sniper robot), and two bosses, completely placeable in the level using 'Boss Arena' objects. But I'm not gonna until they are polished up. xD

Offline

#6 2010-09-19 04:16:17

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

Re: Ideas for the objects

This already exists.

http://opensnc.sourceforge.net/wiki/ind … hit_player

I'm gonna release a plethora of objects soon; missiles, multiple types of bombs (some even dud on you), laser beams, enemies that can use them (even a half-invisible sniper robot), and two bosses, completely placeable in the level using 'Boss Arena' objects. But I'm not gonna until they are polished up. xD

Cool. Looking forward to it. cool

Offline

#7 2010-09-19 04:17:35

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

Re: Ideas for the objects

But that makes it hit the player even if the character's not touching it, doesn't it?

Offline

#8 2010-09-19 04:19:13

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

Re: Ideas for the objects

You're in state A.

state A:
-- on_player_collision, change to state A_hit

state A_hit:
-- hit_player
-- change to state A

Offline

#9 2010-09-19 04:23:01

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

Re: Ideas for the objects

Alexandre wrote:

You're in state A.

state A:
-- on_player_collision, change to state A_hit

state A_hit:
-- hit_player
-- change to state A

Yes I know. I was asking for something that...

SilverstepP wrote:

...makes the object dangerous to the player without having to change states...

...mainly because it messes with elliptical trajectory, timeouts, and bullet trajectory if you switch back and forth between states.

Offline

#10 2010-09-19 04:23:53

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

Re: Ideas for the objects

elliptical trajectories and timeouts should not be affected by that. Try it.

Offline

#11 2010-09-19 04:26:46

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

Re: Ideas for the objects

Alexandre wrote:

elliptical trajectories and timeouts should not be affected by that. Try it.

Alright... I'll experiment a bit and find a way around it.

Offline

#12 2010-09-19 04:30:47

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

Re: Ideas for the objects

Keep in mind that decorators written after an event that holds true will not be executed, as the state will be changed before they get the chance to run.

Offline

#13 2010-09-19 04:32:39

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

Re: Ideas for the objects

Alexandre wrote:

Keep in mind that decorators written after an event that holds true will not be executed, as the state will be changed before they get the chance to run.

OK, like I said, this is why I haven't released this stuff yet. There's these tiny nitpicks and specifics I want to resolve.

Offline

#14 2010-12-07 01:21:41

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

Re: Ideas for the objects

I think i found a good way to handle level-switching.
It doesn't allow for in-level changes, but may let you go different courses over the game's levels.

for example:

we have quest scripts, but they are just a list of levels, that run in sequence.

if the quest script could accept command like objects do, it would be much easier to make multiple paths.

in level 1 you do something important, like acquiring a big ring. that big ring creates a global variable $_lv1_got_big_ring and sets it to 1 (true)

when you clear level 1, either by finish sign, or some other scripted way, the quest script has  commands similar to the object script:

quest "myquest"

level1
{
load_level "levels/level1.lev"
on_level_clear "level2"

}

level2
{
if "$_lv1_got_big_ring = 1" "level2a"
on_level_clear "level3"
}

level2a.lev
{
on_level_clear "level2b"
...
}

so the trick to change level in a level would be to set a variable for the special condition, which if TRUE triggers the level based on it. otherwise it follows normal sequence or other commands.


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

Offline

#15 2010-12-07 01:27:16

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

Re: Ideas for the objects

KZR wrote:

I think i found a good way to handle level-switching.
It doesn't allow for in-level changes, but may let you go different courses over the game's levels.

for example:

we have quest scripts, but they are just a list of levels, that run in sequence.

if the quest script could accept command like objects do, it would be much easier to make multiple paths.

in level 1 you do something important, like acquiring a big ring. that big ring creates a global variable $_lv1_got_big_ring and sets it to 1 (true)

when you clear level 1, either by finish sign, or some other scripted way, the quest script has  commands similar to the object script:

quest "myquest"

level1
{
load_level "levels/level1.lev"
on_level_clear "level2"

}

level2
{
if "$_lv1_got_big_ring = 1" "level2a"
on_level_clear "level3"
}

level2a.lev
{
on_level_clear "level2b"
...
}

so the trick to change level in a level would be to set a variable for the special condition, which if TRUE triggers the level based on it. otherwise it follows normal sequence or other commands.

I like this. And it may be needed for the extra level in the real release.

Offline

#16 2010-12-07 01:36:39

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

Re: Ideas for the objects

KZR wrote:

I think i found a good way to handle level-switching.
It doesn't allow for in-level changes, but may let you go different courses over the game's levels.

for example

we have quest scripts, but they are just a list of levels, that run in sequence.

if the quest script could accept command like objects do, it would be much easier to make multiple paths.

in level 1 you do something important, like acquiring a big ring. that big ring creates a global variable $_lv1_got_big_ring and sets it to 1 (true)

when you clear level 1, either by finish sign, or some other scripted way, the quest script has  commands similar to the object script
quest "myquest"

level1
{
load_level "levels/level1.lev"
on_level_clear "level2"

}

level2
{
if "$_lv1_got_big_ring = 1" "level2a"
on_level_clear "level3"
}

level2a.lev
{
on_level_clear "level2b"
...
}
so the trick to change level in a level would be to set a variable for the special condition, which if TRUE triggers the level based on it. otherwise it follows normal sequence or other commands.

Unfortunately that is not possible. Quests do not support advanced scripting. You can already achieve such an effect with the engine we have today (except for the load_level decorator, which has yet to be created).

Quests are linear. So, suppose there could be a special, secret zone between Sunshine Paradise (level 1) and Waterworks Zone (the next level). The quest script would look like this:

level levels/sunshine_act1.lev
level levels/sunshine_act2.lev
level levels/sunshine_act3.lev
level levels/intermediate1.lev  // <--------
level levels/waterworks_act1.lev

Within intermediate1.lev, you put an object that checks if the player should go to the secret level. If not, proceed the quest normally.

Offline

#17 2010-12-07 02:36:47

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

Re: Ideas for the objects

hmm nice trick, never thought of it that way. thanks big_smile


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

Offline

#18 2010-12-18 08:09:23

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Ideas for the objects

I'm no expert on quests, but it certainly would be nice to have these level tricks implemented.

As for checkpoints I think a feature used in many Mario games would be nice to have in Sonic levels as well:

Play one of the castles in world 2 or 3 in Super Mario Bros Wii. There you got a few paths to choose from, one is right, the other roads is wrong. Choosing the wrong path teleports you back to where you picked the wrong path, chose the right path and you're getting on with the puzzle. I'm sure this can be creaed scriptwise now anyways, just wanted to drop the idea.

As for levels I wouldn't mind to see auto scrolled levels. Just like in Bridge zone act 2 on the old mastersystem.

A few commands I really need is:

object_count "objectname"
to get how many objects there exists in a level.

on_object_exists "objectname" "state"
Execute the following state if an object exists

on_no_object_exists "objectname" "state"
Execute the following state if an object doesn't exist.

A function to format strings to display time wouldn't hurt that bad!

Functions to draw sprites would be pretty sweet, specially when it comes to HUD's.

hide_unless_in_editor_mode is good, but it hides everything from an object. A better way would be:

hide_sprite_unless_in_editor_mode
to disable sprites but enable text output.

Last edited by jobromedia (2010-12-20 20:00:52)

Offline

#19 2010-12-27 05:47:57

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

Re: Ideas for the objects

load_level is implemented on 396

and jobro, these commands do not exist, but you can get their effects by using variables.

Offline

#20 2010-12-28 04:00:12

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

Re: Ideas for the objects

you can set a variable to keep track of the number of any kind of object. just make it global like

$_number_of_objectname

when one of them is active it adds 1 to that variable. when one is destroyed it subtracts 1 from it.

on_object_exists

can be replaced by

if  "$_number_of_objectname <= 1" "state"

and

on_no_object_exists "objectname" "state"

is replaced by

if  "$_number_of_objectname == 0" "state"

i hope i got that right too tongue


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