we must find confort in eachother in these dark times
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
NO NO NO!! PLEASE do not use detectors, I beg you. The engine will crash and burn gloriously.
Detectors are pointless. Since the game has a level editor, you can also store all the corners and intersections in a database.
Then for your traffic, parse the database for each car, and find if the cars position matches the location stored in the database, turn the car.
This system would be very complex to program, and would probably be around 30-50 events, but I think it would definately be worth it, because the system is dynamic and people making maps wouldnt have to bugger around putting waypoints in for their levels.
How are the cars going to detect other cars if they don't have detectors? It's like putting a robot in an environment without any sensors. It's not hard to link detectors to cars using fastloop, and it should never cause any problems.
99 percent chance that the above post is 100 percent correct.
using arrays you wouldn't need any detectors. you just match the position of the car (or whatever) to the tile that's stored in the array in the same location, then do whatever.
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Not to mension there would be way to many
crahes or cars would go through each other.
-Above post is ancient and probably irrelevant-
An old account of mine, recently cleared out. It's a blast to the past, the age was marked as 14 when I found it. If you know where to look, you can track me. Au revoir.
"The method you are talking about with arrays would be extremely complicated to implement."
that doesn't "mean" it can't be "done"
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Ok, for newbies who don't like to work, it's bad, for people who are serious about making a game as reliable as possible, it's good. It's how professional games work-every car and corner has an entry in the array, plotted with it's co-ordinates and for corners, possible outcomes. Then when your car overlaps another cars co-ordinates (using a formula with the size of the object) then they crash, if the car is a certain distance away from yours it tries to move out of the way. Then if the player/other car overlaps a corner co-ord it picks a desicion randomly to go that way. Each car also has a variable to say it is turning, and at which corner. If there are two cars turning at the same corner, make one stop.
I've implimented something similar into a game I'm making (not very far into it so no details yet). If you have a big comment at the top describing each item in the array it helps. Also make a subapp with a 'developers console' and code it so if you type 'getpos 2' or whatever it returns the co-ordinates of object 2. It's a LOT less cluttered and less memory hogging than bloody detectors-think about it, a few values stored for each car, or 4-10 detectors all messily places around each car-which ones more efficient?
I think the most efficient method is the method that takes the least amount of time to code. The player does not care which method you use, since the end result is the same. Using detectors is not "memory hogging". If you create a very small object for the detector and select "info" you will see that it takes up less than 1 kilobyte!
99 percent chance that the above post is 100 percent correct.
Not that sort of memory, MMF's object memory. With an array you can store virtually unlimited amounts of car values, whereas with detectors you can only store about 5000 (I know it says 10,000 but unless you have 3gb of ram no chance). Arrays are much easier to manage. Players at the other end do care which method, because detectors slow the game down and you can always tell if you're using detectors because it looks messy. I know, as I've said I'm making a similar game (not a GTA clone though) and I started off using detectors.
Make a whole lot of detectors, all different.
They test for collisions and such.
Now use rotate in the image editor to make all 32 directions.
Now use spreading values and fastloop to set all the detectors
to one car at a time, consult the array, and make all the
decisions. Don't forget the uses of traffic lights as Flags!
Oh, and this has been bugging me.
What is a Smarite? I know what
a Smartie is, but a smarite?
Edited by the Author.
-Above post is ancient and probably irrelevant-
An old account of mine, recently cleared out. It's a blast to the past, the age was marked as 14 when I found it. If you know where to look, you can track me. Au revoir.