 |
|
heardie
|
|
If I can do it any-one can!
Here is a little bit of a disease model demo that I am working on. I am aware that it is not needed, I was just bored.
Anyway, Amjayee or someone else with C++ experince, please critque, espically my use of Classes. It is not such much what the program does, but how the classes work. Is it all good? I am no sure how to add other modifiers now, ie. incubation, Deoendance od Environment, etc, but I will experiment.
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Ehh, where is it?
Sorry, for my ignorance, I would really like to see this demo, but I don't know where to find it........
------------------
"I chose not to choose life. I chose something else."
- Trainspotting
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Thanks. I will check out the sourcecode as soon as possible.
------------------
"I chose not to choose life. I chose something else."
- Trainspotting
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
The sourcecode looks really cool, Heardie.
But how come the program closes itself automatically just after being opened, if you don't open it from inside the compiler? I tryed opening my pop model (it's done - check the pop model thread) outside the compiler and the same thing happened. What can we do to avoid this, Amjayee?
------------------
"I chose not to choose life. I chose something else."
- Trainspotting
|
|
|  |
 |
|
heardie
|
|
Ah, yes thanks for reminding me. The file is now almost complted. I wrote in the readme that it was completed but I forgot to do Dependance of Environment variable. Anyway, the file is updated at the address listed above.
Joker
--------------------
Well the program from a Dos window. it is because when the program finishes, it is done, and has no more info to display, but in DOS all the old info still shows.
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Is there a way to stop it? Keep the windows opened untill the user shuts it down?
------------------
"I chose not to choose life. I chose something else."
- Trainspotting
|
|
|  |
 |
|
heardie
|
|
not that i know
just view it is dos
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Thanks, Amjayee.
Anyway, it's not really a big deal with my post count. But I guess I should mail someone sooner or later.
------------------
"I chose not to choose life. I chose something else."
- Trainspotting
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Hi Ramo!
Great to see you here again. And thank you for that programming trick.
------------------
Vote Gore. For the sake of people, not god.
GGS Website
|
|
|  |
 |
|
Ramo
|
 |
Austin, Texas, USA
Oct 1999 time: 23:14
|
|
No problem, Joker.
BTW, I also have some suggestions for the model (sorry if I'm repeating comments from earlier ). Basically, an interesting pheonomenom happens when a city's population reaches a threshold of ~200,000 people. If this city comes in contact with a disease (that isn't too lethal), it will keep the disease in circulation forever. It eventually becomes a "child-hood disease" (think measles and small pox). That means infant/childhood mortality would significantly increase, but would not be disastrous to the civilization (besides the fact that kids have better immune systems than adults, kids play a much less significant role in keeping a society together and less resources are "wasted"). Besides, genetic resistances would be built up, and the disease would slowly lose effect.
On the other hand, if a smaller city or village has a run-in with a disease, it gets the majority of the population massacred, and keeps on getting massacred every time it connects with the disease. In addition, many of these people would be vital to holding the civ together, and the civ would subsequently collapse.
To go off on a related tangeant, religious values can affect the course of diseases (and vice-versa). For example, during the first and second centuries, a huge trading network was established between Rome, the Middle East, India, and China, for the first time. In Rome and China, the casualty rates from disease were horendous (Indians and the Middle Easterners, presumably, were more disease resiliant than the Romans and Chinese). In Rome, people were exposed to small pox and the measles for the first time (come the 6th century, it was exposed to the bubonic plague) - unfortunately, the disease info for China is a little more vague, but presumably, they were affected by the same diseases. Both times, the rates were around 1/3 of the population! In addition, Rome had the unlucky proposition of being all along the Mediteranean, and therefore exposed to trade. The smaller cities, therefore, were continually exposed to diesease, and their populations eroded. China faced a similar phenomenon. To go off in another tangeant, this, IMO, caused the collapse of Rome. The interesting thing (if that wasn't interesting enough ), is that both civs converted to a different religion during this era. At approximately the same time, China accepted Buddhism and Rome accepted Christianity. This was probably because these religions advocated helping the unfortunate, decreasing casualty rates greatly. In addition, these religions preached a benevolent God (relatively speaking, of course), reducing psychological agony over the fear of death and the death of relatives.
Errrmm.. uhh... that's all for now ...
|
|
|  |
 |
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Cool demo, Heardie! But one thing: It crashes if you ask for the stats for HIV. Otherwise it's great.
But now for something completely different:
I have been thinking a lot about disease and population lately, and I think we should start working on excactly how to implement diseases in the game (and on the map in particular).
I think we should consider whether to have diseases modeled at a province or at a hex level. The latter is more realistic, and it has some very clear advantages. But on the other hand it has some large disadvantages. These are mainly the calculations required by the computer. There must be a lot of diseases in the game - possibly over 50 - to get it to work properly, and not just have diseases be an unfortunate random event. Diseases must be a completely integrated part of the game, and should have an important role right from the start to the end. And if each hex has 10 diseases on it, with 10 age groups and 1,000,000 hexes this will require 100,000,000 calculations each turn! I don't know if this is too much, but it sure seems like it. And it is not like it has a huge effect on gameplay that diseases and mortality is calculated on every hex.
Therefore I am thinking about what to do to reduce this.
I agree that handling diseases on a province level is pretty much unacceptable, since it means too much inaccuracy.
So what do we do?
I have been thinking about doing it something like this:
First diseases are handled hex by hex, but not including age groups. It would be done simply via Heardie's formula (although I have a few comments and suggestions for it, which I will post later on - first I think we should settle this). Then the total mortalities of all hexes in a region is found, and this gives a mortality percentage for the province. This is then put into some formula that depends on the medical tech level (and maybe a few other things), and this creates a mortality for each age group. The amount of dead people is now calculated in each age group, and the total amount is found. This, however, doesn't have to be the same as the amount found before, cause if there is more old people than there "should" be in the province then the amount will be higher. Finally the new mortality rate is divided with the old mortality rate, and this number is multiplied with the mortality in each hex, to find the actual mortality of each hex, and the new pop in each of them.
So, is this system any good? it should reduce calculations required drastically, and it includes both hex mortality and age group mortality. The downside of it is, that the age mortality is now only a "pro forma" mortality, since it only depends on total mortality and tech level, and is not calculated by it self.
And it might very well be really dificult to calculate the age group mortalities at different tech levels and make the result into a function that can be handled by a computer. But we have to do that anyway, so that shouldn't be an issue here.
So, is this any good?
(NOTE: Now that I think of it I am clear that this should in stead be in the pop model thread, but I'm just posting it here anyway)
------------------
"It would sharpen you up and make you ready for a bit of the old ultra-violence."
- A Clockwork Orange
GGS Website
|
|
|  |
 |
|
heardie
|
|
Okay, Jokre I'm thinbk about those ideas but I am not sure why your program crashed. Mine doesn't....
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Hmm... Weird. But it doesn't really matter. What is important is, that we can have a disease model that works, not whether some demo crashes.
------------------
"It would sharpen you up and make you ready for a bit of the old ultra-violence."
- A Clockwork Orange
GGS Website
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Just a question it is pretty nice to know when thinking out functions for the game:
How many (simple) calculations is a modern computer capable of do per second?
------------------
"In America, first we take the sugar, then we take the power, then we take the women!"
- Homer J. Simpson
GGS Website
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
The computer's speed is measured in clock cycles, as you know all. 700 MHz means 700,000,000 clock cycles per second. On each clock cycle, it is possible to perform one simple macnine-languge instruction, but usually several clock cycles are needed. What this means with C language intructions, it depends. But anyway, I think the machines of today can make at least some 100,000,000 simple mathematical calculations per second. I think your concern is how long it will take to perform the calculations our models need. That's also my concern. I think we should at some point, when the models are ready, estimate how large situations they would need to handle, and then test how long it would take to make that amount of cycles.
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Thanks. So basically we shouldn't worry too much about having too many calculations? Anyway, if we can have econ stuff take 1 second and have pop things take 1 second, then things wouldn't really take too long.
------------------
"In America, first we take the sugar, then we take the power, then we take the women."
- Homer J. Simpson
GGS Website
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
Well, I think memory usage will be a bigger problem than cpu usage, yes. I'm sure we can optimize the algorithms to make the response times sensible. About the speed of performance, the largest load will come from AI, but that we can fight by letting AI think during th human player's turn. 1 second might be good guess in average world for economy, don't know yet. Hopefully it will not be much longer. What do you think would be a sensible response-time when you hit end turn? 10 seconds maximum in all situations? I mean, there will be thousands of turns, so...
About memory; map will be quite a monster in hogging it. But we can handle that by reducing map size, if needed. And graphics in general will require quite much memory. But I'm sure we will handle that when that time comes.
[This message has been edited by amjayee (edited November 17, 2000).]
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
So we have to store all game informations in the RAM?
Then I supposted you're right. We decided to have map hexes be 50 kms across, right?
This means each hex has an area of some 1400 sq kms, and that means a little over 1,000,000 hexes on an earth map. We should keep the possibility to choose the size of a hex, and then have all other variables (unit movement, disease spread etc) be adjusted.
I don't know about the hex properties, but we will propably need 2 bytes or so for the terrain. But what are we going to do about pop in each hex? It should be possible to have pops of several million in each hex, and that would mean about 3 bytes to handle population. That would mean 5 MBs for the map alone, though. Is this too much?
Then comes all the province and civ data, but since the amount of provinces and civs is pretty limited this shouldn't be much of a problem.
And I agree, about 10 seconds per turn seems reasonable. But if the AI does it thing simultaneously with the player then maybe we wont even need that much.
------------------
"In America, first we take the sugar, then we take the power, then we take the women."
- Homer J. Simpson
GGS Website
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
About map size; tile properties take 2 bytes. If we use unsigned long for population, we get some 4.3 billion people, which should be enough, and it would take four bytes (one dword). Diseases and such would rise that figure somewhat, I hope we can have less than 10 bytes all in all. And yes, the map will take the most memory, so we don't need to worry about the other things as much. Populations and regions will take quite much space, but since there will be only couple of hundred of them at maximum, that's not a problem, at least compared to the map.
Map drawing info will take much more space, but I hope I can make a system, where this info is stored only for the visible map area, which should decrease the amount.
I don't like much having a varying tile radius. But we will see. We perhaps should find out the reasonable map size and then decide the tile radius based on that.
|
|
|  |
 |
|
Guildmaster
|
|
Up your butt and around the corner
Jun 2000 time: 05:14
|
|
I hope that doesn't mean we're limiting the world population to 4.3 billion...
I think that since we're going to take the game to at least as far as the current tech level of today's world which houses more than 6 billion, and we're taking that further... I think IF we put a limit on world population it should be upwards of 25-30 billion, that would be assuming we are limited to this world. I see no reason to limit population to even that, especially if we're going to be colonizing other worlds...
------------------
How will you make it if you never even try?
-Macy Gray
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
No, I was talking about tile population. Well, perhaps we will have to create some custom system to store 3-byte integers, for one tile 4 billion just might be too much. With that, if we have 1,000,000 tiles we could have 4,200,000,000,000,000 people in the whole world! Well, of course not every tile would have that many people, and some of them would be ocean. But seriously, with 3 bytes, we get about 16 million per tile. For region, civ and world population we will also need special storage types so we will not reach the upper limit very easily. With 5 byte integers, we can have numbers up to about 1,100,000,000,000 which should prove enough even for the population of the whole Universe!
[This message has been edited by amjayee (edited November 21, 2000).]
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Isn't it possible to to have more than 3 and less than 4 bytes for hex pop?
Having 4 would be a waste of space, but 3 might be too little, especcially in sci fi scenarios with huge cities. So why not 3 bytes and 2 bit = 26 bit? That would give us 64 mio people per hex, which should be enough.
------------------
"In America, first we take the sugar, then we take the power, then we take the women."
- Homer J. Simpson
GGS Website
|
|
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
|
|
Forum 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
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|