[1.10.15] Pedestrians

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

[1.10.15] Pedestrians

Post by Lobby »

image.png


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
Check
using an image like that:
image.png
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.



Roads
image.png
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:
Show
pedestrians
Set this attribute to true or false. Pedestrians can walk on this road only if this attribute was set to true.

If not specified the game will try to determine whether pedestrians are supposed to be able to walk on this road automatically. This is determined by factors like road flags, allow transfer attribute and speed.
Show
sidewalk offset
Distance of the center of the sidewalk to the edges of the road tile (normalized, default value is 0.05).
Show
sidewalk size
Size/width of the sidewalk (normalized, default value is 0.025).
Show
allow road crossing
If set to true pedestrians will be able to cross the road. Only useful for roads without or with slow traffic.

If not set the game will determine this attribute based on the sidewalk offset.


Road decorations
Road decorations have the ability to set allow road crossing to true for the road they are placed on.
Show
allow road crossing
If set to true pedestrians will be able to cross the road underneath the decoration. False by default.


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.
You do not have the required permissions to view the files attached to this post.
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by CommanderABab »

Screenshot_20211126-120207_TheoTown.jpg
:)
You do not have the required permissions to view the files attached to this post.
my avatar:
User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2211
Joined: 07 Jul 2016, 20:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by KINGTUT10101 »

I can't believe it, Commander took a screenshot without the drunk filter :space
User avatar
ian`
Metropolitan
Reactions:
Posts: 117
Joined: 04 Apr 2020, 15:36
Location: 日本
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by ian` »

Show
Screenshot from 2021-12-01 19-15-42.png
nice. :D
i have to set false the pedestrians for my road plugins until an one-side pedestrians attribute is available. :mine
You do not have the required permissions to view the files attached to this post.
:bc
User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 257
Joined: 14 Oct 2021, 08:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by Wepf »

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
User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2211
Joined: 07 Jul 2016, 20:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by KINGTUT10101 »

That's why I removed sidewalk pedestrians from the Nature Pack.
User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 257
Joined: 14 Oct 2021, 08:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by Wepf »

Ok
I play music and create theotown plugin (rarely)


Btw I'm from 🇹🇭 and I'm 13
User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 722
Joined: 17 Jul 2017, 14:16
Location: Philippines
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by Hadestia »

Can we have a sample plugin for the new pedestrian road?
 ! Message from: Hadestia
Visit my YouTube channel:
https://youtube.com/channel/UC5qG-r8y21036JZbGRClbdQ
P
PresidentSmith609
Metropolitan
Reactions:
Posts: 123
Joined: 25 Mar 2021, 11:27
Location: India
Plugins: Showcase Store
Version: Beta

Re: [1.10.15] Pedestrians

Post by PresidentSmith609 »

Can u all help me? I am not able to access the pedestrian? Do i need to update or add file??
User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 722
Joined: 17 Jul 2017, 14:16
Location: Philippines
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by Hadestia »

Attribute to spawn pedestrian like "spawn car" on a building When?
 ! Message from: Hadestia
Visit my YouTube channel:
https://youtube.com/channel/UC5qG-r8y21036JZbGRClbdQ
User avatar
Patchouli Knowledge
Townsman
Reactions:
Posts: 64
Joined: 26 Sep 2020, 07:42

Re: [1.10.15] Pedestrians

Post by Patchouli Knowledge »

how wonderful
User avatar
Patchouli Knowledge
Townsman
Reactions:
Posts: 64
Joined: 26 Sep 2020, 07:42

Re: [1.10.15] Pedestrians

Post by Patchouli Knowledge »

When to consider using it on the original road?
Last edited by Patchouli Knowledge on 19 Dec 2021, 07:57, edited 1 time in total.
User avatar
Matthew H
Settler
Reactions:
Posts: 7
Joined: 26 Mar 2025, 04:18
Location: Vacnvouer, BC, Canada
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

Post by Matthew H »

IMG_5583.png
is it possible to have pedestrians only on one side of the road, perhaps by disabling some of the smaller squares on this image which would prevent pedestrians from walking to them?
You do not have the required permissions to view the files attached to this post.
Previous topicNext topic