• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

RMXP Battle System Project

Dawson

The Rebirth Is Upon Us
9,727
Posts
20
Years
Okay, we seem to be having quite a few threads flying around in different areas of this forum regarding the scripting of a Custom Battle System in RPG Maker XP. So, in order to keep the forum cleaner, I'm making this thread.

This thread will now be the only thread for discussion about a CBS. Any others will be locked and linked to here. Whilst I don't have the knowledge of RGSS or the time to contribute to this project at this current moment in time, I will be willing to help if this project does pick up and make some progress nearer to Spring.

So I'll leave it up to the more advanced scripters to lead the way for now. Develop a team if you want to, or work by yourselves, it's up to you. Just keep it all in this thread.
 
89
Posts
17
Years
Okay. Well I would like to reply on the last post from AzuraBR.

We kinda misunderstood eachother, basicly because we are, apperently both scripters and have our own ways to do things, but.. here we go. We where discussing each ways of storing pokmeon data in a database.

I said: p.s. - Effort Values << That is stupid. EV's are not constant
He said: [i[]Of course EV's are constant, that's what I'm talking about. Growlithe always gives you 1 attack ev, Nidorino gives you 2 points, etc.[/i]

I usually call the points gained by a pokmon the Effort Values, and what you can gain the Effort-Gain from a pokémon. As you can see, a little difference means a lot. So, I guess we where both right.

AzuraBr uses to big global variables. In one the Database is stored, with constant data, and another one which grows larger as the game progresses with Each Indiviual data (triggered by a unique Game-Id). I made this statement about MY database: I use a module, so I do not need to do a global (the data is not going to change, so I go for less memory_usage).. Now I did NOT mentioned, and I think ive should, that I use a special Pokemon class for each pokemon insead of the $pokemon global variable he did. I figured that I think this way it is easier to obtain and store object way, altough there is not much difference.

AzuraBr said:
Me™ said:
It is equally fast for RMXP (from octals to haxadeciamls is one step, from octals to deciamals too).
Really fast. (...)
I don't really get what you are trying to say here. It is 'really' fast... it is, like I said equally fast as decimals :S. You said it messes up the code, I disagree, but that is just the way we are. I don't see it anymore as I wrote it away in the poke_<dataname>.rxdata files.

That's GS DV's (That is the same as the RS IV's, except that is ranges from 0 to 31)
I have read the page. The only difference is that now the stats are calculated a littl;e bit different. I stick with the 0 -> 15 IV's. It is what you like really.

They're NOT constant, so or you couldn't explain yourself right or you really did mistake them
Oh really? Explain me. THey are Asigned at creation. A random number form 0 and 15 or 0 and 31. I don't see really how thay could 'change'. I would like you to explain me if I am wrong.

Me™
 

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
Oh really? Explain me. THey are Asigned at creation. A random number form 0 and 15 or 0 and 31. I don't see really how thay could 'change'. I would like you to explain me if I am wrong.

Answer me, if you caught two Caterpies, will they have the same IV's? No, right. So they change. The same goes for nature (NOT constant). And the same goes for gender. When I say 'they change' I mean they vary from pokémon from pokémon thus, they can't
IMO you can't say EV's (Effort-gain or whatever) are not constant.

You said it messes up the code

I said make the code complicated and dirty. Do you really think writing '0x14' is thaaat better than writing a '20'? The thing is I'm doing my code so real noobs can make use of them later, edit or whatever (I'm tired to say that line on Metropolis' thread), so I can't think of using hexes, but in the end, like you said, it's all the same.

When I say an ironic 'really fast' I mean you should be thinking on the people who will be using your code (if opensource). I don't want to add a new chapter on the manual to explain to users and RGSS-newcomers what is a hex, what does '0x14' means, etc.

That's my opinion, if you didn't like it, feel free to not to take it into account.

I stick with the 0 -> 15 IV's. It is what you like really.

Yes, it's up to you. If you check my post on the other thread, you'll see that I use a MAX_IV_VALUE, so thr priority is not to discuss 15, 31 or 100 IV's.

I usually call the points gained by a pokmon the Effort Values, and what you can gain the Effort-Gain from a pokémon.

Like I said, you couldn't explain yourself properly, what caused the misunderstanding.

I figured that I think this way it is easier to obtain and store object way, altough there is not much difference.

Like you said, we do things the way they look better for us.
 
89
Posts
17
Years
Answer me, if you caught two Caterpies, will they have the same IV's? No, right.
Their is a change from (5*1/16)*2 that they are. But I get what you mean. I meant constant in a way if created, not changed, and you meant constant in a way, always the same.

you can't say EV's (Effort-gain or whatever) are not constant.
The EV points you gain from a pokemon defaiting it Are Constant, the EV from a pokemon are not constant..

Like I said, you couldn't explain yourself properly, what caused the misunderstanding.
You can't really expect when saying EV that I know you want the EV you GET rather then the EV you HAVE.

When I say an ironic 'really fast' I mean you should be thinking on the people who will be using your code (if opensource). I don't want to add a new chapter on the manual to explain to users and RGSS-newcomers what is a hex, what does '0x14' means, etc.
Ah okay. Well I will convert it either way. However, if it are real noobs, they won't even BOTHER looking at the code. :laugh:

Now, a question for you, youve been working 8 hell months on this. I have to say I need to complement you! :shocked:... I am trying to fill it so much jsut like you, I just did the first 80 moves (yes, while writing this, long live regexp)... But I got sooo much to do left.

Me™
 

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
Believe it or not, there are noobs willing to l-e-a-r-n. Too bad scripters/programmers nowadays think the way you think.

Now, a question for you, youve been working 8 hell months on this.

You can do it ^^ You can hire little elves like I did. 8)

You can't really expect when saying EV that I know you want the EV you GET rather then the EV you HAVE.

After reading all the in-depth (ten times each) I've never seen an 'Ev-Gain' term. To me, the EVs you have are just a consequence of the EVs you gained, so saying EV is always what you've gained. But... whatever.

Their is a chance from (5*1/16)*2 that they are.

LOL

Now, we should go ahead in this discussion rather than talk about what is an EV for you.
 
89
Posts
17
Years
Haha. I dunno If that equotation was right XP...

5 ivstats, each can be a numer from 0 to 15, so there is one 16 change for each stat that it will be 0. that means there is a change from 5 ^ 1/16 that ALL stats are 0. You have this for 2 pokemon, so you can again mulitplie them with eachother (so yes my math was wrong, I should have used ^ insetad of * XP)

So the cahnge of 2 pokemon having the exact same stats is... (5^(1/16))^2 I guess..
 

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
Ok, let's leave this "How to input data?" chapter and move on to something more complicated.

Artificial Intelligence - AI

Like I said before, as I script and the game progress, I input new data to my systems. However I stopped scripting the CBS because I couldn't think of a good way to make enemy pokémons decide which move to use.

I don't want a random move selection, because, for example an wild Abra always uses Teleport as his first move.

So I thought there must be some kind of strategy for each Pokémon. Something like "Defensive", "Offensive", "Evasive", etc. Although that's a basic idea, I think I'm in the right way.

In my example, Abra would be 100% evasive.

However if someone could help with any kind of information I may be missing, or add some new strategies like "Mid-Evasive" or "Offensive-defensive", it would be nice to have some contribution, as I stopped at the start of enemy's turn on my CBS (all the rest is already covered up)

Thanks in advance,

~Azura.
 
89
Posts
17
Years
Ah. You are not the only one with that thing buggering around. I have come to a semi-same solution.

Basicly, a pokemon gives his pokemon threath-point. I think these point will be determined by looking in what way the opponent differs. Hereby I mean, Difference in Level (That is n#1) then difference in HP, and differenece in the other stats.

Each attack has an attack bit. As example, bit 0 = deals damage, and this has moves like Tacke, Vine Whip and Pound. There are bits for poisoning, Leechseeding, Toxic, Puts opponent to sleep, Selfdestructing, Stat raiser or lower bits and so on.

Like you, Azura, said each pokemon has his own style (and the abbility to give trainer's pokemon a fixed style) to attack. (Defense = attacking too ::)). Based on the Thread points and the availeble attacks, the pokemon will choose, also based on the opponents status and the progress in turns with attack wil be taken.

For example, if the thread-points are not very high, a pokémon with a poisoning attack will try to poison his pokemon. If the thread points are very high, he will try to flee (With an move) or to kill his opponent quickly, unless that is not possible, thus will try to leave the opponent with a slipping status (poison etc.).

Well that was my idea basicly..
 

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
Yes, preciselly 201 'attack bits', that I call Attack Effects. I used those to make a Move Interpreter

Code:
#============================================================
#ATTACK EFFECTS LIST:
#============================================================
CODE	NAME			
000 Deals damage. Has no additional effect.
	POUND				
	MEGA PUNCH
	SCRATCH
	VICEGRIP
	CUT
	WING ATTACK
	SLAM
	VINE WHIP
	MEGA KICK
	HORN ATTACK
	TACKLE
	WATER GUN
	HYDRO PUMP
	PECK
	DRILL PECK
	STRENGHT
	ROCK THROW
	EGG BOMB
	WATERFALL
	MEGAHORN
	HYPER VOICE
	DRAGON CLAW
001 Base damage is doubled if opponent is using Dive.
	SURF
002 Puts opponent to sleep.
	SING
	SLEEP POWDER
	HYPNOSIS
	LOVELY KISS
	SPORE
	GRASSWHISTLE
003 May poison opponent
(...)
The list goes on until 200



Like you, Azura, said each pokemon has his own style (and the abbility to give trainer's pokemon a fixed style) to attack.

Yes, a trained Pokémon would inherit the strategy from his trainer, not his species.


I think these point will be determined by looking in what way the opponent differs. Hereby I mean, Difference in Level (That is n#1) then difference in HP, and differenece in the other stats.

Yes, I thought of that too. However it's too dificult to think about all variables that could affect a Pokemon's AI. Below is a list I made about a month ago:
Code:
#============================================================
#AI
#============================================================
. defined strategies
	- Action
	   + Move (Offensive)
		> More Damage
		> Preserve Self PP
		> Offensive Stat Up
	   + Move (Offensive/Defensive)
		> Change Stategy-Offensive	[50%]
		> Change Stategy-Defensive	[50%]
	   + Move (Defensive)
		> Preserve HP
		> Defensive Stat Up
		> Counter-attack
	   + Move (Evasive)
		> Preserve HP
		> Preserve PP
		> Evasive Stat Up
		> Defensive Stat Up
	   + Run
		> Just Run
		> Change Stategy-Offensive
		> Change Stategy-Defensive
		> Change Stategy-Evasive

Those are the strategies for Pokémon. IMO opinion only after a strategy is set is that you should consider the variables, which could be:

Code:
#============================================================
#AI FACTORS
#============================================================
#
# Factors that modify the decisions a Pokémon takes:
#
#		   a. Level
#		   b. Attack type effectiveness
#		   c. Damage that can be caused
#		   d. Stat difference:
#	  	     d.1 Attack, if strategy is 'Offensive'
#	  	     d.2 Defense, if strategy is 'Defensive'
#	  	     d.3 Evasion, if strategy is 'Evasive'
#		   e. Weather (?)
#		   f. Habitat (?)
#
#
#============================================================

If we could make a list of all possible variables/factors that affect a Pokémon's decisions (based both on anime and game) we would be one step further, don't you agree?
 
89
Posts
17
Years
If we could make a list of all possible variables/factors that affect a Pokémon's decisions
Indeed. By the way, we could start with what you have and later on increase the I of the AI.

I would try to include E and F, and also, if you do not control a pokemon, sometimes it will use the AI to attack rather then a trainers choice, but taht is for later :P

(sorry for this short answer, ill write more later)

Me™
 

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
if you do not control a pokemon, sometimes it will use the AI to attack rather then a trainers choice

I suppose you're talking about Obbedience check and traded Pokémons, right?

Obedience Check
from UPC's RS In-depth guides

In internal battles, if the Pokemon's ID and OT name are different from those of the player, and its level is greater than the player's "badge level", then this process is followed to determine whether the attack succeeds.

Code:
A = ((Level of Pokemon)+(Badge level))*(0~255)/256
if A is less than badge level
  attack continues as usual, end here
if the attack ordered is Rage, the effect is canceled
if the attack is Snore or Sleep Talk while Pokemon is asleep:
  "X ignored orders while asleep!"
B = ((Level of Pokemon)+(Badge level))*(0~255)/256
 if B is less than badge level
  Use a different move if possible
 if B is greater than or equal to badge level
   C=(Level of Pokemon)-B
   D=(0~255)
   if R is less than C and Pokemon does not have Vital Spirit or Insomnia and
     Uproar is not in effect
    "X took a snooze..."
   R=R-C
   if R is less than C
     Deal confusion damage
   Else
     Display message "X ignored orders/turned away/is loafing around/pretended
       to not notice."
The "badge level" depends on the badges the player has:

* No badges: Badge level=10
* Knuckle Badge/Cascade Badge: Badge level=30
* Heat Badge/Rainbow Badge: Badge level=50
* Feather Badge/Marsh Badge: Badge level=70
* Rain Badge/Earth Badge: Badge level=100

You probably read this, but someone else might find useful.



For the E factor (Weather), I was thinking on associating it with Pokemon Type and Move Type.

Example:

A Charizard would try to run or end the battle as fast it can if the wheather is rain. It would avoid the use of Fire moves too, since they would be less effective in this case.
Since Charizard is an Offensive Pokémon, the 'as fast as it can' means 'to do a lot of damage' lol



Now for the F factor (Habitat)...

If a Pokémon is inside it's natural place, for example: a Caterpie in a forest would be more confortable than a Meowth (Urban Pokémon). So even if the caterpie is weaker, it would still try to fight, as it's more 'secure'/'confident'



Oh btw, what program did you use to encrypt your files? And how does your scripts read the encrypted text files?
 
89
Posts
17
Years
what program did you use to encrypt your files [...]

I wrote an rgss script that utilizes an windows dll actually. Maybe il give it oneday... It is pretty unique, due the fact that I can offer peopel to encrypt theri audio files... I use load_data (Marshal.load) to load the files into an variable after it is decrypted.

You probably read this, but someone else might find useful.
I did not yet actuaaly, but I would have. Either way, I think we should post all kinda things over here, so others can read it :D

As a matter of fact, I actually intended to make the battle system more and more. THe rest of the system I left almost exactly the same, but my ideas as, fire pokemon get slip damage when they are in rain, pokemon in their habitat are a little bit stronger too. Those kind of things. The things you stated are completly to my mind whatsoever.

Me™

So... if I'm right, you guys are trying to figure out the AI variables? Me N00B hehe.... What... specifically are you trying to do?
Like said, we, he, I am going to make an (better) AI, because the one from the real pokemon sucks / is not there. We are going to make a list of variables to be included in this AI, and ask other to input their ideas too.
 

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
going to make an (better) AI

Don't know about the 'better' though. If it's already difficult to think about the default AI...
Anyway, just me and Me post here, so I would like to ask to people to give their ideas too. Otherwise, there's no point as I could discuss with Me on msn...


The things you stated are completly to my mind whatsoever.

Could you be more... clear?
 
89
Posts
17
Years
Don't know about the 'better' though. If it's already difficult to think about the default AI...
Lets just say a new then :D.

Anyway, just me and Me post here, so I would like to ask to people to give their ideas too. Otherwise, there's no point as I could discuss with Me on msn...
I totally Agree.

Could you be more... clear?
I don't drink Crystal Clear... ehhh. Everything you said in post 11 and 9.
 
2,243
Posts
19
Years
Well, I have no knowledge of RGSS, but I do have an idea. Why not make blank moves that people can overwrite so that they can make their own moves?
 
89
Posts
17
Years
It is more or less like that. But to answer our question, you do not need to know RGSS. What kind of AI, and how should it function. Those questions.
 

Glitchfinder

Let's all get along, please?
477
Posts
17
Years
Did you know that a complete Pokemon Battle System was posted on RPGXP.net a couple of years back, before it crashed? (And became rpgxp.org) That would probably take a lot less work to find a repost somewhere than to script a completely new one.
 

Glitchfinder

Let's all get along, please?
477
Posts
17
Years
I thought it had been completed. (I found one there that worked perfectly a couple of years back, with no lag or anything.) Also, the site RMXP.net no longer exists. Instead, they have RMXP.org. Oh, and do I smell a double post?
 
89
Posts
17
Years
Must have been a magic system. I guess it DID used all the correct poké formulas?

(what double post? why are you trying to tell me that rmxp.net does not exist anymore? YOu think I am a complete morron or what?)
 
Back
Top