ID:754648
 
Not a bug
BYOND Version:494
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 19.0.1084.46
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
Mobs with larger bound_width / bound_height don't step_rand very well.

The world.icon_size is 32.
A mob is set to have bound_width and bound_height of 64 and it's icon is a 64x64 icon

Numbered Steps to Reproduce Problem:
1. Setup an environment with some walls and some ground, and put these mobs on the map.

The loop is used to tell the mob to step randomly, but what occurs is that the mob just keeps going in one direction until it hits something.

The smaller mobs actually move around random, though.

2. Use the code below

Code Snippet (if applicable) to Reproduce Problem:
mob
lol_mob
speed = 1
New()
..()
spawn move()
proc
move()
while(src)
step_rand(src)
sleep(11 / speed)


slime
icon_state = "slime"

abom
icon = 'abom.dmi'
bound_width = 64
bound_height = 64


Expected Results:
The regular mobs (unchanged bound_width and bound_height) tend to move more randomly and do not just go in one direction. I expect the big mobs to move around randomly as well.

Actual Results:
The bigger mobs (with bigger bound_width) just walk straight in one direction until they hit something. Only then, do they switch direction.

Does the problem occur:
Every time? Or how often?
This problem occurs every time I've tried it.

In other games?
Don't know.

In other user accounts?
Doesn't apply.

On other computers?
Yes.

When does the problem NOT occur?
It always occurs.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Not sure. Haven't tested.

Workarounds:
Roll your own step_rand, I guess.

Try out this project: http://www.joeysturgis.com/step_rand_bug.zip
You left out the "actual results" part. I'm not sure what's actually happening here.
Check out the code. The big mobs only move in one direction until they hit something. And all I'm telling them to do is step random.
Updated.
The behavior of step_rand() hasn't changed, according to tests with old versions. The function does not randomize the direction on every step, but only when hitting an obstacle. It works much like walk_rand() in this regard.
Lummox JR resolved issue (Not a bug)