siddik3436 / plosdb

Automatically exported from code.google.com/p/plosdb
0 stars 0 forks source link

Random Map Room Descriptions #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Room descriptions are developed using various strings.

1: Environment Description Variable
(describes temperature and generic weather possibilities as well as standard 
environment description)
2: Location Description Variable
(describes the specific location within the environment and it's specifics)
3: Prefix / Suffix Description Variable
(describes the mood and difficulty of enemies that may be located within as 
well as other errata that might be pertinent.

These description variables need to be reviewed and finished. Currently Prefix 
/ Suffix Description Variables are the only ones that aren't finished although 
all variables need to be reviewed for persistence. Variables should work 
together so that the completed room description would be : $Environment + 
$Location + $Prefix|$Suffix = $RoomDescription.

Original issue reported on code.google.com by NBIn...@gmail.com on 4 May 2011 at 7:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
An example of where the room description information is grabbed from is 
available below. Room descriptions are obtained from the variables located 
within the GenerationTypes.xml file.
<!-- here is the location -->
<type number="1" mobs="15" respawn="12" generation="Standard" inside="Yes">
 <name>Abyss</name>
 <description>The current ...</description>
</type>
<!-- here is the prefix -->
<type number="1" difficulty="Hard" items="10">
 <name>Abominable</name>
 <description>This secluded area holds a larger more formidable source of dangerous creatures.</description>
</type>
<!-- here is the suffix -->
<type number="1" difficulty="Normal" items="11">
 <name>Abberations</name>
 <description></description>
</type>
------------------------------
Here is the Generation Type function as of 10/31/11 for dissecting the 
GenerationTypes.xml.

Private Function RetrieveGenerationTypes(ByVal LocationNumber As String, ByVal 
AddendumNumber As String) As Boolean
        'declare xml dimensions
        Dim m_xmld As XmlDocument
        Dim m_nodelist As XmlNodeList
        Dim m_node As XmlNode
        Dim CurNumber As String
        Try
            m_xmld = New XmlDocument()
            m_xmld.Load(Replace(MainProgram.DirMapHeader, "MapHeader.TG", "GenerationTypes.xml"))
            m_nodelist = m_xmld.SelectNodes("/types/location/type")
            For Each m_node In m_nodelist
                CurNumber = m_node.Attributes.GetNamedItem("number").Value
                If CurNumber = LocationNumber Then 'location type requested was found
                    CurrentMap.MobSpawnMaximum = Val(m_node.Attributes.GetNamedItem("mobs").Value)
                    CurrentMap.MobRespawnRate = Val(m_node.Attributes.GetNamedItem("respawn").Value)
                    CurrentMap.GenerationType = m_node.Attributes.GetNamedItem("generation").Value
                    CurrentMap.LocationTypeName = m_node.InnerText
                    Exit For
                End If
            Next
            If CurrentMap.AddendumType = False Then
                m_nodelist = m_xmld.SelectNodes("/types/prefix/type")
            Else
                m_nodelist = m_xmld.SelectNodes("/types/suffix/type")
            End If
            For Each m_node In m_nodelist
                CurNumber = m_node.Attributes.GetNamedItem("number").Value
                If CurNumber = AddendumNumber Then 'prefix or suffix type requested was found
                    CurrentMap.MobDifficulty = m_node.Attributes.GetNamedItem("difficulty").Value
                    CurrentMap.ItemDropRate = Val(m_node.Attributes.GetNamedItem("items").Value)
                    CurrentMap.AddendumDescription = m_node.Attributes.GetNamedItem("description").Value
                    CurrentMap.AddendumName = m_node.InnerText
                    Exit For
                End If
            Next
            CurNumber = ""
        Catch errorVariable As Exception
            MainProgram.SND("/RERROR: " + errorVariable.ToString())
            Return False
        End Try
    End Function
---------------------
At the moment environments are generated randomly, in the future, the locations 
will limit the environments slightly, but for the most part, environments will 
be pushed together depending on the instance situation. Therefor weather 
variables and temperature variables (dependant, both on environment) are 
technically random as well, again varying on their own situations on weather 
patterns (ensuring that they work together and meld appropriately).

Original comment by NBIn...@gmail.com on 31 Oct 2011 at 6:43

GoogleCodeExporter commented 9 years ago

Original comment by NBIn...@gmail.com on 2 Nov 2011 at 6:03