## [1.10.15] Pedestrians

Learn here how to create and use plugins.

Moderator: Plugin Moderators

Lobby
Developer
Reactions:
Posts: 3690
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

### [1.10.15] Pedestrians

Design aspects
In order to incorporate pedestrians into the game multiple aspects had to be considered:
1. Roads should act as unit on which pedestrians are walking
2. Existing plugins that use pedestrian road type should work with the new system as well
3. Setting pedestrian flag automatically for roads would break these plugins (special "pedestrian cars" would use normal roads then)
4. In any case, there has to be a way to detect whether a road is suitable for pedestrians, potentially with additonal support for different types of pedestrians which could be implemented by using road flags
The solution to these requirements was to add a new attribute pedestrians to roads. If not specified the game will try to figure out whether the road is capable to be used by pedestrians.

Pedestrians themselves were implemented using a new plugin type called pedestrian. This plugin type basically consists of some frames that contain the people that will be drawn. These frames are special in regard to their size as people in TheoTown are supposed to have a size of 1x3 pixels. While other sizes may work, too, there is no rotational awareness for the frames. Furthermore, the pedestrian system was optimized around the idea that people have a width of exactly one pixel. Using different sizes may cause more graphical glitches.

Defining pedestrians
A new plugin type "pedestrian" was added to define pedestrians. Here's how a plugin may look like:

Code: Select all    Reset

[
{
"id":"\$pedestrian_plugin00",
"type":"pedestrian",
"frames":[{"bmp": "imgage.png", "w": 1, "count": 8}]
}
]
JSON checker
using an image like that:
image.png (175 Bytes) Viewed 2958 times
This pedestrian type would spawn automatically for all rci types and levels in the game. You can define how likely the pedestrian will spawn for certain types/levels using the following attributes:
• residential
• commercial
• industrial
• level 1
• level 2
• level 3
These are expected to be floating point numbers. The default value for all of them is 1. Use "auto spawn":false to set the default value to 0.

image.png (11.65 KiB) Viewed 2983 times
A single road tile offers four parcels which can be targeted by pedestrians.
Various attributes were added to roads to incorporate the pedestrian system and provide some control over its behavior:
pedestrians
sidewalk offset
sidewalk size

Road decorations have the ability to set allow road crossing to true for the road they are placed on.

Spawning pedestrians
The game will spawn pedestrians automatically on roads that are suitable.

Unlike cars pedestrians don't follow a pre-calculated path. Instead they randomly change direction and eventually vanish. Also, unlike cars, only pedestrians that are currently within the viewport will be updated. This is crucial to maintain game performance while there are thousands of pedestrians.

Interaction with pedestrians
As of right now there are no functions to interact with the pedestrian system directly. Even if something like that will be added (e.g. pedestrians walking to/from stations) it would not have impact on the simulation of the city as only visible pedestrians will be updated.
=^._.^= ∫

CommanderABab
AB
Reactions:
Posts: 10784
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

### Re: [1.10.15] Pedestrians

...

KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2205
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

### Re: [1.10.15] Pedestrians

I can't believe it, Commander took a screenshot without the drunk filter

ian`
Supporter
Reactions:
Posts: 114
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

### Re: [1.10.15] Pedestrians

nice.
i have to set false the pedestrians for my road plugins until an one-side pedestrians attribute is available.

Wepf
Inhabitant of a Megacity
Reactions:
Posts: 284
Joined: 14 Oct 2021, 10:19
Plugins: Showcase Store
Version: Beta

### Re: [1.10.15] Pedestrians

I think this update will be replace pedestrian systemby KT10101 (@KINGTUT10101)
I play music and create theotown plugin (rarely)

Btw I'm from and I'm 13

KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2205
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

### Re: [1.10.15] Pedestrians

That's why I removed sidewalk pedestrians from the Nature Pack.

Wepf
Inhabitant of a Megacity
Reactions:
Posts: 284
Joined: 14 Oct 2021, 10:19
Plugins: Showcase Store
Version: Beta

### Re: [1.10.15] Pedestrians

Ok
I play music and create theotown plugin (rarely)

Btw I'm from and I'm 13

Inhabitant of a Megalopolis
Reactions:
Posts: 718
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

### Re: [1.10.15] Pedestrians

Can we have a sample plugin for the new pedestrian road?

PresidentSmith609
Metropolitan
Reactions:
Posts: 112
Joined: 25 Mar 2021, 13:27
Location: India
Plugins: Showcase Store
Version: Beta
Contact:

### Re: [1.10.15] Pedestrians

Can u all help me? I am not able to access the pedestrian? Do i need to update or add file??

Inhabitant of a Megalopolis
Reactions:
Posts: 718
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

### Re: [1.10.15] Pedestrians

Attribute to spawn pedestrian like "spawn car" on a building When?

Patchouli Knowledge
Townsman
Reactions:
Posts: 58
Joined: 26 Sep 2020, 09:42

### Re: [1.10.15] Pedestrians

how wonderful

Patchouli Knowledge
Townsman
Reactions:
Posts: 58
Joined: 26 Sep 2020, 09:42

### Re: [1.10.15] Pedestrians

When to consider using it on the original road？
Last edited by Patchouli Knowledge on 19 Dec 2021, 09:57, edited 1 time in total.