Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
gggmork

The Somewhat Amazing Impimpede sort of lives!

Recommended Posts

12-24-10 edit:
(in-progress zdoom/acs lameness)
This is what I have so far:
http://www.speedyshare.com/files/25884219/caterpillarDELETEtest.wad

*Currently, a "segment" can get kinda blocked by another segment which will hopefully be fixed.
*eventually it should be possible to have the centipede as long as you want and shoot a middle segment would result in 2 separately moving centipedes (ie. each segment has potential to be its own head)
*probably possible to edit its speed or change its segments images from imps into some sort of legged centipede-looking segments, and animated, and have attacks and stuff. Maybe it could head toward the player half the time rather than random all the time.
*the code probably sucks cuz I don't know how to code. Most functions were abandoned because not being able to delay() inside them made it hard to print variables for testing.

-----

I wanna learn decorate probably. It seems trickier to do simple things like use while/if type logic than acs so far, with goto hackiness and kind of rigid possibilities maybe. The most powerful things I've read about seem to be:
http://zdoom.org/wiki/A_JumpIf
http://zdoom.org/wiki/DECORATE_expressions
and user_ variables ('user_'?, weird terminology but whatever).

I just thought of an arbitrary goal to experiment with decorate:
make a 'leader' imp that walks around and maybe 10 imps that follow behind all in a row like a caterpillar mimicking the lead imps behavior. Maybe, no matter which imp you shoot, the tail imp always dies off until there's only the 'head' left... or even better, maybe you could shoot some middle imp thus breaking it into 2 separate shorter caterpillars.
So before I try/fail, do you think this is even possible in decorate? It seems the only walking-type functions are a_wander and a_chase. These seem to make the monster wander around randomly with no seeming ability to say 'hey, walk in a straight line directly to where the head imp just was' (well maybe if you have map spot TIDs, but then the lead imp is on some fixed course).
Maybe you can use the variables in that 2nd link, like somehow make imp#2's angle/x/y/velx/vely etc variables equal to the head imp from the previous tic(s).

Share this post


Link to post

That sounds really cool. I hope you figure it out, so I can snatch the code for my own experiments afterward.

Share this post


Link to post

That seems more like the kind of things you'd do in ACS... LilWhiteMouse on the ZDoom forum has a lot of experience creating multi-actor monsters. IIRC, there's a caterpillar enemy in Wolfen (it's been a while since I played that mod, but I think it was there) and she also made the "Super Mastermind" and "Harbinger" enemies.

Share this post


Link to post

Feel free to use the code for whatever (if I ever successfully make anything).

I might try wolfen eventually but don't own hexen. For now that harbringer looks like it will be quite nice example code to study:

I found the harbringer here: idclev to map2 on this doom2 wad:
http://files.drdteam.org/index.php/files/get/f4tyDZkwjs/harbringer.zip

That's the most sophisticated doom monster I've seen since the end boss on the last level (5?) in claustrophobia here:
http://www.doomworld.com/idgames/index.php?id=12364

Share this post


Link to post

Has such a thing been done with cacodemons/pain elementals?

They would then be able to vary their height as well like a flying serpent or something. You could do the same thing where they break into smaller caterpillar forms if a middle section is killed. If they are linked up close enough you might not see the "face" of the cacodemon and they would look like body pieces perhaps as well?

-travers

Share this post


Link to post

You could make multiple 'caco' versions, each retextured, like some are green/scaly to look like a part of a dragon body.. some are red with lines to look like a wing or something, some are eyes, etc. And you could piece them all together into a single monster (with a ton of work and you'd have to be good at constructing algorithms and trigonometry to turn the 'monster' and stuff which I'm currently pretty meh at). So far I think it might be possible.
I only did a simple test moving 1 imp so far, but the trick was to make a dormant imp with decorate (still not correct because it attacks if you bump it but good enough for testing):

decorate:

actor DormantDoomImp : DoomImp replaces DoomImp
{
  states
  {
  Spawn:
    TROO A 500
    loop
  }
}

Now that its dormant you can give it your own unique behavior with ACS (this just makes an imp (with tag 1) move/bounce off walls (a 'caterpillar' would be a lot harder depending on how sophisticated its behavior was):
script 1 open
{
    int xmov = 1<<16; 
    int ymov = 1<<16;
    while (1){
        if (! setactorposition(1,getactorx(1)+(xmov),getactory(1),getactorz(1),0) )
            xmov *= -1;
        if (! setactorposition(1,getactorx(1),getactory(1)+(ymov),getactorz(1),0) )
            ymov *= -1;
        delay(1);
    }
}
The way setactorposition works like that seems weird to me... the if condition itself is responsible for moving the imp (rather than code INSIDE the if block moving the imp). I think functional programming languages at least advocate that functions should only return something rather than having 'side effects' like that. Plus setting x/y/z all at once when you really only want to set the x is kinda clumsy. But I can't complain because I'm mostly a code noob and acs/decorate are way more sophisticated/complicated tools than I'd ever be able to create.
I recently read about how a good coding tactic might be to focus on the data rather than algorithms.. like make a big table which is easy for a human to understand then just have simple algorithms brute force it. "data is facts. code is actions that operate on facts."

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×