Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Template Load Verb + Maploader Improvements #13852

Merged
merged 4 commits into from Dec 23, 2015

Conversation

RemieRichards
Copy link
Contributor

Map Templates:

  • Admins with +DEBUG can now Load map files in the _map/templates folder where they (or their ghost) is standing.
  • Admins with +DEBUG can now Upload a map file (smaller than 1MB) to the server for use within that round, it does not persist between rounds.

Includes two examples:

  • small_asteroid_1: an asteroid with low chance for minerals
  • small_shuttle_1: a small shuttle with some chairs

Example naming scheme: "size_quick-description-or-title_instance-number"
I'd like this naming scheme to be followed, but it's not necessary
(I might swap size and title around, so "asteroid_small" appears at the top)

example

Maploader Improvements:

  • Maploader for(X = 1, X<=some_max, X++) loops replaced with the much faster for(X in 1 to some_max) format, removes the 1-2ms delay after loading a maptemplate, woo!
  • Maploader no longer assumes that the coordinates it is given exist, this has NOT slowed down the maploader, AND prevents runtimes from loading templates at map edge, go ahead, load half a shuttle off the z level, the game doesn't give a -shit- anymore!

@RemieRichards RemieRichards added the Feature Exposes new bugs in interesting ways label Dec 20, 2015
@AnturK
Copy link
Member

AnturK commented Dec 20, 2015

What with lava ruins and such i think all these should get unified datums that preload their properties. But i guess that can wait.

@octareenroon91
Copy link
Contributor

What would you want datumized? The main drawback I see is that your areas will be the same in each 'paste' of the map.

@RemieRichards
Copy link
Contributor Author

@octareenroon91 with a datum for each "paste" you could "un-load" them, but I dont think that's that useful right now.

@octareenroon91
Copy link
Contributor

Ah, very true.

…assumptions that the coordinates exist (NO MORE RUNTIMES AT MAP EDGES WOOO!)
@RemieRichards RemieRichards changed the title Map Template Load Verb Map Template Load Verb + Maploader Improvements Dec 20, 2015
@Niknakflak
Copy link
Contributor

oooohhhhh shiny

@MMMiracles
Copy link
Contributor

Is there any limitation reasoning why a system similar to midi uploading be used to upload your own custom .dmm past invalid paths? Most station maps average around 1.5MB, with meta being the biggest at around 2MB so I'd assume uploading little segments like this wouldn't be that intensive.

@RemieRichards
Copy link
Contributor Author

@MMMiracles

literally just because I don't know the exact procs for sending something to the server (things like VVing icon just use "as icon" which apparently defaults to the user's PC, which I guess automatically does the transfer, I THINK there's an "as file" in which case I'd just ban non .dmm files and that'd be that)

tl;dr I'll do it if I can figure it out.

@Jordie0608
Copy link
Member

@RemieRichards
https://github.com/tgstation/-tg-station/blob/master/code/modules/client/client%20procs.dm#L80
AllowUpload() gets called everytime a client tries to send a file via input()

@RemieRichards
Copy link
Contributor Author

@Jordie0608 ah excellent!
I don't suppose there's a way to determine where it ends up? although I suppose we could leave _maps/templates as a "curated" folder, and uploads as just w/e the admin feels at the time.

the 1MB limit should be fine too, as previously mentioned, the "small shuttle" here is only 1.9 kilobytes.
(the asteroid isn't even half a kilobyte (219 Bytes)

@Jordie0608
Copy link
Member

mso files uploaded to the server go to byond\cache folder yes?
yes
then they get merged into the .dyn.rsc

@RemieRichards
Copy link
Contributor Author

@Jordie0608 I'm going to assume that's an IRC log dump, and not you going insane :P

@Jordie0608
Copy link
Member

Apparently < and > are markdown tags

@RemieRichards RemieRichards added the Performance Uses the 32-bit address space and slow interpreter more effectively label Dec 22, 2015
@Bawhoppen
Copy link
Contributor

hell yes.

…her admins, does NOT persist between rounds.
var/map = input(usr, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file
if(!map)
return
if(!findtext("[map]",".dmm"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you use copytext to make sure it isn't something like innocent_map.dmm.mp4.swf.exe
EDIT: not that extension matters anyway, and we're supposed to trust admins but eh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose so.

tkdrg added a commit that referenced this pull request Dec 23, 2015
Map Template Load Verb + Maploader Improvements
@tkdrg tkdrg merged commit 02aff59 into tgstation:master Dec 23, 2015
@Bawhoppen
Copy link
Contributor

also I just thought, could this work for holodeck/thunderdome templates?
and if so, should it?

@octareenroon91
Copy link
Contributor

It would make the holodeck system easier to maintain since you don't have to map onto z2.dmm .
I don't foresee any major difference in resource usage though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Exposes new bugs in interesting ways Performance Uses the 32-bit address space and slow interpreter more effectively
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants