Inactive Procedural Architecture Grammar

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Update time:
Additional to the (working) /build command, I've moved the grammar system into a module, as recommended by Immortius in the Architecture vision thread. Please have a look at the PR and give me some feedback.

What you can do with the grammar system at the moment is generating simple structures through hard coded grammars. One example is given in the BuildingCommands class, which generates the output as you can see it in the game. The split command is working, with which you can specify the walls, leaving the inner room air. Furthermore, you can create rules with more then just one successor, meaning a random selection for the derivation. This will be improved in the future, allowing more detailed probability contraints.

What you cannot do with the grammar system are conditional rules. Until now there are no guards or conditions checked when generating, that means you cannot alter the derivation based on the derivation variables (like remaining height or something). Moreover, it is quite inconvenient to build the grammar by hand, thus I am working on the grammar file parser to support easy grammar loading and specification.

This were the main changes/updates so far. If you have any suggestions regarding the usage or design of the system, please let me know. ;)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Tested and pulled :)

This was the first time we had unit tests in a module directory, so at first that caused issues in IntelliJ. The fix suggested by Immortius was to simply add junit to the dependency list for subprojects (the modules) and the errors went away.

That wasn't before I somehow managed to mess up Git on my PC (even a brand new cloned directory would get Git errors) so I ended up using the GitHub merge button, figuring it would probably break in Jenkins at first. Fixed it in a second pass no problem.

That did however still manage to get the tests missed in Jenkins - you can see the little bump that makes up the tests after they were added until they disappear. I dug up where they go (a build dir gets spawned under "mods/[module]") and added that in for now. Also noticed that Checkstyle gets lost the same way .. going to leave that alone for now since there are good ideas in that area for later :)
 

overdhose

Active Member
Contributor
Design
World
GUI
caketown.png played around with this a bit... nice work. I like how you create a block collection, it's just what I needed as a blueprint base for housing. I made some yummy houses to see what they would look like when they got built.

Time to get those oreon builders building...
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Yummy :)
Look forward to next week, after my exam on tuesday I'll work on the grammar file loading as assets, so we might include "building recipes" within the tasty block mod (or the oreo miniions). This will make life a lot easier than changing some hard coded block names ;)
 

overdhose

Active Member
Contributor
Design
World
GUI
heh no worries I made my own class based on your mod, what you see was executed with 4 consecutive /buildyummy commands who take an extra parameter without restarting, so as far as I am concerned they aren't hardcoded. I'll try my hand at changing the definitions a bit to suit my needs. I'd like to create a bit different looking houses

EDIT: I wasn't planning on leaving the command, as I stated I just wanted to test the outcome. If you like I can leave the command for playing around, the format is /buildyummy 6 6 6 2 for example, where the last digit is an index to definitions
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Ah, ok. Leave it in, may be fun to play around with. And let me know what you need as interface to the system, your miniions are the first real usage for the grammars ;)
 

overdhose

Active Member
Contributor
Design
World
GUI
No interface needed :D I only need the block collection, which I will feed to the minions as a blueprint for houses they will build 1 block at a time while requiring the resources to do so. So I would define a zone as residential, your grammar makes a blueprint, and assigns it to a builder, the minion checks for resources and starts building... that's the idea for now. So all i need is present already. More geometric shapes would be welcome (unless they are there but I haven't spotted them yet) just started with this, so I haven't really found what defines the general shape of the house yet, or how I can alter it.
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
At the moment there's just the box shape. I want to play around with roof types or more complex footprints, but I still have to figure out the best way to "translate" all into the blocks. But I will update this thread if something new is available ;)
 

overdhose

Active Member
Contributor
Design
World
GUI
I'm sure you will... I actually have a hard time concentrating on my thing now that I played with it. But I'm gonna hang on and finish the miniions mod before I stray. Just so they appear as a little community with some basic behavior.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Bump :)

I've begun some design tinkering with Stuthulhu on "Holdings" focused on how small populations of creatures would develop an area and particularly how different races would do stuff differently. A simple first effort is having the number of creatures spawned in an area affect what they do, such as seeking out food, materials, shelter, and so on

I can see a lot of integration potential there with PAGs and Miniions in particular, first related to farming and building structures. Miniions are beginning to "build" BlockCollection representations of PAGs, so that's something to try there as well. My big question for PAGs - Skaldarnar - it has been a while since we were talking about the village-scale of the topic, as opposed to a single structure. Did you envision a PAG-based "village scope" structure of some sort driving the placement of different things in an area?

We can just plop down a farm or a building a random distance from a central block for testing, but it would be nice to have a better feel for how to organically grow a village that makes sense (put "streets" between buildings, group small plots of farms together, favor putting farm-related buildings close to said plots, etc).

I know you're about to go on vacation so I'm not asking for you to implement that already, but thought it would be good to get an initial idea of how we might eventually do it :D
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
I had a look at a lot of papers and articles for the building generation, and I've found a couple related to city generation as well. They differ in complexity of course, but most sound really interesting. I think all of them have in common that they try to provide a "logical" and "natural" city plan, resulting in different street sizes depending on the importance of the street/road, generation of blocks or quarters within in the city and so on...
I may give to of the articles as reference for the ones interested ;)
Parish, Müller - Procedural Modeling of Cities
Lechner, Watson et al. - Procedural City Modeling
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Cool, will look at those when I get home :)

Do you have a feel for how we'd access data from the system after we've implemented something? If we want a small colony of creatures to build a couple houses and a few farm plots could we perhaps consult some sort of PAG provider and just be fed a few coordinates and associated BlockCollections? Or do you think we'd be doing something very differently?

Just thinking out loud for a moment I wonder if the "city egg" approach could pick a coordinate where it lives, so to say, then generate in stages from there. At a world-gen scope you might then tell it to simply push forward x time units to scale to a city of 200 inhabitants from race y. At a "Girl-Gooey and Boy-Gooey just met and are setting up shop" scope you could place the egg and then only sequentially request steps

1) Build shack (get coordinate of first residence)
2) Build farm from across shack with enough space for a path between them (get first farm coord)
3) Build second shack next to first shack for when Baby-Gooey arrives (...)
4) Build nice house on other side of shack when Baby-Gooey is big enough to help
5) Build second farm plot
6) Clear a decent road-looking thing between line of shacks and line of farms
7) Tear down original shack to make it a nice new house for Teenage-Gooey
8) Etc
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
My thought about this were a couple of different generators (with first determine a common generator interface ;) ) Given the different stages, the city egg might save information on how big the city/village is at the moment and "governs" how the city evolves, which is basically where streets will be placed. Apart from the streets different building plots can be used for more detailed city generation - the Gooey family may request a new plot for the baby next to their home or they can change their house (restricted by the overall size of the house bounding box defined by the city egg).
Furthermore, if the plots are big enough (-> industrial areas) the inhabitants can of course use a "miniature city generator" to build small roads and stuff in there.
All in all, we would need good cooperation of the different generators I would say.
 

overdhose

Active Member
Contributor
Design
World
GUI
actually been breaking my head about a similar issue... it's actually a lot harder when you actually try to achieve something within a given context and not just have some "floating" ideas about how to do it. tbh I'm quite interested to hear more details about how you plan to fill in the generators, and how you plan to check available building space for example, or level plots etc to make something that looks consistent. Also, do you have any ideas how you will combine the "auto" generation and player generated decisions?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
The phased world generation is something I've been occasionally badgering Nym Traveel about a bit, we had a GDoc floating around on it quite a while ago before we got stuck staring in awe at the Tectonics by Laurimann and follow-up climate sim + height map world by Nym. It is a definite architecture piece and probably a bit boring (and hard) to lay the foundation for :)

Basing city gen, organic or fast-forward growth, on first preparing a zoning layout sounds very useful, since in that case you could as the player change / paint these zones to change the future layout of a city, akin to placing full blueprints of structures for creatures to then build. The "city egg" (could actually be a Holding, come to think of it) would sort out the zoning with some sort of generator/PAG processor then be the thing to ask when a creature wants to build something. Player could trigger some control option to make zones visible, akin to those currently used in miniions.

Also now picturing preparing these city zoning setups in groups, say call em districts, so we can start only preparing zoning for one area, then if the city grows close to capacity just add another district ... but at that point I really need to get around to reading those articles, or better yet have somebody else do it :D
 

overdhose

Active Member
Contributor
Design
World
GUI
can i has district 9?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
can i has district 9?
I resisted inserting that reference purely so somebody else could. Yes you can has - as long as you can build it ;)
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Yay, finally back from vacation, had a nice week :)

overdhose, most of my suggestions are just "floating ideas". Consistency might only be achieved by a "good" use of different generators/generator types. We had the notion of meta data a lot in discussions about city/building/biome generation to keep one style for one area. One way would be to define the biome type and stuff in the grammar file, and also store it for player specific building blueprints. Doing this, the involved generators can use this information, maybe with some sort of preferences like using wooden structures in a forest biome and so on.

Available building space would be anything inside the reach of the "city egg" that is not a building yet, and therefore we'd need a way to store the data for any building somehow (we need that anyways to allow utilization of buildings, such as a black smith or just living/sleeping places).

The player generation aspect is half a game design decision I think. One way would be to restrict the players (editing) access to a city until he buys a plot/district or conquers the whole village somehow, and then he may be able to access a "building menu" or something like that to control generation... or a more complex economy/management screen :D

The concept of holdings may be useful for city/town centers, that can be controlled by the player to gain access to the whole city at once. But as player generation, this a real game design decision, and not the architecture itself ;)
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Getting back to my good ol' grammar system :pinkiehappy:

Over the last weeks, sdab and I had a good (and even constructive) convo about the grammar system. As a first result, we set up a (hopefully) solid languag specification for the PAG-grammar files. You can find it here, an example is provided on the bottom of the wiki page.

Moreover, I updated the initial incubator post with some roadmap information. Thanks to UberWaffe for bringin' MoSCoW to this forum :D

As a mid-term goal I thought of integrating the grammar system in the L&S, our first game module.
 
Top