[Tutorial] Marker Position

Discussion about Mods for Prison Architect

Moderator: NBJeff

Meppi
level0
Posts: 6
Joined: Sun Nov 02, 2014 2:38 pm

[Tutorial] Marker Position

Postby Meppi » Fri Oct 23, 2015 8:31 pm

I ploted the marker positions defined in objects.spritebank over the objects.png and people.png for reference purposes.
If you want to modify the stock files or make your own mod, this might be helpfull to see how its done in the stock game.

The number is the id in the spritebank. And a little green arrow shows the orientation.

Image Image

The coordinates objects.spritebank in ingame units. One unit is 32px. To get your ingame coordinates you have to get the pixel coordinate of your maker in the image and divide it by 32.
If you want to know the Index of a slot, you can look it up in the spritebank using the id from the image.

Code: Select all

Technical details for those interested:
I copied the markers to a file markers.txt, arranged it in the format "x -y id" and multiplied the coordinates with 32.
Then i ploted it with gnuplot using this code:

set margins 0,0,0,0
unset tics
unset border
set xrange [0:2048]
set yrange [-2048:0]
set terminal png size 2048,2048 small
set output 'marker_objects.png'
plot 'marker.txt' using 1:2:(sprintf("%d",$3)) with labels point pt 1 offset char 1,-0.5 notitle
set output 'marker_people.png'
set yrange [-4096:-2048]
plot 'marker.txt' using 1:2:(sprintf("%d",$3)) with labels point pt 1 offset char 1,-0.5 notitle
unset output

markers.txt

Strangely there are no markers on bench, table, sofas and a few others. Yet they work ingame and it's possible to define you own in a custom material.txt.

EDIT:
Sprite names as defined in objects.spritebank with their bounding boxes:

Image Image

Code: Select all

Technical details:
Sprite coordinates saved in sprite_names.txt, arranged it in the format "x*32 y*(-32) Name w h"
Then i ploted it with gnuplot using this code:

set margins 0,0,0,0
unset tics
unset border
set xrange [0:2048]
set yrange [-2048:0]
set terminal png size 2048,2048 small
set output 'objects_sprite_boxes.png'
plot 'sprite_names.txt' using ($1+$4/2):($2-$5/2):($4/2):($5/2) with boxxyerrorbars lw 2 notitle
set output 'people_sprite_boxes.png'
set yrange [-4096:-2048]
plot 'sprite_names.txt' using ($1+$4/2):($2-$5/2):($4/2):($5/2) with boxxyerrorbars lw 2 notitle
unset output

sprite_names.txt
Last edited by Meppi on Fri Oct 23, 2015 10:52 pm, edited 3 times in total.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Tutorial] Marker Position

Postby aubergine18 » Fri Oct 23, 2015 9:13 pm

Fantastic work!! Can I use that in the guide I'm making on github? Specifically at bottom of this page: https://github.com/aubergine10/Prison-A ... spritebank

EDIT: Oh wow, Equipment can have markers to define where it should be held! Superb find!!

EDIT #2: BTW, I think there are also default markers defined for objects (if none specified in the .spritebank or .txt) - they seem to be arranged at equally spaced distances across the object sprite, but I've not yet been able to work out exactly what the defaults are - that would explain the reason some objects don't have markers defined, they are using the defaults.
Last edited by aubergine18 on Fri Oct 23, 2015 9:18 pm, edited 1 time in total.
Meppi
level0
Posts: 6
Joined: Sun Nov 02, 2014 2:38 pm

Re: [Tutorial] Marker Position

Postby Meppi » Fri Oct 23, 2015 9:17 pm

Can I use that in the guide I'm making on github?

Sure! Go ahead.
BTW your guides on steam are great. Unfortunately i found them after i figuered out most by my self. But reverse engineering is half the fun anyway :D
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Tutorial] Marker Position

Postby aubergine18 » Fri Oct 23, 2015 9:26 pm

Cool, thanks :)

Would you be able to do similar images but instead of markers overlay the sprite names?

Also, what software did you use to run that script?
Meppi
level0
Posts: 6
Joined: Sun Nov 02, 2014 2:38 pm

Re: [Tutorial] Marker Position

Postby Meppi » Fri Oct 23, 2015 9:43 pm

Would you be able to do similar images but instead of markers overlay the sprite names?

that should work but it might get a little cramped
Also, what software did you use to run that script?

http://www.gnuplot.info/

EDIT:
Would you be able to do similar images but instead of markers overlay the sprite names?

Added to OP. Some of the names overlap a bit but there is no easy way around it.
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: [Tutorial] Marker Position

Postby Brento666 » Thu Oct 29, 2015 6:09 pm

Hi Meppi !

Your work should be stickied! (as a very helpful doc; I'm not sure it's a tutorial, unless you mean it's a gnuplot tutoriall ) :mrgreen:

Thanks for creating these awesome visualisations! They are pretty wicked sweet to check references and markers!!
You just greatly helped me track default marker positions on the bed; so I could rewrite them to local markers more easily and reuse them for my beds seconds subtype!!
-> Now my coming {mini, upgrade}'s (extension to {Paint, upgrade, downgrade, sign} ) new objects are truly fully freaking working as intended !
https://www.reddit.com/r/prisonarchitect/comments/3qq4i0/mini_upgrade_release_incoming/

Mini Upgrade is coming later today!

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest