Skip to content
Permalink
Browse files

New mesh animation system

Scrapped the old crappy animation system because it made absolutely
no sense and was horribly limiting. The new system is based on two
mechanisms. The first is a new section in PIE files called ANIMOBJ
that modify the position, rotation and scaling of frames for the
given mesh level. The second is a new directive in PIE files called
EVENT which tells the game to use a different model instead when
the given event is triggered for the game object, such as burning and
moving.

There used to be three animations systems in the game - texture
coordinate flipping, key frames, and skeletal. Key frames are now
merely expressed in terms of skeletal frames in which scaling for
all but the key frame is set to a fixed -1000, which disables the
frame entirely.

The reason that this information went into the PIE files is simply
because it was easier. Making a new file format when there is current
exactly two models with proper animation (supercyborg and oil derrick)
made little sense. In the long run we should reconsider the whole PIE
format.

Scaling now actually supported, in all three dimensions. It used to
possible to specify in ANI files, but was never used. Each level can
now have separate animation framerates and cycle counts (how many
times to run an animation, zero for infinity).

Currently implemented for structures and droid bodies (which includes
cyborg feet).

Currently supported animation event types: Movement, power generator
active, firing, and dying. All units can now have a dying animation.
However, babas no longer run around screaming before they die - this
was just too hard to generalize (and was pretty much broken anyway).

See documentation in doc/ for further details.
  • Loading branch information
perim committed May 2, 2015
1 parent caa66b8 commit af9c9137d231d4b2c1d4e5e1ffde0e86dc443b3c
Showing with 1,527 additions and 3,769 deletions.
  1. +0 −1 data/Makefile.am
  2. +0 −14 data/base/anims/anim.cfg
  3. +0 −91 data/base/anims/blderik.ani
  4. +0 −11 data/base/anims/cybd_run.ani
  5. +0 −8 data/base/anims/cybdpjmp.ani
  6. +0 −8 data/base/anims/cybdplnd.ani
  7. +0 −11 data/base/anims/cybdprun.ani
  8. +0 −8 data/base/anims/fireknee.ani
  9. +0 −9 data/base/anims/flamfall.ani
  10. +0 −9 data/base/anims/runanim.ani
  11. +0 −9 data/base/anims/runflame.ani
  12. +0 −9 data/base/anims/walkanim.ani
  13. +43 −1 data/base/components/bodies/cybd_run.pie
  14. +1 −0 data/base/components/bodies/cybd_std.pie
  15. +0 −2 data/base/components/bodies/cybdpjmp.pie
  16. +0 −1 data/base/components/bodies/cybdplnd.pie
  17. +4 −1 data/base/components/bodies/exbloke.pie
  18. +21 −1 data/base/components/bodies/flamfall.pie
  19. +21 −1 data/base/components/bodies/runanim.pie
  20. +21 −1 data/base/components/bodies/runflame.pie
  21. +52 −0 data/base/structs/blderik.pie
  22. +0 −12 data/base/wrf/basic.wrf
  23. +0 −15 data/mp/anims/anim.cfg
  24. +79 −1 data/mp/components/bodies/scbd_run.pie
  25. +1 −0 data/mp/components/bodies/scbd_std.pie
  26. +0 −13 data/mp/wrf/basic.wrf
  27. +24 −0 doc/Animation.markdown
  28. +143 −0 doc/PIE.markdown
  29. +1 −6 lib/gamelib/Makefile.am
  30. +0 −344 lib/gamelib/anim.cpp
  31. +0 −86 lib/gamelib/anim.h
  32. +191 −274 lib/gamelib/audp_lexer.cpp
  33. +0 −5 lib/gamelib/audp_lexer.lpp
  34. +439 −757 lib/gamelib/audp_parser.cpp
  35. +62 −61 lib/gamelib/audp_parser.h
  36. +2 −108 lib/gamelib/audp_parser.ypp
  37. +1 −5 lib/gamelib/gamelib.vcxproj
  38. +1 −13 lib/gamelib/gamelib.vcxproj.filters
  39. +0 −406 lib/gamelib/hashtable.cpp
  40. +0 −195 lib/gamelib/hashtable.h
  41. +98 −59 lib/ivis_opengl/imdload.cpp
  42. +25 −0 lib/ivis_opengl/ivisdef.h
  43. +25 −0 lib/ivis_opengl/piematrix.cpp
  44. +9 −6 lib/ivis_opengl/piematrix.h
  45. +1 −1 lib/ivis_opengl/pietypes.h
  46. +3 −6 lib/sound/audio.cpp
  47. +0 −18 macosx/Warzone.xcodeproj/project.pbxproj
  48. +0 −3 src/Makefile.am
  49. +0 −3 src/Warzone2100.vcxproj
  50. +0 −9 src/Warzone2100.vcxproj.filters
  51. +0 −36 src/anim_id.h
  52. +0 −232 src/animobj.cpp
  53. +0 −75 src/animobj.h
  54. +3 −2 src/basedef.h
  55. +2 −1 src/baseobject.cpp
  56. +0 −35 src/bucket3d.cpp
  57. +0 −1 src/bucket3d.h
  58. +30 −42 src/component.cpp
  59. +0 −46 src/data.cpp
  60. +57 −251 src/display3d.cpp
  61. +3 −2 src/display3d.h
  62. +36 −117 src/droid.cpp
  63. +0 −3 src/droid.h
  64. +0 −1 src/feature.cpp
  65. +89 −120 src/game.cpp
  66. +1 −41 src/init.cpp
  67. +0 −4 src/loop.cpp
  68. +20 −99 src/move.cpp
  69. +0 −1 src/multigifts.cpp
  70. +0 −1 src/multistruct.cpp
  71. +1 −1 src/objmem.cpp
  72. +2 −14 src/order.cpp
  73. +1 −1 src/orderdef.h
  74. +0 −1 src/projectile.cpp
  75. +2 −0 src/qtscriptfuncs.cpp
  76. +12 −40 src/structure.cpp
@@ -10,7 +10,6 @@ stamp:

BASELIST = \
palette.txt \
anims \
audio \
campaigns \
components \

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -47,6 +47,13 @@ POLYGONS 16
200 3 20 14 22 29 201 39 213 29 213
200 3 25 21 24 39 187 29 187 29 199
200 3 25 24 15 39 187 29 199 39 199
ANIMOBJECT 166 0 6
0 0 0 0 0 0 0 1000 1000 1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 -1000 -1000 -1000
4 0 0 0 0 0 0 -1000 -1000 -1000
5 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 2
POINTS 24
12 0 -10
@@ -90,6 +97,13 @@ POLYGONS 16
200 3 18 12 20 40 201 49 213 40 213
200 3 23 19 22 49 187 40 187 40 199
200 3 23 22 13 49 187 40 199 49 199
ANIMOBJECT 166 0 6
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 1000 1000 1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 -1000 -1000 -1000
4 0 0 0 0 0 0 -1000 -1000 -1000
5 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 3
POINTS 26
12 0 8
@@ -135,6 +149,13 @@ POLYGONS 16
200 3 22 12 20 50 201 57 214 50 214
200 3 25 24 23 57 187 50 187 50 200
200 3 25 23 13 57 187 50 200 57 200
ANIMOBJECT 166 0 6
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 1000 1000 1000
3 0 0 0 0 0 0 -1000 -1000 -1000
4 0 0 0 0 0 0 -1000 -1000 -1000
5 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 4
POINTS 26
-4 9 -15
@@ -180,6 +201,13 @@ POLYGONS 16
200 3 23 22 15 39 201 29 213 39 213
200 3 20 25 14 29 187 39 187 39 199
200 3 20 14 24 29 187 39 199 29 199
ANIMOBJECT 166 0 6
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 1000 1000 1000
4 0 0 0 0 0 0 -1000 -1000 -1000
5 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 5
POINTS 24
-4 0 -10
@@ -223,6 +251,13 @@ POLYGONS 16
200 3 21 20 13 49 201 40 213 49 213
200 3 18 23 12 40 187 49 187 49 199
200 3 18 12 22 40 187 49 199 40 199
ANIMOBJECT 166 0 6
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 -1000 -1000 -1000
4 0 0 0 0 0 0 1000 1000 1000
5 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 6
POINTS 26
-4 0 8
@@ -267,4 +302,11 @@ POLYGONS 16
200 3 22 21 20 57 201 50 201 50 214
200 3 22 20 13 57 201 50 214 57 214
200 3 25 24 12 50 187 57 187 57 200
200 3 25 12 23 50 187 57 200 50 200
200 3 25 12 23 50 187 57 200 50 200
ANIMOBJECT 166 0 6
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 -1000 -1000 -1000
4 0 0 0 0 0 0 -1000 -1000 -1000
5 0 0 0 0 0 0 1000 1000 1000
@@ -1,6 +1,7 @@
PIE 2
TYPE 200
TEXTURE 0 page-14-droid-hubs.png 256 256
EVENT 1 cybd_run.pie
LEVELS 1
LEVEL 1
POINTS 26
@@ -115,7 +115,6 @@ POLYGONS 44
200 3 63 56 57 118 197 112 186 112 197
CONNECTORS 1
-16 4 40

LEVEL 2
POINTS 62
-4 1 3
@@ -227,7 +226,6 @@ POLYGONS 44
200 3 61 54 55 118 197 112 186 112 197
CONNECTORS 1
-16 4 40

LEVEL 3
POINTS 64
-4 8 16
@@ -115,7 +115,6 @@ POLYGONS 44
200 3 63 56 57 118 197 112 186 112 197
CONNECTORS 1
-16 4 40

LEVEL 2
POINTS 62
-4 1 -7
@@ -1,6 +1,9 @@
PIE 2
TYPE 200
TEXTURE 0 page-7-barbarians-arizona.png 256 256
EVENT 1 runanim.pie
EVENT 2 fireknee.pie
EVENT 3 flamfall.pie
LEVELS 1
LEVEL 1
POINTS 16
@@ -30,4 +33,4 @@ POLYGONS 10
4200 3 11 10 9 2 1 8 18 7 146 1 146 1 162
4200 3 11 9 8 2 1 8 18 7 146 1 162 7 162
4200 3 15 14 13 2 1 8 18 158 98 152 98 152 114
4200 3 15 13 12 2 1 8 18 158 98 152 114 158 114
4200 3 15 13 12 2 1 8 18 158 98 152 114 158 114
@@ -25,6 +25,11 @@ POLYGONS 8
200 3 7 5 4 38 235 50 255 38 255
200 3 11 10 9 24 232 16 232 16 255
200 3 11 9 8 24 232 16 255 24 255
ANIMOBJECT 250 1 4
0 0 0 0 0 0 0 1000 1000 1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 2
POINTS 14
-11 46 -21
@@ -50,6 +55,11 @@ POLYGONS 8
200 3 9 7 6 25 234 37 255 25 255
200 3 13 12 11 138 195 126 195 126 221
200 3 13 11 10 138 195 126 221 138 221
ANIMOBJECT 250 1 4
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 1000 1000 1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 3
POINTS 12
-2 9 9
@@ -73,6 +83,11 @@ POLYGONS 8
200 3 7 5 4 153 222 169 250 153 250
200 3 11 10 9 16 232 24 232 24 255
200 3 11 9 8 16 232 24 255 16 255
ANIMOBJECT 250 1 4
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 1000 1000 1000
3 0 0 0 0 0 0 -1000 -1000 -1000
LEVEL 4
POINTS 14
-4 -5 -1
@@ -97,4 +112,9 @@ POLYGONS 8
200 3 9 8 7 126 195 138 195 138 221
200 3 9 7 6 126 195 138 221 126 221
200 3 13 12 11 37 234 25 234 25 255
200 3 13 11 10 37 234 25 255 37 255
200 3 13 11 10 37 234 25 255 37 255
ANIMOBJECT 250 1 4
0 0 0 0 0 0 0 -1000 -1000 -1000
1 0 0 0 0 0 0 -1000 -1000 -1000
2 0 0 0 0 0 0 -1000 -1000 -1000
3 0 0 0 0 0 0 1000 1000 1000

0 comments on commit af9c913

Please sign in to comment.
You can’t perform that action at this time.