Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [request] Parenting sprites

Author
Message
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 2nd May 2019 22:22 Edited at: 2nd May 2019 22:25
I may use the wrong term here. The idea is, it would be nice if we could group sprites in a hierarchy one being the "parent" and others can be the childs. The idea is that when we move, rotate or scale a parent, childs follow and keep relative rotation, position and angle to the parent. Different engines call this different ways. Some call it "parent", some call it "pining" other call it "grouping". I prefer to call it "parent-child" because it is describe perfectly the relation.

We could have a property for sprites called "parent" where we could enter the name of the sprite object that is being considered the parent and so once we update the position, rotation of that parent sprite it is going to also effect the childs. Or the other way is to have a property called "childs" where we could enter the name of sprites to be considered a child. Essentially, it would store the ID of the parent and all child sprites inside an array similar to groups, but in this case, the code would move, rotate only the parent in global space (the first element of the array maybe) and the rest 1 to Array.Length being moved and rotated in local space relative to the parent. So for example if I have a child on the right side of the parent, it is remain on the right side of the parent at all times.

I know it is already possible with a little math, but I think it would be very useful to be able to setup something like this without coding.
It would be also important to have commands to either add and remove childs from the array during gameplay so for example if you want to add a new rocket to your ship at runtime, you can or remove it so the rocket can fly on it own once launched while the parent (the ship) still moving around but we no longer want to effect the rocket we launched.

Thanks.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 3rd May 2019 21:14
I like this idea! I work with 3D applications day in day out and they use parenting extensively. In 3D you have the ability to "parent in place" and simply "parent" - parent in place, as the name suggests means that when you parent, they child becomes bound, in its current position, to the parent. With classic parenting, if you move the child to be close to another item and then parent it, it would fly off as it would parent it, taking into account the child's position relative to the origin. Now, in 3D, both methods are essential. In 2D.... I can see the case for Parent n Place but not classic parenting. But I raise it because perhaps I've just not thought it through and this is something you'd want to think through carefully before implementing. You want a parenting system that is flexible for all situations.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
haliop_New
User Banned
Posted: 4th May 2019 06:05
Thumbs up.
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 4th May 2019 06:40
+1 for this to be implemented.
Win 10 Pro - AMD RYZEN 7 Octacore 3.8ghz - 32GB DDR4 - RTX 2070 8GB
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th May 2019 08:51
If you want it as a request the official request method is to use GitHub https://github.com/TheGameCreators/AGK-Studio/issues
this way developers don't have to search the forums just to find something that people may want implimented
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 4th May 2019 10:54 Edited at: 4th May 2019 10:59
Quote: "the official request method is to use GitHub...this way developers don't have to search the forums "

The sticky saying we must discuss requests on the forum first:
https://forum.thegamecreators.com/thread/224038

I think it would make sense if someone from either the dev team or moderator team would be dedicated to play the filter on the forum and post on github anything that the community support and reasonable and haven't been requested before since we must use the forum first anyway. Probably to make sure we don't request something that is already implemented, already requested or something nonsense.

I also don't use GitHub and personally I would prefer to have a cathegory or label here on the forum dedicated to feature request instead of a single cathegory with no labels for everything Studio related.

But thanks for the link anyway.
haliop_New
User Banned
Posted: 4th May 2019 12:02
Zigi why like this?
its not really a problem to open a GitHub account and you don't really have to do anything about it ... just read and write requests... it is way better than to use the forum. and login in GitHub is done in a second BTW...
I will check if parenting is on the Github request channel if not I will upload it.
haliop_New
User Banned
Posted: 4th May 2019 12:12
uploaded a request, you can check it out and comment if you'll like, maybe add some changes...

https://github.com/TheGameCreators/AGK-Studio/issues/325
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 4th May 2019 13:06 Edited at: 4th May 2019 13:08
@haliop_new
Of course I can go straight to GitHub and post whatever I want, but told to come here first to make sure the request I make is valid and makes sense. It is the devs who prefer to discuss any bug report and request on the forum first to avoid github issue tracker being filled with trash which makes sense, but I personally dislike this method because it is require me to post twice the same and reply the same questions and concerns twice beause people on github don't read the forum but may raise the same questions and concerns.
So I think it would be better if someone from the dev team or the mod team, would review these requests since we need to post them on the forum anyway, and post them on github for us.

An other and in my opinion a better alternative would be is to use something like Trello where we can post and discuss "ideas" and then if a dev agree it should be worked on can move the discussion from "idea" to "planned" and then once they start working on it, they can move it from "planned" to "doing" and when they are about to done they can move it from "doing" to "ready for next release". It would be a better place since everyone can post and discuss features at one place and the devs can also easily track what they are doing and what they plan to do next while we can continue the discussion. Trello is awesome, much better than GitHub for tracking what is being requested and worked on.

Thank for posting on GitHub anyway looks great.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th May 2019 16:51
I wrote a function that does something like this awhile back for someone. No clue where to search for it, but I could likely write it again.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 6th May 2019 17:58 Edited at: 6th May 2019 18:04
I made a FixSpriteToSprite system a while back that handles the offseting and rotation aspects but did not implement scaling. It could be done of course with a new SetFixedSpriteScale function.

That grew into a general purpose sort of Extended API that can be included in every project.

I definitely understand your wish to have this sort of thing included natively in the API and engine and scene editor etc . I wish it was too. Be awesome to have it native running at max speed and just automatically handling all of the concerns of offsetting, rotation, scaling, etc.

Just throwing out the above in case it helps you or anyone else.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 6th May 2019 18:09
Quote: "
The sticky saying we must discuss requests on the forum first:
https://forum.thegamecreators.com/thread/224038"


/shrug I'd honestly take that more as a guideline than a hard rule. We've been told repeatedly that the devs are not watching for the forums for suggestions, they aren't going to come around and say "yep, this idea is fleshed out and clear to move to github"

Basically, if you are not sure about an idea and want to discuss it - open a thread on the forums. If you have an idea you feel is already solid, just go submit it on github.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.

Login to post a reply

Server time is: 2024-04-20 03:35:57
Your offset time is: 2024-04-20 03:35:57