PCL2ED v0.0.1 - provisional Lemmings 2 editor

Started by geoo, September 09, 2008, 11:00:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

geoo

- Download Link (Windows binary) - (edited as the link was originally hidden between a lot of text)

Some people have been ranting about LemEdit (though I personally actually quite liked it), but when you think it couldn't get any worse...

Having said in the other thread I could get a first release done within a day, I guess I should release something now. It's not quite as complete as I wished it to be, but as I'm pretty busy (in spite of being in the time between school and studies) I just release what I have got for now.
The 'PC' in the name might stand for

  • provisional & crappy - the initial meaning for it
  • being meant for PC DOS Lemmings
  • platform compatile - hopefully. I'm not much of an expert in that regard
For now it only supports basic terrain and object editing, but I will at least release a console app sometime allowing for editing stuff like skills etc. For now use a hex-editor for that, the level format documentation can be found here (bottom).

Source is to be found here: http://207.58.177.175/~geoo89/lemmings/PCL2ED/PCL2ED_src.zip
As I said, it is a whole mess as this is my first UI programming experience and I attempted object oriented programming in a C-based environment, OpenGLUT that is, which is somewhat problematic. I guess the only code of interest might be in the L2LData and L2Def files. I hope it is managable to compile this thing, I used DevC++ for compilation, quoting from their site:
QuoteIt uses Mingw port of GCC (GNU Compiler Collection) as it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC based compiler.
Following libraries are used (commands): -lopenglut  -lglu32 -lopengl32 -lwinmm

As for the Windows executable, get it here: http://207.58.177.175/~geoo89/lemmings/PCL2ED/PCL2ED_win32.zip
It might need an OpenGL32.dll to run...

Usage: It runs via commandline, with the parameter being the path of an uncompressed level file. If you feed it with anything else, it will crash. Also, the Style files have to be decompressed.
e.g. for Classic 1: PCL2ED.exe levels/level000.dat
To Decompress files, use Mindless' lem2zip. If you want to decompress all Level/Style files, put the two batch files from here http://207.58.177.175/~geoo89/lemmings/PCL2ED/ into your Lemmings 2 folder and run it. The decompressed files will be in a separate folder. Watch out for files of the filesize 0, in that case the files already have been compressed. Use the original ones in that case.

On to the editor itself:
When editing, there are 4 modes: NoDraw, Sprite, Tile and Object.
In any mode, doubleclicking the right mousebutton will select the object under the cursor; if there is no object under the cursor, it will select the sprite under the cursor; and switch into the respective mode.
Singleclicking the right mousebutton will take you back to NoDraw mode.

The action of right-clicking is dependent on mode.
In NoDraw and Object mode, it will select the object under the cursor. If there is no object under the cursor, in NoDraw mode it will do nothing. In Object mode it will draw a new object.
In Sprite/Tile mode, leftclicking will draw Sprite/Tile respectively.

Keys settings:
Press +/- in NoDraw mode to change the level arrangement, i.e. the amount of sprites per row. This will affect all rows, and the level will have to be fully re-designed then.
Arrow keys change the view window of the level in any mode but Object mode.
In Object mode arrow keys move the selected object, +/- changed the object ID. WASD in Object mode extends/contracts the selected object, i.e. for some objects like steel, water or the swing chain it is possible line up replicates of an object horizontally or vertically.
Delete key deletes the selected object.
'B' toggles background draw, i.e. whether terrain (Sprites/Tiles) is solid or background.
Press F3 to save the level.

Object boundaries might not be correct as I haven't figured out the object definition format completely yet. Special object components like parts of the swing or the cannon are not displayed, though the boundary size considers them.
Also, I noticed in Polar 9 that not all of the stars are displayed. I noticed in the level file some object ID entries with 0xFFFF, I'm not sure what that means yet.

Mindless

I'll see if I can build it here, tomorrow probably.

Mindless

got it building... I had to use freeglut instead of openglut though, it seems to work despite that (though I don't quite understand the control scheme)

geoo

Yeah, I think freeglut and openglut are mostly interchangable, I have not been using the features of openglut that are not supported by freeglut I think. In fact, in the beginning I had been using the freeglut library, not sure anymore why I switched to openglut.

You mean the control scheme of the editor is difficult to understand?
I guess that's something I still have to work on, my basic idea was that clicking in the respective window or double-rightclicking would select a sprite/object, while leftclicking would draw it. That idea doesn't fit too well for objects I think, e.g. it is confusing that when in object mode leftclicking somewhere will create a new object, or also that you don't see what will be drawn until you actually leftclick.
I'll work on this, though I'll be off for about two weeks beginning in a few days.

Mindless

Quote from: geoo89 on September 11, 2008, 08:55:28 PMYou mean the control scheme of the editor is difficult to understand?
yeah, sorry, that was worded badly

I didn't play around with it too much yet, so maybe I could get the hang of the controls after using it a bit.  I do think double-right-clicking isn't very intuitive though

geoo

Well, the problem to me is that there are two types of level elements, for one the sprite matrix, and the objects.
Initially I though to make it right click = select sprite, left click = draw sprite, problem is that you can't get out of sprite mode then anymore, unless I write it so that it is impossible to draw a sprite where an object is located, and clicking on an object selects this. To draw a sprite there, one would have to move that object first off and then back again though. But I guess I could do it that way and just scrap the NoDraw mode, after all, the NoDraw functions can also be used in sprite/tile mode. That way object selection would be more intuitive.

Tim

That sounds all very complicated and technical...is this for a new level editor that you are working on? Or fixing and original?

EDIT: You know what? Never mind. I am happy with my level editor I am using now. Forget anything I said here.

geoo

I guess the download link was hidden between a lot of text. Added it to the top of the post now.
You should read the notes though; for editing stats you'll still need a hex-editor.

Mindless


weirdybeardy

Just mentioning that I think this is a great idea, and I'm glad something is happening. Is the ultimate aim to produce something as functional as Lemmix...? And is it true that a level editor already exists for DOS Lemmings 3...?
My projects:

Lemmings in Weirdyland (NeoLemmix):
https://www.lemmingsforums.net/index.php?topic=6135.0

My levels for Lemmings 2 The Tribes can be found here:
https://www.lemmingsforums.net/index.php?topic=990.0

Mindless

Quote from: weirdybeardy on September 15, 2008, 12:10:32 PMJust mentioning that I think this is a great idea, and I'm glad something is happening. Is the ultimate aim to produce something as functional as Lemmix...?
I believe that's the end goal.

Quote from: weirdybeardy on September 15, 2008, 12:10:32 PMAnd is it true that a level editor already exists for DOS Lemmings 3...?
Yes, I've written part of a level editor, currently it requires you to have nimble fingers (insertion and deletion of objects and changing the object ID can only be done with the keyboard; everything else has both keyboard and mouse) and you'll also have to change the level properties (width, height, etc) with a hex editor (not too hard, but it'll keep a lot of people from using it :().  So lem3edit is still a work in progress.

weirdybeardy

Brilliant!  :thumbsup:  I know that Lemmings 3 is not quite as popular as other Lemmings games, but it would be nice to one day see if a level editor can bring about the sort of burst of creativity for L2:Tribes that Lemmix and Lemmini have done for Classic Lemmings.

Keep up the good work.  :) 
My projects:

Lemmings in Weirdyland (NeoLemmix):
https://www.lemmingsforums.net/index.php?topic=6135.0

My levels for Lemmings 2 The Tribes can be found here:
https://www.lemmingsforums.net/index.php?topic=990.0

geoo

Quote from: Mindless on September 15, 2008, 12:37:16 AM
in case you're interested, I've rewritten lem2zip in C
Ah thanks, that will allow me to have the program handle the compression internally. No need for the user to do that beforehand then. :)
What language was it initially written in?

My primary goal is to produce something remotely usable with GLut for now.
As I'm going to learn how to use SDL anyways, I'd like to port it to SDL or perhaps WxWidgets (want to learn that as well) and clean up the code later.

Anyways, I will be offline for two weeks now.

Mindless

Quote from: geoo89 on September 15, 2008, 08:14:38 PMWhat language was it initially written in?
FreeBASIC, but I got tired of the platform restrictions (FB is only 32-bit, and I run 64-bit Linux); C is much more portable

weirdybeardy

I know this isn't strictly related to the topic, but I thought I'd mention that I'm gonna try downloading Lem3Edit and see how it works. Ta.  :)
My projects:

Lemmings in Weirdyland (NeoLemmix):
https://www.lemmingsforums.net/index.php?topic=6135.0

My levels for Lemmings 2 The Tribes can be found here:
https://www.lemmingsforums.net/index.php?topic=990.0