1
\$\begingroup\$

I'm creating an open-world RPG like Neverwinter nights. But I’m worried about memory and am afraid if I just populate a huge world with physics based sprite nodes, I won't have any memory for anything else.

The method I thought of is to remove the sprites when they go far outside of the viewport and then re-add those sprites when I get close to their location.

How could I accomplish this?

\$\endgroup\$
6
  • \$\begingroup\$ Try not to worry about the problems you have not faced yet. Make a prototype and do the load-testing and see what are the actual bottlenecks. \$\endgroup\$ Commented Jun 14, 2020 at 8:59
  • \$\begingroup\$ How does your game know which sprites to spawn where in the first place? \$\endgroup\$ Commented Jun 14, 2020 at 9:53
  • \$\begingroup\$ @DMGregory I'm thinking I would have a invisible sprite node that encapsulates all others in the area and on collision, I then add those sprite nodes to predesignated points through a function \$\endgroup\$ Commented Jun 14, 2020 at 14:12
  • \$\begingroup\$ @Kromster A fair point lol \$\endgroup\$ Commented Jun 14, 2020 at 14:13
  • \$\begingroup\$ That sounds like an approach worth trying. What happens when you test the idea? \$\endgroup\$ Commented Jun 14, 2020 at 14:15

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.