Other Lemmings Projects > Other Projects

Updating Lem3Edit {v2.1 - 05/05/2018}

(1/8) > >>

kieranmillar:
Now on Github: https://github.com/kieranmillar/lem3edit

I promised myself next time I had a day off, I'd spend it trying to do some programming. I'm seriously amateur-hour at programming so wanted to edit an existing program to as a way to learn.

About 8 years ago Mindless made a Lemmings 3 level editor, lem3edit, then before finishing it decided to redo it in C++, but unfortunately abandoned it before re-implementing some key features... like the ability to save! So I sat down with a tutorial on how to get SDL to work in your environment and today's project became adding in a save ability to Lem3Edit. You can find Mindless's original source code here: https://bitbucket.org/mindless/lemmings-tools

It turns out it was pretty easy to add in the save feature, you just do the opposite of loading the level, hah!

So I looked to do a few more things because the save feature got implemented pretty quickly. Now you can cycle an object through all of the object ids so you can actually change what is in the level, this was a heck of a lot tougher to implement because the object ids are not contiguous and jump all over the place! But I got there in the end.

Lastly I made a quick "backgrounds only" view because it was quick to do and it's nice to be able to properly select and edit the backgrounds when they hide behind the terrain.

Unfortunately, making levels looks like it will be an unbelievable pain in the ass with the current interface, so I'll have to revisit this on my next day off and work on this some more. But at least now, if you also use a hex editor to edit some of the other level properties, you can actually make a fully-functioning mod!

P.S. If you want to play around, make sure to read the README file for controls. Note that you can't create new objects or terrain from scratch without copying and pasting existing ones then cycling through the object ids to change what they are. All objects are one of two types, terrain, and everything else.

To use the program, it needs to be put in the folder one step up from the GRAPHICS, LEVELS and STYLES folders. Those are on the CD, so copy your CD contents to your harddrive. And backup all of the files in your level folder! The program only loads levels via a command line argument, so make a shortcut to the exe file and put the level number (e.g. 123) directly after the link to the exe in your shortcut's properties.
EDIT: This is no longer how the program works. Read the README file!

I don't know how to use source control, so have uploaded my source to comply with the licencing. Maybe learning source control should be my next mini-project!

namida:

--- Quote ---I don't know how to use source control, so have uploaded my source to comply with the licencing. Maybe learning source control should be my next mini-project!
--- End quote ---

I thought it seemed like a lot of effort when I first heard about it, but I don't know how I lived without it now.

mobius:
:thumbsup:
:thumbsup:
:thumbsup:

kieranmillar:
I was enjoying this too much, so I just spent the whole weekend on it too!

I've attached v0.4 and its source code to the opening post. This feature comes with what I think is a really important addition for usability, a zoom feature!

Adding this was not so simple. Everything I could see online suggested I use SDL2 instead of SDL1.2 that lem3edit was coded in, so I could easily scale up the graphics using textures instead of manually duplicating the bits to the screen. I figured an update of SDL would be good practice and it's not like this is a huge program, so that's what I did. It ended up being quite a significant task as the paletted graphics the game uses were not immediately suited for it, but as you can see I got there in the end! This may mean for those of you who have computers with graphics cards (and not this integrated chipset nonsense my 10-year-old laptop uses) you might see some significant speed increases on complex levels like level 110, which seems to have about 900 objects in it for some nonsensical reason, just object after object layered on top of one another.

The change to SDL2 came with a few other minor changes. Gone is full screen mode, but I plan to eventually allow a resizable window so you won't need fullscreen. The selection boxes are no longer complicated marching ants selection boxes but much simpler semi-transparent rectangles, because hey with SDL2 we have easy alpha rendering now!

The zoom is triggered with only the mouse-wheel so far. It currently uses the top-left corner as the centre of zoom which is almost always not what you actually want, but that will be for another day.

Happy editing, this time without lots of squinting!

kieranmillar:
I want to write a ToDo list to make the time I spend on this more efficient, so might as well post it here. Tasks higher up their respective list are higher priority for me. If you have any plans to use this program sometime soon and have some suggestions or would like to see something earlier, post about it and I'm happy to reprioritise. Besides, posting it here lets me do funky strikethroughs in the text! This post will change over time as I do things, make releases or think of more things to add.

Smaller Tasks

Medium Tasks

* Test level button.
* Investigate why lemming and monster palettes are wrong
Larger Tasks

* Program appears to load animations. Show these?

Navigation

[0] Message Index

[#] Next page

Go to full version