Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
investigating object range with loadTarget()
i've written a code to have a closer look at how object slots are being assigned by the game:
void id(){
 int d = 400;
 for (int i = 399; i > -1; --i){
  if (loadTarget(i) >= 0){
   d = i+1;
 int c = 0;
 for (int i = 0; i < d; ++i){
  c = loadTarget(i);
  if (i == 0 || i == 25 || i == 50 || i == 75 || i == 100 || i == 125 || i == 150 || i == 175 || i == 200 || i == 225 || i == 250 || i == 275 || i == 300 || i == 325 || i == 350 || i == 375){print("\n");}
  if (c >= 0){print( c );} else{print(".");}
the code will first iterate backwards to find the highest occupied object slot and then go through from 0 to that slot, printing out the object type on a slot (or a . for an empty slot)
25 slots per line going from left to right, top to bottom

the result:
0-7 are for human players (as already known)
8-15 are for selected computer players (occupying the same slots as humans)
a good conclusion from this already is: if there is a human player on slot 0, then slot 8 will most likely be empty
so you never have to iterate over the first 16 slots if you aren't looking for characters (and in non battle or stage mode fights you only need to look through the first 16 slots for opponents, except for clones of course)

after that the slots get filled from 16 onwards with anything that comes along (just go into battle mode with this AI and have everything at max)
but if you only have a normal vs or stage battle you will notice that the game keeps a few free slots after the characters and only starts filling slots with weapons (F8) and other objects from slot 50 onwards. it seems the first 50 slots are usually reserved for characters!

lets use this info to make our iterations more compact!
Thanks given by: Alblaka
Which means There cannot be any T!=0 object within slot 0-49?
That IS indeed useful.
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.

Thanks given by:
nope - i think i've seen battle mode fill these slots with a few type 6 (bottles)
but i may be mistaken

if i am then you sure can start all your non character iterations at slot 50
Thanks given by:
Sounds too unreasonable 0_o. One can say that maybe the first few slots were done like that to ease the sorting for teleportation or something, but I know for sure you can go over 100 characters on the screen. Setting a condition for when characters go beyond 50 sounds like a hassle also, and I don't see the Wongs doing it.

Perhaps everything is just being filled in order (except for the human players maybe), and these empty slots you observed are just shadows of objects that were deleted? (energy balls?)
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Thanks given by:
I don't know what you are getting at.
In versus mode all non character objects fill slots 50 onwards, leaving a big gap between characters and other objects - that's all I observed.
Thanks given by:

Users browsing this thread: 1 Guest(s)