- juraj.horvathspecialist
- Posts : 146
Reputation : 8
Join date : 2018-08-07
Age : 44
Location : Bratislava, Slovak Republic
[MODDING] Patient waiting eventhough there are free doctors on clinic
Wed Jun 17, 2020 7:17 pm
Description
Patient (Susan Barkley from save game, red circle in screenshot) is waiting in waiting room eventhough there are several free doctors on clinic (5 free/idle dcotors).
Repro steps
Use save game.
Attached
Proposal of change
Maybe it is not a bug, but I think that free doctor can be assigned to patient instead of waiting. I dig with dnSpy into code and track down problem into Lopital.BehaviorPatient.FindDoctorOrLabSpecialist(bool onlyAssignSpecialist = false) method. I found out that this part of code
After this change, patient (Susan Barkley) is called to new doctor. I tried to run game with this change longer time, I didn't noticed any negative effects of this change. There is also similar code on end of method, maybe this part should be also changed.
Patient (Susan Barkley from save game, red circle in screenshot) is waiting in waiting room eventhough there are several free doctors on clinic (5 free/idle dcotors).
Repro steps
Use save game.
Attached
- save games
Proposal of change
Maybe it is not a bug, but I think that free doctor can be assigned to patient instead of waiting. I dig with dnSpy into code and track down problem into Lopital.BehaviorPatient.FindDoctorOrLabSpecialist(bool onlyAssignSpecialist = false) method. I found out that this part of code
- Code:
if (this.m_state.m_doctor != null && this.m_state.m_labSpecialist == null && this.m_state.m_doctor.GetEntity().GetComponent<BehaviorDoctor>().IsFree(this.m_entity) && this.m_state.m_waitingRoom.GetEntity().IsCharactersTurn(this.m_entity))
{
GameDBRoomType entry = Database.Instance.GetEntry<GameDBRoomType>("ROOM_TYPE_COMMON_ROOM");
if (this.m_state.m_doctor.GetEntity().GetComponent<EmployeeComponent>().m_state.m_homeRoom.GetEntity().m_roomPersistentData.m_roomType == entry)
{
Debug.LogWarning("Wrong doctor seleced for walk-in patient (from common room)!");
}
this.GetCalled(this.m_state.m_doctor.GetEntity());
return;
}
- Code:
if (this.m_state.m_doctor != null && this.m_state.m_labSpecialist == null && this.m_state.m_waitingRoom.GetEntity().IsCharactersTurn(this.m_entity))
{
EntityIDPointer<Entity> previousDoctor = this.m_state.m_doctor;
if (!this.m_state.m_doctor.GetEntity().GetComponent<BehaviorDoctor>().IsFree(this.m_entity))
{
this.FindClinicDoctor();
if (this.m_state.m_doctor == null || !this.m_state.m_doctor.GetEntity().GetComponent<BehaviorDoctor>().IsFree(this.m_entity))
{
this.m_state.m_doctor = previousDoctor;
}
}
if (this.m_state.m_doctor.GetEntity().GetComponent<BehaviorDoctor>().IsFree(this.m_entity))
{
GameDBRoomType entry = Database.Instance.GetEntry<GameDBRoomType>("ROOM_TYPE_COMMON_ROOM");
if (this.m_state.m_doctor.GetEntity().GetComponent<EmployeeComponent>().m_state.m_homeRoom.GetEntity().m_roomPersistentData.m_roomType == entry)
{
Debug.LogWarning("Wrong doctor seleced for walk-in patient (from common room)!");
}
this.GetCalled(this.m_state.m_doctor.GetEntity());
return;
}
}
After this change, patient (Susan Barkley) is called to new doctor. I tried to run game with this change longer time, I didn't noticed any negative effects of this change. There is also similar code on end of method, maybe this part should be also changed.
DocDesastro likes this post
- jan.oxymorondeveloper
- Posts : 2309
Reputation : 336
Join date : 2018-03-23
Re: [MODDING] Patient waiting eventhough there are free doctors on clinic
Mon Jun 22, 2020 4:26 pm
Hi, thanks for the analysis and the proposed change!
Technically this is just an exception from the usual rules, patients that have been already diagnosed try to return to their original doctor to get treatments prescribed. I'll have a chat with the designers if we actually still want this behavior (there have been quite a few changes that prioritize even distribution of patients between doctors).
Btw - the easiest change would be to remove the check for m_diagnosedMedicalCondition in this block in FindDoctorOrLabSpecialist().
Technically this is just an exception from the usual rules, patients that have been already diagnosed try to return to their original doctor to get treatments prescribed. I'll have a chat with the designers if we actually still want this behavior (there have been quite a few changes that prioritize even distribution of patients between doctors).
Btw - the easiest change would be to remove the check for m_diagnosedMedicalCondition in this block in FindDoctorOrLabSpecialist().
- Code:
else if(m_state.m_medicalCondition.m_diagnosedMedicalCondition == null &&
(m_state.m_doctor == null || !m_state.m_doctorAssignedByPlayer))
{
FindClinicDoctor();
}
- juraj.horvathspecialist
- Posts : 146
Reputation : 8
Join date : 2018-08-07
Age : 44
Location : Bratislava, Slovak Republic
Re: [MODDING] Patient waiting eventhough there are free doctors on clinic
Mon Jun 22, 2020 4:49 pm
Hi, I thought that reason for such behavior are usual rules, that patient should return to original doctor. In such case it is not bug, but feature Maybe it could be a game option and players decide what they want. Anyway, I think that your proposed solution with removing m_state.m_medicalCondition.m_diagnosedMedicalCondition == null from condition will not work in all cases. Patient don't have to be diagnosed, he/she can return from examination (X-ray, CT, MRI, USG, laboratories, etc..) without already known diagnose. Now I see that my solution is also not good - I forgot about doctor assigning.
- jan.oxymorondeveloper
- Posts : 2309
Reputation : 336
Join date : 2018-03-23
Re: [MODDING] Patient waiting eventhough there are free doctors on clinic
Thu Jun 25, 2020 9:42 am
Hi - just one more quick update, we'll be making the change on our side in the next patch (and let me double-check the second case you mentioned, I think it worked as expected in the test scenario).
- [MODDING NEED MORE INFO]Patient waiting [forever] for free examination room.
- [MODDING NEED MORE INFO]Can't build ICU and some one always waiting for a Patient Beds
- [RESOLVED DUPLICATE] Doctors not doing work / Patients waiting in waiting room until leaving at 18:00
- [RESOLVED?] Doctors not doing work / Patients waiting in waiting room until leaving at 18:00
- [NEED MORE INFO] Long time waiting for a bed - bed free and nurse seating
Permissions in this forum:
You cannot reply to topics in this forum