Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (OptimusPrime, AndrewAMD), 14,595 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Help for Adventure System #215742
07/13/08 08:30
07/13/08 08:30
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi everybody,

After getting into A7 by writing some smaller test games, I'm going to write my first adventure game.

First of all I'd like to gather some thoughts and ideas how to build the "Adventure System" that holds all object information like "can be taken", "can be opened" ... and state information like "has been taken", "is open/is close" and so on.

One idea I had was using a database like mysql to build all the structures I need there, but then my game always depends on an installed mysql server.

Has anyone did an adventure like system before? How did you implement it in c-script/lite-c ??? Can anyone give me some hints and tipps?

Best regards,
Sascha.

Re: Help for Adventure System [Re: pegamode] #215743
07/13/08 08:35
07/13/08 08:35
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
you can use entity's skills for that

Re: Help for Adventure System [Re: Shadow969] #215745
07/13/08 08:49
07/13/08 08:49
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Isn't there a better way than using skills?

For example:

There are different playable characters in the game.
An object can be taken by just some of them then it would be not nice to
set the values who could take the object by setting skills in wed.

Then there must be stored different texts for the objects just like the ones that are displayed when looking at the object and so on.

I think it would be better to have a more complex structure than just using skills. What do you think?

Re: Help for Adventure System [Re: pegamode] #215748
07/13/08 09:24
07/13/08 09:24
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
more complex structures are harder to program. you can make txt\cfg\xml file in which objects' data is stored as an alternative

Re: Help for Adventure System [Re: Shadow969] #215751
07/13/08 09:46
07/13/08 09:46
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
What would be a good way to get information stored in a file or database related to the entities?

For example when I stored let's say the following information:

name: desk
description: A desk made of dark wood ...
canBeTaken: no
text_take: Sorry, I can't take it. It's too heavy.
canBePushed: yes
text_push: Let's try.
canBeCombined: yes
canBeCombinedWithObjectID: 13
canBeOpened: yes
isOpen: no

... and so on.

What would be a good way to access all those data without reading in a file or accessing a database with every action?

Can I use structs for that? How and when would I fill the structs object with those data and how to build the relation between the entity and the struct object? How can those data like 'isOpen' be persistated so that a door that was opened before is still open when I come back to this door? Can I use the skills to store those state information?

Re: Help for Adventure System [Re: pegamode] #215760
07/13/08 10:25
07/13/08 10:25
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
Yes, you can use structs for that. I see 2 ways to initialise them at startup - in the script, or a harder, but more flexible way - program a function that reads data from file and fills structs with it. After you have initialised the structs you can access and alter it's content anytime. Yes, you can use skills for temporary information, but i currently don't see reasons for that

Re: Help for Adventure System [Re: Shadow969] #215765
07/13/08 10:29
07/13/08 10:29
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
How would I build the relation between the filled structs and the entities?

Should I use an ID stored in a string in the struct and then implement a function getStructByID? Or is there a better way?

Re: Help for Adventure System [Re: pegamode] #215772
07/13/08 11:21
07/13/08 11:21
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
You may simply store a pointer to entity in a struct

Re: Help for Adventure System [Re: Shadow969] #215775
07/13/08 11:47
07/13/08 11:47
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hmm ... I don't know if I understand you right.

If I store a pointer to the entity in the struct wouldn't it then be only possible to access the entity when having the struct object?

I think in most cases I will have the entity object and have to access the struct object.

Can you give an example?

Re: Help for Adventure System [Re: pegamode] #215779
07/13/08 12:07
07/13/08 12:07
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
o, you mean visa versa? in this case you may want to use IDs and make a function for getting a struct for entity

Page 1 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1