Author Topic: Pokemon Red  (Read 120390 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Pokemon Red
« Reply #45 on: June 19, 2010, 02:44:12 pm »
HOLY... :O
Yeah, he mentioned something about importing the original map data from the real Pokemon Red.
Yeah I saw this. It speeds things up a lot. It makes me even more confident he'll finish it quite fast too (depending of his free time). What would be funny, though, is if he managed to get the final game file size to something smaller than the original ;D

Quote
<.<
>.>
<.<
>.>
^.^

SirCmpwn

  • Guest
Re: Pokemon Red
« Reply #46 on: June 19, 2010, 02:45:12 pm »
Yeah I saw this. It speeds things up a lot. It makes me even more confident he'll finish it quite fast too (depending of his free time). What would be funny, though, is if he managed to get the final game file size to something smaller than the original ;D
That would be awesome.  It is really cool that he is getting it developed quickly, though.

Quote from: DJ Omnimaga
Quote
<.<
>.>
<.<
>.>
^.^
v.v
« Last Edit: June 19, 2010, 02:46:36 pm by SirCmpwn »

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Pokemon Red
« Reply #47 on: June 19, 2010, 03:16:47 pm »
Buckeye, I can't wait for the full version!

Offline BuckeyeDude

  • Project Author
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 283
  • Rating: +42/-0
    • View Profile
Re: Pokemon Red
« Reply #48 on: June 19, 2010, 03:21:35 pm »
Holy crap guys I go away for one night and come back with 4 pages of stuff. Anyways to address some of the stuff I remember. So far I have put in the maps of Pallet, Route1, Viridian, Route 2, Route 21, Route 22. I have created most of the main engine, events, NPCs, and so on. All the back sprites of the pokemon are done, and thanks to Art_of_Camelot the first 37 fronts are done too. All the base pokemon stats and move data is in. The one big thing NOT in the game right now is the Pokedex data. The battle engine has been started, it has support for all the stuff (accuracy/evasion, paralysis, sleep, etc.) but only parts of that have been implemented, eg. it checks to see if you're asleep but there is  no way to currently do that :P

As for some of the issues brought up, yes critical hits happen way to often. The original formula is the base speed/2 * critical hit rate. If a randomly generated number is lower than this then its a critical hit. Critical hit rate is 1 unless the move is crabhammer, razor leaf, slash, or something if forget, in which case it is 8. I think the problem is the random number generator doesn't provide enough variance in the randomness. This also creates a problem with discovering wild pokemon (you'll notice that you find lots of pokemon at once).
Code: [Select]
;a = move index
;ix->pokemon structure
CheckCriticalHit:
;N is 1 unless it is a high ratio, then 8
;max(255, int(N*int(Speed/2)))
ld hl,BattleFlags
res criticalHit,(hl)
;i dont think hl matters at this point...
push af
ld a,(ix+IndexNum)
call GetPokemon
call skipstring
ld de,4
add hl,de
ld a,(hl)                  ;hl-> base speed
srl a
ld h,0
ld l,a
pop af
cp Crabhammer
jr z,HighCritRatio
cp KarateChop
jr z,HighCritRatio
cp RazorLeaf
    jr z,HighCritRatio
    cp Slash
    jr nz,_
HighCritRatio:
add hl,hl
add hl,hl
add hl,hl ;*8
_
ld de,256
cp hl,de
jr c,_
ld l,255 ;max(hl, 255)
_
ld b,255
call random2
cp l
ret nc
ld hl,BattleFlags
set criticalHit,(hl)
ret
The issue with damage is also something im rather stumped upon. It doesn't happen very often, which makes it harder to find. The damage formula is very complex, so im sure there are things wrong with my implementation. I'll post that as well, see if I missed an obvious issue. As for why sand attack can kill you, each non damaging move requires me to specify a call back, which I have not done so for sand attack, so it just goes through the normal damage formula :P

Code: [Select]
;ix->pokemon structure
;iy->enemy pokemon
;(movepower) contains maybe the moves power (no duh :P)
;STABBonus is set if stab bonus is in effect
;(TypeModifier) contains type modifier (400, 200, 100, 50, 25, 1)
CalculateBDF:
ld a,(ix+level)
add a,a
ld h,0
ld l,a
ld c,5
call divhlbyc
;since max level is 100 it will be fine 8 bit
;100*2*2/5 = 80
inc l \ inc l
ld b,l ;b = 2L/5+2
ld de,0
ld a,(BattleFlags)
bit CriticalHit,a ;a critical hit ignores all this
jr nz,_
ld hl,(CurrentBattleStuff)
ld de,AttackBattleStuff
add hl,de
ld hl,a,(hl)
_
ld e,(ix+attack)
ld d,(ix+attack+1)
add hl,de
ld a,b ;a = 2L/5+2
call multhlbya
ld a,(MovePower)
or a
jp z,NoMovePower
call multhlbya
ex de,hl
ld bc,0 ;so we can dont effect defense
ld a,(BattleFlags)
bit CriticalHit,a ;a critical hit ignores all this
jr nz,_
ld hl,(RelativeEnemyBattleStuff)
ld bc,DefenseBattleStuff
add hl,bc
ld c,(hl)
inc hl
ld b,(hl)
_
ld l,(iy+defense)
ld h,(iy+defense+1)
add hl,bc
ld bc,1
or a
sbc hl,bc
add hl,bc
jr c,_
ex de,hl
ld a,h
ld c,l
call divacbyde
ld h,a
ld l,c ;hl = ((2L/5+2)*A*P)/max(1,D)
_
ld c,50
call divhlbyc ;hl = (((2L/5+2)*A*P)/max(1,D))/50
ld de,997
cp hl,de
jr c,_
ld hl,997 ;hl = min(((((2L/5 + 2)*A*P)/max(1, D))/50), 997)
_
inc hl
inc hl ;+2 to a max of 999
ld a,(BattleFlags)
bit STABBonus,a
jr z,_
ld de,hl ;this does hl*1.5
srl d
rr e
add hl,de ;hl = ((min(((((2L/5 + 2)*A*P)/max(1, D))/50), 997) + 2)*S)
_
ex de,hl
ld a,(TypeModifier)
call multdebya ;this one needs to be de*a so we have the a 24 bit result
ld e,a
ld d,100
call divehlbyd ;hl = ((((min(((((2L/5 + 2)*A*P)/max(1, D))/50), 997) + 2)*S)*10T)/100)
ld a,(BattleFlags)
bit CriticalHit,a
jr z,_
add hl,hl
_
ld b,255-217
call random2
add a,217
call multhlbya
ld a,h
ld c,l
ld de,255
call divacbyde
ld h,a
ld l,c

;fuck that was a long equ
;result is
;hl = (((((min(((((2L/5 + 2)*A*P)/max(1, D))/50), 997) + 2)*S)*10T)/100)*R)/255
;in theory at least
;by this equ 5992 is the max amount of damage doable in one shot
ret
NoMovePower:
ld hl,BattleFlags
res CriticalHit,(hl)
ld hl,0
ret

As for what you guys can do to help. I will need the pokedex imported into something spasm can do with macros. Not sure how this will be done yet, but when i figure out the necessary stuff, it would be helpful if you could each add one or two entries. I am also posting all the tiles I have so you guys can make maps. http://group.revsoft.org/Pokemon should contain everything you need to make maps. All the maps can be found http://www.spriters-resource.com/gameboy/pokerb/index.html. Claim whatever map you want to do here, and I'll try to keep track of everyone doing maps.

I should also point out that I was not doing this alone. I had the help of a good friend at school, who is not active in the community, to convert all the back sprites, tiles, and maps to this point. Also had the help of another person making front sprites (although he disappeared recently) and lately as I said earlier, aoc has been helping with those. Anyways thanks for all the support guys, hopefully by the end of summer I'll have something playable for the school year :D


SirCmpwn

  • Guest
Re: Pokemon Red
« Reply #49 on: June 19, 2010, 03:27:51 pm »
I call the Pokemon League.

Offline BuckeyeDude

  • Project Author
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 283
  • Rating: +42/-0
    • View Profile
Re: Pokemon Red
« Reply #50 on: June 19, 2010, 03:29:53 pm »
Oh yeah and if I didn't mention, the second they become accessible in the game, I can add them. Eg: whenever someone gives me viridian forest I'll add it in now.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Pokemon Red
« Reply #51 on: June 19, 2010, 03:30:07 pm »
how exactly do i get the tiles into calcGS? do i have to copy them by hand? i call Celadon City.


Offline qazz42

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1130
  • Rating: +30/-12
  • hiiiiiiiii
    • View Profile
Re: Pokemon Red
« Reply #52 on: June 19, 2010, 03:30:11 pm »

« Last Edit: June 19, 2010, 03:30:36 pm by qazz42 »

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Re: Pokemon Red
« Reply #53 on: June 19, 2010, 03:31:09 pm »
Looks very nice Buckeye, will definitely be keeping an eye on your progress. =]
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline BuckeyeDude

  • Project Author
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 283
  • Rating: +42/-0
    • View Profile
Re: Pokemon Red
« Reply #54 on: June 19, 2010, 03:31:19 pm »
how exactly do i get the tiles into calcGS? do i have to copy them by hand? i call Celadon City.
You should just be able to open them in calcgs then open the map editor and start using them.

Looks very nice Buckeye, will definitely be keeping an eye on your progress. =]
Thanks tifreak. I've actually been really impressed with your clone, since what you are doing is actually way harder than mine. You've stayed with it for an impressively long time, I hope to see yours finished in all its BASIC-y glory :)
« Last Edit: June 19, 2010, 03:35:33 pm by BuckeyeDude »

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Pokemon Red
« Reply #55 on: June 19, 2010, 03:33:06 pm »
figured it out. thanks.


SirCmpwn

  • Guest
Re: Pokemon Red
« Reply #56 on: June 19, 2010, 03:35:17 pm »
Can we have a copy of the one with more maps, and a copy of the maps themselves for reference?
« Last Edit: June 19, 2010, 03:35:51 pm by SirCmpwn »

Offline BuckeyeDude

  • Project Author
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 283
  • Rating: +42/-0
    • View Profile
Re: Pokemon Red
« Reply #57 on: June 19, 2010, 03:37:05 pm »
Can we have a copy of the one with more maps?
Sure, I'll try and post updates as soon as I make major progress on anything. My number one goal is to make it as close to the original as possible, so the more people testing it the better

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Pokemon Red
« Reply #58 on: June 19, 2010, 03:39:45 pm »
Quote from: Buckeye
Holy crap guys I go away for one night and come back with 4 pages of stuff.
Yeah, this is Omnimaga :P

Btw did you check some Pokémon sites for attack formulas and stuff? If I remember, someone posted some links somewhere on a TI forum to help one of the Pokémon project author and it could maybe be useful. I am not experienced in the domain, though, so I wouldn't be able to help. :P
Quote from: SirCmpwn
Quote from: DJ Omnimaga
Quote
<.<
>.>
<.<
>.>
^.^
v.v
^.^

Ok I'll stop that quote pyramid now :P

Looks very nice Buckeye, will definitely be keeping an eye on your progress. =]
Thanks tifreak. I've actually been really impressed with your clone, since what you are doing is actually way harder than mine. You've stayed with it for an impressively long time, I hope to see yours finished in all its BASIC-y glory :)
I agree, I've been looking forward for PP for years. I hope you finish it too :) (and that it remains as BASIC as possible to show the true potential of BASIC. Also I like the oldskool ness of the overworld.
« Last Edit: June 19, 2010, 03:42:35 pm by DJ Omnimaga »

Offline BuckeyeDude

  • Project Author
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 283
  • Rating: +42/-0
    • View Profile
Re: Pokemon Red
« Reply #59 on: June 19, 2010, 03:44:24 pm »
Quote
Btw did you check some Pokémon sites for attack formulas and stuff? If I remember, someone posted some links somewhere on a TI forum to help one of the Pokémon project author and it could maybe be useful. I am not experienced in the domain, though, so I wouldn't be able to help

I've been using a lot of stuff from http://bulbapedia.bulbagarden.org in addition to stuff from http://www.serebii.net and finally the big resource has been this: http://www.gamefaqs.com/gameboy/367023-pokemon-red-version/faqs. If anyone else has more info, I would love it.