Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reviewed] [Object Spawner] Added "Random Position" checkbox and deprecated "Offset" properties #1115

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

tristanbob
Copy link
Contributor

Offsets were originally designed to enable random positions, but this new implementation is much cleaner. The offset method can still be used by adding a value to the position of objects as a subevent to the "Periodically spawn objects". This was not possible before GDevelop started picking objects created by extensions.

Playable game:
https://gd.games/instant-builds/cbf53f3e-449a-45e2-b7c1-011f257c7343

Project file:
ObjectSpawnerRandomPositions.zip

Offsets were originally designed to enable random positions, but this new implementation is much cleaner.
The offset method can still be used by adding a value to the position of objects as a subevent to the "Periodically spawn objects".  This was not possible before GDevelop started picking objects created by extensions.
@tristanbob tristanbob self-assigned this Dec 3, 2023
@tristanbob tristanbob requested a review from a team as a code owner December 3, 2023 20:07
extensions/reviewed/ObjectSpawner.json Outdated Show resolved Hide resolved
"objectGroups": []
},
{
"description": "Change if use random positions inside the spawner. Useful for making large spawner areas.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are areas rectangular? I guess distance based area could be useful too.
Users will have to deal with big spawner objects. It's not always easy to manage in the scene editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to give users the ability to see the area that the object could spawn in, which is why I am using a the AABB of the spawner object.

Large objects can be "disabled" so they won't be easily selected, just like a background or other large object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another important aspect of providing a visual spawning area is that creators can make sure their objects are not accidentally spawned inside a wall or outside the playable area.

@tristanbob
Copy link
Contributor Author

tristanbob commented Dec 4, 2023

@D8H I updated the wording, and I like it a lot better. What do you think?

@tristanbob tristanbob merged commit f97ef51 into main Dec 5, 2023
1 check passed
@tristanbob tristanbob deleted the object-spawner-random-position branch December 5, 2023 16:04
@D8H
Copy link
Contributor

D8H commented Dec 5, 2023

It sounds good, thank for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants