Procedurally generated encounters

Blueworx

Villager
Member
Joined
Jan 6, 2019
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hi RPG-Makers,
for my current game I'm trying to figure out a way to generate random encounters that you can *see*, and therefore avoid or actively seek out while they are moving. Some are enemies. Some are not. My solution so far is this...



I let the event autorun when entering a map, generating a random number that turns a self switch and generates one of four (ABCD) encounters, with a specific appearance, behavior and aftermath. If you kill them (well, no one dies in my game, but that's a different story) they disappear, and the next time you enter the map a new encounter will be set up.

This thing does exactly what I want, but: Only with 4 different outcomes. The main purpose however is to
save time by not having to build/customize every single encounter, while explicitely not using the random encounters.

The main problem is the appearance of the moving event. I can set up 4 different events that have a specific appearance in the example above by storing the "choice" in a self-switch. If I try to do the same with a common event I can't for the life of me figure out how to do the same for the hundreds of choices that will eventually be possible (and necessary).

I'm pretty sure I'm not the first person to try this, but I haven't been succesful finding a solution so far. Maybe you have an idea or done something similar?
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
224
Reaction score
199
First Language
Swedish
Primarily Uses
If you run a common event from a map event any self switch stuff you do in the common event will only effect the map event that called the common event. So that could.... maybe help some as well?
 

Blueworx

Villager
Member
Joined
Jan 6, 2019
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
If you run a common event from a map event any self switch stuff you do in the common event will only effect the map event that called the common event. So that could.... maybe help some as well?
Good idea, but tried that already and there was a cruel moment of hope until I realized that I'm still limited to ABCD. It's crazy how each event has his own 4 flags, but I can't find a way to store one individual variable in it. The only way I see right now is to create a common event for every single instance of the generating event, handling it's own set of variables, and that is just insane.

I had a similar problem with collectibles where it was seemingly impossible to have the common event they called when used figure out which item called them, so each item needed it's own event. Thanks to copy+paste it's not that much work, but it bugs me because it blows up the number of variables and events. And I really don't want to get into scripting, so hopefully there is a plug-in...


What about my event spawner plugin, would it help?
(...)
Thanks, this looks interesting; give me a day or two to see what I can do with this.
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
224
Reaction score
199
First Language
Swedish
Primarily Uses
Good idea, but tried that already and there was a cruel moment of hope until I realized that I'm still limited to ABCD. It's crazy how each event has his own 4 flags, but I can't find a way to store one individual variable in it. The only way I see right now is to create a common event for every single instance of the generating event, handling it's own set of variables, and that is just insane.

I had a similar problem with collectibles where it was seemingly impossible to have the common event they called when used figure out which item called them, so each item needed it's own event. Thanks to copy+paste it's not that much work, but it bugs me because it blows up the number of variables and events. And I really don't want to get into scripting, so hopefully there is a plug-in...




Thanks, this looks interesting; give me a day or two to see what I can do with this.
An event spawner plugin of some sort is probably your best bet then.
 

Broozer

Veteran
Veteran
Joined
May 30, 2018
Messages
48
Reaction score
7
First Language
Dutch
Primarily Uses
RMMV
Have events that wander around, and when you touch them, make them select a random number.
Based on that number, you fight a specific troop.
 

Blueworx

Villager
Member
Joined
Jan 6, 2019
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
Have events that wander around, and when you touch them, make them select a random number.
Based on that number, you fight a specific troop.
That would be the easy way out, and if you look at the image above, that *is* pretty much what I'm doing. The real problem is that I want them to look their part *before* you run into them.

 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,039
Reaction score
10,258
First Language
Czech
Primarily Uses
RMMV
And I realize now I made an oops.
I shouldn't have suggested just the event spawner...
But the extra event pages plugin.
It allows you to artificially increate an event's pages to above 20.
Nevertheless, your situation made me realize that the plugin needs an update before it can be used by your project.
 

Blueworx

Villager
Member
Joined
Jan 6, 2019
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,039
Reaction score
10,258
First Language
Czech
Primarily Uses
RMMV
When I update my extraEventPages plugin, it should be even easier. However, I need to find time for that... :D
 

mobiusclimber

Veteran
Veteran
Joined
May 3, 2018
Messages
254
Reaction score
148
First Language
english
Primarily Uses
RMMV
What you're doing works, right? Why not use a variable? That way you can make more than 4 outcomes.

[edit: you could set up the variable through the player move event command - so say you're in town and you leave. The event that takes you to the new map would also choose a random number for your variable. Every enemy event on the new map would have something different for that number variable.]
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Guess I'll rework all the existing screens in my game. Except of the save/battle screen. For this I will be lazy and use Yanfly. With my current pace it'll take a few months.
Electro Swing--it's like swing--but with electros.
Is it wrong to look like a dead fish at all times :)
What worst could happen when your driver said "I know a shortcut"?

Forum statistics

Threads
93,629
Messages
914,118
Members
123,212
Latest member
nuwandw
Top