10 Replies - 512 Views - Last Post: 18 December 2012 - 06:31 PM Rate Topic: -----

#1 Ytry  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 120
  • Joined: 25-July 12

Integrating combat into text based game

Posted 17 December 2012 - 09:15 PM

Lately I have been working on a text based game in java, with no real goals in mind, but after getting the locations, and moving sorted out I have decided I want to add in combat of some sort. My first idea of combat was to make it some what randomized, which I believe will require me to develop many complex algorithms. I have thought about making a stat system like you would see in an RPG, but I don't know how I would do it. What would you recommend doing for combat?
Is This A Good Question/Topic? 0
  • +

Replies To: Integrating combat into text based game

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,473
  • Joined: 12-June 08

Re: Integrating combat into text based game

Posted 17 December 2012 - 11:25 PM

Quote

What would you recommend doing for combat?

Honestly it's really up to the game. I don't know enough to make an educated guess.
Was This Post Helpful? 0
  • +
  • -

#3 Ytry  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 120
  • Joined: 25-July 12

Re: Integrating combat into text based game

Posted 18 December 2012 - 03:39 PM

Perhaps this is too broad a topic, combat aside I am working on how to handle inventories, and items. which has got me completely stumped. This leads me to the topic of persistence I imagine I am going to need to make files of some sort, I am just stuck as to what I need to do to store thinks like player data.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,473
  • Joined: 12-June 08

Re: Integrating combat into text based game

Posted 18 December 2012 - 03:41 PM

Quote

I am working on how to handle inventories, and items. which has got me completely stumped.
...
what I need to do to store thinks like player data.

sounds like a textbook example of when to use a database.
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,692
  • Joined: 19-March 11

Re: Integrating combat into text based game

Posted 18 December 2012 - 04:12 PM

What sort of persistence are you looking for? What is the environment in which you're running? What needs to persist?

Get a little more particular about the problem.

As for the combat - "Kill troll with sword" always worked for me. If you're looking for something more exciting, what would it be?
Was This Post Helpful? 0
  • +
  • -

#6 Ytry  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 120
  • Joined: 25-July 12

Re: Integrating combat into text based game

Posted 18 December 2012 - 04:26 PM

Well, I need a couple of things to persist for example the player is going to have stats, health, and current location. As for more exciting combat I was thinking possibly making it so enemies encountered have some sort of health and stats system as well. and maybe adding in some ability to attempt to disengage from combat think fleeing in Pokemon.

Coming up with the calculations for the stats and how they effect combat is not the problem. I am having trouble with the concept of handling entities. I think I am thinking about it wrongly. Perhaps I can just generate a random number every time the player moves locations and somehow make them engage combat based on that.

That aside the idea of fighting is the least of my concerns because I conceptually understand that but the idea of creating a file and saving data from the player to that file, then reading it later is got me completely stumped. I mean I understand it, but I just can't wrap my head around how to actually do it. This has been my problem for so many projects lately I can explain to others what I would need to do but when it comes to actually doing it I can't put it all together.
Was This Post Helpful? 0
  • +
  • -

#7 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,692
  • Joined: 19-March 11

Re: Integrating combat into text based game

Posted 18 December 2012 - 04:34 PM

Okay, one thing at a time. Which do you want to deal with right now? Files or fighting? Fighting is more of a game design issue: what happens when you get in a fight? Do you want to be tromping along,

> west
You're in a field
> north
You're still in a field
> east
There are bandits here


And then you're in a live-action fighting game?

Or what did you have in mind?


The persistence you're talking about seems to be more within one session? I think you're still doing Java, right? Probably I'd have an instance of a Player class which knows about all of that stuff.

You wouldn't want to be writing to a file in game time, unless you're backing up the game state against the possibility of power loss or something.

If you're talking about playing along until dinner time, and then stopping play and picking up at the same spot later - that's another story. For that, you'd want a save file. Start a new topic on that if you want to go into it.
Was This Post Helpful? 0
  • +
  • -

#8 Ytry  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 120
  • Joined: 25-July 12

Re: Integrating combat into text based game

Posted 18 December 2012 - 04:37 PM

Okay I will start a new topic about Save files.
Was This Post Helpful? 0
  • +
  • -

#9 Ytry  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 120
  • Joined: 25-July 12

Re: Integrating combat into text based game

Posted 18 December 2012 - 04:41 PM

I am currently working on a text based game with RPG based aspects. Currently I am working on how save the players data. My goal is be able to save data relevant to the players current game like current location, player stats etc.. My question is what kind of file do I use? What is most efficient? How can I read data from that file in order for players to load their previous game?
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,473
  • Joined: 12-June 08

Re: Integrating combat into text based game

Posted 18 December 2012 - 06:22 PM

Don't open duplicate topics. Thanks.
Was This Post Helpful? 0
  • +
  • -

#11 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Integrating combat into text based game

Posted 18 December 2012 - 06:31 PM

View PostYtry, on 18 December 2012 - 11:41 PM, said:

I am currently working on a text based game with RPG based aspects. Currently I am working on how save the players data. My goal is be able to save data relevant to the players current game like current location, player stats etc.. My question is what kind of file do I use? What is most efficient? How can I read data from that file in order for players to load their previous game?

You create your own custom file format for your saves. I don't think you should approach this right now.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1