May 23, 2012, 12:31:16 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Traffic system?  (Read 1814 times)
Spaz
Full Member
***
Posts: 109


View Profile
« on: February 12, 2009, 02:24:02 PM »

I've seen lots of chatter on the forums about a traffic system, but I sure can't find any examples / templates / tutorials, etc. . .  Does anybody know if a traffic system actually exists?  Does a tutorial or example exist that we could learn from? Huh
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #1 on: February 12, 2009, 02:33:30 PM »

in previous gamecore ther was a car demo with cars going round and round Smiley
Logged
Spaz
Full Member
***
Posts: 109


View Profile
« Reply #2 on: February 12, 2009, 03:32:55 PM »

Yeah, I remember that.  Can't find it on my hard drive, though.  Would you have a copy of that you could post?
Logged
Spaz
Full Member
***
Posts: 109


View Profile
« Reply #3 on: March 12, 2009, 06:35:25 PM »

Anybody?

As a matter of fact, does anybody remember what release that was that had that racing demo?  I've probably got the installer for that version still if I knew which one it was.
Logged
Ron
Sr. Member
****
Posts: 326


View Profile
« Reply #4 on: March 13, 2009, 12:18:31 AM »

As a matter of fact, does anybody remember what release that was that had that racing demo?  I've probably got the installer for that version still if I knew which one it was.

I think it was a Alpha release, but I'm not positive. I deleted mine awhile back. I either broke it  Smiley or maybe the raycasting command format changed. When I tried to run it back then the cars sunk to the ground and rested the body collision on the pavement.

I do remember itused pathfinding to get around the track, not the traffic system. I am using the newest raycasting vehicle demo as a example while I change over from the joints vehicle. Working pretty well, except when I crash it launches into outter space  Cheesy
Logged
Spaz
Full Member
***
Posts: 109


View Profile
« Reply #5 on: March 13, 2009, 11:59:28 AM »

I'm using the newest raycasting version as well.  I like how it drives, but it's just really goofy how gravity affects it.  If the car's not on level ground it's going to start sliding or rolling.  There's no lateral friction to keep it from sliding sideways, nor parking brake to keep it from rolling forward or backward.  I haven't noticed the bounce into space issue, but I have noticed that if I walk into one of the wheels with the lego guy it knocks the vehicle over on its side pretty violently.  Doesn't happen if I walk into the side of the vehicle, only the wheels.  Also, my cars roll over way to easily.  I've got all the weight down low, but it doesn't seem to help.  I'm going to try increasing the weight a fair amount to see if that helps.  Then I'll have to give it more power to get it moving.

I didn't know the older demo wasn't using the traffic system.  I don't really want to start using something that's outdated.  I got Gekido to send me a file called cars.lst that contains the list of cars you want used by the traffic system, but I don't know how or where to call the file.  There are also some things in it that I'm not sure the purpose of.  It looks like this:

Quote
MinPathType 0
MaxPathType 0
MinDistance 100
MaxDistance 150
AverageSpeed 15
MaxVisible 50
OrientTerrain 1

LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_blazer.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_bmw_X5.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/van_tranz.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/van_renault.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/suv_xc60.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_volvo_s80.opr
LoadObject 1 10 ../../media/objects/vehicles/city_cars/car_taxi2.opr
LoadObject 1 10 ../../media/objects/vehicles/city_cars/car_taxi1.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_rangerover.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_pontiacg6.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_policebmw.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_mitsubishi_x.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_mercedes_e.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_mercedes_s.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_mercedes_cls.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_mercedes_cl.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_lexus.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_imprezza.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_crown_victoria.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_challenger.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_cadillac_xlr.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_bmw_6.opr
LoadObject 1 5 ../../media/objects/vehicles/city_cars/car_policenypd.opr

Got any ideas what the 1 and 5 are for behind the LoadObject?  Got any ideas where or how to call it so it can be used by the traffic system?  Any ideas how to activate the traffic system? Undecided

I've tried to reach Gekido several times trying to get information or a sample to work from , but so far I've been unsuccessful.
Logged
Spaz
Full Member
***
Posts: 109


View Profile
« Reply #6 on: March 19, 2009, 01:17:39 PM »

Hey, hey, I finally got some instruction from Johnathan about how this whole thing works.  It does a lot more than what I got instruction for, but if you just want some traffic on a simple road, here's what everything means.

Concerning the cars.lst file that I posted earlier:

Quote
MinPathType [number]
  The minimum path type which these traffic objects should be spawned on (as specified in the path editor).

MaxPathType [number]
  The maximum path type which these traffic objects should be spawned on.

MinDistance [distance]
  The minimum distance from the camera at which the object can be spawned.

MaxDistance [distance]
  The maximum distance from the camera at which the object can be spawned. Any objects going beyond this distance will be recycled.

AverageSpeed [speed]
  The average velocity of the objects after being spawned (meters/second). If the camera is moving faster than this speed, objects moving away from the camera will also be spawned, not only ones moving towards the camera (such as in the case of driving fast down a road, you want to be able to catch up to traffic which is going the same direction but slower).

MaxVisible [number]
  This is the absolute maximum number of these objects that can be active at any one time.

OrientTerrain [0 or 1]
  If set to 1, the objects when spawned will be oriented to face along the vertical path orientation so that it sits oriented with the ground (ie. placing a post box on a hill will cause it to lean accordingly). If set to 0, the objects will be spawned completely upright, with no regard for the slope of the terrain (ie. a street lamp always stands straight).

LoadObject [probability] [load count] [object file]
  There can be multiple of these lines in the file. The probability value specifies how likely it is that this object will be spawned in comparison to all the others (ie. if one object has a probability of 2 and another a probability of 1, then it will show up twice as often compared to the other object). "Load count" specifies the maximum copies of the specified object file to load into memory. Spawned objects are recycled, however each simultaneously visible object must be unique so this in essence specifies the maximum number of this object that can be visible at any one time. Setting this value appropriately is important because if you specify too many then your application can run out of memory, but too few and you may not have enough objects to populate your world as desired.

Then as for how to call the cars.lst file, I did it from the main.gsl script using these commands:

Quote
Once you have your traffic list file prepared, it can be loaded in the game by calling:
    GetGameManager().GetWorld().LoadTrafficList( "cars.lst");

The traffic manager will automatically start working at that point, however it will not spawn any objects within the minimum radius. So in order to pre-populate an area, after you have the camera positioned call:
    GetGameManager().GetWorld().PopulateTraffic();

PopulateTraffic can be called multiple times if the desired density is not reached within a single call.

Works like a charm.  Only thing I had to do was decrease the PathTurnSharpness variable in each car's opr file so they'd travel down the road without worming back and forth within their lane.

You do, of course, have to have a path on your road.  If anyone needs directions on how to do that just let me know, but it's an extremely easy thing to do within the Edit Road menus.

Hope that helps some of you! Grin
Logged
gekido
Guest
« Reply #7 on: June 13, 2009, 02:10:23 AM »

http://www.gamecore3d.com/docs/user-guide/bringing-your-worlds-to-life/procedural-geometry-traffic-system

The next release includes updates to the simple_bad_guy.gsl ai controller so it is fully integrated and supports usage within the traffic system.  Works very well actually.  I also have a simple pathfollower stand-alone script that can be used for pedestrians etc as well that should be ready to be bundled with a release soon.
« Last Edit: June 13, 2009, 02:12:54 AM by gekido » Logged
steenosterby
Newbie
*
Posts: 26


View Profile
« Reply #8 on: August 14, 2009, 07:27:42 AM »

Hello

I have tried to place

GetGameManager().GetWorld().LoadTrafficList( "EnviromentWorld.lst");
    GetGameManager().GetWorld().PopulateTraffic();

in my game.gsl

but get error's.

It will really help if someone had a very small project example to show how things is done.

Please help
Kind regards Steen Osterby
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #9 on: August 14, 2009, 09:33:35 AM »

I will search for the car demo when I get home, I know I have it because it uses my sky texture, some brown cars going around. In max 3 hours I will post

PS. I think I have ALL past revisions of BV and gamecore installed still so alot of old demos that don't fully work anymore but some things to "steal" and implement in new versions
Logged
steenosterby
Newbie
*
Posts: 26


View Profile
« Reply #10 on: August 14, 2009, 02:45:10 PM »

thank you for your help and looking forward to download that project. We really need alot more tutorials projects. For gamecore. I am also a old beyondvirtual user and still waiting for ex. Gore blood decals and some more advanced ai npc. Like intense-i.com anyway thanks.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #11 on: August 14, 2009, 05:58:00 PM »




Here are the template files for the car path demo:

http://www.filefront.com/14285901/Car%20Racing.rar

around 8mb .rar file
Logged
steenosterby
Newbie
*
Posts: 26


View Profile
« Reply #12 on: August 15, 2009, 04:46:48 AM »

hello pix i cant find the car list in the project. Does anyone have a example project about traffic manager regards steenosterby
Logged
Freedom
Newbie
*
Posts: 11


View Profile
« Reply #13 on: December 09, 2009, 11:40:37 AM »


...

Here are the template files for the car path demo:

http://www.filefront.com/14285901/Car%20Racing.rar

around 8mb .rar file
Link was dead Sad Can you upload it again pls  Undecided
« Last Edit: January 14, 2010, 03:42:29 PM by Freedom » Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!