[Mod] Citybuilder [singleplayer][WIP]

Post Reply
Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

[Mod] Citybuilder [singleplayer][WIP]

by Sokomine » Post

This mod aims at providing functionality for (relatively) generic city building games instead of a concrete one. Games like Sim City, the Anno series, mods like MC Millennaire and MC Minecolonies tend to have some things in common. What citybuilder does is:

- provide the craftable (9 diamond blocks) "city administrator desk" that allows you to start your own settlement
- the name of the settlement can be set
- wood type can be choosen (all wooden structures will then use that wood type)
- list the structures you've added to your settlement
- add structures to your settlement by "printing" floor plans of level 0 structures on blank constructors
- abandon the settlement (if you misplaced it or no more structures are associated with it)

Constructors (the sign with a bed on)..
- can be placed and will show you how the structure will look like; where a block is missing, there'll be a scaffolding node which you can climb and walk through, and where you need to dig, a digging indicator (red upside-down pick) will appear
- you can dig the constructor and place it elsewhere until you've found a place you like; the scaffolding will be removed when you dig it and placed when you place the constructor
- constructors can only be placed withhin a certain (configurable) distance of the city administrator desk
- constructors cannot be placed in such a way that the resulting structures would overlap
- constructors provide a menu where you can update the status of the structure (scaffolding/dig_here indicators will be placed according to the current state), remove the scaffolding nodes (update will place them again), see how it will look when finished (preview), see which materials are needed to finish the structure, how many nodes need to be digged and placed, and which upgrades are available and what is needed in order to be able to upgrade
- if a building is not required by other buildings at its current level, it may also be downgraded
- note: if you want to build manually, climb to the top of the structure and right-click the topmost scaffolding node; blocks will be taken out of your inventory and be placed from bottom upwards at each click until the column is completed or you lack a material
- once a structure has been completed at level 0, the constructor can no longer be digged

More technical:
- data about the cities is stored inside the citybuilder.cities[ minetest.pos_to_string( position_of_city_administration_desk) ] data structure; buildings are stored in the table buildings[ minetest.pos_to_string( position_of_constructor) ] in the above mentionned data structure of each city; start- and end positions of each building are available
- buildings can provide exactly one functionality to the city at a given level, i.e. { provides = "housing", level = 2} or { provides = "pub", level = 1} etc.
- buildings can require a list of functionalities provided by other buildings and required to be at a certain level; i.e. a structure with requires = { housing = 2, pub = 4, mill = 1} can only be achieved through upgrading if the settlement has at least one structure that "provides" housing at level 2 or above, one that provides a pub at level 4 or above and one that provides a mill at level 1 or above
- only structures that have no requirement and which are level 0 can be "printed" through the city administration desk and then placed by the player
- some checks are done when a building is added using citybuilder.add_blueprint( path, data, modname ); i.e. the size of upgraded structures has to be equal to that of the structure from which it is upgraded

Known bugs:
- you will need 2 beds if you want to place one bed
- the list of needed materials is only available if you click on "Update" manually at least once

Wanted and will hopefully be provided by other mods (not mine!):
- mobs that "live" in the city, interact with the building mechanism and do "tasks" depending on the structure (cutting wood, mining, farming, happily moving about, sleeping at night, ...)

Citybuilder in combination with citybuilder_structures:
Image
To the very left, you can see the city administrator desk. From left to right: House at level 1 beeing upgraded to level 2 (see the scaffolding and dig_here indicators), a tree farm, in front of that a pub at level 1, and at the very right a mine at level 1. All buildings start at level 0. The sign with the bed on is the building constructor. Right-click it in order to update the scaffolding, see what's needed for the next upgrade, and upgrade the structure.

citybuilder_structures is a sample implementation of how citybuilder might be used. Without the structures there won't be anything to do. You can provide your own structures. Those in citybuilder_structures are probably a bit big and too complex for a city building game. Provided are houses of level 0-6 (from tiny shed to multi-generation brick house), mines at level 0-6 (from a ladder in the ground to a large mine entrance with a complex rail system), a pub at level 0-6 (from a table below a tree to a large brick inn), churches at level 0-1 (small chapel) and a tree farm at level 0. Not all structures can be reached as some structures list requirements that can't be fullfilled yet due to the structures that could provide that functionality not existing yet.

Download: https://github.com/Sokomine/citybuilder ... master.zip
Browse code: https://github.com/Sokomine/citybuilder
Version: 0.1
Licence: GPLv3
Depends on: handle_schematics
Highly recommmends: https://github.com/Sokomine/citybuilder_structures (or a future mod of that kind), which will in turn need cottages and bell.
Attachments
citybuilder_scenery.jpg
citybuilder_scenery.jpg (205.04 KiB) Viewed 565 times
A list of my mods can be found here.

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] Citybuilder [singleplayer][WIP]

by D00Med » Post

This is a really interesting idea, although maybe your description could be a little clearer.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod] Citybuilder [singleplayer][WIP]

by TumeniNodes » Post

8 paragraphs wasn't clear enough? 0_o
:P
A Wonderful World

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Citybuilder [singleplayer][WIP]

by Sokomine » Post

Perhaps I scared people away with too much text...anyway: You've probably heared about mods like towntest, npcf or others where a mob runs around and builds your house. Or heared about mods like MC Millennaire and MC MineColonies. Or you might have played games like Anno 1603, Sim City and the like. Citybuilder allows you to start a town and tell the game where you want each building (be it a house, a pub, a mine, a mill, ..) to be placed. Buildings can be upgraded (improved) to get more inhabitants. So, for example, you can only upgrade your house one more level if you've built a pub in your city because otherwise the workers will be unhappy. Or you need to build a mill in order to upgrade further - because the families will only get more children if they're certain that you can produce enough food. The general goal of these games is to develop a large, thriving, booming city with lots of inhabitants.

The mobs that are supposed to live in these cities and be the inhabitants do not exist yet. The job of the mobs is to live in one of the houses, have a job in another house (i.e. work in said mill, be a lumberjack, miner, build further houses, gather materials, ..), and go about their businiess (=simulate life). There are several developping mods out there which might be candidates for inhabitants.

The next thing I'm going to implement will probably be a basic interface for handling those mobs - namely deciding which ones ought to be added to the city at which time. Sucessfully upgrading a house to a new level will then get you another inhabitant - be it a wife for your worker, a child, or other people moving in. Each mob gets his/her own bed in one of the houses assigned. The adults may get jobs assigned (by you?). For now, they'll all just be data only...no actual mobs running around until I find a mod that will fit in somehow.
A list of my mods can be found here.

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: [Mod] Citybuilder [singleplayer][WIP]

by KCoombes » Post

This is a brilliant idea, Sokomine! I've often wondered if the singleplayer player gets bored quickly, with no clear goals presented to them - this mod will correct that issue. Once again, your devotion to MT shines through!

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Citybuilder [singleplayer][WIP]

by azekill_DIABLO » Post

towntest revived?
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Citybuilder [singleplayer][WIP]

by Sokomine » Post

azekill_DIABLO wrote: towntest revived?
In a way. At least I think that towntest was intended to be that way once, and it started years earlier. Sadly it never got beyound the place-chest-and-let-builder-build-one-house level. The mobs working for citybuilder will not need to know as much about the structures they're constructing as those in towntest. They only need to know which nodes to look for and what to do when they find one (and consider themshelves to be a builder with the necessary items in their inventory).
A list of my mods can be found here.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Citybuilder [singleplayer][WIP]

by azekill_DIABLO » Post

cool!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Post Reply

Who is online

Users browsing this forum: Skamiz Kazzarch and 14 guests