Remember me
You are here: HomeForumCyberix3D ForumGeneral Discussionspawn many objects without affecting performance
Welcome, Guest
Username: Password: Remember me

TOPIC: spawn many objects without affecting performance

spawn many objects without affecting performance 2 years 9 months ago #2755

  • GODEBEX
  • GODEBEX's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 158
  • Thank you received: 42
I was wondering if there is any way that the game doesn't slow down if you spawn multiple elements within it.

for example: a slither.io game of a caterpillar that when eating becomes longer and longer generating more spheres in its body but in such a way that it does not slow down the performance of the game little by little.
The administrator has disabled public write access.

spawn many objects without affecting performance 2 years 9 months ago #2756

  • ViraX
  • ViraX's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 152
  • Thank you received: 113
Theoretically it is possible, after in practice not easy to do.

I imagine that in Slither.io, each time the body grows by adding spheres to it the program merges the whole in order to manage a collision set and not several spheres separately

on Cyberix3D, calculating a large number of physics spheres with collision is heavy for the engine, but there are surely some tips to lighten the work of the engine
The administrator has disabled public write access.
The following user(s) said Thank You: GODEBEX

spawn many objects without affecting performance 2 years 9 months ago #2757

  • GODEBEX
  • GODEBEX's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 158
  • Thank you received: 42
I think it is something quite complex, it is in fact that if we use commands like "merge" and we generate a high number of elements with collision it does not help much, although I hope one day that Cyberix3d ​​will find a solution.

I was thinking of creating a slither.io with multiplayer but I found a simpler way without using so many resources
The administrator has disabled public write access.

spawn many objects without affecting performance 2 years 9 months ago #2760

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 661
  • Thank you received: 626
In fact, this kind of game is possible in Cyberix3D.
It is best to use 2d images to create the worm for the best performance.
The concept is very simple, just put a circle image whenever you go and remove it after x seconds where the x is the worm size.
In order to detect a collision, just add a distance detection between the worm's circles tail and the player position.
We have made an example:
www.gamemaker3d.com/player?pid=01659736
Press space to increase the worm size.
worm_game.jpg

Regards,
Cyberix3D team
Last Edit: 2 years 9 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: ViraX, GODEBEX

spawn many objects without affecting performance 2 years 9 months ago #2762

  • GODEBEX
  • GODEBEX's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 158
  • Thank you received: 42
wow, this is incredible, in the future it would be possible to create a slither.io with multiplayer
Last Edit: 2 years 9 months ago by GODEBEX.
The administrator has disabled public write access.
Time to create page: 0.267 seconds