Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Conceptual Question about the use of Structs etc. #284060
08/11/09 14:00
08/11/09 14:00
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
I want to code a struct of NPCs that have an array to structs that contain several relation values to other NPCs. For instance, strength, trust, fiend/friend etc.

At the moment my idea is to code a struct in the way that George showed in the AUM 83 where the engine reads the data of each entity/struct from a text file.

Each entity gets an array for about 100 other entities to store and compare values of its relations.
Imagine, there are 100 NPCs, each of them with a struct for each other NPC, means, I get almost 100 000 text files to read from.

Is this a reasonable way?

Re: Conceptual Question about the use of Structs etc. [Re: Pappenheimer] #284069
08/11/09 14:48
08/11/09 14:48
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Maybe do it base on each race like the games such as Rome Total War, Caesar 4,
Microsofts Age Of Empires etc. Have a look at thier *.ini *.cfg files.

Hopefully that'll give you an idea to start with.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: Conceptual Question about the use of Structs etc. [Re: Nidhogg] #284079
08/11/09 15:54
08/11/09 15:54
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
That's an idea. Don't have any of that files 'on board' at the moment. Will ask my son whether he got one of the games on his pc.

Any other suggestions? Isn't this a point, where MySql and such comes into play?

Re: Conceptual Question about the use of Structs etc. [Re: Pappenheimer] #284088
08/11/09 16:42
08/11/09 16:42
Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
GorNaKosh Offline
Junior Member
GorNaKosh  Offline
Junior Member

Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
Have a look at this:
GSTsqlite

This is similar to mysql, but you don't need a MySql-Server. This plugin uses one external file (.db) for each database. To edit your db-files without script you can use an editor like this. Don't have test it for this amount of data - tell me if you try something wink

Re: Conceptual Question about the use of Structs etc. [Re: GorNaKosh] #284164
08/12/09 00:55
08/12/09 00:55
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Sounds like a pretty data-intensive way to handle things.
Even after loading there will be a LOT of number crunching per frame.

What are you trying to achieve? There may be a better way we can find...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Conceptual Question about the use of Structs etc. [Re: EvilSOB] #284169
08/12/09 01:29
08/12/09 01:29
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Thanks for your interest! smile
I plan to make a sort of LOD to avoid that all the data has be updated all the time. For instance, if you step into a room or a backyard, then all NPCs outside are ignored.

It is not even necessary to calculate each relation each frame, the NPCs shall get different speeds of thinking, different reaction time depending of the authors intention when 'writing' the scene/organizing the arena.

It is about balancing the closeness of the NPCs to each other, fiend to friend, foreigner or neighbour shall make a difference. And getting familiar shall change that need of maintaining a distance to certain others. If one trust one another he stays closer to him, fights shoulder by shoulder. If the NPC is a nice but weak princess, she will keep behind strong knights that she tries to convince to protect her, and so on.

First: The structs shall serve an easy and intuitive way to build characters and constellations of relationships, and connect them with believable behaviour, dialogs and animations.
Second: The structs shall be updated while playing fast and easily, for instance an NPC shall be able to win and loose other NPCs trust, and the NPC should be able to win and loose trust into himself and his strength or his ability to get a majority of followers to withstand his enemy.

Re: Conceptual Question about the use of Structs etc. [Re: Pappenheimer] #284173
08/12/09 02:41
08/12/09 02:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
WHOH! MOTHERF....ER! Thats nuts!
But I see its needed IMHO. Cant see a way around it ... yet.

I think you should look into GSTsqlite, like GorNaKosh suggested.
Even though Ive never used it, it sounds like the way to go.

Otherwise, if each entity has its own array of "relationship" records for each "other" entity (stored in A skill),
with a pointer or name to the other entity, and other record elements storing the "values" of their relatinship.
This could be stored as a single file, one record per line, so 100 files for 100 entities, 100 "lines" each file.

Is this the sort of idea you are after?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Conceptual Question about the use of Structs etc. [Re: EvilSOB] #284183
08/12/09 04:49
08/12/09 04:49
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Thanks EvilSOB! Especially for this one:
Quote:
WHOH! MOTHERF....ER! Thats nuts!

grin

Quote:
This could be stored as a single file, one record per line, so 100 files for 100 entities, 100 "lines" each file.

I think, this is the way to go, at least for now.

GorNaKosh, thanks for your suggestion, link and explanation, each is piece that gives me an idea, what its all about.
I never was sure what such a database is all about, and I thought it is needed, if I have a lot of data, but it seems that it is needed especially for internal relations between values of money and such, like in an excel sheet.

For my purpose, the transaction, or better, interaction happens in game, when the entities are in the level, and the changes of the relations, as one NPC has it 'in his mind' doesn't relate directly to that of the others. This means no direct dependencies between the data of different entities.

The concept as it looks for now:
- I need a list of all entities of the game's world with their positions, in which zone they are.
- When loading the level, I check the list which entities are in this level.
- Each entity has a file with its relation values.
- If an NPC is in the loaded level, I read the values of its relations from the file, and it gets created as an entity in the level.
- Each relation is read into a struct, the NPC gets access to each struct via an array with the name of the relation.
- The level starts, each NPC has a number, the actions and reactions follow the order of the numbers, between each a pause, if the player wants, like in a round based game.
(That is easier to debug and to balance?)
- Each NPC compares the positions and distances between the NPCs with the relations and starts a reaction. Means, it takes a step depending its speed and its sort of action.
- Let's say the NPC changes the values of the relations only when its his turn. Maybe, that's too artificial, maybe, its not, because the player needs time to think as well. Maybe, each NPC can change its values each turn and it gets a gameplay as fast as that of an fps.
- In case that the player doesn't pause, playing 'realtime' instead of round based, each thinking-reaction chain has a delay rectified by a sentence of dialog or animations that suggest that the action couldn't happen faster.
- If the player leaves the scene, all values get saved, if he doesn't want to start the level from the beginning.

What's the author's side of the story:
- He creates a character with a default model, a default name, a default image and default values.
- He can choose from anxious, lighthearted, dumb, clever, slow, fast, trustful, suspicious...maybe, a smaller list then this is sufficient.
- He places the character into a scene, let's say a village, with default neighbours, default foreigners, default family, default enemies.
- Depending of the time frame of the story, the author chooses the quests. He can create a single big twisted quest. He can choose everyday quests, every month quests, one in a year quests and once per life quests.
- He creates the main quests for the player, which are contrary to the other quests to establish interesting conflicts.
- All the default values and behaviors and quests have default dialog sentences and animations.
- Everything that is default can be modified step by step to give a certain style and feeling and unique social environment to entertain the player.

Re: Conceptual Question about the use of Structs etc. [Re: Pappenheimer] #284185
08/12/09 05:09
08/12/09 05:09
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I need some further info to hopefully streamline memory usage a bit.

1> Is this a "single" player game? (in the relationship context)

2> NPC's wander around I assume, can they change zones, ever?

3> Does the number of NPC's ever grow? (shrinkage is fine)

4> Do the NPC's get loaded by the level, or ent_created from the master-list
just after level-load?

That'll do for now... (back of brain bubbling...)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Conceptual Question about the use of Structs etc. [Re: EvilSOB] #284189
08/12/09 05:42
08/12/09 05:42
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Last question first:
- The NPC's get loaded from a master-list just after level-load.

- The number of NPC's shall be able to grow by birth or a new foreigner, but the number of 100 is meant to be the highest number of actors. Although, I don't know whether this is enough for an epic social adventure.

- The NPC's can change zones. Zones are things like the streets of a medieval town, like in the fields, a meeting in a backyard, a contact with raiders at the town's gate, when driving back a dangerous giant. (Maybe, I can reserve 'places' for NPC's that only appears once, because of a side quest.)

- I'm not sure whether I understand the first question:
Each NPC gets a list of relations with their values, each of them could be the character that is 'controlled' by the player, it depends on what the author allows, the control is blocked or modified by the character's fear and trust and wishes.
And, I imagine multiplayer levels, too.
For instance, where different players collaborate, controlling weak character's with their individual anxiety and strength(that counteract the full control) who attract and fool a giant in collaboration to lead him away from the threatened village.

Page 1 of 2 1 2

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

Gamestudio download | chip programmers | 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