New animation system is finally in

Improving the artwork in Warzone2100 - not for mod discussions
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: New animation system is finally in

Post by Jorzi »

Hi, sorry, in retrospect mixed up the two ways of doing it because I tried both approaches.
Approach 1: place origin at world origin, rotate and inverse translate the object for every frame.
Approach 2: place origin at pivot, translate object to the proper position and then just rotate it for each frame.
So my ani files were approach 2 and my meshes were from approach 1, sorry about that.
ImageImage
-insert deep philosophical statement here-
MIH-XTC
Trained
Trained
Posts: 368
Joined: 31 Jan 2014, 07:06

Re: New animation system is finally in

Post by MIH-XTC »

Does anyone know the name of the .pie file responsible for the rings around the power generator? I thought it was effects/fxpower.pie but that turns out to be some other animated effect on the power generator. I don't know how to view .pie models, I just edit them in a text editor.

I doubled the size of a power generator just by multiplying all vertices by two and everything works great except now the rings don't line up and they're not viewable because the generator is 2x taller. Players won't be able to tell how many oils they have if they can't see the # of rings and I don't know which file contains that animation.
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: New animation system is finally in

Post by Berg »

If you deleted or did not modify the connection data at the very bottom you effect is either not in the model or is inside too low to be seen.
Plus you will need to double the fxpower model pie to have it bigger that's if it is the effect.
Remember the height data is the 3rd number you might need to double it too in the connector data at the very bottom of file.
MIH-XTC
Trained
Trained
Posts: 368
Joined: 31 Jan 2014, 07:06

Re: New animation system is finally in

Post by MIH-XTC »

Berg wrote: 08 Jul 2019, 20:16 If you deleted or did not modify the connection data at the very bottom you effect is either not in the model or is inside too low to be seen.
Plus you will need to double the fxpower model pie to have it bigger that's if it is the effect.
Remember the height data is the 3rd number you might need to double it too in the connector data at the very bottom of file.
The ring effect is inside the model too low to be seen but I don't know which file the ring effect is stored in. I doubled the values in fxpower.pie but the rings did not move so apparently it's not that file.

The power generator uses these pie files:
blpower0.pie
power_module4.pie
blpower4.pie
blbpower.pie

I copied each file, appended ar to the new file names and doubled all the "POINTS" values.


blpower0ar.pie
power_module4ar.pie
blpower4ar.pie
blbpowerar.pie
new_pow_gen_model.zip
(5) .pie files for new 4x4 power generator
(4.28 KiB) Downloaded 371 times



The new generator is 4x4 and renders correctly but the rings did not move. I also don't know how to tell the new blpower0ar.pie to use the effect in the new fxpowerar.pie. (I need to maintain the original effect as well). The connection between fxpower.pie and the power generator model is not specified anywhere and I don't know how animation scripting works.

Image
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: New animation system is finally in

Post by Berg »

welcome to the animated land of Warzone2100
Forgon
Code contributor
Code contributor
Posts: 298
Joined: 07 Dec 2016, 22:23

Re: New animation system is finally in

Post by Forgon »

MIH-XTC wrote: 08 Jul 2019, 21:33
Berg wrote: 08 Jul 2019, 20:16 If you deleted or did not modify the connection data at the very bottom you effect is either not in the model or is inside too low to be seen.
Plus you will need to double the fxpower model pie to have it bigger that's if it is the effect.
Remember the height data is the 3rd number you might need to double it too in the connector data at the very bottom of file.
The ring effect is inside the model too low to be seen but I don't know which file the ring effect is stored in. I doubled the values in fxpower.pie but the rings did not move so apparently it's not that file.

The power generator uses these pie files:
blpower0.pie
power_module4.pie
blpower4.pie
blbpower.pie

I copied each file, appended ar to the new file names and doubled all the "POINTS" values.


blpower0ar.pie
power_module4ar.pie
blpower4ar.pie
blbpowerar.pie
new_pow_gen_model.zip




The new generator is 4x4 and renders correctly but the rings did not move. I also don't know how to tell the new blpower0ar.pie to use the effect in the new fxpowerar.pie. (I need to maintain the original effect as well). The connection between fxpower.pie and the power generator model is not specified anywhere and I don't know how animation scripting works.

Image
Look at structureEffectsPlayer() in src/display3d.cpp.
MIH-XTC
Trained
Trained
Posts: 368
Joined: 31 Jan 2014, 07:06

Re: New animation system is finally in

Post by MIH-XTC »

Forgon wrote: 09 Jul 2019, 08:28 Look at structureEffectsPlayer() in src/display3d.cpp.

Thank you.

It looks like what I'm trying to do is not going to work because it would require having 2 sets of spirals at the same time; one spiral for the large generator and 1 spiral for the small.

But according to structureEffectsPlayer() the position and size of the rings are hardcoded on lines 3547 and 3553 to be 32 wide and 64 off the ground. I could try to rewrite the logic to check for if small or large generator but... I'll come back to that thought. For now this is just cosmetic.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Heloooooooo and happy new year :)
i was showing my son this project, as he is starting to use scratch to make his first games and asked me what i was interested in before.
Ten, i remembered i was into animations and looked for this thread. I then tried to use it in blender and it was too old to work. So i fed it to ChatGPT 3.5 and it explained the changes needed. Then generated a new version. And behold it is working:

Code: Select all

ANIMOBJECT 15 0 15
		0	0	0	0	0	0	0	1.0	1.0	1.0
		1	-62500	78125	78125	0	0	7031	1.0	1.0	1.0
		2	-200000	250000	250000	0	0	22500	1.0	1.0	1.0
		3	-337500	421875	421875	0	0	37969	1.0	1.0	1.0
		4	-400000	500000	500000	0	0	45000	1.0	1.0	1.0
		5	-400000	396000	500000	12199	7859	39676	1.0	1.0	1.0
		6	-400000	148000	500000	35249	16332	24497	1.0	1.0	1.0
		7	-400000	-148000	500000	59303	13574	8242	1.0	1.0	1.0
		8	-400000	-396000	500000	80671	4618	760	1.0	1.0	1.0
		9	-400000	-500000	500000	90000	0	0	1.0	1.0	1.0
		10	-358400	-448000	448000	80640	0	0	1.0	1.0	1.0
		11	-259200	-324000	324000	58320	0	0	1.0	1.0	1.0
		12	-140800	-176000	176000	31680	0	0	1.0	1.0	1.0
		13	-41600	-52000	52000	9360	0	0	1.0	1.0	1.0
		14	0	0	0	0	0	0	1.0	1.0	1.0
Its based on the 3.3.0 version. I don't know if someone needs it but the export script is attached.
I always wanted to revisit this project, but life had other plans.
Attachments
wz_anim_export_gpt.py
(3.32 KiB) Downloaded 22 times
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

astorian wrote: 09 Jan 2024, 22:52 Heloooooooo and happy new year :)
Its based on the 3.3.0 version. I don't know if someone needs it but the export script is attached.
Hi :wink:
Blender scripts were updated awhile ago to support new features
https://github.com/Warzone2100/warzone2 ... /pie_addon
Image
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Hi MaNGusT,
That is great news! I checked the link and it looks awesome.
I have to try it out.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Unfortunately i have trouble installing the addon. I downloaded three 2.9x blender versions, installed both from zip and manually.
Refreshed,but the pie_addon is not visible for enabling. Did anyone encountered this issue?
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

Tried for 2.93.9, all 4 scripts must be in the pie_addon folder in the zip
Attachments
pie_addon.zip
(12.08 KiB) Downloaded 21 times
Image
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Oh, of course. I did not copy the __init__.py into the zip.
Now it works. I have tested the import with few files and it worked for most of the files.
Some gave me an error in parsing like blhq.pie. Also blderik.pie works, but blderik_anim.pie not.
Is it because of the file format changes? Is there some documentation i can look into?
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: New animation system is finally in

Post by MaNGusT »

blhq.pie is PIE4. You should change it to PIE3 and delete tcmask line.
Don't know about blderik_anim.pie, WMIT opens it correctly
Image
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

PIE4? i only know of PIE2 and PIE3 from the wiki https://developer.wz2100.net/wiki/PIE_format
Is the the PIE4 described somewhere?
I sucesfully build WMIT and opened blderik_anim.pie.
Post Reply