A new platformer with dwimmercrafty!

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

A new platformer with dwimmercrafty!

Post by kylekrack »

Hello again. I took the scripts from [game]Pixel-Walker[/game] and reworked them into a sidescrolling tech demo, [game]Dwimmerplatformy[/game]. It worked out really well! Took me hardly any time to do it, and it works even better than pixel-walker. Some of the commenting, especially on the animation scripts, isn't super clear, so if you have any questions about that I can explain. I'll likely be reworking them anyway to be easier to rework into other games.

In this demo, I'm also working on a custom animation definition system. For now, it works, but it isn't efficient. It uses invisible slices to store an animation's number of frames and speed at which to cycle through the frames. If anyone has any better ideas or examples of similar scripts, I'd love to see it. My mind's a little all over the place with this.

There isn't any NPC compatibility, which means this demo isn't very versatile in the kinds of games it could make, but my intention was to give a proof of concept for how simple and solid a sidescroller can be using plotscripting now.
Attachments
The little guy animates!
The little guy animates!
Screen Shot 2017-09-07 at 3.37.37 AM.png (49.08 KiB) Viewed 740 times
Last edited by kylekrack on Thu Sep 07, 2017 10:38 am, edited 1 time in total.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

OK, I guess you're first!

There's a one tick delay before gravity is applied after you step off a ledge. Move "apply gravity" futher down the main loop. Also, since the hero sprite isn't 20 pixel wide, yuo should parent it to a container slice which is the correct hitbox size. Currently you you can walk well off a ledge.

Nice to see an idle animation. Using a timer like that for looping animation is a solid approach, but I found the use of the "create animation definitions" script confusing. It's an extra layer of indirection. Instead of storing that table of animation definitions somewhere, you could just as well make 'animation handler', which changes to the correct animation, delete the animation description from the slice being animated and replace it with the new description (created by a modified "create animation definitions" which creates just one description instead of all of them)

Also, how about defaulting to a higher frame rate? :)

It's a bit weird to call the y-velocity variable "gravity", which I expect to mean the strength of gravity.
Last edited by TMC on Thu Sep 07, 2017 4:23 pm, edited 2 times in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Very nice! I am impressed with how quickly you put this together
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

I thought it was amazing how quick and easy it is to get a sidescroller out of these new commands.

I fixed the gravity delay and added a container slice that is the appropriate dimensions of the sprite. That makes it feel much better.

I also find the animation definitions script confusing. I just didn't know how to store that information in a way that was simple and allowed for more animations to easily be added. I think I see what you mean about storing the information directly in the player's sprite. That makes more sense.

The framerate is up to 30 fps. I lowered the speed of the player sprite to compensate. Feels pretty smooth along with the collision box fixes.

I will work on variable names and such. Gravity, as a variable, at one point made more sense. I wasn't sure what to change it to.

Thank you for the comments. It's made the demo better already.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I think there's a lot of good stuff in the SS101 scripts that you might be able to use, including the general structure and conventions of them, but they could do with a lot of updating. They don't use slices at all.

Well, actually it's not totally clear that using slices is better than heroes and NPCs. It's easiest to place NPCs in the map editor, and then you can use the usenpc command. In future releases I would expect things to swing a little more in favour of NPCs/heroes. We need things like the ability to use putslice on heroes/npcs, and doors and NPC activation which works with pixel-based movement.
Last edited by TMC on Fri Sep 08, 2017 9:07 am, edited 1 time in total.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6461
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

I find that a combination of heroes/npcs AND slices works best.
Slices are great, but using npcs opens up a lot of built in functions with the map and hero, and also helps with storing data for those newly created objects such as summoned slimes or fireballs.

I'm not super sure what benefit slices even have here, other than access to the collision command, as the standard walkabout size hasn't changed.

Also, I did manage to get myself lodged inside a wall while jumping around in this. I attached an image of this. It seems to be corner collision based. getting to exactly the middle of the square rockets you to the top of all the walls in that 3x3 block.

Some npc/enemy collision would be nice to see here. Can't have a platformer without npc/enemy collision.
Attachments
sidescroller0001.bmp
sidescroller0001.bmp (63.55 KiB) Viewed 2109 times
Last edited by Spoonweaver on Fri Sep 08, 2017 10:39 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes, you wouldn't want to use NPCs for everything (projectiles and particles), probably only for the enemies and NPCs.
You can still use slice collision commands if using NPCs, and you can also resize their container slices (hitboxes) to be something other than 20x20. I would say the benefits of using slices are that you don't need an NPC definition, you can exceed the 300 NPC limit, you can set any spriteset and frame you want instead of having to set NPC direction and frame and modify the NPC definition, and you can use slice movement commands and just use putslice instead of worrying whether it's an NPC or a slice.

As I mentioned in the other thread, occasionally being able to pass through walls is an engine bug (which is my fault), and I plan to fix it soon.
Last edited by TMC on Fri Sep 08, 2017 12:16 pm, edited 1 time in total.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

This platformer is really cool! You got a lot further along than I did with my attempts.
Last edited by SwordPlay on Fri Sep 08, 2017 2:40 pm, edited 1 time in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

I fixed a lot of the issues with [game]Dwimmerplatformy[/game]. The player's hitbox is accurate now, instead of being 20x20 pixels. The game runs at a higher framerate, and the speeds are adjusted to accommodate. May be too fast for certain people or certain games, but thankfully adjusting speeds is pretty simple. I might need to make it simpler to make minor changes like that.

I fleshed out the animated sprite and cleaned up the animation handler scripts. Now there's a bit more to look at. You can go into the map editor and draw different kinds of platforms to feel what it's like to jump around.

While the corner collision bug still exists, I put a finicky fix to prevent the player from getting stuck, but it allows for some potentially remarkable exploits. The main game loop checks if the player's current tile is all walls, and if so, it places them 1 tile directly upwards. This means if you jump down into a corner and you go through it, the game will put you on top of the tile. However, if you jump up into a corner, it sends you shooting up until you're on top of a tile. You can go through an entire floor this way, regardless of its height.
My pronouns are they/them
Ps. I love my wife
Post Reply