Author Topic: Good lord! ANOTHER lemmings clone!  (Read 9453 times)

0 Members and 1 Guest are viewing this topic.

Offline covox

  • Posts: 100
    • View Profile
Good lord! ANOTHER lemmings clone!
« on: January 01, 2007, 10:43:03 AM »
Hey guys. Happy new year et al. Anyway, if anyone's interested, please try this.
http://www.pygame.org/projects/21/352/

EDIT: the following instructions are now outdated; visit http://rebui.ld.net.au/software/tundra for up-to-the-second information

Requirements:
Any platform supporting Python 2.4, Pygame, PIL and PyXML (quite a lot)
At least a 1GHz computer machine
Gobs of memory (running Windows alone with <512mb of RAM is productivity suicide)
Graphics card with 32 bit colour (anything less and it becomes cranky and irritable)
A keyboard and pointing device

INSTRUCTIONS:
Run the game. If there isn't a ".tundra" configuration file in your home folder, the first-time setup will begin. Normally you'd need DOS Lemmings and/or DOS Oh No! handy, however to save time (just this once) I've bundled the data with the archive. If you delete the contents of the levels and/or styles folders, you'll be asked to rip them again from DOS Lemmings/Oh No.

After clicking "Game" on the title screen, you can reach the Level Select menu by clicking the "Classic - Fun - Level 1" title at the top of the window. Because this is a "fix the boneheaded mistakes" release, all levels will appear in the menu rather than merely the ones you've unlocked.


FEATURES:
- Preview release: please help me fix boneheaded mistakes!
- Written entirely in Python. So simple a small child could understand it.
- Human-readable layout of storage directories
- Support for level-contained visual themes
- Preliminary support for music playlisting
- Game can display chunky pixels or Scale2x smoothing
- Supports both 640x480 fullscreen, and up to 840x480 windowed widescreeen
- Import support (performs almost as good as it rhymes) for Classic and ONML
- Import support for upgrading DOS Classic to the Amiga extended Classic
- Points system! (Currently unused)
- And SO MUCH MORE!

BUGS:
- Probably several regarding movement mechanics, touching interactive objects etc.
- Bashers are a total shambles. Useable, but inaccurate as buggery.
- ALMOST works on Mac OS X, however there is a weird colourkey bug associated with subtractable terrain on a few levels.
- Options menu was cobbled together in an hour.
- Bomber countdown thingy is poorly positioned and occasionally doesn't disappear

STILL TO COME:
- Subversion!
- Explosions! (removed in this release due to bugs)
- Fast forward!
- Fractions or percentages: the ability to choose.
- Import support for CustLemm sets - probably some very cunning way of sorting around imported levels into game/difficulty categories
- More import support! (e.g. importing the original levelsets from Peter Spada's Copycat)
- .app build for OS X (note that the current source code release is mostly playable if you have Python + the Pygame libraries + PyXML + PIL) 
- Style-specific backgrounds (open to suggestions about what would look good without being distracting)
- Sound effects (still having a think about what the best way to go about this is)
- Method for changing the lemming colour scheme.
- Overhaul of the bitmap text system. Might even cave in for the regular, boring, unshaded TrueType kind.


QUESTIONS:

Q: Why is this neccesary? Lemmini and LemmixPlayer already exist.
A: Short version: They sure do, and you're free to use them instead of Tundra.
Long version: In 1991 terms, we're in the FUTURE! Why not try and build up on DMA Design's classic rather than merely photocopy it? Tundra was written on the basis that there are improvements that can be made without tossing the entire gameplay experience in the bin. After all, if you were looking for an exact replica, what's to stop you firing up UAE or DOSBox :P

Q: How come Tundra doesn't use Lemmini's level format? Isn't reinventing the wheel bad?
A: True, however Tundra doesn't follow the same design paradigm that Lemmini does. I wouldn't like changing the INI format around to contain extra information, therefore Tundra uses simple XML. Not only does it make the files human readable, it makes complex data insurmountably easier to get at from the code :P

Q: But... but... it's not compact! It's an abomination of code sprawl! Each level is now a factor of 40 BIGGER than uncompressed in the original game!
A: Lalalalalala not listening not listening lalalalalalala.
(oh come on, it's not too bad when all the level files are compressed)

Q: It won't play out of the box!
A: That's right. You need Lemmings and/or ONML for PC DOS, which Tundra will ask you for so it can nab the resources. You'll be given the option of converting everything to Amiga, which looks better, but some people enjoy a bit of nostalgia.

Q: DOS? Why not Windows? It has better graphics!
A: Windows is missing a whole bunch of levels, and the "better graphics" are sick-eatingly bad. No, no, no.

Q: You've buggered up skill x/The lemming should be y pixels to the left/Level z is unfinishable.
A: Tell me everything. I've only got this far by guesswork, observing DOSBox in slowmotion and the commendable hard work of fellow lemmingspotters. If you're feeling sinister, have a poke around in the src/skills folder for the lemming control scripts. Failing that, let me know where and what I've cocked up.

Q: I can see flickery things through terrain pieces when Scale2x smoothing is turned on!
A: Those would be animations. Pygame doesn't do a very thorough job of blitting graphics over other graphics, and there's a little bit of invisible colour loss. Sadly, the scaling algorithm isn't as good as your eyes, which is why there's a tiny bit of ghosting.

Q: When I bash through arrowed pillars, then build in the gaps, arrows don't appear over my bridge!
A: Due to the unique (read: dodgy) method of how overlayed animations are handled, being forced to fix this problem would make me very very sad. However, don't worry about gameplay; the resulting structures will act just as if the arrows were there.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #1 on: January 01, 2007, 01:22:52 PM »
Nooooo.... I don't understand how to run it in Linux... :(

Offline covox

  • Posts: 100
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #2 on: January 01, 2007, 02:54:28 PM »
Aha. All you need is the src release. Make sure you have Python 2.4, Pygame, PyXML and PIL (python imaging library) installed; all are available from apt last time I checked. Then simply cd into tundra/src and type "python tundra.py".

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #3 on: January 02, 2007, 12:52:20 AM »
It appears that whatever you're using to play the MODs doesn't recognized partial panning -- the instruments are being completely seperated to left and right channels, which doesn't sound so good.

Offline covox

  • Posts: 100
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #4 on: January 02, 2007, 02:02:10 AM »
That'd make sense. MikMod (i.e. the standard Unix modplayer library) isn't as perfect as other things like ModPlug. Although to be fair, the Amiga wouldn't have partial panning would it? :P

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #5 on: January 03, 2007, 01:45:17 AM »
As a whole, I like this "clone," especially the open-source bit.

Here's the issues I've had so far:
* selection of single lemmings in the masses is a bit buggy, ccexplore posted about the correct selection method somewhere, I'll see if I can dig it up
* the intro screen music was included with the Amiga MODs, it isn't nearly as fun to listen to
* fallen lemmings don't disappear until I scroll


I like the bitmap text system... don't do a boring TrueType font.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #6 on: January 03, 2007, 02:18:12 AM »
I've now disassembled the portion of the DOS version of lemmings that deals with skill assignment.  It is pretty much what everyone has known or expected.  It's just stated here in a more precise manner for programming purposes.

I still haven't worked out however the exact way the game determines collision between a lemming and the cursor.  However, I did determine that the game calculates some (Lx, Ly) based on the lemming's position, some (Cx, Cy) based on the cursor's position, and then use the following test (in lo-res pixel units) as the condition for the lemming to be "under the cursor":

(Cx >= Lx && Cy >= Ly && Cx <= Lx + 12 && Cy <= Ly + 12)

which is equivalent to

(Cx - 12 <= Lx <= Cx && Cy - 12 <= Ly <= Cy)

So looks like to me this basically means the cursor square within which the lemming is considered to be "under the cursor", the size is 13x13 lo-res pixels.

The game then loops thru all lemmings currently under the cursor (as explained above), and looks for the following candidates for assigning the skill to:

candidate P: the most recently entered prioritized lemming

a prioritized lemming is defined as one who is carrying out one of the following actions:
  • blocking
  • building
  • bashing
  • mining
  • digging
  • shrugging (when the builder finishes)
  • oh-no-ing (when the explosion countdown reaches 0 but before the actual explosion)
Notice that carrying the climber or floater skills does not earn the lemming prioritization.

candidate N: the most recently entered non-prioritized lemming (non-prioritized is the exact opposite of "prioritized")

Note that either of the candidates may not exist.  Candidate P does not exist if all lemmings under the cursor are non-prioritized (ie. walkers etc.), and Candidate N does not exist if all lemmings under the cursor are prioritized (ie. a whole bunch of builders, say).

After finding the two candidates, the following happens:

1) if the non-prioritized selection mode is active, or if there are no prioritized lemmings

Then the game will only consider up to 1 candidate for skill assigment, namely candidate N (if exists)

"non-prioritized selection mode" is activated in Amiga and DOS Lemmings by holding down the right mouse button while clicking with the left.  For the Mac whose mouse has only one button, holding down the Option key (or some such key) on the keyboard stands in for the right mouse button.

Lemmini currently does not support this non-prioritized selection mode, but a few levels (especially Havoc 5) intends for this to be used, so it should be supported.  I would further suggest that both the right mouse button and the keyboard method should be supported (so that if eithe the right mouse button or the XXX button or both are held down, you are in the mode).

2) otherwise

Then the game considers up to 2 candidates for skill assigment.  First choice candidate is candidate P, second choice candidate is candidate N (if candidate N exists).

The game then displays the lemming type name for the first choice candidate, whatever it happens to be.

Next, regarding the actual skill assigment.  Note that the description above might contradict some stuff I said in earlier posts; the description below is the authoratative version (as far as DOS is concerned).  Going through the 8 possible skills to assign:

Before I dwelve into the specifics, note that the general form of handling is roughly like this:

1) if first choice candidate is not already doing the skill you are trying to assign, nor doing actions like falling/climbing/blocking that doesn't really allow for most skill assignments, then assign to lemming.
2) otherwise, check the second choice candidate instead if there is one.

The actual details of course are a little more complex and sometimes unusual.  For bashers/miners/diggers there are of course also tests for steel and such.  And, contrary to what I said before, you apparently can assign exploders to drowning or exiting lemmings.  Not that it matters since the explosion would never happen.  It's also the case that the second candidate is often ignored.  There are also cases where the second candidate requires less tests, which are probably bugs that should be fixed for Lemmini.

assigning a climber:

1) if the first candidate is not already a climber, and if he is not doing any one of the following actions: blocking, splattering, exploding, then assign.
2) otherwise, do not assign and ignore the second candidate.

assigning a floater:

1) if the first candidate is not already a floater, and if he is not doing any one of the following actions: blocking, splattering, exploding, then assign.
2) otherwise, do not assign and ignore the second candidate.

assigning an exploder:

1) if first candidate does not already has explosion countdown status, and is not in any of these actions: oh-no-ing, fried, exploding, splattering, then do the assignment.
2) otherwise, do not assign and ignore the second candidate.

assigning a blocker:

1) if first choice candidate's current action is one of the following: building, bashing, mining, digging, shrugging, walking, and if this lemming's blocker field would not overlap with another blocker's field, then do the assignment.
2) otherwise, do not assign and ignore the second candidate.

assigning a builder:

1) if first choice candidate is too close to level's top boundary, then do not assign and ignore the second candidate.
2) otherwise, check if the second choice candidate's current action is one of bashing, mining, digging, shrugging, walking.  If so, allow the assignment.
3) otherwise, and if there exists a second choice, check if the second choice's current action is one of bashing, mining, digging, shrugging, or walking.  If so, allow the assignment to the second choice.

Notice the bug here where the second choice candidate does not need to pass the boundary test.  This bug which is in the real game should probably be fixed in Lemmini.

assigning a basher:

1) if the first choice candidate's current action is one of building, mining, digging, shrugging, or walking, then
  i) check for steel and one-way walls.  If yes, then do not assign  and ignored the second candidate.  Otherwise assign.

2) Otherwise, and if there exists a second choice, check if the second choice's current action is one of building, mining, digging, shrugging, or walking.  If so, then:
  i) check for steel and one-way walls for second choice.  If yes, then do not assign.  Otherwise assign to second chocie.

assigning a miner:

1) if the first choice candidate's current action is one of building, bashing, digging, shrugging, or walking, then
  i) check for steel and one-way walls.  If yes, then do not assign  and ignored the second candidate.  Otherwise assign.

2) Otherwise, and if there exists a second choice, check if the second choice's current action is one of building, bashing, digging, shrugging, or walking.  If so, then:
  i) check for steel and one-way walls for second choice.  If yes, then do not assign.  Otherwise assign to second chocie.

assigning a digger:

1) if first candidate is standing on steel, then do not assign and ignore the second candidate.
2) otherwise, check if the first candidate's current action is one of building, bashing, mining, shrugging, or walking.  If so, allow the assignment.
3) otherwise, and if there exists a second choice, check if the second choice's current action is one of building, bashing, mining, shrugging, or walking.  If so, allow the assignment to the second choice.

Notice the bug here where the second choice candidate does not need to pass the steel test.  This bug which is in the real game should probably be fixed for Lemmini.

-----------------------

One final thing to point out is that this system is not well-equipped for assigning climbers and floaters, because there, only the first candidate is considered.  And when you think about it, since already having climber/floater status doesn't affect priority, you end up with the situation where if you have a whole bunch of lemmings under the cursor and the most recently entered one is already assigned a climber, you would not be able to easily assign the other lemmings as climbers, unless you move the cursor (and that still won't help if some of the lemmings actually occupy the exact same position).  Thus it is probably helpful at least for those cases to deviate from the real game and redesign the assignment system so that climbers and floaters can be more easily assigned.

Offline covox

  • Posts: 100
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #7 on: January 03, 2007, 06:39:11 AM »
Thanks for the feedback, I really appreciate it.

* selection of single lemmings in the masses is a bit buggy, ccexplore posted about the correct selection method somewhere, I'll see if I can dig it up
Smashing stuff. I'll have a proper read of the selection method, currently it defaults to the newest lemming in the group, along with some arbitrary skill priority I just made up.

* the intro screen music was included with the Amiga MODs, it isn't nearly as fun to listen to
The intro screen will be getting an overhaul very soon (there's a proper artist on standby, might investigate some music).

* fallen lemmings don't disappear until I scroll
Yep, that's a side effect of the cheap rectangle-based rendering method I used. Sometimes it works, sometimes it doesn't. I'll weigh up the performance impact of not using it and sort it out somehow.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #8 on: January 03, 2007, 10:52:03 PM »
* lemmings don't show up in the mini-map (probably overlooked :))
* maybe the 'P' key could be used for pause?

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #9 on: January 04, 2007, 12:53:42 AM »
That'd make sense. MikMod (i.e. the standard Unix modplayer library) isn't as perfect as other things like ModPlug. Although to be fair, the Amiga wouldn't have partial panning would it? :P

I know the original Amiga has two of the channels fixed to output left and the other two fixed to output right, so there's no panning control at all, although with software mixing (which tends to be too CPU-intensive for game purposes with the machines of the time) you can play the same sound with different volumes on a left and a right channel to create partial panning.

One possibility is if you can setup MikMod to output to a mono rather than stereo format, then everything is effectively panned centered.  Although "non-partial" panning doesn't really sound too bad unless you're using headphones; on speakers each of your ear will always pick up a little bit of sound from the "other side".

2112

  • Guest
Re: Good lord! ANOTHER lemmings clone!
« Reply #10 on: January 04, 2007, 03:36:11 AM »
This is heavy, Doc...

Looks good, albeit kind of stressful to the system. I might do some work with this one at some point, but don't expect that to be any time soon, and reasons for that are mostly due to music bootlegs, but ne'er mind that. Good t'have options.

-2112

Offline covox

  • Posts: 100
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #11 on: January 04, 2007, 07:44:55 AM »
* lemmings don't show up in the mini-map (probably overlooked )
Will add this once I remove the screen-rects problem.

* maybe the 'P' key could be used for pause?
Consider it done.

Looks good, albeit kind of stressful to the system.
Aye, that'd be the truth. There's probably ways to make it faster (at one stage I tried Psyco and Numeric, but they seemed to make things worse). I don't quite know what the lowest possible CPU speed is, but the 1.3GHz iBook G4 I've pilfered from work is borderline slow. Which is not a good benchmark as the framebuffer performance on OSX is dreadful.

As for music bootlegs... well, name someone who'd get upset over an analogue recording of an Adlib soundtrack.

2112

  • Guest
Re: Good lord! ANOTHER lemmings clone!
« Reply #12 on: January 04, 2007, 08:22:40 AM »
As for music bootlegs... well, name someone who'd get upset over an analogue recording of an Adlib soundtrack.

Well, actually, I meant that my hard drive is pretty well packed with various live recordings of... let's just call it questionable legality. I should have mentioned that, sorry.

Upon further investigation, it says here that a lemming cannot bash if currently building. Hm... Don't you almost have to do that for a few of the levels? I forget which ones, though... I think Cascade was one of 'em.

-2112

Offline covox

  • Posts: 100
    • View Profile
Re: Good lord! ANOTHER lemmings clone!
« Reply #13 on: January 04, 2007, 01:41:41 PM »
Well, actually, I meant that my hard drive is pretty well packed with various live recordings of... let's just call it questionable legality. I should have mentioned that, sorry.

*penny finally drops*

Upon further investigation, it says here that a lemming cannot bash if currently building.

Sorry, can't reproduce that. A lemming will not bash/dig/mine however, if he is in a steel area, which is probably wrong and needs mending.

2112

  • Guest
Re: Good lord! ANOTHER lemmings clone!
« Reply #14 on: January 04, 2007, 10:58:13 PM »
Well, actually, I meant that my hard drive is pretty well packed with various live recordings of... let's just call it questionable legality. I should have mentioned that, sorry.

*penny finally drops*

Yeah. You got me.

I figure this is as good a place as any to drop that - after all, a lot of posts on here concern nigh-exact copies of a copyrighted game and editing it...

-2112