Text-Based MMORPG
Posted: Wed Apr 16, 2014 2:23 pm
Hi there,
As I said in the Introduction's, I found this forum while I was looking for PHP MMORPG tutorials on YouTube. I watched hallsofvallhalla's tutorial series and applied it but I was developing something different than hallsofvallhalla's game, I was building something like PokemonVortex (old PokemonCrater). What I managed to do so far;
1) Login/Register page,
Nothing to explain, its just login/register.
2) Page for searching Wild Pokemons,
For searching pokemons, I made a MySQL query which rolls the dices between 0-100 and after that, it pickes the pokemon type depending on number result. I have a table which is looks like this;
Table: PokemonSelection
1, NormalPokemons, 75
2, RarePokemons, 20
3, LegendaryPokemons, 3
4, RareLegendaryPokemons, 2
So lets say guesser picked number 61, query chooses the table "NormalPokemons". If guesser picks number 99, query chooses the table "RareLegendaryPokemons". I have 4 another tables, "NormalPokemons", "RarePokemons", "LegendaryPokemons", "RareLegendaryPokemons". After first query, another query follows it for picking random row from chosen table (It pickes "Pichu" from "NormalPokemons" table for example).
3) Wild Battle Page,
After wild pokemon selection, "Attack!" link appears below the pokemon information. When you click it, it redirects you to attack page. Attack page gets information from URL with $_GET (attack.php?pokemon=Pichu&level=1 for example). In this page, it shows you the pokemons you have for attacking the wild pokemon with it and there is "Attack with this pokemon!" link under the pokemons you have. Lets say you have Raichu which is level 2, if you click "Attack with this pokemon!" link, it redirects you to "attack2.php?attacker=Raichu&attackerlevel=2&defender=Pichu&defenderlevel=1"
So I make it through so far but I have a problem now. hallsofvallhalla made MySQL query which updates goblins health points when he hits the goblin and he deleted it from database when he killed the goblin but I cannot do that because that wild pokemon should stay there. So for example; if my Raichu kills the wild Pichu I found, it should not be deleted from SQL because I should be able to find wild Pichu again. I figured I could create another table and make a query for copying finded wild pokemons to there. So I can do what hallsofvallhalla do, change the copied pokemons hitpoints or delete it if it die. Doing that is fine in localhost but I believe there will be chaos if there will be tens or hundreds of players.
This was my first work but I'm stuck here. I learned a lot of things about PHP and MySQL though. I am still committed to this project but I need suggestions now. Am I should continue this work with this way? (with PHP & MySQL) If not, what should I use? What is your opinions? I really want to hear them. Thanks for your patience, I know this is too long to read but I appreciate who read all of it
As I said in the Introduction's, I found this forum while I was looking for PHP MMORPG tutorials on YouTube. I watched hallsofvallhalla's tutorial series and applied it but I was developing something different than hallsofvallhalla's game, I was building something like PokemonVortex (old PokemonCrater). What I managed to do so far;
1) Login/Register page,
Nothing to explain, its just login/register.
2) Page for searching Wild Pokemons,
For searching pokemons, I made a MySQL query which rolls the dices between 0-100 and after that, it pickes the pokemon type depending on number result. I have a table which is looks like this;
Table: PokemonSelection
1, NormalPokemons, 75
2, RarePokemons, 20
3, LegendaryPokemons, 3
4, RareLegendaryPokemons, 2
So lets say guesser picked number 61, query chooses the table "NormalPokemons". If guesser picks number 99, query chooses the table "RareLegendaryPokemons". I have 4 another tables, "NormalPokemons", "RarePokemons", "LegendaryPokemons", "RareLegendaryPokemons". After first query, another query follows it for picking random row from chosen table (It pickes "Pichu" from "NormalPokemons" table for example).
3) Wild Battle Page,
After wild pokemon selection, "Attack!" link appears below the pokemon information. When you click it, it redirects you to attack page. Attack page gets information from URL with $_GET (attack.php?pokemon=Pichu&level=1 for example). In this page, it shows you the pokemons you have for attacking the wild pokemon with it and there is "Attack with this pokemon!" link under the pokemons you have. Lets say you have Raichu which is level 2, if you click "Attack with this pokemon!" link, it redirects you to "attack2.php?attacker=Raichu&attackerlevel=2&defender=Pichu&defenderlevel=1"
So I make it through so far but I have a problem now. hallsofvallhalla made MySQL query which updates goblins health points when he hits the goblin and he deleted it from database when he killed the goblin but I cannot do that because that wild pokemon should stay there. So for example; if my Raichu kills the wild Pichu I found, it should not be deleted from SQL because I should be able to find wild Pichu again. I figured I could create another table and make a query for copying finded wild pokemons to there. So I can do what hallsofvallhalla do, change the copied pokemons hitpoints or delete it if it die. Doing that is fine in localhost but I believe there will be chaos if there will be tens or hundreds of players.
This was my first work but I'm stuck here. I learned a lot of things about PHP and MySQL though. I am still committed to this project but I need suggestions now. Am I should continue this work with this way? (with PHP & MySQL) If not, what should I use? What is your opinions? I really want to hear them. Thanks for your patience, I know this is too long to read but I appreciate who read all of it