Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Dynamic Memory or Dynamic Arrays #215430
07/11/08 07:09
07/11/08 07:09
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline OP
User
delinkx  Offline OP
User

Joined: Jul 2008
Posts: 553
Singapore
Hello,

I am creating a simulation of walking entities in an empty room. I am creating the entities dynamically. I am using an array for this. But i have been advised in the tutorials not to use arrays for large numbers.

Right now am running at 100 entities. am planning for 10 000 entities. What is the solution for storing them if not arrays ?

The example is shown below


Thnx.

Code:

var entAgent[100];

entAgent[i] = ent_create(strModel, vector(ran_pos_x,ran_pos_y,-55), entity_walk);




A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Dynamic Memory or Dynamic Arrays [Re: delinkx] #215458
07/11/08 10:53
07/11/08 10:53
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
For c-script? Lite-c?
c_script: if not for arrays, I don't know what else :P
lite-c: google for linkedlist, some members here have contributed a linkedlist as well.


Click and join the 3dgs irc community!
Room: #3dgs
Re: Dynamic Memory or Dynamic Arrays [Re: Joozey] #215490
07/11/08 15:03
07/11/08 15:03
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hello,

Quote:
Right now am running at 100 entities. am planning for 10 000 entities. What is the solution for storing them if not arrays ?

This also depends on how the data needs to be accessed.
If you need sequential access a linked list will be fine.
However, if you need to search for specific data other data structures are much better (eg. binary trees).

I have written scripts for doubly linked lists and AVL-trees, but commentation and documentation is german only.

Re: Dynamic Memory or Dynamic Arrays [Re: Fenriswolf] #215923
07/14/08 03:50
07/14/08 03:50
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline OP
User
delinkx  Offline OP
User

Joined: Jul 2008
Posts: 553
Singapore
Originally Posted By: Fenriswolf
Hello,

Quote:
Right now am running at 100 entities. am planning for 10 000 entities. What is the solution for storing them if not arrays ?

This also depends on how the data needs to be accessed.
If you need sequential access a linked list will be fine.
However, if you need to search for specific data other data structures are much better (eg. binary trees).

I have written scripts for doubly linked lists and AVL-trees, but commentation and documentation is german only.



i think linked list should be fine. I am just creating 10000 entities right now.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Dynamic Memory or Dynamic Arrays [Re: delinkx] #216165
07/15/08 14:13
07/15/08 14:13
Joined: Dec 2005
Posts: 116
T
tD_Datura_v Offline
Member
tD_Datura_v  Offline
Member
T

Joined: Dec 2005
Posts: 116
dummy had entity linked list plugins for C-script & A6.60, but you are probably using A7, and / or Lite-C, so that won't be relevant to you.





Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1