View Full Version : Question About Number of Planets
COOL3077
May 1st, 2001, 09:29 AM
Hi
Can some one explain to me why we can only use upto 255 planets per quadrant. I love this game to bits its just so good, but i like Gigantic maps to play with and was just wondering two things. How many can u have? And if only 255 Y????
Drew
PS modder wanabes plus seasoned modders should check this out.
http://www.cdmag.com/articles/032/119/spaceempir-04.html
It's not 255 planets but 255 sytems per quadrant as maximum.
This is hard coded by MM probably because otherwise the game would need higher hardware requirements as it does now.
jc173
May 1st, 2001, 11:55 AM
It's probably got something to do with the way the data is stored is my guess since 256 is a power of 2. Although if this were some sort of 256 slot array, I'd actually expect there to be 256 not 255 systems, I don't know maybe the first slot is some kinda of header.
nerfman
May 1st, 2001, 12:56 PM
2^8 = 256
Taqwus
May 1st, 2001, 03:55 PM
It's probably just an unsigned char -- 8 bits, with the possible range of 0-255. I suppose Aaron *could* have written it so that 0 was interpreted as 1, 255 as 256 (casting to a larger type), and so forth... but pretending that 0 means 1 is a very good way to lose sanity tracking down subtle bugs...
------------------
-- The thing that goes bump in the night
dmm
May 1st, 2001, 08:14 PM
Yeah, array indices in C drive me nuts. That's why I love Fortran. Arrays start at 1 by default, like they ought to. But if you want, you can change the index to anything you want -- even have it go backwards. Beats the pants off C and C++. (Fortran95 also has pointers and structures and overloading, if you want them. Plus many commands will work on entire arrays at once. It's a beautiful language.)
rdouglass
May 2nd, 2001, 01:41 AM
It probably is 255 'cause you can't have Zero systems, can you? It's like using a 0 based array instead of a 1 based array (for any programmer types). Just a guess but a possibility......
vBulletin® v3.8.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.