Storing Que Info in Array

H

HUMMAN

Guest
Basically, some commands in my game are stored and then finish their job after some other commands. The thing is i plan to store all these kind of commands in one array. i just change finished commands to 0. Two questions arise to me:
1. Is it a dangerous way of coding, that large arrays may cause memory issues?
2. Should i delete (somehow) finished commands from array, or any more efficient different methods common in GML realm.
I can be more specific if you desire.
Thanks in advance!
 

angelwire

Member
1. Arrays and data structures can be pretty big before memory issues occur. Depending on what exactly you're storing, you could possibly store thousands of items before memory becomes a problem
2. Gamemaker has the ds_queue data structure that you can use instead of an array. Here is the entry for it in the manual: ds_queues

Hopefully that answers your questions, if you need more help let me know.
 
Top