jtwillis Posted April 16, 2009 Share Posted April 16, 2009 I'm in the process of making a text based browser game. I've finished the character roll php, but now how do I store it to the server, so it's there until they delete the character? Is sessions the way to go? Also, how exactly would I tie two fighters together for a fight simulation? i have a seperate module witht he fight formula, would i use something to call in their fighter's script page? Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/ Share on other sites More sharing options...
Carth Posted April 16, 2009 Share Posted April 16, 2009 I think you want a database, rather than relying on the client's cookies to store data. Cookies/session can easily be altered, and is not a reliable storage solution. To tie a particular character to a person, you would want some form of identification (username/password), and you can use sessions or cookies for that. Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811587 Share on other sites More sharing options...
Maq Posted April 16, 2009 Share Posted April 16, 2009 With a database you can uniquely identify each character. You can also create other tables for fights, items, etc... You should come up with a database design first that incorporates everything you need for this text based game. It's hard for us to help with only general information like this. Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811590 Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 16, 2009 Share Posted April 16, 2009 PHP Sessions shouldn't be used to store data like that. Use a database like MySQL it's free : www.mysql.com Be sure to make the tutorial and read the doc about it : http://dev.mysql.com/doc/ You will probably need some day to learn, get the basic and make some script before being confortable with database. And you should do that before attempting to make a game with php/mysql. Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811591 Share on other sites More sharing options...
jtwillis Posted April 16, 2009 Author Share Posted April 16, 2009 With a database you can uniquely identify each character. You can also create other tables for fights, items, etc... You should come up with a database design first that incorporates everything you need for this text based game. It's hard for us to help with only general information like this. When you say database design, what exactly do you mean? All of the scripts for the fighters, the fight simulation, etc? Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811603 Share on other sites More sharing options...
Maq Posted April 16, 2009 Share Posted April 16, 2009 You need to decide on what/how many tables you need, what columns should be in each table. Think about what you need. characters -------------------------------------- id name type items -------------------------------------- id name power defense etc... Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811610 Share on other sites More sharing options...
jtwillis Posted April 16, 2009 Author Share Posted April 16, 2009 Ah ok. Well the following links should help. The fighter class selection and character roll link:http://instilledlogic.com/mmavirtualoctagon/ideas/thought/charclass.php That will show all the fighter's attributes I need stored. The moves spreadsheet: http://spreadsheets.google.com/ccc?key=pq4WkIHuAluAS61eN_bWyZw&hl=en Ignore the Column C. Maybe that will help in deciding exactly how I should store? Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811629 Share on other sites More sharing options...
Maq Posted April 16, 2009 Share Posted April 16, 2009 You're going to need to store this in a database regardless. I'm telling you, that you need to come up with a database design that can handle all of this data and is well designed. If you design some tables, we can give you feedback as to what needs to be modified. Quote Link to comment https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811636 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.