Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / pedestrians

Author
Message
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 11th Sep 2005 12:39
Hi all for my game i need to have huge amounts of pedestrians walking around but the more objects i try to put in the slower my game becomes no matter how high i set the sync rate. I need to know how to display at one point groups of people walking on the street but when you go away from them they get replaced from the game but another group appears again so basically theres say only 5 people models in the game but you see those people at different places again. Games like set in cities like driver or grand theft auto BUT IM NOT TRYING TO MAKE A GRAND THEFT AUTO GAME so dont say im trying to make a gta or mmorpg game. Ive been working on this game for a few months now but have only just joined the forums.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Sep 2005 15:42
Take a look at the OBJECT IN SCREEN() function.

This will return a zero if an object isn't in view, so you can hide it when it's behind you to keep frame rates up (because DB is only drawing the objects you can see).

Your other suggestion would have to be done based on distances.

Have specific locations on your matrix where groups will congregate.

When your character/camera gets within a certain distance of each spot, your 5 objects are deleted and recreated near the new location.

TDK_Man

Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 11th Sep 2005 16:59
place (for example) ten people around you within a radius of 50 units, create a 100 unit wide cylinder that is permenantly centered on your position, check for any people that are no longer hitting the cylinder, whenever you find one that isnt then place them 50 units away at a random position ahead of you (I did this for bubbles in an underwater game) OR do the same but have small hidden polygons at every possible person position, when you hit a polygon then replace it with a person, when it isn`t hit then make it a simple poly again, cut your vis range down by making the scenery complicated or foggy (or both), in wide open spaces you can increase the fog distance and keep the population very low to keep the framerate up.



the average IQ is 100...but the people that took the test where trying to look smart. most people don`t go over 50.
Area 51?, I`m more intrested in what they have in areas 1 to 50
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 11th Sep 2005 18:50
right ok next question is to do with what i need how do i create random traffic so say a vehicle comes down the road every time i run the game how do make it so that every time the vehicle that comes down is a differnet one out of 3 differnent vehicles avaliable
Leeorg
19
Years of Service
User Offline
Joined: 5th Jul 2005
Location:
Posted: 11th Sep 2005 20:54
The randomise commands.
RANDOMIZE TIMER() ` So its randomly different every time you run your game (place at start of program)
Then RND(3) and the outcome is 1,2 or 3. Each number is a different type of car.
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 11th Sep 2005 22:26
I thought rnd(2) would be better - gets you a number between 0 and 2. If you do rnd(2)+1, then you get between 1 and 3.

I think it always starts at 0.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Sep 2005 23:57
Tinkergirl,

You're correct.



+NanoBrain+

Login to post a reply

Server time is: 2025-05-22 09:20:56
Your offset time is: 2025-05-22 09:20:56