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

Post Reply  Post Oekaki 
 

Posted By Message

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
11th January, 2004 at 05:06:47 -

Hey everyone,
I've been working on a project with Yuyu for a little while now. It's a gta style clone and we've done a fair bit. We have tried to make it as flexible as possible, including map makers, customizable graphics. But we can't get around the traffic and the Peds. We've made several small traffic engines, failing somewhere in each. I've gotten very close in one, and it worked great until I overcomplicated it with roads and detectors going everywhere.

If you know of a good traffic engine or could shed any light on the idea, please feel free.

-Andy & Yuyu

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
11th January, 2004 at 06:10:14 -

The only game I can remember doing something like this is Harry Cars (or whatever it was) which used detectors at every junction showing what way the cars could go, and they turned at random.

 
gone fishin'

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48488

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
11th January, 2004 at 07:49:35 -

Yup. Say for instance you had a road like:


__|__

A T-Junction.

You'd put a detector in the middle and then make an event which is something like:

ALWAYS: Set Alterable Value A of Car to random (1) - so it randomly flickers between Value 0 and 1.

Only one event while action loops and car is overlapping detector, and Alterable Value A of Car = 0: Set direction to UP

Only one event while action loops and car is overlapping detector, and Alterable Value A of Car = 1: Set direction to CONTINUE

Course, it'd need to be more complex than that, but as far as Im aware, you'd have to do something like this.



 
n/a

Smeggy

The Smegster

Registered
  08/01/2003
Points
  1062

VIP Member
11th January, 2004 at 08:02:24 -

Sounds a very difficult task, I hope you get around it..

 
http://www.klik-union.com

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
11th January, 2004 at 08:15:58 -

I've never played GTA but I've know that Jak II has an engine similar to it.
Like Circy said, use the turning detectors. For pedestrians, give them a more random movement.


 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
11th January, 2004 at 08:30:40 -

smarties have the answer
but they just wont tell me!!

i would start with the cars as bouncing ball objects and objects at set points in the road to turn them
mabye using flags to stop/start

 
.

Zane



Registered
  09/09/2003
Points
  1183
11th January, 2004 at 11:36:34 -

oh god. the memorys of taxi dash ar coming flooding back.
im attempting to make one now using the direction calculator. its not going well. ill keep trying though.

 
www.klikforever.co.uk
GO THERE!!!

Mr Coffee



Registered
  04/09/2003
Points
  440
11th January, 2004 at 12:42:18 -

Well, if you really want to make it good, you should have the cars change lanes, pull in and out of parking spots, etc. You would need to use fastloop and link detectors to each car. The cars would then use the detectors to see if it's safe to change lanes, turn right on red, etc. The cars would simply drive around randomly, changing lanes every once in awhile. I actually don't think it's that complicated, just very time consuming to program. The hard part would be programming the cars to navigate a parking lot. That would require quite a bit of work to pull off.

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

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
11th January, 2004 at 14:10:34 -

you could get some ideas if you look at the ai in games like grand theft auto.
the normal traffic is simple.
they just stop when they get too close to other cars and red lights and turn at the right time.
the police cars are more tricky to code because they chase you when you're wanted and aviod other cars by changing lanes.

 
.

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
11th January, 2004 at 14:51:30 -

hey, that reminded me of this little train simulation i started.

Works a treat, I just got bored of it too soon.

Image

edit: what bastard admin got rid of my amazing signiture?

Image Edited by the Author.

 
"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

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
11th January, 2004 at 15:12:22 -

eh? we can't edit signatures. you need database access.

 
www.thenatflap.co.uk

Kris

Possibly Insane

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

then it was obviously one of the admins with that power

 
"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

Karnage [Ragnarok Games]



Registered
  28/10/2003
Points
  664
11th January, 2004 at 15:22:24 -

Shadowcaster, maybe? He has the signature-changing power.

Well, here's a VERY simple engine, andy.

0 <---- Car
_|_ <---- Your basic t-junction.
^
Sensor

When the car hits the sensor, set alterable value a to random 1-3. 1=->, 2=->, 3 = ^.

 
Remember, there's a little darkness in all of us... we just express it best.
--Ragnarok Games



yuyu



Registered
  13/05/2003
Points
  202

VIP Member
11th January, 2004 at 20:04:13 -

Thanks for helpin out.

 
n/a

Ashman

Possibly Insane

Registered
  12/06/2002
Points
  3974
12th January, 2004 at 07:31:26 -

Kris you can take comfort in the fact that they also changed my rating! Or you can laugh at me, either way is good.

 
Show me the power child,
I'd like to say,
That I'm down on my knees today,
Gives me the butterflies,
Gives me away,
'Til I'm up on my feet again,
I'm feeling outshined.


"Outshined" - SoundGarden
   

Post Reply



 



Advertisement

Worth A Click