Jump to content
bama1234

Montana Mod v2.5 RELEASED

Recommended Posts

Has anyone discovered the source of the terminal lag with this mod? I've yet to find the source, though I'd like to try and fix it if anyone can help point me in a good direction.

They said that a fix will hopefully be in the next patch.  I believe that the team has found the issue, but correct if I'm wrong...

Link to comment
Share on other sites

Has anyone discovered the source of the terminal lag with this mod? I've yet to find the source, though I'd like to try and fix it if anyone can help point me in a good direction.

 

We think it might possibly be coming from the unit or command icons, for whatever reason, if you want to start there.

 

Does anyone know if the next patch will have a MPVFD water tanker unit?

Probably not.

 

When does the patch comes out to fix the bugs?

TBA. Probably a matter of a few months.

Link to comment
Share on other sites

We think it might possibly be coming from the unit or command icons, for whatever reason, if you want to start there.

 

 

I think there must be an object on the map with unreasonable physics or something; it's just a matter of locating it. I decided to do a little experiment by removing all the units and GUI that you had created and replacing it with LA MOD units, GUI and specs just to see what would happen. When I did this, I no longer got lag while clicking the vehicles, however the lag did terminally seem to get worse as if a loop of some kind was generating gradually tougher problems for the computer to solve, which led me to believe it was one of two things: A bugged object in the map somewhere with unreasonable physics, or a broken "FOR" loop in one of the custom scripts, though I've yet to confirm either one of my theories. If I'm able to solve the issue, am I free to release whatever files does the trick?

Link to comment
Share on other sites

I think there must be an object on the map with unreasonable physics or something; it's just a matter of locating it. I decided to do a little experiment by removing all the units and GUI that you had created and replacing it with LA MOD units, GUI and specs just to see what would happen. When I did this, I no longer got lag while clicking the vehicles, however the lag did terminally seem to get worse as if a loop of some kind was generating gradually tougher problems for the computer to solve, which led me to believe it was one of two things: A bugged object in the map somewhere with unreasonable physics, or a broken "FOR" loop in one of the custom scripts, though I've yet to confirm either one of my theories. If I'm able to solve the issue, am I free to release whatever files does the trick?

Yes.

 

When does the patch comes out to fix the bugs?

If the moderators see this, they might give you a warning point for asking for a release date. Please be warned.

Link to comment
Share on other sites

Hey bama and itchboy, this was posted on an Emergency 4 facebook fan group. I thought you guys would like to see it.
 

just got the Montana mod I love the crap outa it it's so realistic reminds me of my hometown paged the guys to the station and I thought my pager was going off they both have the same tones
Link to comment
Share on other sites

Yes.

 

If the moderators see this, they might give you a warning point for asking for a release date. Please be warned.

 

 

Only after you run it through me first for approval. 

 

Those are all interesting theories and definitely possible, things we're looking in to. 

 

mwgUyYE.png

MTVolunteerScript.script

 

Not too familiar with C++, but if it's anything like Python, Java, or JavaScript, there needs to be an integer setting and a variable that's announced to the script before the semi-colon in the beginning of the statement.

 

E.g: for (int i=0; i < MAX_VOL; i++) 

 

Honestly haven't got the foggiest idea if that'd be the problem, but it's worth the exploration. 

Link to comment
Share on other sites

mwgUyYE.png

MTVolunteerScript.script

 

Not too familiar with C++, but if it's anything like Python, Java, or JavaScript, there needs to be an integer setting and a variable that's announced to the script before the semi-colon in the beginning of the statement.

 

E.g: for (int i=0; i < MAX_VOL; i++) 

 

Honestly haven't got the foggiest idea if that'd be the problem, but it's worth the exploration. 

Hmmm..in our C++ classes, we were told that we didnt need to include a initial value if we already had the integer value or counter declared already.

 

The counter in that loop has already been defined as a global variable so re declaring it in the loop would mess it up each time the loop was entered.

 

Lets keep this public so that we can "crowdfund" the fix for the mod and bring out some of the talented scripters on the site.

Edited by randomperson139
Language removed. Please avoid in future.
Link to comment
Share on other sites

Hmmm..in our C++ classes, we were told that we didnt need to include a initial value if we already had the integer value or counter declared already.

 

The counter in that loop has already been defined as a global variable so re declaring it in the loop would mess it up each time the loop was entered.

 

Lets keep this public so that we can "crowdfund" the fix for the mod and bring out some of the talented scripters on the site.

Ahh, that makes sense. Does the semi-colon still need to be there in C++? Usually that's used to end a statement, seems like that could equally mess the thing and make it confused. I figure it almost has got to be a for loop causing the terminal lag because when playing the mod, the lag worsens with time, it's not just always bad, so it seems like it must be something that duplicates with time, such as a botched for loop. Though, there are so many scripts it's really hard to tell where it's coming from... I'm thinking my next test will be process of elimination, I'll take one of the custom scripts out each time I run it and see what happens. It'll take time though lol.

Edited by randomperson139
Again, language removed.
Link to comment
Share on other sites

Ahh, that makes sense. Does the semi-colon still need to be there in C++? Usually that's used to end a statement, seems like that could equally mess the thing and make it confused. I figure it almost has got to be a for loop causing the terminal lag because when playing the mod, the lag worsens with time, it's not just always bad, so it seems like it must be something that duplicates with time, such as a botched for loop. Though, there are so many scripts it's really hard to tell where it's coming from... I'm thinking my next test will be process of elimination, I'll take one of the custom scripts out each time I run it and see what happens. It'll take time though lol.

There are several custom scripts running in the mod. One, you have the Stop sign script, the other is the night sound script, third is the fire hydrant script. Two of those are by bma, the hydrant is by me. Try checking those because those are the most likely suspects.

 

In Em4, if a loop in a script such as the one you posted does not terminate, the game crashes. Stack overflow I guess.

Link to comment
Share on other sites

Also check this issue with ATF person I found this in the log file playing the game. CTD when tried the AFT unit. 

 

 

|Model contains 3666 vertices, 1536 polygons, 20 bones, 0 muscleanimframes

?ERROR: Unassigned vertex 367 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent. 

?ERROR: Unassigned vertex 3659 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3660 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3661 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3662 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3663 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3664 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3665 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

?ERROR: Unassigned vertex 3666 found in dynamic model mod:Models\Persons\03 LA Police\atf_agent.

|Fixing invalid blended vertex weightings for model mod:Models\Persons\03 LA Police\atf_agent!

 

 

 

Link to comment
Share on other sites

There are several custom scripts running in the mod. One, you have the Stop sign script, the other is the night sound script, third is the fire hydrant script. Two of those are by bma, the hydrant is by me. Try checking those because those are the most likely suspects.

 

In Em4, if a loop in a script such as the one you posted does not terminate, the game crashes. Stack overflow I guess.

 

Lines: 380 -> 461 in the script: "MTVolunteerScript"

 

if(ChildID == 0)
{
if(p.HasName(NAME_PERSON01))
{
VehicleList vl1(NAME_CAR01);
for(int j=0; j < vl1.GetNumVehicles(); j++)
{
car = vl1.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON02))
{
VehicleList vl2(NAME_CAR02);
for(int j=0; j < vl2.GetNumVehicles(); j++)
{
car = vl2.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON03))
{
VehicleList vl3(NAME_CAR03);
for(int j=0; j < vl3.GetNumVehicles(); j++)
{
car = vl3.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON04))
{
VehicleList vl4(NAME_CAR04);
for(int j=0; j < vl4.GetNumVehicles(); j++)
{
car = vl4.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON05))
{
VehicleList vl5(NAME_CAR05);
for(int j=0; j < vl5.GetNumVehicles(); j++)
{
car = vl5.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON06))
{
VehicleList vl6(NAME_CAR06);
for(int j=0; j < vl6.GetNumVehicles(); j++)
{
car = vl6.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON07))
{
VehicleList vl7(NAME_CAR07);
for(int j=0; j < vl7.GetNumVehicles(); j++)
{
car = vl7.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON08))
{
VehicleList vl8(NAME_CAR08);
for(int j=0; j < vl8.GetNumVehicles(); j++)
{
car = vl8.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON09))
{
VehicleList vl9(NAME_CAR09);
for(int j=0; j < vl9.GetNumVehicles(); j++)
{
car = vl9.GetVehicle(j);
}
}
else if(p.HasName(NAME_PERSON10))
{
VehicleList vl10(NAME_CAR10);
for(int j=0; j < vl10.GetNumVehicles(); j++)
{
car = vl10.GetVehicle(j);
}
}
It looks as if its continuously cycling and once the condition is met, for example car = vl10.GetVehicle(j) it doesn't break the loop. Although, I haven't looked at the memory usage during the time when this script is called, I suspect this is probably the/one of the issues.
Link to comment
Share on other sites

Lines: 380 -> 461 in the script: "MTVolunteerScript"

Hmmm...sounds like a possibilty, because it constantly declares the Vehicle variable "car" each time the loop iterates. It makes use of the same variable all through out for sake of not having to create 10 different variables. The number of VehicleLists is also another possibilty since the game has to search for the specific vehicle x number of times depending on how many persons of those are present on map.

Link to comment
Share on other sites

Hmmm...sounds like a possibilty, because it constantly declares the Vehicle variable "car" each time the loop iterates. It makes use of the same variable all through out for sake of not having to create 10 different variables. The number of VehicleLists is also another possibilty since the game has to search for the specific vehicle x number of times depending on how many persons of those are present on map.

 

I am attempting a fix as we speak, and I will test it and report back. Keep in mind, I don't know much c++, I am more of a Java developer.

Link to comment
Share on other sites

I am attempting a fix as we speak, and I will test it and report back. Keep in mind, I don't know much c++, I am more of a Java developer.

Some hints. Maybe pointer variables are more efficient, so get your asterisks and -> ready. Despite having some knowledge of C programming, I don't know the effect or difference of having pointers vs regular variables in Em4, except for functions.

 

The scripts I've made so far don't make use of functions so pointers to me didn't seem like a useful thing unless I was going to "pass" something. Another option would be to divide the command scripts further into individual functions and have them pass pointer variables instead.

 

I am unsure if this makes it more efficient, but from what I've learned, having a single permanent variable that changes in a case to case basis is more efficient than having 10 different variables which may or may not even be used.

Link to comment
Share on other sites

Some hints. Maybe pointer variables are more efficient, so get your asterisks and -> ready. Despite having some knowledge of C programming, I don't know the effect or difference of having pointers vs regular variables in Em4, except for functions.

 

The scripts I've made so far don't make use of functions so pointers to me didn't seem like a useful thing unless I was going to "pass" something. Another option would be to divide the command scripts further into individual functions and have them pass pointer variables instead.

 

I am unsure if this makes it more efficient, but from what I've learned, having a single permanent variable that changes in a case to case basis is more efficient than having 10 different variables which may or may not even be used.

So far everything is working excellent, I will continue to test a little bit more then release my fix.

Link to comment
Share on other sites

Was the ATF issue all ready fixed or is not  factor in what is causing the game to glitch or lag?

I have seen noticeable increase in FPS when I added the breaks, however it could just be me imagining it. I have isolated the crash(for me anyways) to this:

?SpawnPoint "civspawnrowhouse2": Assigned path "civpath06" is blocked.
?VVideoTexture::StartPlayback(): could not run graph [80070008]
?SpawnPoint "civspawnhouse2": Assigned path "civpath10" is blocked.
!WARNING: global listener object is still registered! Unregister listener before destroying object!

 

I am unsure if it has to do with the volunteer script, I have been trying to pin point the exact cause but I haven't been able to find it. It seems plausible that if the civpath is blocked it leaves it registered and picks another civpath and attempts to destroy the civpath that was blocked, which causes this error. I am still looking into it(I really dislike notepad++).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...