Animated map objects #430

sauer2 opened this Issue Jun 12, 2016 · 7 comments


None yet

2 participants

sauer2 commented Jun 12, 2016

It might make the maps seem more vibrant if it contains animated map objects like computers with blinking cursors, space ship wall computer screens, fires in attacked buildings or fans in ventilation ducts.

@cxong cxong added the feature label Jun 14, 2016
@cxong cxong added this to the Wishlist milestone Jun 14, 2016
@cxong cxong changed the title from Feature: Animated map objects to Animated map objects Jun 14, 2016
@cxong cxong referenced this issue Jun 14, 2016

Implement Cyberdogs gameplay #71

11 of 15 tasks complete
@cxong cxong added a commit that closed this issue Nov 9, 2016
@cxong Animated map objects (fixes #430) ba265b8
@cxong cxong closed this in ba265b8 Nov 9, 2016
@cxong cxong modified the milestone: 0.6.3, Wishlist Nov 9, 2016
@cxong cxong added a commit that referenced this issue Nov 9, 2016
@cxong Add animated fans post (#430) 1cd63aa
cxong commented Nov 11, 2016

I've implemented this feature plus the spinning fan tile from Cyberdogs; the computer terminal would be an obvious choice for animation, but what else? Let's add some animated map objects as required, for example I recall some of your campaigns are supposed to have server racks? Perhaps we can resprite those with blinkenlights.

sauer2 commented Nov 11, 2016

@cxong Allright, I'll try to do that and the wallscreens mentioned in the opening post later today.

sauer2 commented Nov 11, 2016

@cxong I sent you a modified version of the space pirates campaign with wall screens in the 4th mission. Those aren't exactly works of art, so improvements and suggestions are welcome, but I might add more stuff later.

The animation works flawless. However, it uncovers some issues:

  • wall objects are immune to shooting (but that's somewhat logical from an implementation POV I guess)
  • normal objects that are shifted to the wall still have the player collide with their normal position
  • the wreck image is at the original position and so is the break down particle effect (however, it looks cool in this case, as if the screen felt from the wall and broke on the floor)
sauer2 commented Nov 12, 2016

@cxong Ok, I added blinking servers and powerhubs to the AI Insurgency campaign.

cxong commented Nov 17, 2016

Thanks; the sprites aren't bad. I've updated AI insurgency.

The Space Pirates ones will need more work; the current map object system doesn't fully support what you want. Some problems:

  • Once map objects are destroyed, they are displayed as "wrecks", which are assumed to be on the ground, so they are drawn last. Even if they are shifted using the (currently unused) WreckOffset parameter, the walls will be drawn over them, making them invisible
  • Wall objects will have funky hitboxes; either they physically stick out, even affecting players walking into them, or they are completely inside the walls, which might make it possible to shoot them from the other side of the wall, or if you make the hitboxes too thin, small/fast bullets may be able to tunnel through them

To fix the first problem, I'm thinking of reworking the "wreck" system, adding a separate flag for whether a map object should be drawn last, and instead when map objects are destroyed, they can optionally spawn another map object in their place. This is usually a wreck, but it could also be another destructible map object. You could have map objects at different stages of destruction, or you could loop them back into the original object. Sounds interesting but I don't know if there are practical uses for that - maybe a light that toggles between colours as you shoot them?

The second problem is harder. Unless you want them to be shootable from behind the wall, we'll need to do continuous collision detection, maybe using a technique like this one: Then we can have a super-thin map object, 1px tall and just outside the wall. This will also fix other bugs like #372. I've been putting this one off because I've been wondering at which point it'll be worth it to just go directly to a real physics system like Chipmunk2D, but I suppose that'll probably never happen.

By the way, the screen sprites are ok but they can be improved by shading the edges, so it looks like a physical screen instead of something painted onto the wall. Just like the techniques used here:

sauer2 commented Nov 17, 2016

@cxong Thanks, I'll look into shading.

If it turns out that the changes in the code aren't worth it, should I leave the collision stuff as it is or disable the wrecks?

sauer2 commented Nov 17, 2016

@cxong I added some shades, but I'm not sure if the light is right. C-Dogs has some weird light sources and the shades look kind of big due to the low resolution.

@cxong cxong referenced this issue Nov 21, 2016

Animated doors #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment