Slug annoyance

Completed patches for Keen4.
Post Reply
Bernie
Posts: 124
Joined: Sat Sep 22, 2012 2:28 pm
Location: Aus

Slug annoyance

Post by Bernie »

I just started getting into enemy patching and have a problem with the slug here:
I've changed its graphics, but the new graphics are taller than the original, so in the game the new graphics are half underground- so I did the patch thing and 'moved' the slug up a bit, but now the slug is still and 'spinning' rapidly.

I'm thinking this: is there a difference between repositioning the enemy and repositioning its graphic? or what?

thanks.
User avatar
troublesomekeen
Posts: 223
Joined: Fri Feb 03, 2012 7:56 pm
Location: Shadowlands
Contact:

Post by troublesomekeen »

Hello, Bernie. Have you seen Ceilick's Keen Galaxy Modding Tutorial?
http://www.shikadi.net/keenwiki/Ceilick ... g_Tutorial
Look under the "Editing Graphics and Text" section.
Which program did you use to extract your graphics? Modkeen or KeenGraph?
If you used ModKeen, notice that there's a "4SPRITES.txt" file in your graphics folder. The Slug sprites are 191 to 198. Open up 4SPRITES.txt and scroll down to number 191. You'll see this:

Code: Select all

191: [2, 8, 13, 23], [0, 0], 2
The first set of 4 numbers dictates to height and width of the Hitbox. The second set of 2 numbers are the ones you want to pay close attention to. They adjust where the sprite is placed/spawned, as noted in Ceilick's Tutorial. It is a little confusing whether to use negative numbers or positive numbers.

So let's say your Slug is halfway into the ground. We want to make that Slug appear properly on the surface. We would use lower or negative numbers for this purpose.

I wrote up a separate text file that helps me remember what does what:

Code: Select all

Higher numbers make sprites
appear more DOWN or SOUTH

Lower number make sprites
appear more UP or NORTH
So let's take sprite 191.

Code: Select all

191: [2, 8, 13, 23], [0, 0], 2
The last number in the second set of numbers in the brackets is what controls the height of the sprite's position.

Code: Select all

191: [2, 8, 13, 23], [0, -8], 2
Notice that we changed it to -8, to make the sprite appear higher. -8 might not be the number you want. It may be too low or too high. Keep saving your 4SRPITES.txt and importing your graphics until you get it right. You'll have to play with it for a while. You'll also have to adjust the coordinates for the rest of the Slug sprites.

You might consider making your Slug replacement sprites all the same dimensions. The default Slug is a little tricky to deal with because it changes sizes constantly as it animates. If your Slug replacement size is the same for all 191 to 198 sprites, it might be easier to edit the coordinates.

But if you're using KeenGraph, it'll work a bit differently. Again, Ceilick's Modding Tutorial explains all of this nicely. Lastly, this topic is posted in the wrong place.
Bernie
Posts: 124
Joined: Sat Sep 22, 2012 2:28 pm
Location: Aus

Post by Bernie »

wow, big reply! Thank you so so much. I have actually gone through ceilik's tutorial, though mainly when learning to edit levels. must've missed that.

I'd fiddle around with those numbers and see what happens. thanks again!

EDIT: after a whole lot of fiddling, it works! god oh mighty.
User avatar
troublesomekeen
Posts: 223
Joined: Fri Feb 03, 2012 7:56 pm
Location: Shadowlands
Contact:

Post by troublesomekeen »

Bernie wrote:EDIT: after a whole lot of fiddling, it works! god oh mighty.
Good work! Super glad you got it to work. There is one thing, however, that I should mention. When you change the size of your sprites, they might have trouble walking up or down hills. Hills are either really steep, or slightly slanted, as you well know.

Have you ever noticed that the Arachnut, the crazy two-mouth, crab-walking monster, is seldom (or perhaps never) seen where there's hills? Arachnuts seem to be always in flat ground. Once I placed an Arachnut on a hill, and then it got stuck, rapid switching between sprites. In other words, Watch Out for hills when you build your levels!
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

This is why Keengraph reads its hitboxes off the sprite graphics if at all possible.

Notice also the other Poison Slug patches here: http://www.shikadi.net/keenwiki/Patch:Poison_Slug
Bernie
Posts: 124
Joined: Sat Sep 22, 2012 2:28 pm
Location: Aus

Post by Bernie »

ran into another related problem the other day when I changed the pics for the 1UP (for keen 4 again)- whenever i changed the X offset by one, it would jump like 6 pixels, left or right. it *sorta* worked, as in it would correctly move one pixel whenever I incremented the value, but then bam, all of a sudden it would skip like 6 pixels. basically I could never get it centered. any more help please guys??
User avatar
troublesomekeen
Posts: 223
Joined: Fri Feb 03, 2012 7:56 pm
Location: Shadowlands
Contact:

Post by troublesomekeen »

Bernie wrote:ran into another related problem the other day when I changed the pics for the 1UP (for keen 4 again)- whenever i changed the X offset by one, it would jump like 6 pixels, left or right. it *sorta* worked, as in it would correctly move one pixel whenever I incremented the value, but then bam, all of a sudden it would skip like 6 pixels. basically I could never get it centered. any more help please guys??
I've always been afraid to mess with the size, dimensions and positioning of collectable items because some are tiles and some are sprites.

On a side note, I did, however, venture to change the size of the 1UP barrel in Keen5. Sprites are going to spawn where you place them in the Omegamatic. So I took a screenshot of my level in the Omegamatic, and compared it to a screenshot of the actual level in-game.

Image

Ah ha! Just as I thought. Keen and the 1UP are two tiles high. If we want Keen to spawn on the ground, we place the sprite on the ground. But if we want the 1UP to spawn on the ground like Keen, we'd have the place the sprite 1 tile above the ground.

But back to the issue at hand. I've had this problem, too. I was trying to make Keen's bullet spawn a little lower. Um... Sorry I can't offer a solution here..
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

I'm not sure I get what's wrong here. The easiest thing is just to make a sprite full of empty space for it, and use that. enemies can be positioned, but collectable items... not so much. They're mostly useful for when hidden behind tiles.
Bernie
Posts: 124
Joined: Sat Sep 22, 2012 2:28 pm
Location: Aus

Post by Bernie »

well my 1UP graphic replacement is bigger than the usual 16x16 that other collectors are at (its 24x24), so i have to screw around with its dimensions but just cant get it 'centered' for some reason.

EDIT: okay after a bit of experimentation i've found that when i make the X offset for one frame -1, and the other frame that it animated to as -2, there is no position difference at all between the two, confirming my primary issue. weird weird shit. im scared you guys.

EDIT#2: holy shit i got it to work!! its now centered! THERE *IS* A JESUS! what i did was change the animation, er, 'smoothness' or whatever you call it (the last number in the 4sprites.txt entries) to 2 instead of the usual 1.
i dont understand shit but IT WORKS!
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Someone's in a... vocal mood today.


This can be very annoying and relates to a number of factors. The first is the sprite offset; where the sprite appears relative to the collected item. We don't know this at present and it probably affects all the 'got' sprites.

The second is the sprite's action type, which can mess with animations something fierce.

The third is the sprite image offsets which can be adjusted, but for some action types won't do Jack (Or Jill.)

The fourth is the number of sprite copies, which worked in your case. These allow the sprite to be placed at 8, 4 or 2 pixel increments depending on how many there are. (1, 2 or 4 respectively.) Tough stuff.
Bernie
Posts: 124
Joined: Sat Sep 22, 2012 2:28 pm
Location: Aus

Post by Bernie »

hmm the plot thickens.

and yeah i was vocal because, my god, i got something to work on my own!
Post Reply