Dracopillar

This will be a dev log for my latest attempt at finishing another small game, starting from the very beginning (day 3 to be exact) and hopefully ending up with a polished desktop release.

Dracopillar (name suggestions welcome), is inspired by Snake, but you will play a fire-breathing caterpillar monster and have full, continuous control over your movement. I don’t have any other design decisions made for certain yet (uh oh), but it will be some sort of action-shooter with relatively short playthrough times.

2 Likes

1: Movement prototype

All I have so far is a basic character movement protoype. You can walk around, pick up more body segments, and switch directions (your tail becomes your head). It took a few iterations, but I’m reasonably happy with it now. All the segments are the same and each one is mostly independent. Their script can either do nothing, act as a follower segment, or be controlled by a player. Hopefully this will make it easy to handle your body breaking apart, as well as local multiplayer.

The feet animation is still pretty bad, I will probably work on that next. My initial method of only moving the feet when they got a certain distance from the body worked fairly well, but then they didn’t alternate nicely at all, so currently they’re just moved on a repeating timer. Now it doesn’t adapt well to different movement speeds though, so I may go back to the old method.

Here’s a gif: (the feet are also lagging behind here due to low framerate while recording)

12 Likes

Interesting!
Btw, how to you record the video? Have you tried the “start_record” event? There shouldn’t be any framerate drops due to the recording then.

2 Likes

Ah! Good point. I’ve never tried the built-in recorder, I’m just using ScreenToGif. I just tried copy-and-pasting the “start_record” line from the docs, but I got: “ERROR:ENGINE: Unable to start recording (-2)”. Do you know what that means?

Hmm, noticed that it doesn’t print anything extra there, but I wonder what width/height you have of your project? In the code it says it should be a multiple of 8.

1 Like

Yeah, just the error code “(-2)” (at least I assumed it was an error code). I have the default 960x640 width x height set.

1 Like

yes, in this case the -2 means a bad argument. What does your line you pasted look like?

i have the same issue

1 Like
function on_input(self, action_id, action)
  if action_id == hash("input_record") and recording == false then
    recording = true
    msg.post("@system:", "start_record", { file_name = "recording.ivf", frame_period = 1, fps = 60 } )
  elseif action_id == hash("input_record") and action.released then
    recording = false
    msg.post("@system:", "stop_record")
  end
end

Ah, hm. Maybe the file name needs to be different? I just pasted:

msg.post("@system:", "start_record", { file_name = "test_rec.ivf" } )

Hmm, strange, I’ve tested both your versions (same as the docs), and for me it works. Both with 800x600 and 960x640. I’m on OSX, what platforms are you on?

im on osx also

Windows 7.

Hmm, I’m stumped. Perhaps @sven or @britzl has a hint of what is going on?

No idea. As far as I know it should work.

Hmm, well that’s a bummer. Let me know if there’s anything else I can do to help debug it.


2: Better feet animation

It turns out the trick to generating a decent walk animation is to keep track of the ‘balance’ of the feet and try to keep them on opposite sides of the body (front/back). That’s pretty much all you need to do in fact. As the body moves, both feet fall behind, and when you hit a balance threshold, you step the furthest foot to the other side. This way they only move when they need to, and automatically sync up when moving at a constant speed. There’s some other stuff to figure how far to step and cover up some edge cases, but that’s the gist of it.

Here’s what it looks like in action: (not entirely natural, but good enough for this I think)

10 Likes

would you be able to send a code example that works with you?

Awesome solution, those little feet look great.

5 Likes

This has been fixed and will be working again in the next release.

4 Likes

@sicher Thanks!
@Andreas_Tadic Oh, nice, thanks a lot!


3: Multiplayer, multi-segment grabbing

Thanks to my earlier setup efforts, adding other players only took about 20 minutes! I just had to add the input bindings, make the player controller only check for its own inputs, and add a simple player spawner. For now I set up four players, but the only limiting factor at this point is having input bindings for all of them.

I also got grabbing multi-segment chains mostly working. There are still some occasional annoying bugs that I have to hunt down. I colored the segments based on their owner and allowed players to steal chunks of other players to test it out. Here’s me trying to control two players at once:

17 Likes