[1.10.15] Pedestrians

Learn here how to create and use plugins.

Moderator: Plugin Moderators

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

Platform

[1.10.15] Pedestrians

#1

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
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.



Roads
image.png
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:
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.
=^._.^= ∫

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

Platform

Plugin Creator

Re: [1.10.15] Pedestrians

#2

Post by CommanderABab »

Screenshot_20211126-120207_TheoTown.jpg
:)

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

Platform

Plugin Creator

Re: [1.10.15] Pedestrians

#3

Post by KINGTUT10101 »

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

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

Platform

Plugin Creator

Re: [1.10.15] Pedestrians

#4

Post by ian` »

Show
Screenshot from 2021-12-01 19-15-42.png
Screenshot from 2021-12-01 19-15-42.png (99.68 KiB) Viewed 2883 times
nice. :D
i have to set false the pedestrians for my road plugins until an one-side pedestrians attribute is available. :mine
:bc

User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 284
Joined: 14 Oct 2021, 10:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

#5

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: 2205
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Platform

Plugin Creator

Re: [1.10.15] Pedestrians

#6

Post by KINGTUT10101 »

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

User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 284
Joined: 14 Oct 2021, 10:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Pedestrians

#7

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: 718
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Platform

Plugin Creator

Re: [1.10.15] Pedestrians

#8

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

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

Re: [1.10.15] Pedestrians

#9

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: 718
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Platform

Plugin Creator

Re: [1.10.15] Pedestrians

#10

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: 58
Joined: 26 Sep 2020, 09:42

Re: [1.10.15] Pedestrians

#11

Post by Patchouli Knowledge »

how wonderful

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

Re: [1.10.15] Pedestrians

#12

Post by Patchouli Knowledge »

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.

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”