User talk:Ezer'Arch/Level Design
Enemy seeing distance
Hmm, only read this now. Some distances are incorrect in there, you know? For instance, both Buzzes attack you on sight, no matter the distance. The same thing applies to the Deton. The Turret's distance is actually 2048. The Pop-up Turret has no view distance and as long as any player is in its 360 degree line of sight (as in no walls blocking that line), it will shoot a bullet. The Jet Jaw has a view distance of 192.
I confirmed these on the source, but still I'm curious about your test wad. If you could upload it somewhere, I would appreciate it. I'd like to take a look at it to see if I misread something ^_^' --Ricardo [Contribs] [Talk] 17:57, 30 September 2010 (UTC)
There you go: http://dl.dropbox.com/u/4799936/SRB2/Files/TestArea.wad
Only the test wad itself isn't enough. You'll need to open up the file on SRB2DB and:
- replace the enemy you want to test with;
- run the map;
- don't move yet. Turn the camera so you can see the enemy. On console type "cam_rotate 180; cam_dist 8000;". A script will be useful here.
- turn on DEVMODE;
- walk along Y-axis. The Y-value will tell you the distance between the player and the enemy. To get an exact value, use "teleport -x -y" to "move" the player until the enemy detects the player.
A screenshot. --Ezer'Arch|עֶזֶר'AρχTalk 02:52, 1 October 2010 (UTC)
Okay, I tested your map and revisited the relevant code, here's where I was wrong T_T
- both Buzzes have a max view distance of 3072 (they actually look at you no matter how far you're from them, but they only start chasing you at the 3072 mark), and to properly test this you must give the sector they spawn in a floor height of -288 so they spawn at coordinate z = 0;
- detons behave exactly like the buzzes ("chasing" distance = 3072); test it with the sector's floor height at -33;
- Turret: 2047 (sorry, I totally misread that one);
- Pop-up Turret: 1024 (see above x_x).
About the Jet Jaw, yep it's really 192. The thing is, it's kind of tricky to test it properly since the guy never stops swimming around! Anyway, to make the sucker stand still run a soc with these lines before level load :P
- Thing 14
- REACTIONTIME = 0
That's all I've got. --Ricardo [Contribs] [Talk] 23:39, 1 October 2010 (UTC)
I'm glad my material was of some use. --Ezer'Arch|עֶזֶר'AρχTalk 03:19, 2 October 2010 (UTC)
If these values are precise and valuable for some use in level design, why not to include them in actual articles? --Ezer'Arch|עֶזֶר'AρχTalk 01:23, 7 October 2010 (UTC)
Ricardo, could you please tell me which source code file where you found the enemy seeing distances? I'd like to look into it for my amusement ^_^. --Ezer'Arch|עֶזֶר'AρχTalk 23:20, 7 March 2011 (UTC)
It's in both info.c and p_enemy.c. I used the former to check which actions the enemies called and the latter to read their implementations. Sometimes you can see some pretty weird "hardcode-ness", for example in A_JetJawRoam (Jet Jaw's "player searching" action), the seeing distance is equal to 16 times the mobj's radius (12 fracunits), hence 192. --Ricardo [Contribs] [Talk] 16:21, 8 March 2011 (UTC)