GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

What's more efficient on memory/CPU?

HappyKat78HappyKat78 Posts: 173Member, BASIC
Hi Guys,

Does constantly updating a table cause memory issues? For example (although this might be a bad example) if I was to update a table directly with the X and Y coordinates of the mouse pointer, is this likely to slow things down and would it therefore be better to just update a global attribute and then save it to the table at specific points? Or is game salad as comfortable/efficient constantly updating tables as it is updating attributes?

Thanks in advance!

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,913Member
    Unless you want to store a history of the positions, I would use the game level attributes as the method described defeats the purpose of a table as static data.
  • HappyKat78HappyKat78 Posts: 173Member, BASIC
    Thanks for your comments! I'm actually needing to tie an instance of an actor (Actor 2) to the instance of another actor (Actor 1) and there is not a set limit of how many actors can be spawned. Hence I don't know how many global attributes to make as there is not a limit of instances of the actors. I actually want Actor 1 to always rotate to face Actor 2 for each instance. I have it working right now by assigning an ID to both Actor 1 and Actor 2 when they're created and then anytime I move an instance of Actor 2 I'm updating the relevant row in the table with the X and Y position of that instance of Actor 2. That way no matter how many instances of Actor 1 and Actor 2 get spawned, each instance of actor 1 will only rotate towards the instance of Actor 1 it's associated with. I just wondered if this was hurting memory. So far I can spawn a lot of these and it all seems good, but it might be because it only updates the table (real time) when I click on an instance of Actor 2 (not all of the time).
This discussion has been closed.