Talk:Tribes expansion: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Magodra (talk | contribs)
Magodra (talk | contribs)
 
(7 intermediate revisions by 2 users not shown)
Line 6: Line 6:


--[[User:Magodra|Magodra]] 19:06, 3 May 2011 (UTC)
--[[User:Magodra|Magodra]] 19:06, 3 May 2011 (UTC)
Adding an operation to handle mood changing and executing it on a TimeOfTheDay perception is a great idea, I'll work on it.
--[[User:Zee|Zee]] 21:29, 4 May 2011 (UTC)
----
For the random behavior I suggest to look into sending them as perceptions. When the npcclient advance the the npcclient could loop over every npc that has a reaction of type mood and than check if a perception should be fired. This should include to create a general map of perception_types_by_npc to greatly improve the performance of the perception system in general in the NPCClient. Today every npc and every reaction is checked when a perception is fired. With this map only the npcs that has a given reaction type would be iterated.
--[[User:Magodra|Magodra]] 04:01, 4 May 2011 (UTC)
If I got you well then this design should fire mood perceptions only on tribe NPCS, right? (cause they're the only ones who use moods) My first idea after seeing this design would be to have a flag array/hashmap for each NPC, with flags true or false based on what the NPC receives:
Example:
        myNormalNPC.pflags[moodPerception] = false;
        myNormalNPC.pflags[damagePerception] = true;
        tribePC.pflags[moodPerception] = true;
        tribePC.pflags[damagePerception] = true;
I'll give it a deeper thought and get back to you.
--[[User:Zee|Zee]] 21:29, 4 May 2011 (UTC)


== XML <-> DB ==
== XML <-> DB ==
Line 13: Line 34:


--[[User:Magodra|Magodra]] 19:06, 3 May 2011 (UTC)
--[[User:Magodra|Magodra]] 19:06, 3 May 2011 (UTC)
What do you suggest we should keep in a database? (rather than in the xml)
Tribes, as I see them, have a variable number of needsets, so storing them in the database will require us to serialize everything into a single column.
Example: Needsets: expansionist|advanced|diplomatic
I think moods can be stored in a db, yes.
--[[User:Zee|Zee]] 21:11, 4 May 2011 (UTC)
Currently we are in the process of moving the npcbehavior.xml file into the DB. Configuration Managment of xml files that needs to be loaded is a nightmare, so we prefer having tables that can be edited through the [[Web Console]]. For th enpcbehavior we will use a text field that will have xml in it. So if the data isn't of a sort that is easy to put in tables we can do the same. But the new stuff should not depend on some xml files loaded from the filesystem.
--[[User:Magodra|Magodra]] 18:51, 19 May 2011 (UTC)


== Treats ==
== Treats ==
Line 19: Line 52:


--[[User:Magodra|Magodra]] 19:06, 3 May 2011 (UTC)
--[[User:Magodra|Magodra]] 19:06, 3 May 2011 (UTC)
I read the documentation on TribeNeedSet before writing the page. I wanted to adapt my ideas as much as I can so I can alter the existing code as little as possible. I think we will only need to add some methods on TribeNeedSet that will break more complex needs into base needs and prioritize them. (Mention: More Research on my behalf is required here)
--[[User:Zee|Zee]] 21:16, 4 May 2011 (UTC)
== Tribe object ==
=== Splitting member arrays ===
Comment to splitting the npcs in the tribe into different tables. At least we should still keep the current members table so that iterating all members will be easy. Though if needed we can create new access functions to speed up things. Though today each NPC have the tribeMemberType that is used to select what need set to use. This was thought to be a way to create different professions.
--[[User:Magodra|Magodra]] 20:59, 6 May 2011 (UTC)
=== Recipe System ===
Many of the needs have a concept of depended needs. E.g. the tribe ResourceArea (The need to go harvest/dig something have a dependency to explore. Can't get resources unless you know where they are. The ReproduceNeed have a dependency that in most cases will be to gather resources. If the key to be able to do the need isn't yet reached the depended need will be selected in the tribe brain when an npc become available for a new task.
--[[User:Magodra|Magodra]] 20:59, 6 May 2011 (UTC)

Latest revision as of 18:51, 19 May 2011

Moods

Suggest to use a operation to set the mood. E.g. <set_mood />, <set_mood random="Yes" />, or <set_mood new_mood="Lazy" />. In this way it can be done at what ever time of day you wish. To do it at the start of the day it can be in a behavior that is executed based on a time event for start of day. Night tribes might have this at the evening.

--Magodra 19:06, 3 May 2011 (UTC)

Adding an operation to handle mood changing and executing it on a TimeOfTheDay perception is a great idea, I'll work on it.

--Zee 21:29, 4 May 2011 (UTC)


For the random behavior I suggest to look into sending them as perceptions. When the npcclient advance the the npcclient could loop over every npc that has a reaction of type mood and than check if a perception should be fired. This should include to create a general map of perception_types_by_npc to greatly improve the performance of the perception system in general in the NPCClient. Today every npc and every reaction is checked when a perception is fired. With this map only the npcs that has a given reaction type would be iterated.

--Magodra 04:01, 4 May 2011 (UTC)

If I got you well then this design should fire mood perceptions only on tribe NPCS, right? (cause they're the only ones who use moods) My first idea after seeing this design would be to have a flag array/hashmap for each NPC, with flags true or false based on what the NPC receives:

Example:

        myNormalNPC.pflags[moodPerception] = false;
        myNormalNPC.pflags[damagePerception] = true;
        tribePC.pflags[moodPerception] = true;
        tribePC.pflags[damagePerception] = true;

I'll give it a deeper thought and get back to you.

--Zee 21:29, 4 May 2011 (UTC)

XML <-> DB

For each persistent data it should be considered if a db table can be used instead of a xml file. A db file will allow for editing through the WC. Data structures should be designed with the goal of making them possible to reload runtime. E.g. like we do with the /killnpc reload command. This will enable easy modification of the tribes on live servers.

--Magodra 19:06, 3 May 2011 (UTC)

What do you suggest we should keep in a database? (rather than in the xml) Tribes, as I see them, have a variable number of needsets, so storing them in the database will require us to serialize everything into a single column. Example: Needsets: expansionist|advanced|diplomatic

I think moods can be stored in a db, yes.

--Zee 21:11, 4 May 2011 (UTC)

Currently we are in the process of moving the npcbehavior.xml file into the DB. Configuration Managment of xml files that needs to be loaded is a nightmare, so we prefer having tables that can be edited through the Web Console. For th enpcbehavior we will use a text field that will have xml in it. So if the data isn't of a sort that is easy to put in tables we can do the same. But the new stuff should not depend on some xml files loaded from the filesystem.

--Magodra 18:51, 19 May 2011 (UTC)

Treats

The npcclient has a needset concept already. It should be evaluated if the existing need set concept is the same as the new suggested sets.

--Magodra 19:06, 3 May 2011 (UTC)

I read the documentation on TribeNeedSet before writing the page. I wanted to adapt my ideas as much as I can so I can alter the existing code as little as possible. I think we will only need to add some methods on TribeNeedSet that will break more complex needs into base needs and prioritize them. (Mention: More Research on my behalf is required here)

--Zee 21:16, 4 May 2011 (UTC)

Tribe object

Splitting member arrays

Comment to splitting the npcs in the tribe into different tables. At least we should still keep the current members table so that iterating all members will be easy. Though if needed we can create new access functions to speed up things. Though today each NPC have the tribeMemberType that is used to select what need set to use. This was thought to be a way to create different professions. --Magodra 20:59, 6 May 2011 (UTC)

Recipe System

Many of the needs have a concept of depended needs. E.g. the tribe ResourceArea (The need to go harvest/dig something have a dependency to explore. Can't get resources unless you know where they are. The ReproduceNeed have a dependency that in most cases will be to gather resources. If the key to be able to do the need isn't yet reached the depended need will be selected in the tribe brain when an npc become available for a new task. --Magodra 20:59, 6 May 2011 (UTC)