You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by MosheLevi, Mister SCP

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: How To Fly AOE3 Units - Tutorial
posted 12-29-05 02:27 AM EDT (US)   
AOE3 Flight School 101

Introduction

Since the early days of AOM, designers seemed to be fascinated with perching units up on anything that would support them. Walls, buildings and towers were favorites. Yet the process used up to now, that is creating a small hill using the elevation tool and hiding the hill with a model has severe limitations, and during levels, often when the building that's hiding the hill was destroyed, you were left with an unsightly hill that gave away the illusion. Also in AOE3, since there's no impassable terrains, it is hard to get units to stay put atop their little hill perches.

I posted the above shots in the eye candy thread and the boys asked me to explain how it was accomplished. Well I bribed them into making me a banner for my project in exchange for sharing the secret, and since Kastor agreed to help me make my banner, here is the technique as promised.

The Secret is the Flying Units

I first got the idea while playing AOM, and observing the flying units like the Nidhogg and Pegasus. Although I didn't try the technique until AOE3, I couldn't wait to try it as soon as I saw the hot air balloons. Notice that all flying units maintain a certain distance from the ground. The next question was, what exactly determines a flying unit?

The Magical Proto File

This technique requires modding the proto.xml file so if you undertake this process you'll have to learn a bit about modding this file. I won't cover it here but suffice it to say you should back up your original proto for safety, and restore the original proto file if you plan on playing on-line or watching replays. Otherwise you'll get OOS errors.

If we look at any land based unit's proto definition we see one line that defines it as a land based unit:


(MovementType)land(/MovementType)

Alternatively if we look at a flying unit, we see these lines:

(MovementType)air(/MovementType)
(Flag)FlyingUnit(/Flag)

And those two lines are the key. You'll first select what unit you want to "fly". In my case I chose the SPC Buccaneer since they look good perched up on ship's rigging. With a text editor open up the proto.xml file, its found in the Program Files/Microsoft Games/AOE3/data folder. The entry starts and ends with these lines respectively:

(Unit id ='549' name ='SPCBuccaneer')
(/Unit)

Copy and paste that proto entry between the last line of the last proto entry and the very last line of the proto file. If you haven't modded your proto, the last entry will be the Moon Bass and where the XXXXX is below is where you'll insert the proto entry for the new flying buccaneer.

(Unit id ='620' name ='FishMoonBass')
.....
.....
(/Unit)

XXXXX

(/Proto)

Once you've pasted the buccaneer's proto entry in that space, make sure to use a new ID number, which would be 621 if your proto hasn't been altered before. I like to rename the new unit something else although you don't have to since new proto entries get a symbol put in front of them automatically in the editor object list. I called my "SpecialBuccaneer". I also like to change these two lines:

(DisplayNameID)35253(/DisplayNameID)
(EditorNameID)35254(/EditorNameID)

and replace the numbers with the name "Special Buccaneer" without the quotes.

Next alter this line of the buccaneer's proto:

(MovementType)land(/MovementType)

to

(MovementType)air(/MovementType)

and add this line:

(Flag)FlyingUnit(/Flag)

where you see other entries that start with the (Flag) argument. As far as I can see, it doesn't matter if this entry is first, last, or in the middle, but I put in with the other entries that start with the argument.

And that's it, we're ready to test our flying buccaneer! Just make sure not to disturb any other code in the proto file. Save as an UTF-8 encoded file with the name proto.xml in the folder defined above.

Final Touches in the Editor

Fire up AOE3, open the editor, and open the place units tool. Select the Special Buccaneer off the list and place him on the map. You'll notice he floats about 15 units above the ground, and that's higher than anything in the game - save other flying units. You'll also notice he follows the terrain just like the balloon does - that is the height is constant so if he walks over a hill, he goes up.

The ICG Galleon model is great for placing flying units on since the model's origin is well away from most of the crow's nests and rigging. Slide the buccaneer into position near the crow's nest for example, then use the elevation tool with the smallest brush setting, and elevate the ground down underneath the buccaneer to bring him level with the surface you want him to rest on. The nice thing is, the buccaneer is free to move around as long as the ground directly beneath him is low and level. This is a vast improvement over the old method. If you can see his decal on the ground, all the easier to select the tile to lower.

And there it is! I hope you agree this technique is more refined than the old way and gives a better end result. Veterans can make the proto alterations very easily and for the newbies out there, when I get time I will update my HC units mod to include a couple of flying units so you don't have to mess with your proto yourself.

Happy designing and I can't wait to see my new banner and make my project announcement!


_.,-=~+"^'`*`'^"+~=-,._
Can't this editor fire triggers off the same way twice?
Check out the new AOE 3 Trials Walk Through web site
The Dread Zone - my Flash Bio Site
––––•(-• •-)•––––

[This message has been edited by ToMyBoY (edited 03-09-2006 @ 08:38 PM).]

Replies:
posted 12-29-05 02:48 AM EDT (US)     1 / 17  
Damn, I thought you did it via triggers. I can't put anymore proto changes into my scn. I generally don't like modding too much. Just some mods to kill the editor bugs (no pitch, black map etc..) but nothing big.

No doubt this will be useful to others though=)

posted 12-29-05 03:43 AM EDT (US)     2 / 17  
I had nearly a similar idea, by changeing the unit type of the hot air ballon.
posted 12-29-05 03:50 AM EDT (US)     3 / 17  
do others require this mod for it to work for them?

Bah.
posted 12-29-05 05:50 AM EDT (US)     4 / 17  
Yes, otherwise the unit will still stand on the ground.

|| argalius.elpea.net
|| Cherub at AoE3H
|| In honor of FlipBizcut
|| Mod: The Age of Crusades
posted 12-29-05 09:37 AM EDT (US)     5 / 17  
can you let the flying object land? would be cool with the hot air balloon
posted 12-29-05 12:35 PM EDT (US)     6 / 17  
can you make mod that has every unit flying and non flying?
posted 12-29-05 05:48 PM EDT (US)     7 / 17  
TomyBoy, I did all that you have instructed, and I succeeded to make an airborne unit while editing, however, when I playtested, the unit became a land movement type and the whole effect was ruined. Have I done something wrong? Is it supposed to be that way?
posted 12-29-05 05:57 PM EDT (US)     8 / 17  

Quote:

can you make mod that has every unit flying and non flying?


That would be awesome. I'd be able to get my men to stand on walls!

| Botolf the Crazed |
There's treasure everywhere!
Winner of the Kman Lame Puns Award
posted 12-30-05 07:46 PM EDT (US)     9 / 17  
Looks like a great effect from the screenies
posted 12-30-05 10:34 PM EDT (US)     10 / 17  

Quote:

do others require this mod for it to work for them?


Like Argalius says, for the effect to work you have to have a modded proto.

Quote:

can you let the flying object land? would be cool with the hot air balloon

No. Adding a unit and modifying it is just a hack, and you couldn't really pull it off without having an animation. For a one-off maybe you could unit change between the two versions, but the transition wouldn't be fluid.

Quote:

when I playtested, the unit became a land movement type and the whole effect was ruined. Have I done something wrong? Is it supposed to be that way?

No, if you properly added and modified the unit, it should stay off the ground, unless its riding on a depression in the terrain. It should act just like the hot air balloon. So you're saying when you place it in the editor it floats, but when you play test it goes to the ground?

The next thing to figure out is how to adjust its height. I could swear I stumbled across the setting - I think at least - but I can't for the life of me find it again. If anyone is sifting through the files and sees the code defining the default height for flying units, TELL ME. That way maybe the height could be dialed in.

posted 01-02-06 09:29 PM EDT (US)     11 / 17  
Could you please tell us what your project is? It looks awesome from the screenies...

The RoL forum colors make me sooo hungry.
-Unit Costs for 5-Philbo1-Explorer Micro-
B_E looks like a demented evil smiley.-Botolf

Stonewall Pwns
posted 01-02-06 09:59 PM EDT (US)     12 / 17  
Thank you Philbo1 for your interest in my little project.

Kastor is busy working away on the banner and once that's done I will post a project announcement complete with screenies. I plan to release the cinematic as a preview and its being play tested as we speak. I handed the play testers a cine that was about 98% polished so I don't expect too much more fixing. It will probably go into the DL section by the end of this week and will provide a taste of what to expect in the map. Most of the nifty stuff is in the level and I'm working hard to complete it for a mid-February release.

All the best and I really appreciate your interest. GL and happy designing.

posted 01-02-06 10:10 PM EDT (US)     13 / 17  

Quote:

So you're saying when you place it in the editor it floats, but when you play test it goes to the ground?

Ya.


btw, i'm looking forward to your project.


Visit The EyeCandy Guild!
« « Co-Founder & Co-Leader » »
Forum‡Team
retired
posted 01-02-06 10:10 PM EDT (US)     14 / 17  
http://wiki.heavengames.com/age/Main_Page

Congrats, you made the article of the month!


oh you can wait for what I can give
you know what I am so you know how I live
try to look proud but you’re not in the slightest
its happening now and it’s always been like this.
posted 01-02-06 11:13 PM EDT (US)     15 / 17  
Hey crap. With the html enabled my formating for the proto entries is forked up. Anyone know how to fix that? OMG, don't follow those directions!!!

Quote:

Congrats, you made the article of the month!

Yay me. The cheque will follow, right? Papaya, did you get that thing okay?

zeuslord5000 you probably messed up in the proto somewhere since I have the units in my map and they work fine. I have no idea why they would float while editing then sink to the ground when testing. Did you add both lines to the proto? Try making the proto entry again, and if it still doesnt' work, maybe email me your proto as an attachment. I will install it in my game and test it. Just indicate what exactly you've called it in your proto so I can find it. Otherwise post the proto entry in this thread and let me look at it. I would be interested in seeing the effect for myself as it totally defies the coding if indeed your new unit is defined as a "flying one" with "air" movement.

My mail is tbarak@mts.net

[This message has been edited by ToMyBoY (edited 01-02-2006 @ 11:44 PM).]

posted 01-03-06 00:40 AM EDT (US)     16 / 17  
Here it is:

<Unit id ='657' name ='Elf'>
<DBID>53</DBID>
<DisplayNameID>Elf</DisplayNameID>
<EditorNameID>Elf</EditorNameID>
<PopulationCount>1</PopulationCount>
<ObstructionRadiusX>0.4900</ObstructionRadiusX>
<ObstructionRadiusZ>0.4900</ObstructionRadiusZ>
<FormationCategory>Ranged</FormationCategory>
<MaxVelocity>4.0000</MaxVelocity>
<MaxRunVelocity>6.0000</MaxRunVelocity>
<MovementType>air</MovementType>
<TurnRate>18.0000</TurnRate>
<AnimFile>units\infantry_ranged\longbow\longbow.xml</AnimFile>
<ImpactType>Flesh</ImpactType>
<PhysicsInfo>dude</PhysicsInfo>
<Icon>units\infantry_ranged\longbow\longbow_icon</I con>
<PortraitIcon>units\infantry_ranged\longbow\longbow_po rtrait</PortraitIcon>
<RolloverTextID>22978</RolloverTextID>
<ShortRolloverTextID>25652</ShortRolloverTextID>
<InitialHitpoints>95.0000</InitialHitpoints>
<MaxHitpoints>95.0000</MaxHitpoints>
<LOS>24.0000</LOS>
<ProjectileProtoUnit>Arrow</ProjectileProtoUnit>
<AutoAttackRange>16.0000</AutoAttackRange>
<UnitAIType>RangedCombative</UnitAIType>
<TrainPoints>30.0000</TrainPoints>
<Bounty>10.0000</Bounty>
<BuildBounty>10.0000</BuildBounty>
<Cost resourcetype ='Food'>60.0000</Cost>
<Cost resourcetype ='Wood'>40.0000</Cost>
<AllowedAge>1</AllowedAge>
<Armor type ='Ranged' value ='0.3000'></Armor>
<UnitType>LogicalTypeHealed</UnitType>
<UnitType>LogicalTypeValidSharpshoot</UnitType>
<UnitType>LogicalTypeNeededForVictory</UnitType>
<UnitType>LogicalTypeHandUnitsAutoAttack</UnitType& gt;
<UnitType>LogicalTypeLandMilitary</UnitType>
<UnitType>LogicalTypeScout</UnitType>
<UnitType>LogicalTypeValidSPCUnitsDeadCondition</Un itType>
<UnitType>LogicalTypeGarrisonInShips</UnitType>
<UnitType>LogicalTypeRangedUnitsAutoAttack</UnitTyp e>
<UnitType>LogicalTypeVillagersAttack</UnitType>
<UnitType>LogicalTypeHandUnitsAttack</UnitType>
<UnitType>LogicalTypeRangedUnitsAttack</UnitType> ;
<UnitType>LogicalTypeMinimapFilterMilitary</UnitTyp e>
<UnitType>Ranged</UnitType>
<UnitType>HasBountyValue</UnitType>
<UnitType>AbstractArcher</UnitType>
<UnitType>AbstractInfantry</UnitType>
<UnitType>Unit</UnitType>
<UnitType>Military</UnitType>
<UnitType>UnitClass</UnitType>
<UnitType>ConvertsHerds</UnitType>
<UnitType>AbstractRangedInfantry</UnitType>
<UnitType>CountsTowardMilitaryScore</UnitType>
<UnitType>AbstractCavalryInfantry</UnitType>
<UnitType>AbstractLightInfantry</UnitType>
<Flag>CollidesWithProjectiles</Flag>
<Flag>ApplyHandicapTraining</Flag>
<Flag>CorpseDecays</Flag>
<Flag>ShowGarrisonButton</Flag>
<Flag>DontRotateObstruction</Flag>
<Flag>ObscuredByUnits</Flag>
<Flag>Tracked</Flag>
<Flag>FlyingUnit</Flag>
<Command page ='10' column ='2'>Delete</Command>
<Command page ='10' column ='1'>Stop</Command>
<Command page ='10' column ='0'>Garrison</Command>
<Tactics>archer.tactics</Tactics>
<ProtoAction>
<Name>BuildingAttack</Name>
<Damage>10.000000</Damage>
<DamageType>Siege</DamageType>
<ROF>3.000000</ROF>
</ProtoAction>
<ProtoAction>
<Name>DefendHandAttack</Name>
<Damage>11.000000</Damage>
<DamageType>Hand</DamageType>
<ROF>1.500000</ROF>
</ProtoAction>
<ProtoAction>
<Name>DefendRangedAttack</Name>
<Damage>17.000000</Damage>
<DamageType>Ranged</DamageType>
<MinRange>2.000000</MinRange>
<MaxRange>22.000000</MaxRange>
<ROF>1.500000</ROF>
</ProtoAction>
<ProtoAction>
<Name>MeleeHandAttack</Name>
<Damage>11.000000</Damage>
<DamageType>Hand</DamageType>
<ROF>1.500000</ROF>
</ProtoAction>
<ProtoAction>
<Name>StaggerHandAttack</Name>
<Damage>11.000000</Damage>
<DamageType>Hand</DamageType>
<ROF>1.500000</ROF>
</ProtoAction>
<ProtoAction>
<Name>StaggerRangedAttack</Name>
<Damage>17.000000</Damage>
<DamageType>Ranged</DamageType>
<MinRange>2.000000</MinRange>
<MaxRange>22.000000</MaxRange>
<ROF>1.500000</ROF>
</ProtoAction>
<ProtoAction>
<Name>VolleyHandAttack</Name>
<Damage>11.000000</Damage>
<DamageType>Hand</DamageType>
<ROF>1.500000</ROF>
</ProtoAction>
<ProtoAction>
<Name>VolleyRangedAttack</Name>
<Damage>17.000000</Damage>
<DamageType>Ranged</DamageType>
<MinRange>2.000000</MinRange>
<MaxRange>22.000000</MaxRange>
<ROF>1.500000</ROF>
</ProtoAction>
</Unit>

The format is not for protoXML, as you can see.


Visit The EyeCandy Guild!
« « Co-Founder & Co-Leader » »
Forum‡Team
retired
posted 01-03-06 02:45 PM EDT (US)     17 / 17  
I had no luck replicating your problem. I recreated your proto entry in my own proto and tested it and the elf characters floated just fine. I thought maybe it was the DBID number, or placement of the "flying unit" line. I also tested to see if adding an AI to a comp player somehow sticks the objects back to the ground. In all cases they floated and remained floating during playtest.

Probably the only difference in our games is the version - that is I haven't installed the latest patch yet. But I don't see how it could be that since the patch didn't really deal with the engine. I am assuming your balloons float so I really don't understand the problem. Sorry, I wish I could of more help.

[This message has been edited by ToMyBoY (edited 01-03-2006 @ 02:45 PM).]

Age of Empires III Heaven » Forums » Scenario Design » How To Fly AOE3 Units - Tutorial
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Empires III Heaven | HeavenGames