Raised This Month: $ Target: $400
 0% 

[INC] GHW Spawnlist Generator


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 08-14-2008 , 05:32   [INC] GHW Spawnlist Generator
Reply With Quote #1

  • This script simply fills in a floating point array with random origins for player spawns. The player spawns are all tested to be assured that the spawns are valid (inside of the map). This process takes a while and test results for some maps on my home PC are listed below.
  • This process is meant to be run simply once per map which means whoever uses this script should create a way to save and load the origins.
  • An example of how this script can be used is attached (it is fully functional and requires AMXX 1.8+ (Ham Sandwich)).
  • A test plugin that I used to test the methods and bad spawns is also attached.
  • This can also be used to create random power-up/item/rune/etc. spawn locations (Change min/max size in .inc file)



  • Code:
    /* GHW Spawnlist Generator - v1.0
    *
    * by GHW_Chronic
    *   06/2008 - 08/2008
    *
    * This file is provided as is (no warranties).
    *
    *
    *
    *
    *	//This fills in the array (Float:origins[MAX_ORIGINS][3])
    *	//Methods: 1=Normal 2=Extensive 3=Exhaustive
    *	//num_origins - number of origins to find (Max is MAX_ORIGINS)
    *	genspawnlist(method,num_origins)
    *
    *	//This checks to see if a player is inside the map (Some maps may give broken random spawn points)
    *	In_Map(id)
    *
    *	//This stops the current search
    *	save_locations()
    *
    *
    *	Tests (Windows - AMD 64-bit 2.6 Ghz Dual-Core Processor):
    *
    *	Map		Method		# Found		Time (sec)	# Broken
    *	de_dust2	1		27		60		0
    *	de_dust2	2		30		93		0
    *	de_dust2	3		30		97		0
    *	de_train	1		20		60		1
    *	de_train	2		30		70		0
    *	de_train	3		30		120		0
    *	de_nuke		1		30		41		0
    *	de_nuke		2		30		65		0
    *	de_nuke		3		30		122		0
    *
    *
    *
    */
    
    
    //Number of origins to find
    #define MAX_ORIGINS	30



  • Methods
    • #1 - Normal - Searches 2,500,000,000 units3 with a 60 second timeout
    • #2 - Extensive - Searches 16,000,000,000 units3 with a 120 second timeout
    • #3 - Exhaustive - Searches 24,000,000,000 units3 with a 300 second timeout
    • Normal works for most maps yet sometimes Extensive can give better results. Exhaustive seems to give the best results however it takes on average 2-3 times longer than Normal.


  • Note: Attached below are a few examples of bad spawns not detectable by my algorithm nor the In_Map(id) function.
Attached Thumbnails
Click image for larger version

Name:	GHW_SLG-cs_assault1.jpg
Views:	4351
Size:	26.6 KB
ID:	30172   Click image for larger version

Name:	GHW_SLG-cs_assault2.jpg
Views:	4330
Size:	36.6 KB
ID:	30173   Click image for larger version

Name:	GHW_SLG-de_dust2.jpg
Views:	4745
Size:	52.2 KB
ID:	30174  
Attached Files
File Type: inc GHW_spawnlist_gen.inc (6.1 KB, 2683 views)
File Type: sma Get Plugin or Get Source (GHW_Spawnlist_Test.sma - 2755 views - 1.5 KB)
File Type: sma Get Plugin or Get Source (GHW_Spawnlist_Example.sma - 2810 views - 1.7 KB)

Last edited by GHW_Chronic; 08-14-2008 at 05:49.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode