Talk:Tribes expansion

From PSwiki
Revision as of 21:29, 4 May 2011 by Zee (talk | contribs) (Moods)
Jump to navigation Jump to search

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)

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)