Announcement

Collapse
No announcement yet.

Efficient Random Battle System

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Efficient Random Battle System

    Inspired by Raithwall, I came up with a way to minimize Enemy Units as well as Unit Placement. Essentially, it works by having one enemy call others based on Map number. Here are the specifics;

    Step 1:
    Create an enemy from scratch(don't copy and paste, it will only need one directing command)we'll call him "Sorter". Set it's action status to Death(This clears it from battle once it's task is complete). Then create an Enemy Movement from scratch. Lastly, create a unit comprised of one "Sorter".

    Step 2:
    Make the following short script:
    Random Var.0?3
    Data:Variable:Temp Var.8=0?3//This can be set to the total amount of enemies per map.

    Next, make this script to sort the enemies by Map#:
    Enemy Sort 2
    Script Branch:Sort:Variable[Map Number]
    Apply If:0//Or whatever Map# you choose.
    Call[Random Var.0?3]
    Sort:Temp Var.8
    Apply If:0
    Enable Call Enemy[Goblin]
    Call Enemy[Goblin]
    To End
    Apply If:1
    Enable Call[Dragon]
    Call[Dragon]
    To End
    (Repeat for all enemies in the area)
    Script Branch:End
    To End
    Script Branch:End

    Next make this script to tie it all together:
    Enemy Sort 1
    Data:Variable:Temp Var.9=3
    SB:Repeat:Temp Var.9 N= 0
    Call[Enemy Sort 2]
    Data:Variable:Temp Var.9=Temp Var.9 -1
    Wait 7F
    SB:End
    Apply Together
    Camera:Veiwpoint Target
    Color:Black,Black,Black,Black, Trans.100% 30F
    Apply In Order

    Step 3:
    Create a sytem event for Enemy Sort 1. Place this event in "Sorter"'s Enemy Appear slot. Then, in the Battle Opening script, remove the Color:B,B,B,B,T100% 30F command(This is replaced at the end of Enemy Sort 1).
    Modify the common Enemy Appear script with these commands(Optional, but a maximum of 3 enemies can be called, this will add more randomly for a max of 5 depending on size);

    Call[Random Var.0?3]
    SB:Condition:Temp Var.8<1
    Enable Call Same Enemy
    Call Same Enemy

    Make one Unit placement for Dungeons and another for World Map.
    Make seperate Units and "Sorters" For Land, Sea, Air, and any other specific Units you want to place. This should greatly reduce the number of enemy units made, and add some randomness to dungeons.
    24 is the highest number there is.

    #2
    Re: Efficient Random Battle System

    A+

    this is something I hadn't even considered. Not only can you control an exclusive set of enemies per map, you can do away with the need for units entirely and make any number of combinations of enemies. You do lose the ability to control ratios, but that too can be done to some extent in scripting if you really wanted it.

    Basically hes saying to start the battle with a single enemy, and have it call the other enemies based on random unit settings unique to that dungeon. The initial enemy should also be the smallest possible size so there are no size issues.

    I knew there was a better method out there then using teleport and a random selection of units upon reentry. Had I not already released my games, I'd consider using this and making something else with the 12,000 memory Id get for deleting 100 units.

    Setting a variable to a random range of enemies allowed in the dungeon requires the dungeon to be sorted and the number to be recycled in a seperate script, in other words no putting the command in your enter map script.

    Feel free to reply to the new game + with this suggestion and the basic way to go about it. I'd say to ammend the file itself, but Valk has already gone to the trouble of setting it up, putting into ps3 format, etc. I don't want to keep bothering him.
    "Reality is merely an Illusion, albeit a persistent one." -Albert Einstein.

    Comment


      #3
      Re: Efficient Random Battle System

      I'm glad you approve. I've been trying to implement as many of your memory saving tecniques as I could in my game. When I came across your posts at Doan's, they got me to re-evaluate my memory consumption. If I didn't already have a lot done, I'd start over with New Game+, but as it stands I just hope to learn a few tricks from it.
      24 is the highest number there is.

      Comment


        #4
        Re: Efficient Random Battle System

        Yeah, but I really enjoyed having a full unit placement to differentiate units on the world map. To do that on a single map with your system you'd need to start sorting the parys X, Y, coordinates.

        Considering I would have to do that, make a new enemy and action, and all of the sorting, the actual memory Id gain would be more like 3000, but for someone with no world map and/or more units then me this is great.

        In RW2 I have 3 unit placements. There are two tricks I use to seperate them so its more like having 9 unit placements.

        1) world map, with special ground units placed in the oceans. On a different map these units are encountered because the ocean isn't there.

        2) Units that aren't placed at all: since all units appear in the dungeon editor you set those units to a very high ratio and those are the only ones you encounter when in the dungeon editor.

        But yeah, way to think outside the box. I'm glad to have inspired you.
        "Reality is merely an Illusion, albeit a persistent one." -Albert Einstein.

        Comment

        Working...
        X