Space game to test - can animation be improved?

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Space game to test - can animation be improved?

Post by SWEdeAndy » Wed Jul 03, 2019 12:06 pm

Hi guys,

I would like to share with you a game I’ve been working on for over a year. I plan to release it soon, in one way or another (probably for free).

However, smooth animation remains a bit of an issue. I’d be very happy if someone could find out why the animation sometimes tends to be ”choppy”, in spite of all my efforts to use helpers like animationEngine, and tricks of layer setting etc. In the most recent version, I’ve even tried the 9.5.0 dp1 novelty of layerMode ”container”, for the group containing the sprites (which have layerMode dynamic). Unfortunately I see no difference at all in animation performance.

So, the game is called SpaceNode, and is a 2-D retro-looking turn-based strategy game set in space.
Not everyone’s cup of tea, I suppose, but my ambition was to create a game I would enjoy playing myself, and that I have achieved. If you have nostalgic memories of old games like Starbound, Escape Velocity etc, then you might enjoy it too. :D

You can download the standalone, for Mac or Windows, here:
https://wheninspace.se/en/mesmerize/spacenode/

Give it a spin, and if you feel that you have time and interest in seeing the source code, and maybe find a way to tweak the animations (or have other improvement suggestions), then send me an email at info@wheninspace.se and I’ll send you the LC stack along with some instructions on how to penetrate the code base (it’s naturally rather massive, the main card script has 3500 lines of code).

Cheers,
Andreas
WhenInSpace
Sweden
Last edited by SWEdeAndy on Fri May 01, 2020 2:55 pm, edited 1 time in total.
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Space game to test - can animation be improved?

Post by sphere » Wed Jul 03, 2019 12:58 pm

Looks great, although i don't understand what to do after docking a spaceship.
But it was smooth animation for me.
Good Job Andreas!

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Wed Jul 03, 2019 1:14 pm

Thanks! Well, after docking ships you buy modules from them to add to your space station.

I didn't make an interactive tutorial, instead you have some text-based instructions to read through. It's always a matter of playing style, I think, if you're the kind who dives right in to a new game, or the kind (like me) who devours all the instructions first. 8) I should probably accommodate both types better... :)

The animation is normally smooth enough in the beginning, but when things start to get busy, with more spaceships moving simultaneously and bullets flying around the place, it tends to start lagging a bit. The game is still very playable to the end, but I'd like to iron out that last laggy bump...
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Wed Jul 03, 2019 1:19 pm

I may add that I run on a MacBook Pro 15" (2018), so the hardware capabilities should not be lacking. It makes me afraid that lagging animation may be even worse on older computers.
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Space game to test - can animation be improved?

Post by richmond62 » Wed Jul 03, 2019 4:09 pm

How did you do the animation?

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Wed Jul 03, 2019 5:31 pm

Sprites consist of images/PNGs (spaceships) that have been imported and stored on a ”storage card”.
There is also one template graphic object for ”shots”.

The game plays out on a ”game area card”, to which sprite images/graphics are cloned from the storage card.
Sprites are moved using animationEngine command aeMoveTo, often with easing effects.

Images are also rotated by repeatedly setting their angle property. This is done by adding the img id to a list that is iterated through (”send in 10 millisecs”) until each image has reached its target angle.

An image may move and rotate simultaneously, and several (up to some 20) images can do this simultaneously, although normally around 1-8 are involved each round.
Shots graphics may be moving at the same time (up to max 10-12). Collision detection is in that case continuously going on until all shots are off the ”shot move list”. I couldn’t get animationEngine’s collision detection function to work properly, so I built my own, very similar.

Images have layerMode ”dynamic”.
bufferHiddenImages is set to true in openStack.
acceleratedRendering is set to true when there is movement.

In LC pre 9.5.0 dp1 the images are simply cloned to the card.
In LC 9.5.0 dp1 the images are placed into a predefined group. The group has its layerMode set to ”container”. Animation performance appears the same though, I get no visible difference.

When a smaller number of sprites are moving, animation appears reasonable smooth. It’s when the action heats up, with several ships and shots moving, that animation gets stuttered, and collision detections ”falls behind” and starts to fail. The message queue gets choked, it seems.

It’s still acceptable for an enjoyable playing experience on the whole, but it doesn’t look as professional, as polished, as I would like it to. But maybe I’m too much of a perfectionist… 8)
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Space game to test - can animation be improved?

Post by richmond62 » Wed Jul 03, 2019 6:04 pm

Seems very complicated to me.

I tend to animate using no animation engine; merely individual frame images
or sprite sheets shown in some sort of framing object:

individual frames in a graphic, sprites sheets in an image.

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Thu Jul 04, 2019 11:05 am

Well, to put it more simply, the animations consist of:
- images moving from point a to point b
- images rotating
- graphics moving from point a to point b

And then collision detection for graphics on specified images.

Sprite sheets might be applicable for the rotation part, although I fear it would take quite a number of sprite versions to ensure a smooth rotation illusion. And rotation and movement must sometimes happen simultaneously, so I'm not sure it would improve animation smoothness in the end.

I'll keep this possibility in mind though, as it is at least a different approach that could be worth testing, if nothing better comes up here.
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Space game to test - can animation be improved?

Post by richmond62 » Thu Jul 04, 2019 6:52 pm

I'm a slob, and frankly working out the magic numbers for the sprite sheets seems too much like hard work.

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Thu Apr 30, 2020 12:48 pm

Do what, exactly?
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Space game to test - can animation be improved?

Post by Klaus » Thu Apr 30, 2020 12:58 pm

SWEdeAndy wrote:
Thu Apr 30, 2020 12:48 pm
Do what, exactly?
Delete a SPAMMER, Andy! :-)

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Thu Apr 30, 2020 1:04 pm

Klaus wrote:
Thu Apr 30, 2020 12:58 pm
SWEdeAndy wrote:
Thu Apr 30, 2020 12:48 pm
Do what, exactly?
Delete a SPAMMER, Andy! :-)
Ah! Well, I should've figured as much. Got excited, as replies are rare enough in this thread... :(
Thanks Klaus!
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Space game to test - can animation be improved?

Post by bogs » Thu Apr 30, 2020 2:23 pm

I actually wanted to thank our spam-bot visitor, I had meant to come back to this thread but had lost track of it :D
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Space game to test - can animation be improved?

Post by richmond62 » Fri May 01, 2020 12:36 pm

Why does an attempt to download from here:

https://andreasbergendal.se/SpaceNode/Downloads/

consistently crash my browser, so unable to
download?

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: Space game to test - can animation be improved?

Post by SWEdeAndy » Fri May 01, 2020 3:08 pm

Sorry about that, try downloading from my website instead:
https://wheninspace.se/en/mesmerize/spacenode/

The other link works for me, doesn't crash my browser (Firefox on Mac), so I don't know what might cause the problem you experience.
But since the original posting I released the game on my site, so it's better to go the official way. (I've now changed the link in the original post too.)

I have a short movie in the making, as introduction to the game (since today's youth don't like to read my verbose instructions... :roll: ).
But I believe you can read the summary intro page and then dive into the game without problems, and then just look things up if needed during gameplay. :)
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

Post Reply

Return to “Games”