Home   Help Search Login Register  

Author Topic: A long run  (Read 3184 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
A long run
« on: 05 Nov 2004, 13:29:58 »
Does anyone have experience of large and long missions?  I have a strange problem with one I am making.

I am creating an environment that covers a whole island.  My intention is to have a wide range of activities going on across the island that represent a realistic occupation by two groups of opposing forces during an armed truce.  Within this environment I can then create several different missions.

So I have jeep patrols on circular routes, I have convoys of trucks going back and forth between towns (I use boolean variables to prevent collisions) I have fuel stations that each patrol and convoy visit (at which point I run a script that repairs and refuels them), infantry disembark from their transport, search towns and then get back in their vehicles to head off elsewhere etc. etc. The idea is to have a self contained environment that needs no help from the player to keep it all running..

Everything works, for a while, but eventually, and so far unpredictably, things break down.  Convoys and patrols get stuck at waypoints they have visited a dozen or so times before.  Jeeps get stuck between waypoints at places they have been to many times before, others in the patrol run slowly waiting for them and then eventually run out of fuel before they get back to the fuel station.  One pattern emerging is that it is not the lead jeep of a patrol that stops first.  Sometimes it all runs for a couple of hours before there is a problem and sometimes it can run for 20+ hours, but eventually something goes wrong.

So if it will keep running for several hours before there is a problem why am I bothered?  Well firstly it offends my sense of tidiness, and secondly if I don't know what the problem is how do I know it will not happen much earlier sometimes?

I am reasonably convonced that the problems do not result from convoys and patrols colliding.

Any thoughts or suggestions gratefully received.  

« Last Edit: 05 Nov 2004, 13:38:22 by THobson »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:A long run
« Reply #1 on: 05 Nov 2004, 14:06:14 »
My advice would be to rework the entire system. Not only does this system break down, it will also use a lot of CPU to keep everything moving. Better would be to createvehicle stuff around the player and keep track of convoys and stuff via variables. It isn't über realistic, but it's a simulation and I guess that's what you're after if I ain't misstaking. It will also cause a lot less lag.

:beat: *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A long run
« Reply #2 on: 05 Nov 2004, 14:23:57 »
You don't need refuel routines for vehicles.   They will refuel automatically if they are below the threshold (about 20% I think) and passing a fuel station or barrels.

I know the problem you refer to:   never got to the bottom of it myself but I think it's a randomness thing.     OFP has randomness built into it, that's partly what makes it such a great game.   Let it run for long enough though, and the bizarre, crap very unliklely possibilities come home to roost.    

The lead vehicle is indeed rarely the one to hit trouble:   I think this is because it has a clear road with nothing to do but follow waypoints.   The other vehicles have to follow the leader.    Because of the random element, the leader will take a slightly different route down the same stretch of road each time.    Because of the random element, the other vehicle will follow in a slightly different way each time.   If you run the simulation enough times, sooner or later the other vehicle will get itself stuck between two trees.

The solution, I think, is a slow loop that checks the position of each vehicle.   If it hasn't changed, and it is supposed to, then setpos it a few yards away.     At the end of the setpos section of the script I'd refuel and repair the whole group, just to be on the safe side.    If you want to be sure the player doesn't see, check that he is sufficiently far enough away.

I ignored all this in the Un-Finishable Mission because it didn't really matter:  I had repair routines to keep them on the road but the blackop motorbike patrol, for example, rarely makes it round its loop even once without coming to grief.   However, this just splits the group up which in some ways adds to gameplay - you never quite know if you've got them all.


Edit:  Armsty is right.
« Last Edit: 05 Nov 2004, 14:24:30 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #3 on: 05 Nov 2004, 15:21:55 »
Thanks guys.  I feared as much.  

On the setPos trick.  I have written a script that instead of an immediate setPos will move the vehicle smoothly backwards a few meters (I don't know who might be watching at the time).  Problem is that some of the vehicles quite correctly will need to sit in one place for several minutes - either to avoid using a piece of road that is already occupied (that is guaranteed to cause a problem quickly) or to wait while their on-board troops have got out, searched a town and then re-boarded.  I am still thinking this through.

On the refuelling bit.  The script only runs when the vehicles are at a fuel station.  Each 'lap' of the patrol takes 40%+ of a tank of fuel and I have removed the fuel from all the other fuel stations on the patrol route so I do this to force a refuel even if they think they don't need it.

Another reason I wrote the script is that I did not know they would do it themselves  ::). Thanks for the information.

I did have a support group at a support waypoint, but they just got too active running around filling up vehicles and just got in everybody's way.

Amsty.  I know you are right.  But that is not what I want.  I really do want to create a working island.  Please bear with me in my old age!
« Last Edit: 05 Nov 2004, 15:42:05 by THobson »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #4 on: 06 Nov 2004, 08:20:01 »
OK - my solution for the jeep patrols that I am currently soak testing:

Every 5 minutes or so:

For each vehicle in the group that is not the leader's vehicle:
if the vehicle is:
- alive (ie it exists)
- canMove
- side driver == east  (or west as appropriate)
- distance to leader's vehicle >= 500
- distance to player >=500
- distance of player to leader's vehicle >= 500


then it is setPosed to 25 meters exactly behind the leader's vehicle and facing the same direction.  Subsequent vehicles being setPosed are placed 10 meters behind the previous setPos-ed vehicle.

then:
each vehicle (including the leader's) is:
- refuelled
- damage set to 0
- damage set to 0 for all crew in the vehicle

Can anyone see any logic flaws in this or ways that it can be improved?  
(For example I am not too sure about restoring full health to all crew members)
 
« Last Edit: 06 Nov 2004, 09:06:39 by THobson »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A long run
« Reply #5 on: 06 Nov 2004, 11:21:47 »
Add the fuel before checking the canMove condition, or at least investigate what result you get for canMove on a vehicle at empty.

Don't setDammage 0 the crew, setDammage (getDammage - 0.5).

These guys should be on very high skill.   Dunno if it really helps, but ...

Check the whole road network (drive along it) and make sure there are no static objects placed closer than about 2m.    An object in one place can have a weird effect on the driving of a vehicle hundreds of yards away.    Sometimes you can get away with it, and sometimes you can't.    Depends on the object and the exact location.

500m might turn out to be a little too high IMHO, but numbers like that are always subject to lots of experimentation.      As a player you don't really see much happening beyond about 200m unless you're looking for it.

Give the drivers NVGs for when it gets dark.   Some dismounts too.


Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:A long run
« Reply #6 on: 06 Nov 2004, 12:20:15 »
A bit OT: Could you at least use the benchmark command on some units? You've told me before you sit on a badass computer (although my benchmark was higher than yours, that thread was funny. "OMG! YOU BIATCH ARMSTY! You shouldn't have that high benchmark!!" ;D ) so you won't exactly experience the kinda lag an avarge OFP player would.

:beat: *Gets Shot* :beat:

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #7 on: 06 Nov 2004, 15:00:36 »
Quote
Add the fuel before checking the canMove condition, or at least investigate what result you get for canMove on a vehicle at empty.
Comref says that canMove is unaffected by fuel level - I will check.

Quote
Don't setDammage 0 the crew, setDammage (getDammage - 0.5).
I was wondering about this.  I have a 'complete refresh' script that sets fuel 1 dammage 0 for vehicles and crew.  It sort of simulates a crew change over.  The script is used when it returns to base, I call the same script after doing a setPos - just lazy.  I think you are right I shouldn't really do that here.

Quote
These guys should be on very high skill.  Dunno if it really helps, but ...
They are - and I don't know either.


Quote
Check the whole road network (drive along it) and make sure there are no static objects placed closer than about 2m.    An object in one place can have a weird effect on the driving of a vehicle hundreds of yards away.    Sometimes you can get away with it, and sometimes you can't.    Depends on the object and the exact location.
I have been along those roads (as a passanger in the patrols) until I was dizzy.  There was one corner where they sometimes left the road and hit a tree.  I fixed that.  I will keep checking.


Quote
500m might turn out to be a little too high IMHO,
You are right, I think I have it down to 300, and still checking.

Quote
Give the drivers NVGs for when it gets dark.  Some dismounts too.
Already have.


Quote
A bit OT: Could you at least use the benchmark command on some units?
I am a long way from finishing this and I may well do exactly that.

Bye the way Armsty - what's with the name change?

« Last Edit: 06 Nov 2004, 15:06:16 by THobson »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:A long run
« Reply #8 on: 06 Nov 2004, 15:10:09 »
Quote
Bye the way Armsty - what's with the name change?

I was wondering about that too.....   ;D

Is it just coincidence that dmakatra backwards is:

artakamd.

I wonder what amd means.


Planck
I know a little about a lot, and a lot about a little.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:A long run
« Reply #9 on: 06 Nov 2004, 17:24:23 »
LMAO! Didn't see that. And no, the answer to the name is much simpler than that. A hint, think capital letters... :)

I'm converting into this name gradually on all places I'm active in. I had two before, both stupid. I mean like Armstrong? I'm not even yank! ;D

:beat: *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A long run
« Reply #10 on: 06 Nov 2004, 17:42:40 »
Dumb Motherfucker Also Known As The Real Armstrong
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:A long run
« Reply #11 on: 06 Nov 2004, 17:45:38 »
Actually, that's almost it. Except the Dumb Motherfucker part. It's my other nickname which I used in all other thingies outside OFP. Das Mattesnille. So it's:

dmakatra = Das Mattesnille also known as The Real Armstrong

Kinda neat eh? Anyway, we've strayed away from the topic quite a bit now haven't we? :P

:beat: *Gets Shot* :beat:

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #12 on: 06 Nov 2004, 19:12:30 »
Quote
Anyway, we've strayed away from the topic quite a bit now haven't we?
Well it is my thread and I did ask the question.  You will always be Amsty to me.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:A long run
« Reply #13 on: 08 Nov 2004, 05:40:22 »
Interesting topic here... I don't have much experience with it myself, since I usually have infantry moving around, not vehicles. But I'm curious: when you test this, do you set the time accel to x2 or x4? At least for me, doing that will make the AI do things like crash into trees on turns in the road, and generally cause chaos.

Of course, even if you AREN'T upping the time, the actual player of the mission most likely WILL, at some point. So on my computer at least, your simulation is SURE to get wacked out, unless you use some of those ugly scripting tricks you and macguba were working on.

Keeping that in mind, you may have to implement even more ugly scripts, or else consider what Arms.... I mean dmakatra said. Or you could restrict the player from using the acc-time button.











HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #14 on: 08 Nov 2004, 08:03:48 »
All my soak testing is on x1 speed.  A 20+ hour soak causes no end of family grief.  

I plan to have a trigger that fires if Acctime != 1 and resets it to 1.  Not just to solve the problem you correctly out line, but also to ensure the player plays the game I have written and not some high octane blast through.  Is there a less resource intensive way of turning time acceleration off than using a trigger?

The execise is proving quite interesting.  After an overnight run this morning I saw my convoys were in a configuration that should be impossible.  No time to check before leaving home, so I hope the computer is not needed before I get back tonight to check the details.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A long run
« Reply #15 on: 08 Nov 2004, 12:09:06 »
2x works more like 1x than 4x.      4x is very different from 1x, you can even do things like climb over walls and run through fences.     In other words 2x can be used as a proxy for 1x.   4x cannot.   That doesn't mean you can't use it for testing - I use it all the time - but for something like checking whether a convoy works for 24 hours you're doing it the right way.    Sod the family, you paid for the bloody computer, right?   ;D

I had a lot of this kind of thing when making you know what.   Many of the mysteries I solved, often when not at the computer.    "When you have eliminated the impossible, whatever is left - however improbable - must be the truth."

If you want such a trigger to stop the player going fast, give him a hint or something so he knows what's happening.  
   
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #16 on: 08 Nov 2004, 14:53:38 »
Quote
you paid for the bloody computer, right?  
Absolutely right.

Quote
Many of the mysteries I solved, often when not at the computer.
It amazes me how often this happens.  It is as if the mind just needs a bit of soak time.  

The problem I have now will take some thinking through though.  I am begining to think it is not possible to do what I am trying.  All I have are 2 patrols ( 2 to 4 vehicles each) and 2 convoys (5 vehicles each)  Ok so the convoys each have 2 infantry patrols that get out at the sign of trouble, and also when they reach a specifc town, they search the town and then get back in.  No soak test has been successful,  but it has never failed in the same way.  Sometimes it is the patrols that get stuck and sometimes the convoys.  Sometimes it is after 18 hours sometimes after 2!!

Bye the way, I have been meaning to mention, your Blacks Ops on motorcycles did better that you think.  They were all together when I took then out and that was after I had visited the civilians, taken out the road block and visited the drop zone, with much travelling on all fours!

Quote
give him a hint or something so he knows what's happening
Yes - only polite to do that.  On a similar issue: can I turn cadet mode off for the player as well?
 

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:A long run
« Reply #17 on: 08 Nov 2004, 15:12:30 »
I still really recommend you do as I told you. You can still simulate it VERY efficient, depending on the detail of your script. You can keep track of the convoys and town searching with variables, booleans and arrays. Very neat and tidy (and reliant, as your problem seems to be), and take like nowhere near the much CPU.

About the problem thingy. Really not my style. If I think about my project beside the computer it's more like the features - so when I actually sits by the computer I need to include even more stuff. ;D

:beat: *Gets Shot* :beat:

Offline KTottE

  • Former Staff
  • ****
Re:A long run
« Reply #18 on: 08 Nov 2004, 16:03:09 »
You can force him to play in cadetmode by detecting cadetmode:
http://www.ofpec.com/editors/comref.php?letter=C#cadetMode

And then use a script to hint that he has to play in veteran and then have a time-delay and after that, end the mission.

I strongly suggest that you allow people to play the mission in cadetmode however, there's a reason they do that you know :)
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #19 on: 08 Nov 2004, 16:50:55 »
dmakatra:  I may well end up having to do just that, getting things to work properly is proving very painful.

Bye the way should your new name not be: dmpkatra???

KTottE: Thanks.  I could find how to detect both the game speed and cadet mode.  I could also find the way to re-set the speed, but not cadet mode.  I don't think I would like it if the mission died on me like that so I will leave the mode open - and perhaps just hint to recommend not playing as a cadet.
« Last Edit: 08 Nov 2004, 16:55:30 by THobson »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:A long run
« Reply #20 on: 08 Nov 2004, 17:05:37 »
You can force him to play in cadetmode by detecting cadetmode:
http://www.ofpec.com/editors/comref.php?letter=C#cadetMode

And then use a script to hint that he has to play in veteran and then have a time-delay and after that, end the mission.

I strongly suggest that you allow people to play the mission in cadetmode however, there's a reason they do that you know :)

Actually, I played in cadet mode first 'cause I was too lazy to change to veteran. Then I started poking at the editor and found out veteran mode was so much better. ;D

You can still script some of the functions that are in Cadet mode and then let the player choose himself which functions to be turned on in a dialog at the mission start.

Why should it be dmpakatra btw? Das Mattesnille Also Known As The Real Armstrong = dmakatra

:beat: *Gets Nicknamed* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A long run
« Reply #21 on: 08 Nov 2004, 17:23:00 »
UnIMpossible has a hint and titletext at the start if you are in Cadet mode.  Given that the start is so hard anyway, it's virtually terminal, or likely to be if you're the kind of person who likes to play in Cadet.    Also you get no waypoints, which is a big reason for playing Cadet.   I did consider making the mission end, but thought what's the point, if somebody wants to play it in Cadet why should I stop them.    The mission designer is trying to create fun after all, not prevent people from having fun.

Glad to hear about the blackop motorbikes.    The guys at the back always seemed to be walking when I found them.

As for the test, your mistake is to run it when you are at work or overnight.   You have to run it while you are there, or at least popping in every few minutes.    Use ECP's specator script so you can see what's going on.      
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #22 on: 08 Nov 2004, 21:38:16 »
I am now convinced it should be dmokatra (look at the text under your dancing banana), but I like the Previously version better.

OK I will leave the cadet capability.

Quote
your mistake is to run it when you are at work or overnight
I only have work or overnight!!  Anyway I am trying to get it so the infrastructure on the island will run permanently if needs be.  Based on experience with your UIM means 24 to 48  hours with no failures.

As for spectating - each vehicle has a marker that is repositioned on the map every couple of seconds (this is the most useful),  also every couple of seconds I have player sidechat giving me the status of fuel and damage levels for each vehicle, how many journeys they have done, who has got out of the vehicles, how many times my setPos "ugly" script has run etc. and I am resistance (friendly to all - for the time being) sat next to an empty jeep so I can go and look at any problems in person.  What would ECP give me?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A long run
« Reply #23 on: 08 Nov 2004, 22:10:58 »
Lol I just meant you need to put a Saturday or Sunday onto it ... clean the car bonnet, check the mission, clean the windscreen, check the mission etc.  

ECP gives you a camera shot of every unit in the mission.     It would mean that you could see the problem immediately rather than having to drive to it.    
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #24 on: 09 Nov 2004, 07:50:25 »
Interesting.  Thanks.  I will have a look

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #25 on: 23 Dec 2004, 23:51:34 »
An update:

Since I started this thread my computer has been turned off for less than 1/2 an hour while I updated my network.  During all the time it was running I was either editing my mission or running it.  I have had several trips overseas that allowed some exceptional long runs.  All with disastrous results.

Today for the first time my island completed 36+ hours with everything still working at the end.  All the choppers were flying, patrols and convoys running, infantry still searching towns etc.  If I tell you that there are two sides on this island and that both search the same town (and setCaptive true is not used) and that refuelling etc is only done at fuel stations you might see the challenge.

Anyway I cannot imagine a player will take 36 hours to start interacting with the opposition, so I am now ready to start making the mission

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:A long run
« Reply #26 on: 24 Dec 2004, 01:58:40 »
Wow.... now that's dedication. I'll be sure to try this mission when it comes out!
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #27 on: 24 Dec 2004, 07:44:59 »
Thanks.  I am having great fun, and I hope others do too when it is ready.  But don't hold your breath, it while be a while yet

Knowlife

  • Guest
Re:A long run
« Reply #28 on: 26 Dec 2004, 19:52:15 »
I have often thought about making the same thing (a little diffrent though), but never got around to. What you're doing sounds really interresting. I'm really looking forward to your mission, best of good vibes to you..! :D
« Last Edit: 03 Jan 2005, 16:27:46 by Knowlife »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:A long run
« Reply #29 on: 27 Dec 2004, 01:04:53 »
Thanks