AntyVersum

    Making games with passion
Creating tools for roads and land plots as part of modding (technical) #38
Last month major focus was on improving land plots and developing tools, to help creating world. Also to support later modding features. In this post, there is a bit of mechanics and some technical discussions.
Want to help? Whishlist us on Steam (With Pre-Alpha Experimental Playtest Demo)

Last month major focus was on improving land plots and developing tools, to help creating world. Also to support later modding features.

Mechanics

With this update, the video showcases editing of simple roads, land plots and building walls on selected land plot.
Video starts a bit slow, since editing happens inside development editor, which is a bit awkward atm.
But idea is, to provide means to players, to allow creating road networks and automatic layout of land plots. Saying that, tools will be very bear bone for some time, as other areas have higher priorities. 

Various functionalities of editing land plots will be possible. Some like making more, or less zones on the road path. Making more smooth zones on the inner and the outside perimeter of the zones. Changing zones shapes. 
In the future mechanics should allow to split and combine land plots into bigger, or smaller zones. Consider mechanics of inheritance, where children receive part of the family wealth.

Additionally, goal is to provide not only ingame editing tools (may happen in later development time), but also to allow dynamically change world via lua.
For example mentioned inheritance. Or expanding roads, while town grows.

Gameplay

Gameplay wise, the idea is to allow player purchase land plots, on which player and family will be able to reside. 
Other land plots will be either available to purchase, or occupied by other UMes, where life will dictate their fate.
Land plots will allow to build on and nothing can be build beyond borders.
Building will also involve cost of materials, like walls, or furniture.

Other UMes NPCs (AI), will live in their owned places. But will be able to visit and interact with any other UMes including player. And vice versa.

During gameplay, future mechanics will allow to expand territory to be able build. For example extending roads. Or extending land plots.
Like for example growing town through times.

Technicalities

As UMeFate development progresses, UMes NPCs will need places to live. Hence development direction decided that land plots are important at this development stage, to ensure AI characters will be allocated to their places, where they can stay. Many NPCs will be able to live in one space. And later multi story building swill be possible. 

Roads has no other meaning atm, besides land plots being created along them. There are various future plans with roads however. But none critical at this early development stage.

Current tools are getting prepared, to be integrated into core game.
Also, upcoming plans are to replace old navigation system, with more performant solution. Plus will allow streamline whole code, on the collision detection side of things.

Along with everything, focus on the game performance is number one.

A Bit Of Math

Found that creating this tools mechanics is both interesting and challenging at the same time.
For the first, there is an idea of mesh based topology structure made of nodes, which allow to create land plots and walls. In fact, the system is made in such way, that the same algorithm is responsible for these two different game mechanics. 

Mesh based topology means, nodes which define where land plots, or walls are positioned, are also interconnected each other with segments.
Next thing is, to extract information about actual zones inside land plots and walls. So to define for example, which room contains which walls. 
For that similar algorithms to Depth-First Search (DFS) or Breadth-First Search (BFS) is used.
In the principle, algorithm starts at one node, and spreads into other nodes, recording the path. Somehow similar to A*.
Then project specific data cleanup is executed and all is recorded into useful storage.

Having that base, now "just" need implement land plots, to follow roads curvature.
Not as simple at first, as it seems. Road is made of set of nodes. For simplicity, limiting bending angle.
Roads are of specific width and road is split into many segments of regular length.

Now need define points along road curve, which is based on Bezier.
Width of the road, pavement width and land plots with are deifined by parallel offseting of points.
Saying that, higher resolution of points per road, creates overlapping points. These need to be cleaned out.
Then new perimeter line can be defined, on which new points can be plotted, with desired spreading.
And finally, with some additional woodo magic, new zones are calculated.

Reddit Discussion

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top