5 Replies - 600 Views - Last Post: 07 July 2014 - 01:28 PM Rate Topic: -----

#1 markjc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 06-July 14

How to store settings, variables , and such between runs of program

Posted 07 July 2014 - 12:45 PM

Hey guys. Intermediate vb.net level programmer here. I am currently working on a text adventure game and could use some help with one facet of it. I am in sure of how to create a save file for my game. I'm assuming I could use some type of delimited file or a database, but I have no idea where to start. Any suggestions of where I can start looking? Thanks for the assistance guys!
Is This A Good Question/Topic? 0
  • +

Replies To: How to store settings, variables , and such between runs of program

#2 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 73
  • View blog
  • Posts: 571
  • Joined: 05-December 13

Re: How to store settings, variables , and such between runs of program

Posted 07 July 2014 - 12:50 PM

Depending on what you would like to store, you could always use My.Settings if you only want to save scores etc or a position or level the user is at in your game. Alternatively, you could use SQL Compact, which is a compact database which you could supply with your game install shield for each user.
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13485
  • View blog
  • Posts: 53,847
  • Joined: 12-June 08

Re: How to store settings, variables , and such between runs of program

Posted 07 July 2014 - 12:50 PM

Quote

I'm assuming I could use some type of delimited file or a database, but I have no idea where to start.

You would need to be a bit more specific on your own game's requirements and with respect to any pertinent objects, classes, etc. I mean sure you can use a database, a random streamwriter text file, something in the my.settings, some sort of flatfile.. etc.
Was This Post Helpful? 0
  • +
  • -

#4 markjc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 06-July 14

Re: How to store settings, variables , and such between runs of program

Posted 07 July 2014 - 01:09 PM

All I am storing is variables that hold player data, score data, inventory, level data etc.
Essentially several hundred variables.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13485
  • View blog
  • Posts: 53,847
  • Joined: 12-June 08

Re: How to store settings, variables , and such between runs of program

Posted 07 July 2014 - 01:24 PM

that seems like a horrible idea. I would advocate a better planning and structure. Start with objects!
Was This Post Helpful? 0
  • +
  • -

#6 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 73
  • View blog
  • Posts: 571
  • Joined: 05-December 13

Re: How to store settings, variables , and such between runs of program

Posted 07 July 2014 - 01:28 PM

No mater which way you do this, it sounds like it will require a little configuring and work. My.Settings will require you to write these variables values into your project settings. Right click your project and go to properties. Then click Settings. This is where you will add the variables settings which will be stored by your application. The link above explains how this works.

But if you are writing several hundred variables, it would take the same amount of work to do what you want with a compact database. This database can be distributed as part of your application installation. If you use the VS publishing system, you can choose to include certain files; such as your compact database. Again, right click on your project and go to properties, then go to publish, and then click application files. In there, you can choose what files are distributed with your application when published. Both links I provided you with should help you to decide which option is easier or better preferred by you. It all comes down to your preference in the end.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1