Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811587
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811590
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811591
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811603
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811610
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811629
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/154368-best-way-to/#findComment-811636
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.