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

#26 2018-10-30 22:39:55

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

Re: Editor palette (new!)

May I request that the hotspots can also be defined per animation and globally, instead of just globally for all animations of a given sprite? if an animation does not have this definition then the hotspot reverts to the global value.

maybe even defining multiple hotspots, useful for spawning or attaching objects from/to positions other than the sprite's "center"

this would make it easier to create complex objects made of multiple linked ones. and improve parent/child relationships

Remember that snake boss we were working on a few years ago for Dark Forest? or suppose you're making a character whose body parts are different sprites. It could help for such cases.

Last edited by KZR (2018-10-30 22:42:57)


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

Offline

#27 2018-10-31 02:29:29

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

Re: Editor palette (new!)

KZR wrote:

May I request that the hotspots can also be defined per animation and globally, instead of just globally for all animations of a given sprite? if an animation does not have this definition then the hotspot reverts to the global value.

The engine already supported that, but we just haven't acknowledged it (it just did not read the input). Will be available in the next build.

KZR wrote:

maybe even defining multiple hotspots, useful for spawning or attaching objects from/to positions other than the sprite's "center"

You do that using parent-child relationships in SurgeScript (Transform component).

Offline

#28 2018-11-01 00:10:01

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

Re: Editor palette (new!)

another thing, set_animation with optional sprite change. if no sprite name is passed on, the animation is changed for the current sprite.

Last edited by KZR (2018-11-01 00:11:53)


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

Offline

#29 2018-11-20 08:55:11

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

Re: Editor palette (new!)

One month ago I ripped a level maps from Sonic Unleashed in Dolphin Emulator and I find one interesting moment. The engine don't load full level map. It load a small fragment of level map for a particular moment:

what does the player see:
illust_1_201118.png

what is actually in memory at this moment:
illust_2_201118.png

Open Surge working on the same principle?

Offline

#30 2018-11-20 14:41:06

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

Re: Editor palette (new!)

one question:

I noticed you used that big equation for angles in the barrel script.

is it possible that we add functions

angle_to_pos(x,y,targetx,targety) // outputs the angle from this object's position to xy coords.
look_at_pos(xy) //simply set the angle of this object to look at the target coords
rotate_to(x,y,mode,speed) //mode == 0 clockwise 1 counterclockwise 2 closest 3 furthest. delta rotation
distance(x,y,targetx,targety)//linear distance from A to B

either via source code or surgescript? they would be useful for a lot of things, especially projectiles, special effects and simple physics

Last edited by KZR (2018-11-20 14:46:49)


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

Offline

#31 2018-11-20 20:35:18

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

Re: Editor palette (new!)

G.E.R. wrote:

Open Surge working on the same principle?

The whole level is stored in the memory, but only the items that are near the camera get updated & rendered. You can bypass this behavior by tagging your SurgeScript entity as awake (or your legacy object as always_active), but it's not recommended to bypass it too much, because this is meant to improve performance.

KZR wrote:

I noticed you used that big equation for angles in the barrel script.

is it possible that we add functions

angle_to_pos(x,y,targetx,targety) // outputs the angle from this object's position to xy coords.
look_at_pos(xy) //simply set the angle of this object to look at the target coords
rotate_to(x,y,mode,speed) //mode == 0 clockwise 1 counterclockwise 2 closest 3 furthest. delta rotation
distance(x,y,targetx,targety)//linear distance from A to B
either via source code or surgescript? they would be useful for a lot of things, especially projectiles, special effects and simple physics

I'm already doing that. The Transform component already includes some of these functions, and in the next build, I'll be updating it to work with 2D vectors. There will be a new API. Yesterday I submitted code that makes math a lot easier, but I have yet to finish the implementation and the documentation. https://alemart.github.io/surgescript/

Offline

#32 2018-11-30 00:22:15

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

Re: Editor palette (new!)

SurgeScript now features Vector maths (version 18.1129-dev). I've changed the API; rather than working with individual coordinates, it now works with vectors. See: Vector2, Transform.

Vectors have been designed in such a way that their functions make them chainable; you can build complex operations using english-based terms, rather than big equations:

KZR wrote:
distance(x,y,targetx,targety)//linear distance from A to B

Becomes:

distance = transform.position.distanceTo(target.transform.position);

KZR wrote:
angle_to_pos(x,y,targetx,targety) // outputs the angle from this object's position to xy coords.

Becomes:

angle = transform.position.directionTo(target.transform.position).angle;

KZR wrote:
look_at_pos(xy) //simply set the angle of this object to look at the target coords

Becomes:

transform.lookAt(target.transform);

KZR wrote:
rotate_to(x,y,mode,speed) //mode == 0 clockwise 1 counterclockwise 2 closest 3 furthest. delta rotation

Becomes:

transform.rotate(speed * Time.delta); // you'll need some logic

Offline

#33 2018-12-02 21:32:14

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

Re: Editor palette (new!)

yay vector maths cool can't wait to mess with these


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