The Daily Click ::. Forums ::. Klik Coding Help ::. Traffic Engines, come on you smarites!
 

Post Reply  Post Oekaki 
 

Posted By Message

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
12th January, 2004 at 10:31:27 -

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

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
13th January, 2004 at 03:44:10 -

Karnage, Having only one sensor at the end of a road will
lead to many car crashes.

Kaboom!!
| /
-oo-
|
|
Turning

Unless your not planning on doing a high way, That is useless.

eg. The squirrle - password: part2

Get up to highway part(if possible), and you will find a useless car crashing
engin.(Really useless)


 
n/a

cake



Registered
  13/12/2002
Points
  1173
16th January, 2004 at 05:52:16 -

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.

 
n/a

Smeggy

The Smegster

Registered
  08/01/2003
Points
  1062

VIP Member
16th January, 2004 at 06:44:24 -

Nice idea cakey

 
http://www.klik-union.com

Mr Coffee



Registered
  04/09/2003
Points
  440
16th January, 2004 at 13:23:41 -

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.

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
17th January, 2004 at 03:17:21 -

Biax = right.

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

Mr Coffee



Registered
  04/09/2003
Points
  440
17th January, 2004 at 09:43:31 -

No, he is not "right". The method you are talking about with arrays would be extremely complicated to implement.

 
99 percent chance that the above post is 100 percent correct.

Keatonian



Registered
  15/07/2002
Points
  571
17th January, 2004 at 10:16:26 -

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.

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
17th January, 2004 at 11:06:37 -

"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

Mr Coffee



Registered
  04/09/2003
Points
  440
17th January, 2004 at 13:09:39 -

It could be done but it would be more complicated than using detectors.

 
99 percent chance that the above post is 100 percent correct.

Lew



Registered
  06/01/2002
Points
  1014
17th January, 2004 at 13:49:27 -

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?

 
<--intelligent, witty comment here-->

Mr Coffee



Registered
  04/09/2003
Points
  440
17th January, 2004 at 14:04:27 -

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.

Lew



Registered
  06/01/2002
Points
  1014
18th January, 2004 at 04:54:14 -

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.

 
<--intelligent, witty comment here-->

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
18th January, 2004 at 05:23:46 -

Detectors -BAD
Array -GOOD

Even all the original Nes and Snes games use this method on platformers.

PS. I wonder how the makers of GTA flet when making it?

 
n/a

Keatonian



Registered
  15/07/2002
Points
  571
18th January, 2004 at 11:03:34 -

Do this:

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?

Image 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.
   

Post Reply



 



Advertisement

Worth A Click