- Dec 14, 1999
- 22.085
- 263.906
Originally posted by szopen76
Well, let's see. About 500 provinces, each one has data for name (say string 32 bytes or so), population(integer or long so either 4 or 8 bytes), nationalism (byte), tax base (byte), ownership (probably pointer, so say 4 bytes), manpower (float, so 4 bytes)), available manpower (4 bytes), supply limit (i guess 4 bytes) , event effects, improvements. So you have 60 bytes at least per province. so 3000 bytes for province data alone.
NOw the states. each state has a name (say 32 byte) list of provinces (probably pointer, so 4 bytes each - say 4 on avg, so on avg 16 bytes) and relationships with others (float per state) - let's say there is 100 states, so relationships 400 bytes. Add list of armies, each with morale, name, leader, infantry, artillery, cavalry - about 100 bytes per army. Add ruler with 3 skills, name, begin and end - about 50 bytes at least. Add inflation, tech levels (six?) and investition in tech level so say 34 bytes. Add list of known provinces, say its char[500] so 500 bytes or province * and avg 400 bytes. Reputation 4 bytes should be enough. 1136 in total?
So states should occupy about 113600 bytes.
So, the data alone should occupy at least 116200 bytes, that is about 116kb.
I guess the event engine really takes the most memory. You have to keep events in the memory, keep lists for effective searching them and evaluating, each event had description, effects, condition and they are lot's of them - and for speed they all are in memory. Say 1000 events with 1kb each (desc takes most of the place, i say 1000 chars is conservative estimation) and you get 1mb at least.
Add graphics and it still wouldn't say why it get so much memory.
Any other ideas ? Did I forgot about something?
Thats not really entirely true..
The province and country datasizes is a tad bit bigger, (by a factor of 10), but that alone is irrelevant.
What takes data and processing powers is the countryXcountry information, and the countryXprovince information.
[200 countries, 1600 provinces] 1600x200 takes a bit of memory.
3dgames usually have alot less information to handle, and the high demands there is purely for the artwork. (I've coded large 3d games as well.)