Best data structure ? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Best data structure ?

I have a big arena about 1M×1M And there is units like(soldier,tank,..) on it and they move to kill the Base (a game like clash of clans) What is the best data structure i can use to store this arena For sure it's not a two dimensional array because it's too big

23rd Nov 2020, 3:20 PM
Michel Ghaith
Michel Ghaith - avatar
3 Respuestas
+ 1
1M seems unreasonably oversized but anyway it's probably better for a lot of other reasons as well to store the position of each unit and other assets as x,y coordinates
23rd Nov 2020, 3:37 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
Benjamin Jürgens how can i do that ?
23rd Nov 2020, 3:48 PM
Michel Ghaith
Michel Ghaith - avatar
0
Michel Ghaith i think you should try using a game engine. I don't know any for java unfortunately. Maybe unity is an option for you. It uses C# for scripting, which should be an easy transition from java
24th Nov 2020, 8:33 PM
Benjamin Jürgens
Benjamin Jürgens - avatar