Random spawning items in a map

Sun Oct 31, 2021 8:24 am

Hello everyone!

I am really not an expert in Doom or mapping at all, so any help is appreciated! I am writing a project on distributed vision reinforcement learning and we are using VizDoom (http://vizdoom.cs.put.edu.pl) as our environment. The objective is for the agents to find a green armour within a map. My problem is that our training map (can be found in their GitHub called my_way_home.wad or here "https://github.com/mwydmuch/ViZDoom/blob/master/scenarios/my_way_home.wad") is supposed to spawn in the object at random locations and not in the same location each episode. I do have Slade so I am able to edit my .wad file. If you need more info, don't hesitate to ask!

Any help would be very much appreciated, and I'll buy you a beer if you ever come to Copenhagen!

Re: Random spawning items in a map

Sun Oct 31, 2021 10:26 am

For those wishing to provide assistance (as the link doesn't work for me, but a Google Cache does...), VizDoom is based upon ZDoom - so assume 2.8.1 for compatibility purposes :)

Re: Random spawning items in a map

Tue Nov 02, 2021 4:06 pm

I do have a solution, that hopefully will match what you need (Not fully sure it is 2.8.1 compatible, which is why it uses ACS)

1. Open the map you'd like to have randomized locations
2. Place a MapSpot (Thing 9001) in each location you'd like the item to spawn
3. Set a unique TID for each MapSpot, make sure they are in sequence. Remember the first and the last TID you used
4. Add this script to the map and compile it
Script 1 ENTER
   int X = Random(1,3); // In place of the numbers, use the first and last TID number you put in the MapSpot

All this should be enough for it all to work :)

Re: Random spawning items in a map

Thu Nov 04, 2021 12:01 am

A little update - it should NOT be an ENTER script, it should be an OPEN script.

Since ENTER is launched for each player, it would not work well in multiplayer environment.