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

Enhancement - create interface to load a super mario maker level #2

Closed
johndpope opened this issue May 24, 2019 · 4 comments
Closed

Comments

@johndpope
Copy link

johndpope commented May 24, 2019

https://github.com/Gummygamer/smmmlevels
There's some work here to procedurally create levels by transferring them into text.
If you could somehow allow a plug in ability - to mario backgrounds - this would open up worlds for game developers / designers.
Consider this maybe a 'help wanted' ticket.

would need to be able to load a cdt and convert into appropriate layout for Glide.

@johndpope
Copy link
Author

There's a method called
level.toAIString

I think this will provide a simple way to populate a swift / sprite level

def toAIString(self):
    aiString = ""
    
    #level grid loop
    #could be optimized
    for i in range(0,239):
        for j in range(0,26):
            present = False
            for spr in self.sprites:
                if (math.floor(spr.objx / 16) == i) and (math.floor(spr.objy / 16) == j):
                    aiString += spr.toAIChar()
                    present = True
            if (present == False):
                aiString += " "
    
    return aiString

@cocoatoucher
Copy link
Owner

cocoatoucher commented May 27, 2019

Hey,
Sorry for the delayed response. I think that looks really interesting. I wasn't aware that Super Mario Maker had open files like that. Looking forward to Nintendo Switch version by the way! 🙂
I'm still not aware of many details but I think glide should support importing functionality from as many editors as possible, if to see Super Mario Maker as a level editor as well.
I implemented a similar functionality for Tiled Map Editor map files. You can check it out here: https://github.com/cocoatoucher/Glide/blob/master/Shared/TiledMapEditorSceneLoader/TiledMapEditorSceneLoader.swift
That one imports json map files you create in Tiled Map Editor (https://www.mapeditor.org)
However, that is basically not glide specific and it'd work on any SpriteKit game. Since glide is SpriteKit based, this converts the contents of json file to a SKTileMapNode instance with some additional specific properties only recognized by glide.

Do you think that is close to what you are looking for? I can give any support needed if you start writing a parser for cdt files. If we could start with converting contents of a cdt file to a SKTileMapNode, that would be a great step.

I have some questions though.

  • Does Super Mario Maker also give access to their art assets? When we are populating a tile map node via the parser, will we be able to populate it with the assets used in the game, or do we need to add support for picking replacement assets?
  • How can I export a cdt file from a Super Mario Maker on a 3ds?

Thanks for sharing this and looking forward to your response.

@johndpope
Copy link
Author

short answer is - you'll need to google - "SMM ROM link" and dig around for 700 MB file to grab assets needed to visualize level with python code below to get RoadrunnerWMC level editor working. There are numbers / codes associated with these parts within level.

RoadrunnerWMC/Metamaker#1 (comment)

I dug around github - there's other code that makes use of a generated png file of sprites
eg. MW_Field_hauntedhouse.png / as opposed to the MW_Field_hauntedhouse.szs (which are zipped and compressed binary specific to nintendo)

https://github.com/AuriRex/SMM-LDE/
Screen Shot 2019-05-27 at 21 48 52

These assets are "highly copyrighted" - so yeah - as you suggested - we'll want to be able to pick the assets. To rebuild a parser - may not be worth effort if you can hot wire some png. Maybe can cherry pick java code above - or have user run some python script from Metamaker ?

My imagination was - I want to use Glide - and leverage the level designed by mario maker -
create my own characters / my own enemies / my own colors / fonts etc.....

@johndpope
Copy link
Author

johndpope commented May 28, 2019

Screen Shot 2019-05-28 at 11 34 16 am
it's possible to convert project to kotlin / which is kind of swifty. CMD + ALT + SHIFT +K

Screen Shot 2019-05-28 at 11 36 22 am

sample SMMLevels.java -> kotlin
https://gist.github.com/johndpope/6b5174539ba1da40530e4c183af0760f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants