|
|
|
|
|
May 9th, 2001, 01:06 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Feb 2001
Location: Waterloo, Ontario, Canada
Posts: 11,451
Thanks: 1
Thanked 4 Times in 4 Posts
|
|
Re: Could someone explain:
No, its CS 251
__________________
Things you want:
|
May 9th, 2001, 01:14 AM
|
Corporal
|
|
Join Date: Dec 2000
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
I don't get your math, your saying for 8 bit numbers, it's 280KB but for 16bit numbers it's 70MB? Your only doubling the # of bits required so You should be 560KB not 70MB...right?
quote: Originally posted by LemmyM:
i think it's about mem usage
let's do a little math :
suppose you have 255 systems
each system can have a name, i don't know the max. characters for a name, but i haven't seen them larger than 32, that is 32 bytes for the name
on average a system has about 10 planets, some have no planets, and some have as much as 15
a planet has three resource values, mineral, organics and radioactives, i haven't seen those above 255%, so one byte per resource would be enough, that is 3 bytes.
a planet also has a atmosphere and type, there are three type, Gas, Rock and Ice
and 5 (?) atmospheres, Oxygen, Hydrogen, Methane, Carbon Dioxide and None. thos could be fitted in 1 byte
then there is the population 4 bytes (common int)
population growth 1 byte
the buildings build on a planet, they could be references to an array in which all the buildings are stored, if so, there is a maximum of 25 (?) buildings on a huge world, that would mean 25 indices, or 25 integers, that is 100 bytes,
a sphereworld can hold 200 buildings, but that is an exception
then there are the ships and units and such but i don't have time include them right now
so for just a galaxy with 255 systems with on average 10 planets per system, you would use
287232 bytes = 280 kb
that ain't much, but suppose you use a 16 bit number for the systems instead of an 8 bit number, then it would be
73531392 bytes = about 70 mb
maybe i'll include ships and units later, or someone else could do it..
[This message has been edited by LemmyM (edited 08 May 2001).]
------------------
Regards,
KiloOhm
__________________
Regards,
KiloOhm
|
May 9th, 2001, 01:26 AM
|
Second Lieutenant
|
|
Join Date: Mar 2001
Location: Netherlands
Posts: 479
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
quote: Originally posted by KiloOhm:
I don't get your math, your saying for 8 bit numbers, it's 280KB but for 16bit numbers it's 70MB? Your only doubling the # of bits required so You should be 560KB not 70MB...right?
if you have 8 bits then you have 2 to the 8th possible numbers, that is 256
if you have 16 bits, you have 2 to the 16th possible numbers, that is 65535
so it's not just twice as much, the difference in bits is 16 - 8 = 8, so it is 2 to the 8th times as much
and 70 mb is of course the maximum, if you actually have 65536 systems in a map
[This message has been edited by LemmyM (edited 08 May 2001).]
__________________
[Boo!]
|
May 9th, 2001, 01:30 AM
|
Corporal
|
|
Join Date: Jan 2001
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
Each entry has a size of one system (planets, populations, values etc.)
so the size of a 16 bit system list would be a lot bigger than twice. It's 2 to the power of 8 times larger (in fact 256 squared).
It would be possible to scale up by factors of 2 but this would require a fair bit of coding just to check how big the system list is every time it parses it.
Bearing in mind I get a noticable pause when looking at my shiplist when there's more that 150 or so entries, a larger galaxy could bring the program to a grinding halt.
And yet again while i'm typing, someone else has already answered.
[This message has been edited by jimbob55 (edited 08 May 2001).]
|
May 9th, 2001, 06:08 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Dec 2000
Location: USA
Posts: 15,630
Thanks: 0
Thanked 30 Times in 18 Posts
|
|
Re: Could someone explain:
Thank god, I thought it was Basic Cobolt 101 with a bit of C, not C++. I was getting confused. Often happens after:
10 cls
20 print "WTF"
30 input = x
40 print "enter your name"
50 print x
60 Print "you just froze up my pc."
__________________
Creator of the Star Trek Mod - AST Mod - 78 Ship Sets - Conquest Mod - Atrocities Star Wars Mod - Galaxy Reborn Mod - and Subterfuge Mod.
|
May 9th, 2001, 11:48 AM
|
Second Lieutenant
|
|
Join Date: Mar 2001
Location: Netherlands
Posts: 479
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
quote: Originally posted by klausD:
Especially because the entire data of the different sectors have not to be in RAM the whole time, (because only one sector is active in RAM at the same time) it could be a resource saving method. On the other hand the universe could be nearly infinite. (depending rather on HD-space than RAM)
but then how do you calculate what the AI is doing in the different sectors, if the sector is stored on hd, then after each turn one sector should be saved, another one loaded, let the AI take their turn, and load the next sector
or am i missing something
[This message has been edited by LemmyM (edited 09 May 2001).]
__________________
[Boo!]
|
May 9th, 2001, 12:31 PM
|
|
General
|
|
Join Date: Mar 2001
Location: UK
Posts: 4,245
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
Does anyone recall Frontier: Elite II? That came on 2x 1meg floppies and the map size on there was ridiculous. There were (literally) millions and millions of systems.
Once I jammed my cursor keys down on the system map and went away for a while. When I got back it had reached grid -1124, 295 or something, and it had still only moved a few pixels on the (full screen) galactic map. To put that to scale, each grid reference had maybe half a dozen 3D systems in. Only the nearest few hundred grid references actually stored system information other than the word "unexplored" but the amount of information was mind blowing.
When I reloaded the game another time and checked back, though, the system data was exactly the same (even at -1124, 295), so if it was generating the systems dynamically, it wasn't doing it randomly. It *must* have been generated on the fly by some kind of fractal routine. Veeeery clever. Shame the rest of the game was so buggy.
------------------
"Pinky, are you pondering what I'm pondering?"
"Uh, I think so Brain, but how are we gonna teach a goat to dance with flippers on? "
|
May 9th, 2001, 02:55 PM
|
|
General
|
|
Join Date: Mar 2001
Location: UK
Posts: 4,245
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
Interesting. Not much good for SE though, sinc once the map is generated you *still* have the problem of how to manipulate it all in memory.
------------------
"Pinky, are you pondering what I'm pondering?"
"Uh, I think so Brain, but how are we gonna teach a goat to dance with flippers on? "
|
May 9th, 2001, 03:20 PM
|
Corporal
|
|
Join Date: Jan 2001
Location: Newport News, VA
Posts: 125
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
quote: Originally posted by askan:
This is because random numbers on computers aren't really random. There is just a huge lookup table full of numbers and each one comes out in order. The 'seed' is what is used to work out where you start in that table.
If you use the same 'seed' you'll always get the same numbers in the same order.
Usually, it's not really a table. Most Random Number Generators perform a series of mathematical operations on the seed, generating a "random" number and a new seed. So if you start with the same seed, as askan said, you get the same series of random numbers. Tables of random numbers exist, but, if you are using billions of them, it's a lot easier to generate them on the fly.
|
May 9th, 2001, 08:17 PM
|
|
Sergeant
|
|
Join Date: Jan 2001
Location: Northern Virginia, United States
Posts: 203
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Could someone explain:
LemmyM:
AFAIK, the AI would behave the same, because it works on a case-by-case basis and not as a 'look at the empire as a whole' thing. But I think I know what you mean...the AI on one Quadrant map wouldn't know that it also existed on the other Quadrant map...they'd be the equivalent of Neutrals stranded in their own system.
Either way, thinking about it, I have enough problems securing 250 systems as is. Try conquering without glassing worlds...it rilly drags it out and forces you to keep supply lines!
zen
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|