[Release] [ALPHA] "Arma III" Styled Missions

yeah but… i have people all around quebec… some from france too…
there ping isnt the same. Maybe its cause by it.
yeah a check every 10 sec could do it…

Yeah, the 5 minute difference between client and server is wierd… the ping shouldnt make a difference. How long did you set that mission for?
I can add some debug statements that you can easily turn on that can spit out server and client time info as well in the next build.

25 minute mission
for the 5 minutes one that stop.

ok. is there anything i can do now to test…
thanks.

Not really.

There are some lines of code commented out in the timer loop on the server. You can remove the – chracters and restart and you can see what the server time is on the server console. It might be in millseconds though or minutes cannot remember.

ok ill do some test…
il wait for next built then
thanks a lot

1 Like

17 player online with mission on…
Lag as hell

i stop the ressource… no more lag.
i cant test the ressource its too buggy when to many player.
that is too bad.

Sorry to have bad news.

Hmmn, you get more lag with more players? When do you get lag exactly? When fighting NPCs up close, or just in general when there are a lot of players?
There are places were I can definitely optimize the code, or throw it into separate threads to see if that helps. I dont notice any lag of course. I’ve noticed some quirkness with the main mission check loop now which may not be good to have it all be called together once a second, and thrown into separate threads.

This may not be a resource to use on large servers then until it is optimized.

the time sync error for joining clients should be fixed now at least.

1 Like

i think when the host of a mission logout… the mission timeout…
maybe the 5 minute left… was cause by that?

i did have this issue when host deconnect… but not the issue when they stay till the timer goes down…

still little lag between their timer but not that much could be prevent by a check each 10 sec

for new commer i dont know… you seem to have an hint about this one… what you said a post after this one sound right!

i have found a bug … from my esx addon

here

				TriggerServerEvent("paytheplayer", totalmoney)
				TriggerServerEvent("UpdateUserMoney", totalmoney)

keep only

TriggerServerEvent("paytheplayer", totalmoney)
1 Like

there was an error in the logic where when a player joined they were getting the correct time left from the server, but my client code was overwriting it with the full time length of the mission. Thats fixed.

Yeah, when the host disconnects, the peer to peer is supposed to migrate the session to another host. I should test that to see what happens here when the host disconnects.

1 Like

is it possible to have… missiontime=true/false
for certain mission that not need any timer?

Have a final update for my alpha version/branch of LanceGood’s original resource, in terms of new features. Its a big update with many fixes, tweaks and additions.

2.9.5 alpha:
http://www.mediafire.com/file/k6rkly8cb8prk04/mrp-missions-2.9.5c.zip/file

Features:
–Many fixes and tweaks including a fix for desync for mission timeout between clients and server (thanks sixsens for pointing this bug out). Also fixed ESX money updates. Aesthetic changes, no more purple blips :stuck_out_tongue:
–Many new missions. Tried to add more balance to NPCs and Safehouses by default, but it is all configurable anyway. The missions are more a proof of concept.
–Missions where you must protect/extract a target. Missions 13, 14. 15 and 18 have these. These are variations of IsDefend=true missions. I have flags that can be turned off/on to modify NPC AI behavior for these types of missions. You can rescue the target like you rescue a hostage as well. Basically targets are similar to hostages, except hostile to NPCs (and vice versa) and can be armed and will fight back. All configurable.
–Can have/create random mission IsDefend and IsDefendTarget missions. Mission18 has this. IsDefend by default is a zone that NPCs try to reach that the players need to stop. Mission10 and Mission16 are default IsDefend missions.
–Killing NPCs in vehicles will give bonus money (configurable).
–Simple scoreboard (activate by phone button), that shows mission count, total money earned, and money per mission for every player for the session the player is currently in.
–Mission12, Mission17, Mission18 and Mission19 showcases the random mission generator. Mission12 uses the predefined random places. Mission17 uses the IsRandomAnywhere flag where missions can spawn anywhere on the map, Mission18 has a couple of random IsDefendTarget missions. Mission19 I call Warfare, where the parameters are bigger, 250m spawn radius, 15 to 50 enemies, 3 to 8 enemy vehicles. I played about with much bigger numbers, but it became unstable, when I got close. Got a phlnstGta pool error,where it said I can increase it in gameconfig.xml. Also added a RandomMissionDoLandBattle flag, which is set to true. It will always make sure that missions and NPCs spawn on land. If turn the flag off, it will spawn boat missions when on water.
–MissionNoTimeout flag added.

Testing on my local LAN, I found that both my old laptop client (on wifi) and my desktop/dev box connecting on localhost synced well, even in Mission19. Only once briefly the laptop lost the blips… not sure why. I restarted the resource and it fixed it. My desktop was the host pretty much all the time, but laptop was host also a few times. With the IsDefendTarget flags there are other flags to define how NPCs behave which can affect how the mission should be created. I will need to create a guide for how to setup the configuration. It is VERY configurable per mission, and per random location as well for regular random missions where you can override global settings. Blip2 is used for IsDefend type missions to set up where the target or defend zone is/starts. Blip then can be used to show where the target is trying to get to (destination) or where enemies start/spawn. BlipS, MarkerS go together and define where the safehouse is. BlipSL is where safehouse land vehicles/aircraft spawn and BlipSB is where safehouse boats spawn. You can define these as well globally, per mission, or per random mission location.
Random spawn anywhere missions do not support IsDefend missions. Also setting UseSafeHouseLocations to true will enable all random missions to use SafeHouseLocations where locations will be randomly picked from.
Also IsDefend=true missions should be used with Assassinate gametype.

By default I have ‘crackdown’ mode enabled, where you get 1000 health, superjump, superun, superswim as well and 100 armor, for $2000 at the safehouse that can be disable

This should be stable enough for lan/low player count servers where there is coordination between players. It might be OK for larger servers. There are still some minor bugs like when a player connects right when mission ends they might get an error, where the resource might or might not need to be restarted for them. I was able to play Mission19 ok on a LAN with 2 players a lot of NPCs spawned in and vehicles over 500m diameter.

sixsens you mentioned lag with high player count. I can definitely optimize the code, which will be my next focus when I get time. I dont see the resource warnings at all when I am running my resource, except a couple of times when I was spitting out tons of debug text. It would be interesting to see this running on a more vanilla server with higher players as well. It may be that I need to use the netid & obtonet stuff, like I saw in fivem_cops to make it more suitable for net play. My resource manifest is still old, due to having problems with createobject when I used newer ones.

safehouse:

scoreboard (old)

scoreboard new

pic with old purple blips of Mission19 random mission generator with very high radius 1000m and up to 250 NPC/ 12Vehicle count.


Game started crashing around this size and got an error saying I need to increase phlnstGta pool in gameconfig.xml.

Mission 19 now has a min/max of 15/50 NPCs and 3/8 vehicles, 250m spawn radius and that has been stable with 2 clients, could possibly go higher to up to 100 NPCs etc… (note, purple blips are now red, lol) :

1 Like

the chippiest thing was setting tasks on NPCs and vehicles when the map areas are not collision loaded. Vehicles definitely work better at long range than Peds. Sometimes even tasks that seemed to usually work far away like taskdrivewander will not always work when player is far away, causing planes to crash etc… when spawned. Hydra is a reliable attack plane in this instance . Another way around this is to spawn more and then some will ‘make it’ and not crash.
TaskVehicleDriveToCoordLongrange works consistently at long range, as long as no more than maybe 10(?) vehicles are assigned. IsDefendTarget’s setting IsDefendTargetGotoBlip uses this to make the Target go from Blip2 to Blip location. NPCs enemies will do this reliably too to meet the target, except when IsDefendTargetChase is set to true whereby they chase/‘escort’ the NPC target. escort and other tasks to make an NPC ped/vehicle go to another suffer from not being reliable at all from long range, meaning they do nothing until you get within collision range ( <600m, sometimes < 250m). Mission13 uses these close range tasks to have NPCs chase the Target NPC, as well as Mission15

regular missions, ones where IsRandom=false, offer more exact positioning and creation of missions. Where you can set props, NPCs, vehicles etc… to exact positions, as well as assign behavior attributes to specific NPCs (see missions.lua), but I think the most enjoyment I will have will be with the random mission generator. The behavior of NPCs (to wander or not etc…) also has randomization

in regular missions the attribute movetocoords uses TaskVehicleDriveToCoordLongrange , and would probably be the best way to have NPCs and targets intercept each other when in vehicles in that case.

here is also the error I got when increased NPC count to be around 250 max with around 10 vehicles or over 2000m area. Even with that many though, I do not have any noticeable fps drops or game lags on either client. My old laptop still ran at 28-38 fps

1 Like

OgCl
i will not sleep tonight
wiiiiiîiiiiiii
:ok_hand:

1 Like

I have another update to 2.9.5 in a little bit, to fix a desync bug for clients joining when random missions are running. Just caught that with some more playtesting.

2.9.5d which fixes a bug with clients not synching up when joining when a random generated mission is being played:
https://www.mediafire.com/file/nu4yxjgm3ooti6c/mrp-missions-2.9.5d.zip/file

You are thinking that using netids might improve efficiency because the entity iterator method is too intensive? It’s possible but it would be unfortunate – I like the solution you are using now and it avoids many potential complications using netcode. It would be ideal if one could confirm resource use of one technique vs another. I thought I read something recently in the FiveM updates thread about being able to do this but I can’t remember.

As for resource manifest and CreateObject, I did notice a report of a similar problem causing some scripts to revert back to manifest 44febabe-d386-4d18-afbe-5e627f4af937.

On the other hand, ghermans in Cops-FiveM seems to be using the latest 05cfa83c-a124-4cfa-a768-c24a5811d8f9 and still creating props in menu.lua. Not sure what is up there.

1 Like

sixsens, I’m not sure this release will solve the problems that you experienced on your server with high numbers of players. My main aim was getting this to a point that was playable at least on a LAN, hopefully online as well with some coordination with players as a gametype maybe, where the host player can be counted on to be online.

Mission16 for instance will be hard if you cannot see blips across the map for players, but at least players will know where to defend based on the marker. Same with some of the defend target missions, they will see a start and end blip, but the target NPC may veer off somewhere else if being chased by an enemy.

Cheers Loque, that might be what I am running into re: createobject.

You are thinking that using netids might improve efficiency because the entity iterator method is too intensive?

It has crossed my mind, but I would imagine that its only when an object changes on the host/or client that net traffic is being generated, but maybe decor is more expensive. Sixsens server is very cool RP, first time I visited an RP server , and it has a ton of mods running as well, and I saw a lot of errors from other scripts in the console. I’m not sure if that has something to do with the lag as well, which is why playing with more players on a more vanilla server might be a better test,or maybe not. Saying that, the host is still very important, and if they disconnect it’s not a show stopper, but certain NPCs may stop doing their assigned tasks etc… until the next mission. I put in some loops for all clients to run every 10 seconds to workaround this, but enough is enough… I thought, and also that did not seem to work very well.

I should time the entity iterator, part of my optimization after sixsens feedback was to remove 4 loops into 1 loop… it appears to be moe than quick enough when I have my 2 clients at home (my old laptop as well as host), my main game state loop is calling it once every second (I should probably shorten this), I do not experience any noticeable hitches beyond what I get with vanilla Fivem (even when I had the 3 redundant loops :grinning:
There are other loops too that happen as well though, that I can also probably remove a couple that are not need and definitely other tidy up.

I did notice that the code that showa a message in the middle of the screen when securing an objective no longer show via triggerevent, so I use chat message. I’m not sure if this is due to a bottle neck, or just a silly error somewhere I am not seeing, since I have the same code running for buying at the safe house and it works fine.

One thing I am not doing as well is SetModelAsNoLongerNeeded in my code.

1 Like

had the middle finger pointed at me by hateful NPCs during my playtesting more than I can remember…
:rofl:

1 Like