Koding Konversation: Pokemon battle/capture system

Recreated from the Project Spark Forum using The Wayback Machine
Date: OP 10 Nov 2014

Original Post

 Reapers Nytmare
Hey everyone, I’ve been playing PS for a few weeks now and I think I’m getting the hang of Koding and I’m trying to make a game similar to Pokemon in the battle and capture sense. Could anybody, please share some Kode you know works? I’ve played the created game “Pokemon Capture system 2.0” but I can’t remix it to see how it was made, but that’s what I’m going for. Basically a JRPG battle system with a spawned monster fighting instead of your character fighting. Then I’ll need a system where I could capture the enemy monster and have it become selectable to use in battle. Any help would be awesome! I love this game and I’ve already seen how helpful the community is so I know there’s a Koder out there who can help! Thanks.

Responses

DavidJCobb: The thing about these sorts of requests is that almost anyone would be willing to provide help with small bits of Kode or individual features, but not as many people would be willing to build entire systems from scratch for you.

The approach I’d take would be to define each Pokemon species as a template, and define individual Pokemon as Logic Cubes that reference these templates. During battles, I’d spawn the referenced templates for visuals and use the Logic Cubes to track them. With this approach, I’d have to manually synchronize things like [health] between the Logic Cubes and the displayed Pokemon models, but I’d also be able to make relatively simple changes at run-time: for example, successfully capturing a Pokemon would involve deleting the displayed template and setting values on the Logic Cube; and I wouldn’t have to worry about teleporting the displayed model out of view (since it doesn’t hold any real data).

Kohldar: Hey Reaper,

I don’t know what the exact mechanics are, but I would imagine its a few variables that result in either a successful capture or a miss. The variables that come to mind are:

1. Target Pokémon’s HP
2. Target Pokémon’s capture resistance
3. Type of Pokeball used
4. RnG between success and miss

I guess the way I would approach this is that each of the variables (1, 2, 3) each have their own weight in the algorithm. As a test case:

1. Pokémon’s HP is at 10/100 HP (10% remaining) this carries a weight of 9
2. Pokémon’s HP resistance is 5 out of 10 (1 being easily captured, 10 being nearly impossible)
3. Type of Pokeball used is a normal (capture chance of 2, which would be weighed against the pokemon’s resistance)

Okay so now for some calculations:
Since the pokemon is weakened, this increases your chances of capture by a lot. So, we could subtract the pokemon’s resistance from its current HP weight:

9 – 5 = 4

Now we’re using a normal pokeball with a capture chance of 2, this would be added to the previous:

4 + 2 = 6

So 6 is our chance to capture. To keep things simple, we could simply do a random roll of 0 to 10 and when the value of the roll is greater than 4 (we get this from 10 being the max minus our chance to capture 6), we have successfully caught the pokemon.

This is completely on the fly, just the idea that rolled into my head. Hopefully it’ll help get things rolling for you.

 

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: