Spawning Sprites

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Spawning Sprites

Post by Sarah »

Well, hey I have an idea for something but I don't know if it would be possible with zdoom.

Although I'm not to this point in the production of this wad I'm making, I've still been thinking about how I might accomplish this. I don't have the skills to do it without help, so I need you guys to give me a hand. Well first, a quick overview of the map: the map takes place outside in a snow covered environment.

Thanks to the brilliance of, oh I can't think of their name, but anyway, there is a nice way to make realistic weather effects in Doom now. Anyway, I want to add some more realism to the game.

I want there to be a way to make footprints in the snow. The method I thought of was to create a new object that is 2 footprints in the snow that gets placed on the map equivalent to the players place on the coordinate plane. Also, to keep the object from doing the brilliant 2D spin that monsters do when you walk around their corpses, there would be multiple images for the different sides of the footprints. The only other option I could think of was to make new floor textures with the footprints on them that take the place of the mapped floor texture, but that has its downfall when a player crosses a sector multiple times.

If I used a new sprite, I would need it to be directionally placed so that it faces the direction the player was facing before they moved. Also, I would need a script to check to see where the player was on the coordinate plane. That would be the only way to to figure out where to place the sprite. Furthermore, there would need to be another script monitoring the players angle so that the new sprite is placed at that same angle. Then there would need to be another script to place the sprite.

So as you can see, this is relatively complex. I get the feeling that it can be done, but I REALLY need any help I can get. Any help with the code would be great! Ideas are welcome. Well that's all. Please help! :D
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Spawning Sprites

Post by Remmirath »

A_SpawnItemEx
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Spawning Sprites

Post by Captain Ventris »

Nero wrote:So as you can see, this is relatively complex. I get the feeling that it can be done, but I REALLY need any help I can get.
If you're going to use sprites, than yes, A_SpawnItemEx. It's easy to make it face the same way. Possibly use a custom player class that spawns the footstep actor as he moves?
User avatar
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: Spawning Sprites

Post by Spleen »

Nero wrote:. Also, to keep the object from doing the brilliant 2D spin that monsters do when you walk around their corpses, there would be multiple images for the different sides of the footprints.
I disagree. The "2d spin" looks much less jarring than when people put 8 rotations on objects that stand still, and those objects suddenly rotate by 45 degrees in an instant when you walk around them. Multiple rotations only work well with moving objects (monsters, projectiles, players, etc.).

The best way I can think of is to make a footprint-shaped mosaic of differently colored 1x1 sprites. It will probably look really good. This method is laggy for making large things (you can even theoretically make a voxel caco out of individual 1x1 sprites like this), but footprints are small enough to be ok.
User avatar
Enjay
 
 
Posts: 27160
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Spawning Sprites

Post by Enjay »

Best way I can think is to make it for GZdoom and make a flat model, like Nash and I have both done for blood splats, and have the player leave a trail of them lying on the ground.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Spawning Sprites

Post by Nash »

The "fake voxel" method Spleen suggested does have its advantages - the "foot print" will be shaped to the contours of the floor - great for sloped terrain. Whereas with models, the polygon will always remain flat, and what this means is, if spawned on sloped floors, the footsteps will intersect with your map geometry and essentially have harsh clipping...

Though I'm not sure the huge amount of things generated from the fake voxel trick is worth it... :P
User avatar
Enjay
 
 
Posts: 27160
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Spawning Sprites

Post by Enjay »

True, I forgot about that. Mind you, a footprint, if you are going to keep it to scale, probably shouldn't be any bigger (if at all) that a blood splat so the problems you mention shouldn't be too noticable. The ones in Duke 3D, for example, are far too big compared to the size of the player sprite feet.
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: Spawning Sprites

Post by Sarah »

Spleen wrote: The best way I can think of is to make a footprint-shaped mosaic of differently colored 1x1 sprites. It will probably look really good. This method is laggy for making large things (you can even theoretically make a voxel caco out of individual 1x1 sprites like this), but footprints are small enough to be ok.
The only problem with this is that I have absolutely no clue how to do this. On top of it, would I then have the problem of whatever this is spinning like a monster corpse?
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Spawning Sprites

Post by XutaWoo »

Nero wrote:On top of it, would I then have the problem of whatever this is spinning like a monster corpse?
Not really, considering those sprites would make the actual footprint, making it actually rotate when you look at it while moving around it.
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: Spawning Sprites

Post by Sarah »

XutaWoo wrote:
Nero wrote:On top of it, would I then have the problem of whatever this is spinning like a monster corpse?
Not really, considering those sprites would make the actual footprint, making it actually rotate when you look at it while moving around it.
Ok, so how do I do this?
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Spawning Sprites

Post by XutaWoo »

Make a 1px1p sprite.

Then mess with A_SpawnItemEx until you get a decent footprint shape.
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Spawning Sprites

Post by Remmirath »

Hey, Xuta. That would be a mess.
I wonder if it's possible to spawn items by basing on the actual actor angle. :?
I mean, let's say i have a footprint sprite. Generally a sprite for a footprint has only one sprite. Now, could it be possible to spawn them completely aligned with the calling actor angle?
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: Spawning Sprites

Post by Sarah »

§-Morpheus-§ wrote:Hey, Xuta. That would be a mess.
I wonder if it's possible to spawn items by basing on the actual actor angle. :?
I mean, let's say i have a footprint sprite. Generally a sprite for a footprint has only one sprite. Now, could it be possible to spawn them completely aligned with the calling actor angle?
So I'm guessing I would make 1x1 pixel sprites that are the different colors of the footprint and then use A_SpawnItemEx to spawn the different sprites to make a footprint?

That does seem like it would be a mess to figure out all of the offsets, even if the final product is relatively small to keep relation to the player correct. Is there no way to create a footprint decal that could be place on the floor, similar to the blood spray that you get when you shoot monsters close to walls? However instead of that being somewhat random, let it spawn the actual footprint decal on the floor in relation to the player's angle. Then at the same time, have that play a "snow crunching" sound to make it seem like the snow is crunching under your feet. Any of this possible or am I getting over ambitious for the engine?
User avatar
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: Spawning Sprites

Post by Spleen »

Nero wrote:
§-Morpheus-§ wrote:Hey, Xuta. That would be a mess.
I wonder if it's possible to spawn items by basing on the actual actor angle. :?
I mean, let's say i have a footprint sprite. Generally a sprite for a footprint has only one sprite. Now, could it be possible to spawn them completely aligned with the calling actor angle?
So I'm guessing I would make 1x1 pixel sprites that are the different colors of the footprint and then use A_SpawnItemEx to spawn the different sprites to make a footprint?

That does seem like it would be a mess to figure out all of the offsets, even if the final product is relatively small to keep relation to the player correct. Is there no way to create a footprint decal that could be place on the floor, similar to the blood spray that you get when you shoot monsters close to walls? However instead of that being somewhat random, let it spawn the actual footprint decal on the floor in relation to the player's angle. Then at the same time, have that play a "snow crunching" sound to make it seem like the snow is crunching under your feet. Any of this possible or am I getting over ambitious for the engine?
As far as I know, decals can only be applied to textures and not flats - hence your problem. Floor decals might be a really nice feature request, though I don't know how feasible it is. :ugeek: Could have many many awesome uses.
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: Spawning Sprites

Post by Sarah »

Spleen wrote: As far as I know, decals can only be applied to textures and not flats - hence your problem. Floor decals might be a really nice feature request, though I don't know how feasible it is. :ugeek: Could have many many awesome uses.
Yeah it would be nice. But all my previous attempts at feature requests have been shot down as unfeasible. So I'm pretty dissuaded from doing any feature requests.

Anyway, can we all try to agree on a method that would be best to accomplish this? Maybe some example maps so I could get an idea of what I would have to do? I don't need somebody to make the fooprints, I can do that myself. But some help with the scripting would be great.

Oh just so you all know, this game runs on GZDoom for the openGL rendering. So waiting for the next zdoom release isn't going to work if we end up doing a feature request. Um, if worse comes to worst, I can send some of you the game, but be forewarned, the game is about 20 megs because I haven't cleaned it up yet. It also runs in a format similar to Foreverhood, meaning I have a copy of GZDoom with it so that I can use a custom .ini file without editing a users .ini file for other engines and games. This means that the game is executed from a batch file. This works pretty well, seeing as how I've tricked GZDoom into running from a fake iwad (it isn't like that hasn't been done before). So yeah. Also, the maps I would implement the footprints into are maps 2 and 3 which are nowhere near done! That said, I more just need a method that could be implemented later.
Locked

Return to “Editing (Archive)”