16-02-2007, 09:26 AM
I just figured this out just then lol but im pretty sure this should work...
*currently
[code]
public const buffer = 3
do while z
*currently
[code]
public const buffer = 3
do while z
Very Simple Optimize Max Looping
|
16-02-2007, 09:26 AM
I just figured this out just then lol but im pretty sure this should work...
*currently [code] public const buffer = 3 do while z
16-02-2007, 09:48 AM
Well, it should be like this:
Code: For i = 1 to MAX_PLAYERS
16-02-2007, 10:09 AM
Lol no the whole point of this was to remove the High_Index crap and all the other codes that tries to find high_index which is pointless because it wastes memory anyway.
this just exits the procedure once theres no players left and requires no extra procedures. And high index wont work unless no one has logged out since logging in actually it should be this Code: for i = 1 to max_players that would give room for error if there are up to 3 indexs above the first cleared index that are cleared and havent been yet filled (which would probably never happen but you never know ![]()
16-02-2007, 10:11 AM
Thats one messy code. You messed everything up in it.
16-02-2007, 10:18 AM
lol sorry *fixed
actually thanks for making me realise the error that alot has made in optimizing max_looping, that if a player is cleared it will ruin the whole procedure until someone else fills its place, which gave me the idea of the 3 index buffer.
16-02-2007, 10:40 AM
Code: for i = 1 to max_players
16-02-2007, 10:50 AM
lol how not?
16-02-2007, 10:52 AM
You have a exit for, so it will only run once I =1. And there are no End if.
16-02-2007, 10:58 AM
*fixed
Lol no "exit for" only executes on the else after the buffer Code: for i = 1 to max_players
16-02-2007, 11:00 AM
But there was no end if before... therefore it ran each time and it exited the loop.
16-02-2007, 11:05 AM
lol thanks
I remake lol its late and im really tired from soccer no wonder theres so many mistakes [code] do while z
16-02-2007, 11:31 AM
Code: player(index).name should be: Code: player(i).name Still I dont understand what you are trying to do with it.
16-02-2007, 12:37 PM
basically if there is a slot with no information it is a slot with no player.
afterwards if this is found three more times then it assumes the end and exits the loop thus saving time and RAM because it exited before getting to max_players. the 3 player buffer is there in case up to three players have left without anyone filling the slots and they are in the middle of the index range.
06-07-2007, 09:58 PM
Sorry to bring up an old topic, but if you had 24 people online, and the first 4 log out without anyone logging in, you're screwed.
Quote:Robin: |
« Next Oldest | Next Newest »
|