Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-12-2010, 04:39 AM   #1 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Default SQL in a game?

Hi there!

I want to make an adventure game (such like Monkey Island or Myst) and I wonder how data can be stored... In my first game (which is action / arcade kind) there is just a few strings and integers to be stored so I used text files, but in this new game there will be lots of descriptions and strings that must be stored and shown when player goes to somewhere or looks at somewhere (however there's no need to modify this data)... Is SQLite the best way to do this? And, if the answer is yes, is there any tutorial to easy integrate a SQL database in a non-view-based application (OpenGL instead)?

Thanks!
Johanovski is offline   Reply With Quote
Old 02-12-2010, 10:05 AM   #2 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

I suppose there is no reason you could not use an SQL database for this, but ... why go through the trouble? Based on your description, why not just stick to a text file, like raw text or XML?

I guess I don't (yet) see a compelling reason to use SQL in your scenario.
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Old 02-12-2010, 05:46 PM   #3 (permalink)
Anyone for iPad Dev?
 
Join Date: Sep 2009
Location: Take a Guess
Posts: 74
Default

Kalimba is correct. There is no reason for a SQL database.

However, I use SQL databases for my high score systems.
This is how it is done. On some kind of web server, make a php file that uses $_GET to get information from the URL (The data you want). The iPhone can do a simple HTTP request with the variables in the URL. The PHP file can see what information it needs and echo the information to the page. The iPhone can parse this information into each individual strings.

EXAMPLE:

URL: www.example.com/example.php?x=1$y=example
PHP RETURN: 1:example

Use the iPhone to get that string then split the string into a array with the information. You can get the information in the string by stopping at the : character and keep going until the string stops.
fondu-Dev is offline   Reply With Quote
Reply

Bookmarks

Tags
database, opengl, sql, sqlite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 277
22 members and 255 guests
2WeeksToGo, ADY, apatsufas, ckgni, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, jakerocheleau, joeallenpro, masc2279, mer10, MozyMac, mystic.purple, objch, Rudy, tathaastu, themathminister, timle8n1, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,223
Posts: 380,731
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:37 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0