Randomize enemies and items so each playthrough is different.

Steven1985

Active member
Hi, I'd like to know if there the possibility to randomize enemies and items, their quantity, position and choose which enemies and items to make random, everything even between number ranges (for example I want there to be a random number of enemies or the random number must be between 7 and 10; that enemies are chosen randomly or they are random only those with the name a, b, c; that items are located randomly or in the x coordinate range between 100 and 200 and y between 180 e 220). This is to have the playthrough always different.
 
Sure, but to do it you'll have to handle all of those things with script. Other than AI movement, the engine is intentionally designed not to randomize anything natively.

DC
 
@Steven1985
the enemies & items that can be easily randomized are the types that come from outside of the screen, one way is to spawn entities that move very rapidly in vertical fashion that feature a walking anim script that spawns random subentities from a list features in another script.
another way is for a invisible entity to summon entities from outisde of the screen, but the script to make the coordinates variable escapes me...
(night slashers X 21C - grey Knight Boss)
some problems i was not able to resolve is the fact that subentities are independent of the numbers that define groups or "at" or "wait" values. In order to fix that you have to find a way for the sub-entities to kill or remove the parent that is offscreen or on but invisible.
on screen random objects enemies & placement is harder to do, the next best thing currently is to exploit the "model change" to give enemies with same appearance different varieties of AI & attack patterns.
you can also use an invisible entity that runs lightning fast on screen (it covers most of the playabe on screen area In less than a second) & its walking animation features - say -- 10 branches that can spawn a randomized enemy or item, but be aware that said enemy or item needs to
A: fall from the ceiling or B: appear from the ground bugs bunny style... or C: come from a void or portal (its spawn animation)
there may be scripts that can spawn random enemies on screen around this forum , but i don't think there are any featuring random coordinates yet
 
I have to agree with Damon Caskey there. Randomizing enemies is best done with script coded manually.
And you really should code it manually to control randomness to prevent strong enemies to appear in stage 1. Unless you don't mind fighting Bongos and Ravens in SoR2 stage 1.

Oh about randomizing items, I have to disagree with that one. Randomizing score items is fine but not food items. It ruins your expectation when you want to recover to full health 🍗 but only find small food which recover small health 🍬.
 
I use global variables that I declare through function entity scripts (invisible). At first it is hard to use but later it becomes easier, I have also seen that there are scripts to generate entities randomly, I think @Oh illusionista uses them in his great Avengers game
 
Back
Top Bottom