Development Log for Magic Pixel, a game maker using Love2d

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pgimeno »

Well, here's what I think are the main salient points of Megazeux:

- A lot of things comes predefined: many kinds of enemies, doors with keys, walls, fake walls, puzzle boxes, teleporters, bullets, text dialogues, health pills, diamonds for scoring, and so on. You only need to select them and place them in the scene, and you are ready to go.
- Similarly, all graphics come predefined as well (one of the biggest differences between ZZT and Megazeux is that the latter allows redefining the characters; you can edit the images of everything).
- Rather than writing code in a bunch of files for all elements in the game, you open the elements and write code for how they interact with the world. This is similar to some "visual" tools; for example 3D Construction Kit used this technique.
- You can design each level in full and test it easily.

This approach makes it easy for people to get started, learn the basics, then move on to more complex stuff, and with some web with code sharing and social features similar to e.g. TIC-80 or Pico-8, it's likely to grow a community and have a long life. Just look at the more than 1,000 programs for Megazeux.

It's an idea that has crossed my mind so often, because there isn't anything similar, but I know it's more work than my attention span allows. I'm embarked right now in something remotely similar, but much simpler, and not Löve-related so off-topic here. But I would be willing to contribute to a project of this kind... except not on MS Github.

Oh, by the way, for editors, look into https://github.com/jeremypenner/lite which is a port to love2d of https://github.com/rxi/lite
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

Yeah, I was thinking that there would be something like the GB Studio example game that would come with it, where you can use already built in graphics that I added along as open source, or move your own graphics into it, etc. And I was thinking the same thing about some pre-built items, weapons, etc. Again, would be in the example, or maybe template version of the game, so that users can get up and running with something quickly, and can customize it as much as they want after a certain point (by using their own graphics, etc instead of the built in ones).

I was already thinking about how using a code editing section for each object, so you could override the update code in the editor using a Lua syntax highlighted code editor and have it apply to that object (loading it as a string, and having it pass self automatically to it, etc). I was looking at moving away from my current GUI system I hand rolled (going to be a mess, needed to ditch it, was originally supposed to be just a proof of concept and got out of hand) and looking at SLAB. SLAB seems to be exactly what I need for this, and it has a built in text editor with Lua syntax highlighting. I've been messing around with it, and even though some features seem to be wonky, they're ones I wouldn't be using for this project.
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

After messing around for a bit, decided not to use SLAB, or any other premade GUI, and just rebuild the one I had. The one I had worked, but was messy since it was originally just a prototype. It was getting annoying, trying to place each GUI element by x/y by hand. So now I went through and created a Flexbox/Bootstrap style layout manager that lets me just add parts and containers and it moves everything about for me. So far, works like a charm.

I'll probably release this as an little open source thing, in case anyone else finds it handy. The layout manager, I mean.
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

Finally got a windows machine to test it on windows (was deving mostly an OSX and Mint Linux), and erm...had some problems with os.execute and nativefs. I went to go look up the documentation for nativefs...and it seems to be taken down, and no longer on github. Well, that throws a wrench into things.I need to either rethink building and game editing, or find a way to open files easily outside of the main application (since the sub-folders would be the actually game engines it's creating). The shell command I was doing was simple folder xcopy's, and the code I had (not xcopy, but cp -r on OSX and Linux) was working fine, in that it was using the relative names and directories correctly. I even had it output the xcopy code it was generating in an error message, copy that, put it in the command line, and watch it work perfectly without issues.

But calling it from os.execute from love in windows just not copying the directories (blank terminal popped up and then disappeared, noticed no errors on it, but also no output, either. On OSX the os.execute doesn't even open a terminal, so I'm assuming it's running silently). If this doesn't work, then the whole thing is pretty much a bust. It was based on the idea of copying the engine and renaming it to the game name, then opening the files within that new folder for editing within the game maker. That functionality gone would complicate things a ton.
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by yetneverdone »

Yeah nativefs author went berserk with love and removed all love-related projects. Here's a rehosted nativefs
https://github.com/EngineerSmith/nativefs

what are the os.execute commands you use? They definitely are different in windows (see batch, cmd, powershell).
MacOS and Linux have similar scripting so your current os.execute commands work
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

Oh yeah, mac and linux work fine. And the Windows version of the os command was basically just xcopy...

And I had it use an error code to print out the exact command it created (since it was building it based on the directories and game name), and then I copied that command, popped it into a dos prompt, and it worked perfectly. It seemed to only have an issue with running in Love2d. I check permissions in the folder it's running them, and all permissions are good.

It doesn't mean I'll drop it, I just need to think about how I'm going to do this going forward, since a majority of people will probably use Windows for this to make games. Though it IS tempting to just make it Mac and Linux only for the game editor (still have the game engine itself export in windows/max/linux, since that doesn't need os.execute), and have windows users suffer like Mac users have suffered, BWAHAHA...

But I have ideas. One idea I'm toying with is unique...making the editor and the game engine the same. You just manually copy it, rename it, and then edit it using the same executable. It is possible...though I do think that is less intuitive than just having an editor that can create new games for you...

Though, even with that, eventually I could create a game launcher in something other than Love2d that would just simply use the copy commands, etc. Actually, that might just work. A bit hacky, though.

For NativeFS- thanks for the link! Too bad he left Love, but I think I understand, after looking over some of the old posts. Things are oddly getting heated around here, which is odd. I've been on this forum since 2013, and it's always been a pleasant helpful space. My only guess is that it's the pandemic having everyone on edge.

The one problem I'd had with NativeFS was loading images. It's probably in how I do it, though I'm not sure. I think with Windows it was having a memory issue with using NativeFS to load images, which wasn't happening on Mac or Linux. In Mac/Linux it loaded images just fine with the regular love functions, but the minute I had to snag an image from a folder outside of the main folder in Windows, it would crash. No fun. No error message or anything, just a silent crash.

This would fix that issue, too, in a way. If I just made the editor and the game engine the same application. And it would be unique...

Hmmmm.
Last edited by pauljessup on Thu Jan 27, 2022 2:22 pm, edited 2 times in total.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by zorg »

pauljessup wrote: Thu Jan 27, 2022 2:07 pm The one problem I'd had with NativeFS was loading images. It's probably in how I do it, though I'm not sure. I think with Windows it was having a memory issue with using NativeFS to load images, which wasn't happening on Mac or Linux. In Mac/Linux it loaded images just fine with the regular love functions, but the minute I had to snag an image from a folder outside of the main folder in Windows, it would crash. No fun. No error message or anything, just a silent crash.
I don't think NativeFS patched any of the löve object constructors, so those can still only take paths that löve's own virtual filesystem has access to (or you got a path/file through the *dropped callbacks); actually nevermind lol, i skimmed over the "it worked in OSX/Linux" part...


one solution that should work still is to load in the file with nativefs.newFileData, and pass that into the Image/Sound/Font/whatever constructors; i must admit though that i haven't tested it myself yet. (Internally it's a ByteData, but it should theoretically work nevertheless)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

Yes, the NewFileData was what I was using, and that's why I think that might be the error, that I might've used it wrong, somehow. It was working fine for OSX and Linux, which has me confused on why it wouldn't work on Windows, and why it did a silent crash...

I think there used to be an example on the NativeFS page from before, and that's why I wanted to go look and check it out, make sure I wasn't doing something wrong. Though it wouldn't make sense that it would work for OSX and not for Windows. My only thought is my Windows machine is pretty bare bones (though on purpose, I want to test on a lower end machine so that it's accessible to all sorts of gamers, and not just uber gamers), and my my Mac for work is a pretty tricked out Macbook Pro. So I might be RAM usage or something that could be causing the issue? Maybe?

Though I have no clue. Either way, with NativeFS no longer in development, and no developer to speak to about it...I don't feel comfortable using it for this project. So I'll just need to figure out different ways in doing what I need to do. I am starting to like this engine/editor same application idea. I toyed with it in the past, when I created an in-game tilemap editor like 5-6 years ago. It's feasible, and an interesting take on a game editor. And it wouldn't require accessing files outside of it's own directory, per se. It could do what Gameboy Studio does, and RPGMaker, and just have you copy the files into the right directory.

And thanks for everyone's help in helping me try and track this down!
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

In case anyone is curious, here is the exact code I was using that seems to crash. I know it's this, because when I run anything else, it works fine. But the minute it calls this function, crash city, but only on Windows. Not on OSX, or Linux

Code: Select all

     
    newImage=function(self, image)
        local nfs = require("engine.nativefs") 
        local file_data = nfs.newFileData(image)
        if file_data then
            local image_data = love.image.newImageData(file_data)
            if image_data then
                return love.graphics.newImage(image_data)
            end
        end
    end,
pauljessup
Party member
Posts: 355
Joined: Wed Jul 03, 2013 4:06 am

Re: Development Log for Magic Pixel, a game maker using Love2d

Post by pauljessup »

Figured out what was going wrong with nativefs and loading images, it had to do with the relative path directory being wrong (after a few error outputs for the paths, I tracked this down). os.execute still not working quite right, it still won't copy the directory. I tried some other functions to see what happens, like mkdir, and some others...still nada. Even tried call a batch file...

So weird. Ah well. The more I think about it, the more I like the idea of the engine/editor being the same application, just for quick in game editing, that kind of thing. It feels oddly intuitive, and then maybe doing a front end loader that would create new, etc. I wouldn't have to do the front end loader in Love2d, I could do it in any number of things. It would be just "Create new", and you give it a name, it copies the engine/editor and renames it and then opens it. Or open existing, it grabs that renamed version, opens and edits it.

I picture it working like Godot's project launcher.
Post Reply

Who is online

Users browsing this forum: No registered users and 50 guests