Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Eevee204

Pages: [1]
1
Network / Re: Retrieve data from database, built in class?
« on: July 13, 2014, 05:51:12 am »
Shame, thought I may as well ask before I went fiddling around with other libraries, thanks for the suggestions on the picojson, will defiantly take a look at that!

2
Network / Retrieve data from database, built in class?
« on: July 13, 2014, 05:43:26 am »
Hello, I am looking to retrieve data from the database and store the values into a class. I was wondering if there was a built in class which could help me with this. I was planning to return a Json string from the PHP file and then decode it with C++, but if there is something in the SFML library that can make it easier than having to decode a Json string, that be great.

Any suggestions/ideas?

Cheers

3
Network / Re: Best method to store user data
« on: July 12, 2014, 10:37:35 pm »
Quote
You make it sound as if the user's list of items in the database is completely different from the list of items the user has in the game.  That doesn't seem right.

Yeah don't mean to make it sound like that, what I mean by that is there would be a list called
std::List<Item> allGameItems(); and another list such as std::List<Item> usersInventory(); and the items from the users inventory would be created from the database table and the allGamesItems list.

Either way, thanks for the advise and help.

4
Network / Re: Best method to store user data
« on: July 12, 2014, 10:18:38 pm »
Hi thanks for the reply, I was just looking for the if it's the best way to go about it so basically what I wanted to do was -

I have a table in the database called tbl_users (for example) and then a table called tbl_items. I would first load all the items into the game as some global list (client side this is). Then I would search the database for say a table called tbl_inventory (which is the relationship table for tbl_users and tbl_items).

Once I have the items from the inventory table, I would then create the the list of items the user has, once the user logs out I would then update the database with the newest list of items the user has in their inventory.

So basically I fetch the items, create the inventory the user has and then when they decide to log out I will then update the table with their newest items and that will be the cycle of the game for the users inventory.

I am just wondering if I should use a database for this because I once used an engine called Eclipse Origins and the users items were stored on the server side using a .dat file, so I was just wondering if the method I am using was the best way or if there was another better way to do what I need to do.

Also I know what you mean about the important of good design, nothing is worse than having to fix a database that had no plan in it!

5
Network / Best method to store user data
« on: July 12, 2014, 09:04:27 pm »
Hello, I am working on an ORPG and I am wondering on the best method to store the users data, by this I mean, I want to be able to store the items that the user has in the his/her inventory or bank.

The user has a their username, password and other details stored in a database, my first initial idea to store the users value was to have a secondary table with a foreign key from the item table and the player table, but having multiple players updating a database all the time is slow? (Correct me if I am wrong!)

My second thought was too load all the possible items from the database into a list array with the item class type and use that though out the applications life time, but if I do this the list array will only exist while the application is running unless I store the values on the server or a database of some sort, preferably after the user logs out of the game?

I am just wondering if I am on the right tracks to do this, is the logic I am trying to accomplish the most efficient? Any tips or resources would be greatly appreciated on this. Thanks

6
Network / Re: Getting graphics from a server
« on: July 10, 2014, 11:57:07 pm »
That makes perfect sense, thanks for the tips!

7
Network / Re: Getting graphics from a server
« on: July 10, 2014, 11:22:37 pm »
Oh right, that sounds like a better approach, I never knew you could store graphics as a DLL, I will need to have a look into this. Thanks for the information.

8
Network / Re: Getting graphics from a server
« on: July 09, 2014, 11:31:09 pm »
Yeah, having them stored on the client would be a lot easier, however I wouldn't want anyone to be able to customize the images to edit the game graphics for that client alone. So yeah option two seemed good for me also, don't suppose you or anyone else has any tips on how to send classes like texture, sprites as a package?

9
Network / Getting graphics from a server
« on: July 09, 2014, 11:02:04 pm »
Hello, I just have a question about how to use graphics for an online game. I was looking at either:
1. Storing the images on an FTP server and have the client access these files like that
OR
2. Store the images on the server and have the server send the files to the client as a package.

Which one is the recommended for this?

Pages: [1]
anything