Adventures in map rendering

Mapping Ideas and Sprite Galleries
Post Reply
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Adventures in map rendering

Post by Atlanta-Ned » #318732

This is statbus' ugly sibling; an attempt to write a new map rendering tool.

The development VM has crashed my laptop
1 time
since work began on this.


Here's a giant, randomly updated todo list:

[DONE] Parse out the map files from the code base
[DONE] Split out definitions and tiles into distinct json
[DONE] Determine what each tile's turf and area is (since all(?) tiles at least have a turf and area specified)
[DONE] Render a minimap, where colors are determined by a hash of the tile's area. Tiles that have a turf with 'closed' in the string are rendered as black, so we can start to see the overall structure of the map.

------- Next up -------
• Manually get DMIs/PNGs for /area/ definitions from the game code, pick and place these icons on the render
• Determine what each tile definition corresponds to in the game code. Use this information to get a list of DMIs we need to render for the given map
• Account for layers and overlays (my biggest challenge with previous map rendering attempts)
• Do a full-size render (probably in parts)
• Tile the full size render and insert it into a mapping javascript engine so we can put it on the web

------- Far Future -------
• Figure out coordinate math (because of course Byond has to be weird about it)
• Start tying in all our given coordinates in statbus to these maps

------- Current Status -------

Here's my current best render of Box:
Image
Last edited by Atlanta-Ned on Thu Jul 20, 2017 3:41 pm, edited 2 times in total.
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
bman
Github User
Joined: Fri Oct 14, 2016 4:55 pm
Byond Username: Basilman
Github Username: Militaires

Re: Adventures in map rendering

Post by bman » #318740

super sexy
User avatar
John_Oxford
Github User
Joined: Sat Nov 15, 2014 5:19 am
Byond Username: John Oxford
Github Username: JohnOxford
Location: The United States of America

Re: Adventures in map rendering

Post by John_Oxford » #318851

what's the ship thing with a H?
Bill Rowe - Used for everything // SYS-OP - AI // SYS-USR - Cyborg
https://gyazo.com/07cbe7219ba24366c1f655ad6c56a524

Signature Content:
Spoiler:
Offical In-Game rank:
Image

Image

Image

Image
TechnoAlchemist wrote:you where always right john, you where always right
>implying the admin conspiracy wasen't just confirmed by a admin.
see, i told you motherfuckers.
NikNakFlak wrote:this isn't a game you can't just post whenever you want
I don't even know what the fuck tg is.

Image

Image
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #318883

AI sat, dummy
私は完璧
User avatar
RandomMarine
Github User
Joined: Fri Apr 18, 2014 8:50 am
Byond Username: RandomMarine
Github Username: RandomMarine

Re: Adventures in map rendering

Post by RandomMarine » #318920

Can grilles, lattices, and windows be included or are non-turfs right out?
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #319007

RandomMarine wrote:Can grilles, lattices, and windows be included or are non-turfs right out?
Eventually, yes. This is all rudimentary for the moment. Turfs and areas are only being rendered because I know every tile has those defined.

For shits and giggles, here's the map where I took every tile definition (which starts as an array), encoded the entire thing in json, passed that json through a hash function and used that to generate this mess:

Image
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Ikarrus
Joined: Fri Apr 18, 2014 2:17 am
Byond Username: Ikarrus
Github Username: Ikarrus
Location: Canada
Contact:

Re: Adventures in map rendering

Post by Ikarrus » #319151

Beautiful. Gets me nostalgic
Former Dev/Headmin
Who is this guy?
User avatar
John_Oxford
Github User
Joined: Sat Nov 15, 2014 5:19 am
Byond Username: John Oxford
Github Username: JohnOxford
Location: The United States of America

Re: Adventures in map rendering

Post by John_Oxford » #319170

imagine if that's how you played ss13 and it was turned based and every turn you can move onto another pixel

moving onto someone else is a 50% chance to either kill you or kill them

press e when next to the command console to call the shuttle

nuke ops have a 25% to 85% chance to kill you if they move onto you
Bill Rowe - Used for everything // SYS-OP - AI // SYS-USR - Cyborg
https://gyazo.com/07cbe7219ba24366c1f655ad6c56a524

Signature Content:
Spoiler:
Offical In-Game rank:
Image

Image

Image

Image
TechnoAlchemist wrote:you where always right john, you where always right
>implying the admin conspiracy wasen't just confirmed by a admin.
see, i told you motherfuckers.
NikNakFlak wrote:this isn't a game you can't just post whenever you want
I don't even know what the fuck tg is.

Image

Image
User avatar
Armhulen
Global Moderator
Joined: Thu Apr 28, 2016 4:30 pm
Byond Username: Armhulenn
Github Username: bazelart
Location: The Grand Tournament

Re: Adventures in map rendering

Post by Armhulen » #319172

John_Oxford wrote:imagine if that's how you played ss13 and it was turned based and every turn you can move onto another pixel

moving onto someone else is a 50% chance to either kill you or kill them

press e when next to the command console to call the shuttle

nuke ops have a 25% to 85% chance to kill you if they move onto you
you move on them = you kill them

they move on you = you die

move towards eachother = 50 50

there
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Adventures in map rendering

Post by oranges » #319633

language, repo, source?
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Adventures in map rendering

Post by oranges » #319634

license?
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #319743

私は完璧
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #319744

Actually I'll probably split it off into a new repo once I have something to show.

Currently working on grabbing every atom(?) and its icon and icon_state parameters (if defined) from the game code. This is proving to be an unmitigated pain in the ass. If anyone has any insights into a better way to do this I'm all ears.
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #319747

I would say parse the XML produced by dm.exe
however:
1. I don't know if that XML contains icon references
2. that XML is known to just produce garbage at times
私は完璧
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #319750

I'm also assuming that it's something DreamMaker outputs and that we're not saving it to github. Dagnabit.
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #319758

Progress!!

Code: Select all

Getting atom definitions from /renderbus/tgstation/code/game/area/areas.dm:
/area starts on 4 and ends on 69
/proc/process_teleport_locs() starts on 70 and ends on 90
/proc/area_contents(area/A) starts on 91 and ends on 100
/area/Initialize() starts on 101 and ends on 131
/area/Destroy() starts on 132 and ends on 135
/area/proc/poweralert(state, obj/source) starts on 136 and ends on 165
/area/proc/atmosalert(danger_level, obj/source) starts on 166 and ends on 196
/area/proc/ModifyFiredoors(opening) starts on 197 and ends on 214
/area/proc/firealert(obj/source) starts on 215 and ends on 240
/area/proc/firereset(obj/source) starts on 241 and ends on 261
/area/process() starts on 262 and ends on 266
/area/proc/close_and_lock_door(obj/machinery/door/DOOR) starts on 267 and ends on 272
/area/proc/burglaralert(obj/trigger) starts on 273 and ends on 292
/area/proc/set_fire_alarm_effect() starts on 293 and ends on 297
/area/proc/readyalert() starts on 298 and ends on 304
/area/proc/readyreset() starts on 305 and ends on 309
/area/proc/partyalert() starts on 310 and ends on 317
/area/proc/partyreset() starts on 318 and ends on 329
/area/proc/updateicon() starts on 330 and ends on 342
/area/space/updateicon() starts on 343 and ends on 351
/area/proc/powered(chan)		// return true if the area has power to given channel starts on 352 and ends on 367
/area/space/powered(chan) //Nope.avi starts on 368 and ends on 372
/area/proc/power_change() starts on 373 and ends on 378
/area/proc/usage(chan) starts on 379 and ends on 397
/area/proc/addStaticPower(value, powerchannel) starts on 398 and ends on 406
/area/proc/clear_usage() starts on 407 and ends on 411
/area/proc/use_power(amount, chan) starts on 412 and ends on 422
/area/Entered(A) starts on 423 and ends on 449
/atom/proc/has_gravity(turf/T) starts on 450 and ends on 463
/area/proc/setup(a_name) starts on 464 and ends on 473
Script finished in Time: 27 ms, Memory: 2.00MB
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #319769

IT GETS BETTER

Code: Select all

Getting atom definitions from /renderbus/tgstation/code/game/area/areas.dm:
/area starts on 1 and ends on 50
	/area has an icon set to icons/turf/areas.dmi
	/area has an icon_state set to unknown
/proc/process_teleport_locs() starts on 51 and ends on 61
/proc/area_contents(area/A) starts on 62 and ends on 67
/area/Initialize() starts on 68 and ends on 91
	/area/Initialize() has an icon_state set to 
/area/Destroy() starts on 92 and ends on 94
/area/proc/poweralert(state, obj/source) starts on 95 and ends on 121
/area/proc/atmosalert(danger_level, obj/source) starts on 122 and ends on 148
/area/proc/ModifyFiredoors(opening) starts on 149 and ends on 165
/area/proc/firealert(obj/source) starts on 166 and ends on 186
/area/proc/firereset(obj/source) starts on 187 and ends on 204
/area/process() starts on 205 and ends on 208
/area/proc/close_and_lock_door(obj/machinery/door/DOOR) starts on 209 and ends on 213
/area/proc/burglaralert(obj/trigger) starts on 214 and ends on 229
/area/proc/set_fire_alarm_effect() starts on 230 and ends on 233
/area/proc/readyalert() starts on 234 and ends on 239
/area/proc/readyreset() starts on 240 and ends on 243
/area/proc/partyalert() starts on 244 and ends on 250
/area/proc/partyreset() starts on 251 and ends on 261
/area/proc/updateicon() starts on 262 and ends on 273
	/area/proc/updateicon() has an icon_state set to blue
	/area/proc/updateicon() has an icon_state set to red
	/area/proc/updateicon() has an icon_state set to party
	/area/proc/updateicon() has an icon_state set to blue-red
/area/space/updateicon() starts on 274 and ends on 275
/area/proc/powered(chan) starts on 276 and ends on 288
/area/space/powered(chan) starts on 289 and ends on 290
/area/proc/power_change() starts on 291 and ends on 295
/area/proc/usage(chan) starts on 296 and ends on 313
/area/proc/addStaticPower(value, powerchannel) starts on 314 and ends on 321
/area/proc/clear_usage() starts on 322 and ends on 325
/area/proc/use_power(amount, chan) starts on 326 and ends on 333
/area/Entered(A) starts on 334 and ends on 354
/atom/proc/has_gravity(turf/T) starts on 355 and ends on 367
/area/proc/setup(a_name) starts on 368 and ends on 377
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #320030

you'll want to drop the procs, obviously.
私は完璧
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #320073

Remie Richards wrote:you'll want to drop the procs, obviously.
Ooh I bet that'll solve my memory allocation issues
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #320116

Code: Select all

    "\/obj\/machinery\/vending\/snack\/blue": {
        "start": 727,
        "end": 729,
        "icon_state": "female_assblastusa"
    },
''''''''''''progress''''''''''''
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #320369

that is very wrong.
私は完璧
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Adventures in map rendering

Post by oranges » #320371

female_assblastusa
User avatar
Atlanta-Ned
In-Game Game Master
Joined: Fri Apr 18, 2014 2:11 pm
Byond Username: Atlanta-ned

Re: Adventures in map rendering

Post by Atlanta-Ned » #320471

The important thing is that I'm learning regex real fast.
Statbus! | Admin Feedback
OOC: Pizzatiger: God damn Atlanta, how are you so fucking smart and charming. It fucking pisses me off how perfect you are
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #320571

you can learn it in an hour (its what I did) using https://regexone.com/
do all the lessons and all the challenges.
私は完璧
User avatar
Jordie0608
Site Admin
Joined: Tue Apr 15, 2014 1:33 pm
Byond Username: Jordie0608
Github Username: Jordie0608
Location: Spiderland, Australia

Re: Adventures in map rendering

Post by Jordie0608 » #320702

Regex testing sites can also be quite a hand: https://regex101.com/
Forum Admin
Send me a PM if you have any issues, concerns or praise of fishfood to express about the forums.
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Adventures in map rendering

Post by Remie Richards » #320710

That too, I write the majority of my regexes on regex101.
very useful to run it live as you write it on test data.
私は完璧
Post Reply

Who is online

Users browsing this forum: No registered users