Sorry to let u feel confuse.
. Actually,I'm looking for some methods to revamp my simulation. Basically, I have created a simple simulation and attached at below.
REM PROJECT: HBS1
REM CREATED: 1/4/2009 3:01:05 AM
REM
REM ***** MAIN SOURCE FILE *****
REM
CLS
SYNC ON : SYNC RATE 0 : AUTOCAM OFF
SET TEXT FONT "VERDANA" : SET TEXT SIZE 14
AI START
AI SET RADIUS 20
RANDOMIZE 1
REM DIMENSION
WIDTH#=500 `X
HEIGHT#=100 `Y
DEPTH#=500 `Z
REM CAMERA
REM *** W X H X D *** 500 X 100 X 500 ***
POSITION CAMERA 0,500,-(DEPTH#/2)
POINT CAMERA 0,0,0
REM FLOOR
MAKE OBJECT BOX 100,WIDTH#,2,DEPTH#
POSITION OBJECT 100,0,-1,0
COLOR OBJECT 100,RGB(255,255,255)
REM CREATE X ENTITIES
FOR I = 3 TO 18
MAKE OBJECT SPHERE I, 20
COLOR OBJECT I,RGB(RND(255),RND(255),RND(255))
POSITION OBJECT I, (-WIDTH#/2+25*I-12.5+RND(5)),10,(-DEPTH#/2+10+RND(10))
AI ADD ENEMY I
AI SET ENTITY SPEED I,20
AI ENTITY GO TO POSITION I,RND(500)-250,(200+RND(50)-15)
NEXT I
REM MAKE BOUNDARY OBSTACLE, ENCLOSES THE SPACE TO KEEP THE ENTITY IN
AI START NEW OBSTACLE
REM ADD POINTS IN A ANTI-CLOCKWISE DIRECTION TO CREATE A BOUNDARY (USE CLOCKWISE TO CREATE AN OBSTACLE)
AI ADD OBSTACLE VERTEX -250,-250
AI ADD OBSTACLE VERTEX 250,-250
AI ADD OBSTACLE VERTEX 250,250
AI ADD OBSTACLE VERTEX -250,250
REM FINISH CREATING OUR BOUNDARY
AI END NEW OBSTACLE 0,1
AI COMPLETE OBSTACLES
AI SET AVOID MODE 0
DO
REM HANDLE DEBUGGING OUTPUT
REM ***COPYRIGHT DBP***
IF KEYSTATE(2)=1 AND PTIMER<TIMER()
PTIMER = TIMER()+300
PMODE = 1-PMODE
IF ( PMODE=0 ) THEN AI DEBUG HIDE PATHS ELSE AI DEBUG SHOW PATHS 2.5
ENDIF
IF KEYSTATE(3)=1 AND BTIMER<TIMER()
BTIMER = TIMER()+300
BMODE = 1-BMODE
IF ( BMODE=0 ) THEN AI DEBUG HIDE OBSTACLE BOUNDS 0 ELSE AI DEBUG SHOW OBSTACLE BOUNDS 0,2.5
ENDIF
IF ( KEYSTATE(59)=1 AND F1TIMER<TIMER() )
F1TIMER = TIMER()+300
F1PRESSED=1-F1PRESSED
ENDIF
IF ( F1PRESSED )
REM DISPLAY INFO
SET CURSOR 0,0
PRINT "ENTITIES FOLLOW PRESET PATHS, AVOIDING OTHER ENTITIES"
PRINT
PRINT "DEBUG CONTROLS: "
PRINT "[1] TOGGLE ENTITY PATH"
PRINT "[2] TOGGLE OBSTACLE BOUNDS"
PRINT
PRINT "FPS: ";SCREEN FPS()
ELSE
CENTER TEXT SCREEN WIDTH()/2, 30, "-- PRESS F1 FOR HELP --"
ENDIF
REM ***COPYRIGHT DBP***
AI UPDATE
SYNC
LOOP
All the entities (sphere) are referred to human. They were walking from bottom to the upper.
I would like to create the environment in a shopping mall. They travel from one place to another. They may exit or enter different shops. display how are the people avoid each other.
But now I'm facing the problem to position the entities at the beginning part. If I position the entities in the random way, the entities may be position quite near to each other and "overlapped" situation happed. If I position in the sequence, it will look like what i did now; all the entities are line up there. This look weird..
Hope there are any advice for me to revamp my code, so that the simulation can become more natural..
Thank you for all of your kind helps..