Join the forums now, and start posting to receive access to our Scripts Vault!
Ive also had another idea, not sure how itll go so I didnt mention it before, but I figure I may as well.We have a square, 10 units by 10 units. In this square, we must get 15 players. Once we have 15, then the square moves along. Howver Im not sure how or even if this would work.
Why not just pre-determine 'village locations' for each coordinate graph. Basically, this way you'd just have a list of locations and each time a player joins you simply pop the last item from the list.
About the moving square one... If we could get the square to move in a square spiral around the center of the world, it wouldnt be too bad would it?To do that, the square needs to go down 1 right 1 up 2 left 2 down 3 right 3 up 4 left 4 etc.... Im sure we could code a way to keep track of where it is. Not right now though, I have to go out for the day. Ill have a go at somethiing when I get back.
I have also considered this, but like I said, how do I make sure new players are created near eachother, instead of on the other side of the world?
CREATE TABLE village_new_location (id int unsigned not null auto_increment, xcoord int unsigned not null, ycoord int unsigned not null, primary key(id));
SELECT id, xcoord, ycoord FROM village_new_location ORDER BY id ASC LIMIT 1;
DELETE FROM village_new_location WHERE id = '[lastIdValue]';
SELECT * FROM test ORDER BY (SQRT(POW(x,2)+POW(y,2)));
ALTER TABLE test ORDER BY (SQRT(POW(x,2)+POW(y,2)));
With all the games I've coded I've often broke many of the normalization rules so I could get performance. Joins are nice but joins cost both processing time, memory and heavy disk access when updating the tables.
there is a bunch of people in Redmond that just felt a shiver up there spine for me saying such things.