| 05-15-2009, 09:21 AM | #1 |
Hi, working on my first ever map here. I've been reading tutorials and experimenting on my own.. however, I cannot find out how to do this: Generating a random stage of the map when the game starts AND when a unit enters a waygate. All of the Area of Ice Escape maps do this. What this means is that there are several stages to the map, and when the game commences, a random stage is selected and played. When the hero reaches the end waygate another random stage is selected and played. Edit: I've thought about it and decided on using a region instead of a waygate at the end of the stage. Its probably easier this way (well for me thats the only way I can think of :P) Note: Map is in another language, name in Warcraft custom game list as "...." or something similar. |
| 05-16-2009, 10:06 AM | #2 |
Is this a singleplayer game, or do you need to be able to select a different random stage for different players at different times? |
| 05-16-2009, 10:22 AM | #3 |
It will be a multiplayer game. And if one person reaches the end, everyone will advance to the next random stage simultaneously. |
| 05-16-2009, 11:36 AM | #4 |
Oh, ok, then it's simple. Keep an array of all stages and an integer variable with the number of stages stored in it. Then, pick a random value between 1 and the number of stages and pick that stage; remove it from the array and store the last stage in it's place, then decrease the integer variable by one. Whenever a new stage needs to be picked, repeat the process. This will eventually empty your array, when that happens, end the game (you can also end it sooner, if you have a time limit or a stage limit). If this is supposed to go on forever and stages can be picked more than once, simply skip the step where you remove the stages from the array. |
| 05-16-2009, 09:21 PM | #5 |
Oooo that sounds complicated >< but Ill give it a go. The game will not go on forever or repeat any of the stages. Once the players have passed all of the stages, the game will end. Actually now that I think about it, Id like something like a "final stage" once the players have successfully completed all the stages. But Ill concentrate on figuring out how to do the random stages first :P |
| 05-18-2009, 08:40 AM | #6 | |
Quote:
Randomly generating new levels is incredibly complicated. I've tried something like this before and I came up with a pathfinding algorithim which worked; but took something like 45 seconds to generate a 64x64 map; which was just unacceptable. I know there are faster ways to do it; but the criteria really adds up. I had decided to segmentalize "compartments" and combine them amorphically; but it never came to fruition. However; there's a pathfinding/generating algorithim somewhere in the script section which is atleast a basis to start with. |
| 05-18-2009, 02:14 PM | #7 | |
Quote:
That's not what he wants, he'll pre-create the stages, and simply make them start in a random order, which is very easy. |
| 05-19-2009, 06:21 AM | #8 |
Yup what Feroc1ty said. Ill have the stages pre-made, I just want them in a random order. I also want the camera to be bound to just the stage. Is this done with regions or what? |
| 05-19-2009, 06:54 AM | #9 |
Create rects for each stage, and when the specific stage is selected there is a function call that will make the camera bound to the specific rect. |
| 05-20-2009, 05:46 AM | #10 |
Thanks Ill try that |
