So at the moment there are Skaldarnar, Ten'son' and me working on this. (Hopefully I'm right with this one)
Any feedback is appreciated
Skaldarnar and Ten'son' will focus on the generation of a village. I will work on the AI in the meantime.
Generation:
(Part that needs to be written by the other two.
Building Generation
I am working on a procedural architecture generation approach similar to the one described in this paper. My aim is to develop a solid grammar based system for easy building generation. New building types could be added via new grammar files consisting the specific new grammar.
So, how does this corporate with the city generation? As mentioned by @Ten'son', the village or city will be divided into several parcels which have a functionality assigned. The proper building type is then determined by the functionality, the biome the city is located in and the overall style of the city (style could be something like modern, medieval, ancient rome/greek, ... and is defined only once for one city. However, its not necessary for the generation itself, only an esthetic thing).
The concrete building instance is then generated by choosing and applying the grammar rules width the additional information of the parcel size (length x width x height). The generated structure could be stored as a Blueprint in a Metablock or something to "rebuild" the building if the player comes back to the city.
With this approach the cities would differ in the final building instances for the same word seed (as the generation is a quite random process). Although, the generated cities would look very similar (as the same grammar is used).
Finally I would like to give a hint on how the grammars could look like:
A simple rule has the following structure
Code:
predecessor : condition ::- successor : probality;
where condition[\i] is a guard for the rule that has to evaluate to true in order for the rule to be applied, e.g. splitting a building into 4 floors makes only sense if the building height is greater than, let's say, 16, so the associated rule would look like
Code:
building : (height >= 16) ::- floor(height/4) floor(height/4) floor(height/4) floor(height/4)
AI:
The AI will be based on a POI(Point of Interest) System, which defines certain areas and buildings in a city as worth visiting for an NPC.
Let’s take a quick example of this: A fisher would go to the lake to fish. A normal citizen wouldn’t go there . So the POI is not in the POI-list of the villager.
Another one here: A guard would walk on the walls of the city, but normal villagers don’t go there.
This allows us to have a city full of life. Since some villagers will walk to places where others don’t . But there are also certain times where most of the villagers go to a place . Like meeting in a church every morning.
There will be also different ways for the villagers to go to some other place. They can run/hurry or just wander around and even get distracted and stop at some point.
The AI will react on the Players behavior too. If he kills villagers or destroys buildings the villagers will get hostile and attack the player.
AI in theory:
Oh well that sounded neat didn’t it? So here are some information what methods I’m planning to use.
The decision which point a NPC visits will be by chance for the beginning, later this will get a more fine tuning. The navigation from one point to another will be via a graph, in which all crossroads and buildings are added as nodes in the graph. The weight of the edges would be the block distance. Then we run a dijekstra over the graph to get the shortest way to our target.
A A* algorithm will then find the real way of the NPC to walk. So to say the dijekstra gives the NPC a certain direction and the A* the exact path.
This is the basic of NPC walking around in a village. Now let’s had over to the city development.
The speed of the development of the city is mainly based on the amount of visits by the player, if he visits the city often it would grow faster then a city he passed through once.
More information will come later.
Any feedback is appreciated
Skaldarnar and Ten'son' will focus on the generation of a village. I will work on the AI in the meantime.
Generation:
(Part that needs to be written by the other two.
Building Generation
I am working on a procedural architecture generation approach similar to the one described in this paper. My aim is to develop a solid grammar based system for easy building generation. New building types could be added via new grammar files consisting the specific new grammar.
So, how does this corporate with the city generation? As mentioned by @Ten'son', the village or city will be divided into several parcels which have a functionality assigned. The proper building type is then determined by the functionality, the biome the city is located in and the overall style of the city (style could be something like modern, medieval, ancient rome/greek, ... and is defined only once for one city. However, its not necessary for the generation itself, only an esthetic thing).
The concrete building instance is then generated by choosing and applying the grammar rules width the additional information of the parcel size (length x width x height). The generated structure could be stored as a Blueprint in a Metablock or something to "rebuild" the building if the player comes back to the city.
With this approach the cities would differ in the final building instances for the same word seed (as the generation is a quite random process). Although, the generated cities would look very similar (as the same grammar is used).
Finally I would like to give a hint on how the grammars could look like:
A simple rule has the following structure
Code:
predecessor : condition ::- successor : probality;
where condition[\i] is a guard for the rule that has to evaluate to true in order for the rule to be applied, e.g. splitting a building into 4 floors makes only sense if the building height is greater than, let's say, 16, so the associated rule would look like
Code:
building : (height >= 16) ::- floor(height/4) floor(height/4) floor(height/4) floor(height/4)
AI:
The AI will be based on a POI(Point of Interest) System, which defines certain areas and buildings in a city as worth visiting for an NPC.
Let’s take a quick example of this: A fisher would go to the lake to fish. A normal citizen wouldn’t go there . So the POI is not in the POI-list of the villager.
Another one here: A guard would walk on the walls of the city, but normal villagers don’t go there.
This allows us to have a city full of life. Since some villagers will walk to places where others don’t . But there are also certain times where most of the villagers go to a place . Like meeting in a church every morning.
There will be also different ways for the villagers to go to some other place. They can run/hurry or just wander around and even get distracted and stop at some point.
The AI will react on the Players behavior too. If he kills villagers or destroys buildings the villagers will get hostile and attack the player.
AI in theory:
Oh well that sounded neat didn’t it? So here are some information what methods I’m planning to use.
The decision which point a NPC visits will be by chance for the beginning, later this will get a more fine tuning. The navigation from one point to another will be via a graph, in which all crossroads and buildings are added as nodes in the graph. The weight of the edges would be the block distance. Then we run a dijekstra over the graph to get the shortest way to our target.
A A* algorithm will then find the real way of the NPC to walk. So to say the dijekstra gives the NPC a certain direction and the A* the exact path.
This is the basic of NPC walking around in a village. Now let’s had over to the city development.
The speed of the development of the city is mainly based on the amount of visits by the player, if he visits the city often it would grow faster then a city he passed through once.
More information will come later.