sadger / CorsixTH

Open source clone of Theme Hospital
Other
1 stars 0 forks source link

Epidemics don't spread #9

Closed MarkL1961 closed 10 years ago

MarkL1961 commented 10 years ago

I have tried to expand the "who can be infected" a little by creating a function that returns true if the contrate does not equal 0 (trying to limit it to the diseases that are already inline for infection). That has not really helped, so what I might try next is expand on that idea by returning all non-visual diseases. It might well be that I am not calling it from the right place though. I'll let you know if I see any improvement/increase in victims tonight.

MarkL1961 commented 10 years ago

I changed my function to this last night

 function Epidemic:canBeInfected()
 local config = self.world.map.level_config
 local expertise = config.expertise
 local disease = patient.disease
 local visual = level_config.visuals
 if visual then
 return true
 end
 end

I did notice that on my next epidemic that the one victim did pass it on to someone whilst he was waiting for the pharmacy. However when the fax came later he was not counted, that could well be my hack not being complete enough though. I will continue testing to see if I can get multiple victims. One concern I have with my hack is that the newly infected patient did not change his disease, again my hack may need more doing to it to fully work.

sadger commented 10 years ago

Is this issue the same as #1 ?

Your code simply returns true if the config has a visuals section, nothing to do with the disease. There does need to be some modification of the new infected patients disease, i've had a few ideas about this already.

I will have a look at this either today or tomorrow I think I will restrict the game to having one epidemic and no background epidemics so we can try and keep track of them while we are testing then if they work we can make multiple epidemics happen. Think this is a good idea?

MarkL1961 commented 10 years ago

Good point about #1 I overlooked that.

My code does that at the moment, at first it was return true if contrate was >0, but I wanted to increase the possibilities for spreading the infection more. I have also tried doubling the spread rate factor, not helped so far :(

I like the idea of limiting the number of epidemics as it will make it easier to see what is going off and I can then use the bug icons toggle without it being confusing

MarkL1961 commented 10 years ago

I am using your new branch and it is proving very useful. In the attached pic you can see even in a crowded space there is no spreading. The epidemic is not revealed yet and I have the toggle on to see who is infected. 5

MarkL1961 commented 10 years ago

After many months of them going back and forth between rooms the epidemic is revealed. Odd thing is the patients were 100% diagnosed long before the declaration and they carried on going to more diagnosis rooms. Even now the one where it was declared was sent to the pharmacy she waited a bit and is now going back to the GP. 6

MarkL1961 commented 10 years ago

Now the other one was going to go to the ward again, so I clicked on guess at cure and now he is waiting to see the GP again. I don't have diag ramped up or anything. This is with the experimental branch.

MarkL1961 commented 10 years ago

Even more odd he was then sent to the blood machine, after that he left cured!

I am going to abandon this game now as I have far too many patients to keep track of things. Might just hang on for the fax as that is going to be interesting now with this and the fact the other patient died waiting for that GP.

sadger commented 10 years ago

Hmm interesting, I recently changed the behaviour of some of the code to do with sending people back to the GP changes here https://github.com/sadger/CorsixTH/commit/6d1acb5ed779c468958bb115d9b420b2ef1ad573 but it shouldn't do it if they are already diagnosed. I will check this again now to see if I caused any inadvertent bugs with my fiddling.

This code is the problem, I check only for diagnosis rooms not treatment rooms so they go back to the GP infinitely! Ha ha. I'll change the code so it fixes this :/

sadger commented 10 years ago

Right if you update your repository or re-download it should fix the issue of the patients keep returning to the GP. Let me know if not.

MarkL1961 commented 10 years ago

I did not see the same behaviour last night, so that fix seems to have done the trick.

Still not seeing any spreading of the infection though. I watch for them arriving and follow them around the hospital and despite it being crowded and them sitting next to others there is no passing on of the epidemic. So with just the one victim and sometimes two, by the time you get the fax they are already on their way for the cure.

Also noticing that nurses remain in their rooms even if there is no queue to deal with instead of doing the vaccinating. If I hire a new one or pick one up, they then wander around; otherwise they stay in the room they are in.

sadger commented 10 years ago

Ah, i'm glad that fix did it.

I am going to go ahead and start infected patients changing the disease of others assuming they are non-visual. We should definitely see a fair amount of spread in this case, maybe even too much, then we will just need to tweak the infection rate (hopefully).

I discussed this before with someone, in the original nurses don't really go out of their way to vaccinate people so I wouldn't expect nurses to leave their rooms, rather leave it to the player to redistribute the nurses. I guess I could implement it but it might make vaccination a bit too passive.

MarkL1961 commented 10 years ago

I think it was me and Stephen. We seem to have different memories of what used to happen and I sort of prefer the way it is now as it used to be a pain if the epidemic was pharmacy based and the nurses were all wandering around the corridors or if you had one that was waiting for the ward. In the guide it says Any spare Nurses then charge through your Hospital, attempting to reach and vaccinate each marked infected Patient. The Patient who should be vaccinated next is indicated by an arrow above his or her head. Vaccination prevents Patients spreading the disease further but they still have to be cured.

so a mixture of what we both remember. I think by spare nurses it is those wandering around or in rooms with no queue or expected queue.

sadger commented 10 years ago

Ah yeah that was it.

In terms of the hospital how would the nurses know about having to leave the rooms to vaccinate? There is no call to do so. Maybe this is why it's only the nurses that are outside "notice" they must vaccinate if the patient is close. They can't see through walls :P. One compromise would be to make them leave the room if a patient is say less than 10 squares away outside but it seems somewhat unnatural.

sadger commented 10 years ago

Unless say the nurses are "told" about the epidemic and leave their rooms when they are not free (not necessarily when they see a patient) but where do they go when they leave?

MarkL1961 commented 10 years ago

I think they hear the announcement and start to wander the corridors looking for those that have been marked for vaccination, but only if they are not already dealing with someone.

How do the handymen know where there is litter? Although litter does keep still!

sadger commented 10 years ago

Hmm, I guess so. If they leave the rooms then they probably would want to follow the patients around, which I have not implemented after a fight with the action queue. Maybe make a new issue about this as it's not immediately necessary to tackle until we get the core epidemic sorted.

MarkL1961 commented 10 years ago

If we can get more than one patient as a victim I might have the time over the holidays to take a look at adding a method of them wandering the halls like the handymen do and as the come across those in need of vaccination they can then do that.
Like you say though, number one task at the moment is getting the core epidemic sorted and bug free

sadger commented 10 years ago

So @MarkL1961, it is time! I have implemented and pushed to the repository and experimental (and naive) infection and changing of diseases in an attempt to get a decent epidemic. I also take into account the spread factor as defined in the config. It seems to be improving the numbers considerably from a few tests I did. You will have to start a new epidemic (no saved epidemics) to test this as I changed some initialisation stuff

Additionally I have disabled all epidemics for those patients with visual diseases (unless you use the cheat), so don't worry if it takes a bit longer for one to turn up.

If you are testing I would really like to know if there are an noticeable issues in changing non-visual diseases and what the number of infected and difficulty is like.

sadger commented 10 years ago

Do you think the spreading is working correctly now for single epidemics? Is it spreading the right amount or too little/much?

MarkL1961 commented 10 years ago

I think it now spreads too quickly and I have done a patch to try and reduce its effects. I also have some concerns about having multiple epidemics in the background as this might make it a nightmare in the gameplay.

sadger commented 10 years ago

It does spread pretty quickly it's true, but the infection is true to my understanding of the config. I'll try merge some of your patches and fixes now I have time, then we can close some of the issues and try tweak them so they work nicely.

MarkL1961 commented 10 years ago

I think the reason they spread quickly is to do with how often the chance is. My patch takes into account the ticks so as to reduce the chances and it seems to work out nicely. For the medium game it is 25 in 100 or put another way 1 in 4. If however it is 1 in 4 50 times a minute and it will pass to the neighbour every time.
If you use the window github software you should be able to open my branches without merging. I cloned yours when I should have created a fork, so my changes (branches) are in your account and not mine - sorry.

sadger commented 10 years ago

I did change the spreading of epidemics to try and get it a little closer to the 1/4 infected, are you making sure you are on the latest commit when you are doing this testing, it's important we are working from the same code or we will get different experiences :P.

I am not using windows but I am away how to checkout branches. I'll close anything I don't need in my repo, no worries, just try not to touch the main branch :D

sadger commented 10 years ago

They definitely do spread now so this issue can be closed. Maybe we should open a new one about spread balance.