Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

-=Encounter System Recoded=-

-=Encounter System Recoded=-

From Astyllan: War of Deceit

Download Links:

Encounter System Recoded.rtf:
http://www.streamload.com/Arramon/RPG-RMXPGame/Encounter_System_Decoded.txt

Encounter System Recoded.txt:
http://www.streamload.com/Arramon/RPG-RMXPGame/Encounter_System_Decoded.rtf

This is the summary for our Common Event Encounter System I made. It is NOT the entire common event coding, just the main sections with explanations about what is going on (in addition to the comments already inserted in the Common Event itself!!).

Hope this helps...

============================================
==CUSTOM ENCOUNTER SYSTEM - by ARRAMON
==
==Version: 1.8 (6/06)
==
== ~~--._,-=c()xoxoxox](O)==============---_-_>
==
== Visit GOLDEN HELIX PRODS. Forums:
== http://www.s15.invisionfree.com/Golden_Helix_Prods
==
==And RPG-RMXP Forums, home of the Best collected
==RMXP resources:
==www.z4.invisionfree.com/RPGRMXP
==
==1) Did you know you can make your Comment boxes
==as long as you want them? Everytime the box
==automatically closes, just open it back up and keep
==adding more and more lines by copying/pasting
==the carriage return. A new line will appear that
==you can then write more text on. Pressing Enter
==on a blank line seems to autoclose the Comment
==box ;)
==
==..a little sum'n sum'n for you to think about..
==
==2) I will add Extra Comments to this first Encounter
==Area so that everyone can understanding what is
==going on, and possibly add their own Encounter Areas,
==with new Enemy Encounters, Healing, Gold Found,
==Secret Areas, Treasures, and whatever else can be
==created.
==
==*Refer to the Encounter_System_Decoded.txt file for
==more detailed summary of the Event Commands used
==in this Encounter System.
==
==3) Patching this Encounter System or any other
==System within the Common Events:
==
==If you add anything to these Systems, upload the
==CommonEvents.rxdata file to our website and I will
==implement the addition/edit myself, and include it with
==the following Patch Release(if working) at month's end.
==Make sure you archive the file first, using either
==Zip or Rar before you upload. And include a text file
==with your name and information about what you added
==or changed in the Common Events.
==
==4) With this version, there are no graphics or
==images displayed when there is an encounter of
==anykind. BUT, images/sounds can be added for
==each specific type of encounter that occurs. If you
==have the time and knowhow of doing this.. feel free. =)
==
== -=Arramon/GHP=-
============================================

That's from the game itself, first Comment. Now I'll lay out a summary of all the parts that make up the Encounter System and explain what each section does, the flow of the processes, and how you can easily create and add more things within this system for your own projects.

----------------------------

-=ENCOUNTER SYSTEM DECODED=-

---
Main Jump to Labels:


Label: Step Start

This will set the initial Encounter Systems as it loops. Everytime a Jumpt to Label: Step Start is called, it will come here and reinitialize. There is a Wait: 3 frames before each Jump to command so that the process is regulated. The 3 frames is in alignment with the other Common Event systems I made, so that each has a different Wait value, the main System, this one, is quickest, while the smaller systems, Weather & HUD, can Wait longer before they loop back to reinitialize.

System settings (main menu), encounter area (ModfdEncounterArea) and steps (PlayerStepCountA/B) are set, then after the set steps are taken (through a random number defined by encounter area) the enounter happens (Jump to Label: Encounter Start), while the other systems are turned OFF then turned back ON once the encounter has ended and the Jump to Label: Step Start command is used, with a quick Wait just before jumping. That's the whole process...


Label: Encounter Start

From this Marker point, using Label and Jump to Label commands, the PlayerStepCountA variable is set to the Player's current Steps and checked (conditional branch), and once that variable is higher than the random PlayerStepCountB variable set previously, the encounter happens (or doesn't, if the random number was a zero).


---
Actual Code Explained:


>Comment:======BEGIN ENCOUNTER INIT======

>Comment:===This part reinitializes the Encounter System each time 'Jump to Label: Step Start' is called. If an Enemy
was Encountered, I made it so the Weather and HUD systems, plus BGM/BGS are turned OFF, then turned back ON after battle. Seems to save cpu power and lag much less. I also added 'Wait' commands to slow cpu.

>Wait: 2 frame(s)


>Label: Step Start


>Comment:===SET GAME SETTINGS

>Comment:===Unfreeze Player
>Set Move Route: Player (blank settings)

>Comment:===Allow Main Menu (ESC)
>Control Switches: [0001: Main Menu] = ON

>Comment:===Turn ON Weather System
>Control Switches: [0021: Weather ON] = ON

>Comment:===Current Encounter is now OFF
>Control Switches: [0024: Current Encounter] = OFF
>Control Variables: [0005: EncounterSuccess] = 0


>Comment:===MODIFY ENOUNTERAREA VALUE USING THE GAME'S MODE CHOICE (EncounterModifier variable)
>Control Variables: [0107: ModfdEncounterArea] = Variable [0002: Encounter Area] <----this sets the ModfdEnctrArea to the current Map's Encounter area
>Control Variables: [0107: ModfdEncounterArea] += Variable [0016: EncounterModifier] <----this adds the Game Mode modifier to the total ModfdEncounterArea variable for it's total value

>Comment:===Some examples of different Modified Encounter
Area values(modified with Game Mode choice):
Normal Mode (value of 0) + Encounter Area 1 = 1
Hard Mode (value of 1) + Encounter Area 2 = 3
INSANE Mode (value of 2) + Encounter Area 3 = 5
Hard Mode (1) + Encounter Area 7 = 8 (none yet!)


>Comment:===CALCULATE STEPS TAKEN AND STEPS NEEDED FOR NEXT ENCOUNTER VARIABLES
>Control Variables: [0003: PlayerStepCountA] = Steps
>Control Variables: [0004: PlayerStepCountB] = Steps <----these both set the step processing variables to the Player's current stepcount


>Comment:===MAKE ENCOUNTER RATE DEPENDENT UPON MODIFIED ENCOUNTER AREA VALUE
>Conditional Branch: Variable[0107] == 1
->Control Variables: [0004] += Random # (30...60)
->
->Else
-->Conditional Branch: Variable[0107] == 2
--->Control Variables: [0004] += Random # (25...50)
--->
-->Else
--->Conditional Branch: Variable[0107] == 3
---->Control Variables: [0004] += Random # (20...40)
---->
----Else...etc etc
---->Comment:===ELSE GIVE THE ENCOUNTER RATE A NORMAL RANGE
----->Control Variables: [0004] += Random # (10...25)
----->
---->Branch End...etc etc

The above conditional branches will set the encounter rate (the rate inwhich encounters occurs) depending on what the total modified encounter area is. Refer to the examples above. If the modified encounter area is ever something else besides what's defined, then the encounter rate will be set to a normal range of 10-25 steps as a default.

>Comment:=======START ENCOUNTER PROCESS========


>Label: Encounter Start


>Comment:===SET CURRENT STEPS TAKEN
>Control Variables: [0003] = Steps

>Comment:===IF STEPS NEEDED FOR NEXT ENCOUNTER EQUALS CURRENT STEPS TAKEN

>Conditional Branch: Variable[0003] == Variable:[0004]

->Comment:===SET GAME SETTINGS BEFORE ENCOUNTER
TAKES PLACE (ie turn off any Game Systems)

->Comment:===Freeze Player
->Set Move Route: Player (Repeat Action), Turn toward Player

->Comment:===Turn OFF Main Menu (ESC)
->Control Switches: [0001:Main Menu] = OFF

->Comment:===========================
----------=====ENCOUNTER AREA 1=====
----------===========================

->Conditional Branch: Variable[0107] == 1

-->Comment:===SET ENCOUNTER RATE RANGE (0-100 is used, but this can be changed to as high as you want)
-->Control Variables: [0005] = Random # (0...100)

-->Comment:==NO ENCOUNTER==
-->Conditional Branch: Variable[0005] == 0
--->Wait:1 frame
--->Jump to Label: Step Start <----start over
--->
-->Branch End

-->Comment:===SWITCH FOR OTHER SYSTEMS TO KNOW ENCOUNTER IS ACTIVE (for use with Map Inits, HUD and Mini-map Systems)
-->Control Switches: [0024] = ON

-->Comment:===================================
-----------Encounters A-F are for Monster Encounters.
-----------The higher the Modified Encounter Area,
-----------the tougher the Monster Groups used...
-----------===================================

-->Comment:==ENCOUNTER A==

-->Conditional Branch: Variable[0005] <= 10

--->Wait:6 frames
--->Battle Processing: Fire Buzz x2

--->If Win
---->Comment:===Return to the Start of this Common Event (using Labels instead of Loops)
---->Wait:6 frames
---->Jump to Label: Step Start

--->If Escape
---->Wait:6 frames
---->Jump to Label: Step Start
---->
--->Branch End (battle processing end)

-->Conditional Branch: Variable[0005] <= 12

--->Wait:6 frames
--->Battle Processing: FireWasp x4

--->If Win
---->Comment:===Return to the Start of this Common Event (using Labels instead of Loops)
---->Wait:6 frames
---->Jump to Label: Step Start

--->If Escape
---->Wait:6 frames
---->Jump to Label: Step Start
---->
--->Branch End (battle processing end)

-->Conditional Branch: Variable[0005] <= 14
--->etc etc etc... all the way up to EncounterSuccess == 100

The first conditional branch checks the total Modified Encounter Area variable and processes accordingly. 1 is Encounter Area 1, 2 is Encounter Area 2, etc... The Encounter Success variable is the range between 0-100, where 0 is no encounter and 100 is the best kind of encounter you can get. The lower encounter success values have been set to be Enemy encounter, while the higher values are treasure, armor, and secret areas that can be found. These can be changed to ANYTHING you want the Encounter System to do.

Each different kind of Encounter type (gold, treasure, healing, secret area) becomes better and better the higher the actual Encounter Area is, which is the total of the Modified Encounter Area variable, so as the Player progresses, the higher Encounter Areas should use harder enemy groups, give stronger/better quality treasure, heal the party more, give higher amounts of gold and allow for better Secret Areas to be found. So far, the highest Areas defined for our game are only up to Encounter Area 6. Once the other Countries are reachable ingame, more Encounter Areas will be defined with harder enemies and better treasures, etc.

*please refer to the comments in the Encounter System to know how the Healing, Treasure, Gold and Secret Area encounters are defined.

---------------------------------------

That's about all there is to this Encounter System. It's very simple compared to what can be defined, but it's still more advanced than the default Enemy Encounter used in RMXP.

If anyone would like to help add onto this System, please feel free to edit what you like and email me the results (CommonEvents.rxdata file) to:

ashesboomstick@hotmail.com

I will import what you've done to a new project and check it out beforehand and see what's been done, then let you know if it's GOOD and am implementing it into the game. =)

Hope this little summary helped you understand more about the Encounter System we're using.

Take care..

-=Arramon/GHP=-
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top