- Joined
- Sep 6, 2009
- Messages
- 1,213
- Reaction score
- 42
- Age
- 36
Example Map
RMF: https://www.dropbox.com/s/bp4na7l0ls208 ... s.rmf?dl=1
BSP: https://www.dropbox.com/s/rqvbcjoctmvcv ... s.bsp?dl=1
One of the problems with freeroam maps is that they have a tendency cause strain on the server. This is because players are not usually forced to kill monsters in a non linear map, so many monsters will likely be active at the same time in many different areas. This stresses the server and can cause lag or, even worse, a crash. However, there are ways to get around this problem.
You will need the following basic entities for this to work:
- several ms_monsterspawn entities
- an equal number of trigger_multiple entities
- an equal number of multisource entities
- an equal number of func_buttons
- at least three multimanagers
- 1 trigger_once
Here is what you do:
1) Take each area of your map with monsters in it, and cover the floor with a trigger_multiple brush which targets an ms_monsterspawn entity. We will call these areas "combat zones". Don't forget to set the "delay before reset" time on your trigger_multiple brushes (we will come back to this later).
2) Create a multisource entity for each combat zone and type the name of that entity in the "Master" property of the trigger_multiple brush. This has the effect of "locking" your combat zone. Monsters wont spawn unless the multisource entity is being triggered.
3) Create a func_button that targets each multisource entity. Give each button a unique name. Don't forget to set the "delay before reset" time (we will come back to this later).
4) Create a multimanager entity that targets each func_button and set it's random property to "1". If you have too many combat zones in your map you may need to make more than one multimanager. In the example map, this entity is named "random_button".
5) Create another multimanager. This multimanager must target the previous multimanager, and a third multimanager that you will create in the next step. Make sure the "random" property of this multimanager is set to "0". In the example map, this entity is named "start".
6) Create one last multimanager. This one has to target the multimanager that you made in step 5, which creates an infinite loop. In the example map, this entity is named "restart".
7) Create a trigger_once brush that targets the multimanager you made in step 5. Monsters will not be able to spawn until a player triggers the "start" multimanager by walking through this brush.
8 ) Finally, you need to make sure any monster gets deleted if it hasn't attacked a player in a long time. Use the addparam set_die_nt;120 for this. This will cause any monster who has no target to die after 120 seconds. However, 120 seconds is just an estimate, and this number should vary based on the size of your map.
It is important to set the timers correctly on all of your entities. This allows you to adjust the number of combat zones that can spawn monsters at a single time. In the example map it is possible for two out of three combat zones to be unlocked at any given time because the "Delay before reset" timer on the trigger_multiple brush is 10 seconds, and the "delay before reset" timer on each of the func_buttons is 20 seconds. Note that it also takes 10 seconds for the "start" multimanager to loop with the "restart" multimanager so you don't spawn monsters twice in the same room if you kill them before the combat zone locks down again.
Also, be aware that every map is different, and you will have to adjust these numbers in your map in a way that makes sense. You don't want monsters to spawn too rapidly or too slowly. You will probably have to do some testing to find the "Goldilocks" zone for your particular map.
...and there you have it. Monsters will now spawn in your map forever, in random locations, without ever flooding the server with too many active monster entities. Players can split up, and run away from as many monsters as they want, and the server will not crash or even lag. This is a great way to make high level, exploration oriented maps. Combined with randomly spawning monsters and events, you can add a lot of replay value. Hopefully this method will be used more often in the future because it opens up a lot of avenues for creative level design.
RMF: https://www.dropbox.com/s/bp4na7l0ls208 ... s.rmf?dl=1
BSP: https://www.dropbox.com/s/rqvbcjoctmvcv ... s.bsp?dl=1
One of the problems with freeroam maps is that they have a tendency cause strain on the server. This is because players are not usually forced to kill monsters in a non linear map, so many monsters will likely be active at the same time in many different areas. This stresses the server and can cause lag or, even worse, a crash. However, there are ways to get around this problem.
You will need the following basic entities for this to work:
- several ms_monsterspawn entities
- an equal number of trigger_multiple entities
- an equal number of multisource entities
- an equal number of func_buttons
- at least three multimanagers
- 1 trigger_once
Here is what you do:
1) Take each area of your map with monsters in it, and cover the floor with a trigger_multiple brush which targets an ms_monsterspawn entity. We will call these areas "combat zones". Don't forget to set the "delay before reset" time on your trigger_multiple brushes (we will come back to this later).
2) Create a multisource entity for each combat zone and type the name of that entity in the "Master" property of the trigger_multiple brush. This has the effect of "locking" your combat zone. Monsters wont spawn unless the multisource entity is being triggered.
3) Create a func_button that targets each multisource entity. Give each button a unique name. Don't forget to set the "delay before reset" time (we will come back to this later).
4) Create a multimanager entity that targets each func_button and set it's random property to "1". If you have too many combat zones in your map you may need to make more than one multimanager. In the example map, this entity is named "random_button".
5) Create another multimanager. This multimanager must target the previous multimanager, and a third multimanager that you will create in the next step. Make sure the "random" property of this multimanager is set to "0". In the example map, this entity is named "start".
6) Create one last multimanager. This one has to target the multimanager that you made in step 5, which creates an infinite loop. In the example map, this entity is named "restart".
7) Create a trigger_once brush that targets the multimanager you made in step 5. Monsters will not be able to spawn until a player triggers the "start" multimanager by walking through this brush.
8 ) Finally, you need to make sure any monster gets deleted if it hasn't attacked a player in a long time. Use the addparam set_die_nt;120 for this. This will cause any monster who has no target to die after 120 seconds. However, 120 seconds is just an estimate, and this number should vary based on the size of your map.
It is important to set the timers correctly on all of your entities. This allows you to adjust the number of combat zones that can spawn monsters at a single time. In the example map it is possible for two out of three combat zones to be unlocked at any given time because the "Delay before reset" timer on the trigger_multiple brush is 10 seconds, and the "delay before reset" timer on each of the func_buttons is 20 seconds. Note that it also takes 10 seconds for the "start" multimanager to loop with the "restart" multimanager so you don't spawn monsters twice in the same room if you kill them before the combat zone locks down again.
Also, be aware that every map is different, and you will have to adjust these numbers in your map in a way that makes sense. You don't want monsters to spawn too rapidly or too slowly. You will probably have to do some testing to find the "Goldilocks" zone for your particular map.
...and there you have it. Monsters will now spawn in your map forever, in random locations, without ever flooding the server with too many active monster entities. Players can split up, and run away from as many monsters as they want, and the server will not crash or even lag. This is a great way to make high level, exploration oriented maps. Combined with randomly spawning monsters and events, you can add a lot of replay value. Hopefully this method will be used more often in the future because it opens up a lot of avenues for creative level design.