Archived

This topic is now archived and is closed to further replies.

"Lemmings" project... unforseen problems.

This topic is 5500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For the record, I am deciding to call my project "Lemming Quest" until I find somthing better, findout it is allready used, or get sued. Anyways, I have run into some design problems now that I have the ball rolling and I thought mabey If I wrote about them here, It would help me figure out what I need to do, or mabey somone else will have an idea. Please note that this is a C project (newbie). I dont know why you should note that, but err.. lets get down to it: The ENGINE: The engine is very simple (reletive to current games) and the design is based on Lemmings for the Nintendo/Famicon (hense forth referred to as LEM). The main difference between my engine, and LEM is the enviroments. LEM used a tile-based engine however, with the huge availiblity of RAM on modern PC''s, I decided to take a more simplistic approach. I just load a scene as one large bitmap. A scene is defined by the program as any part of the level that is considered "solid" and can be destroyed (eg. by a digger or explosion). So, to make a long story short, gravity is calculated by the program by assuming that masked pixels on the scene bitmap are open space and non-mashed pixels areound the base of a lemming are used to determine the vertical movement of a lemming. The Problem Anyways, the above idea has been working pretty well and allows for some pretty fluid movement and realistic looking levels with minimal effort But the first problem I run into is climbing. If I remember LEM correctly, either all walls were vertical or lemmings we unable to climb walls which were not vertical. BUt how should my lemmings handle climbing since the terrain can be so unpredictable? Never in nature would you find a perfectly straight wall to climb. My first level (Just an engine test relly) is geometricly, quite complicated. I have jagged rocks, over-hanging cliffs, ect, ect... One idea would be to make the lemming "climber" more of a "pro" by equpping him with a long rope with one of those metal hook things. This would work well I think, but Im afraid it might be too attention consuming for Real-time stratedy. To make a single lemming climb you would have to select the lemming, action, and place to throw the hook-rope. Another variation on that idea would be to have a FIXED point (in relation to the lemming) where the hook-rope will always go. actually, i just figured out the awnser to my problem... thanks for the halp guys. :D I am going to have an elected climber continue to walk like normal until an obstruction is detected (in the appropiate coordinates) such as an approaching ridge or cliff above the lemming. then the lemming will throw the rope and begin to climb it. when he gets to the top he will turn around and reel in his rope (selfish bastard lemmings) then contine walking in the same direction he started. What do you think? My only other dillema is.. Should i use a simple animation for the rope and hook being thrown? Or go the more ellaborate route and write a multi segment line tracing routine that draws little (Rope pieces) every couple of pixels tracing along the line. This would allow alot more controll over the ropes movement as it is being thrown whatnot but at the expense of some processor power and extra effort (on my part). hmmm.... I think I''ll go with the line tracing routine. What''s your guys'' thoughts? - Twisted Matrix

Share this post


Link to post
Share on other sites
give the lemmings spiderman''s skill, climbing a vertical wall without rope. that way you won''t have to make him ''throwing out a hook."


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
This could be a long shot but I think it would look pretty cool.
How about you make the Lemming climb the wall and as it reaches funny bumps of kinds you have a routine that identifies what animation to us next for example:

if you have a vertical wall (a perfectly vertical wall) then the lemming climbs as a climber would. if say the wall had a blump half way up, then the lemming does some sort of climbing trick (a different animation) and continues to climb.

On a really rough wall it may get a little confusing though.
slip

Share this post


Link to post
Share on other sites
Lemmings collision, as far as I know, was done per pixel. So a lemming would be walking along, and you''d check to see if the pixel under his feet was present or not.

If all of a sudden the floor was lower than him, he''d start falling. If all of a sudden the floor was higher than him, he''d turn round if it was over X many pixels higher than his feet, or start climbing if he could.

That shouldn''t be too hard to implement - I''m assuming you''re using 8 bit palettised mode - you can just treat your back buffer as an array. You''re going to have to do that anyway to blast chunks out of it when lemmings blow up or dig.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites
quote:
slip wrote:
How about you make the Lemming climb the wall and as it reaches funny bumps of kinds you have a routine that identifies what animation to us next for example:

if you have a vertical wall (a perfectly vertical wall) then the lemming climbs as a climber would. if say the wall had a blump half way up, then the lemming does some sort of climbing trick (a different animation) and continues to climb.
On a really rough wall it may get a little confusing though.


Not a bad idea. In fact that gives me another Idea that might be better than the Rope''n''hook idea. Just caclulate the approximate slope as the lemming is climbing and do realtime (or precalculated) rotations based on that angle.

quote:
siaspete wrote:
That shouldn''t be too hard to implement - I''m assuming you''re using 8 bit palettised mode - you can just treat your back buffer as an array. You''re going to have to do that anyway to blast chunks out of it when lemmings blow up or dig.


Actually, I am writing this in 640x480(truecolor). I am running into some preformance problems concerning the backgrounds. am blitting atleast 2 640x480 16bit layers before the sprites and things and this is eating up alot of speed. I know when I support hardware acceleration this wont be as bad, but I also know that alot of the layer data is getting covered up by new data and I was wondering what I should do? Ideas are..

A. just ignore and blast all pixels
B. test for any foreground data before writing a pixel
C. Mix of the above 2. Divide the screen into sector squares and test for foreground data. results in less conditional code which should speed things up and less accurate pixel culling (writing more pixels than is really required)


- Twisted Matrix

Share this post


Link to post
Share on other sites
For 16 or 32 bit maps it''s similar to 8-bit. Instead you''re checking an array of INT16s or INT32s (I''m assuming Win32).

Remember DirectDraw can do source AND destination colour keying. Try both to see which is faster for you. Also note that reading from video memory is slow, so you might even be better storing an array representation of the map, just for collision.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites