Please help! Database creation

BlitzMax Forums/BlitzMax Programming/Please help! Database creation

DCI(Posted 2007) [#1]
Hello. Maybe THIS is the right section to post this..

Im attempting to write a program where the player can create his own units..
each player is going to have his own text file, listing his units.
this is how i think it will show up in the text file

unit number, armor in section a, armor in section b, location x, location y, ammo in gun 1 , ammo in gun 2.

I dont know how to get the game to write all that info out to one line like that..

also, what would the read command be to load a specific unit #'s data?

please cite examples


GfK(Posted 2007) [#2]
You need to look at ReadFile,WriteFile, CloseFile, WriteInt, WriteByte etc.

I'd advise against storing visible information as its easy for players to change/cheat. Consider encryption.


FlameDuck(Posted 2007) [#3]
XML is your friend. There is no need to come up with your own system. Just use XML files and Brucey's libxml2 module.


DCI(Posted 2007) [#4]
Hey there :) The database would be serverside, each time the client would send a request to the game, the server would check to see if , for instance, the player's empire had enough money to buy the vehicle or unit, or ot build the building.. i'd planned on having the server verify every operation is permissible, so no mater what modification is done to the client, if you dont have the money to do something, the server wont let you. Gfk, would you be willing to let me email you, ask you some questions? its ok if ya say no, im a total noob at this after all :)

And thankyou flame, im trying to figure out how to use xml now


tonyg(Posted 2007) [#5]
this might help but I'm not sure how useful it would be for games.


Winni(Posted 2007) [#6]
SQLiter is great, but since he wants to use a server, it won't be of much use for him unless he begins to store some data locally; SQLiter cannot do remote requests, it's an OOP wrapper for embedded SQLite only.

Webservices & XML might be the "sophisticated & professional" answer. But XML has a lot of overhead that --can-- be overkill. A simpler way would be to use some not-so sophisticated PHP scripts on the server that query the database (SQLite, MySQL, whatever) and return the results -- as many Flash applications still do it.


LarsG(Posted 2007) [#7]
or mySQL or something?!