Jump to content
Sign in to follow this  
crazy_Baboon

Help converting .ac into .dae 3D format

Recommended Posts

Hi,

I am trying to adapt 3D models from FlightGear and use them in 0ad.

FlightGear models are stored in the .ac format, while 0ad uses collada .dae.

In Blender 2.82, I have successfully imported an .ac model, but when i try to convert it to  collada (.dae), the model appears to loose its texture:

The .ac file in Blender:

1472382709_Screenshotfrom2020-03-2109-32-36.thumb.png.78898dd86e2df239dc9f0e58c87d6280.png

The converted .dae file in 0ad:

1320417309_Screenshotfrom2020-03-2109-32-18.thumb.png.fb8aed9ee57bed187dcb2621f5748460.png

 

Does anyone know why the texture is not showing in the collada .dae file?

How do I fix this?

 

Thanks!

 

 

Edited by crazy_Baboon
  • Like 1

Share this post


Link to post
Share on other sites

Hey @crazy_Baboon Nice to see someone more in the modelling business!

To answer your question unlike flightgear textures, ours are not bundled with 3DModels but separately. 

You need to export them in a format the game knows, preferably .PNG but it can also be .DDS, or .TGA. 

Then you need to bind the textures using an actor file. This file defines the 3D Model as well as the variations and a few other things.

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi @Stan`,

I have got the texture .png for the .ac file. These are the files I have:

- catering_truck.dae

- CCS_catering_truck1.png

Say I would like to replace the gaul barracs with it, so there is no animation involved (assuming this is another issue).

Which files would I have to edit to replace the barracs by the truck?

Share this post


Link to post
Share on other sites
3 minutes ago, crazy_Baboon said:

Hi @Stan`,

I have got the texture .png for the .ac file. These are the files I have:

- catering_truck.dae

- CCS_catering_truck1.png

Say I would like to replace the gaul barracs with it, so there is no animation involved (assuming this is another issue).

Which files would I have to edit to replace the barracs by the truck?

You'd have to edit this file

binaries/data/mods/public/art/actors/structures/celts/barracks.xml

https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/actors/structures/celts/barracks.xml

And replace its content by something like

<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
  <castshadow/>
  <group>
    <variant frequency="1" name="Base">
      <mesh>structural/catering_truck1.dae</mesh>
      <textures>
        <texture file="CCS_catering_truck1.png" name="baseTex"/>
      </textures>
    </variant>
  </group>
  <group>
    <variant name="alive" frequency="1"/>
    <variant name="death" frequency="0"/>
  </group>
  <material>default.xml</material>
</actor>

As a general rule of thumb I would avoid capitalization in file names.  I would also use _01 to make modding nicer. If possible I would also keep the names identical like so

ccs_catering_truck_01.dae
ccs_catering_truck_01.png

This line

<texture file="CCS_catering_truck1.png" name="baseTex"/>

Means the game will look for a texture in

binaries/data/mods/public/art/textures/skins/

Add subfolders accordingly.

This line

  <material>default.xml</material>

Means that it will only use the diffuse texture and nothing else.

  • Thanks 1

Share this post


Link to post
Share on other sites

The current spot in the actor above

binaries/data/mods/public/art/meshes/structural/

Default is

binaries/data/mods/public/art/meshes/

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Many thanks @Stan`

However, looking at the error message, this does not seem too easy:

ERROR: Failed to find matching prop point called "projectile" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Failed to find matching prop point called "smoke" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Failed to find matching prop point called "projectile" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Failed to find matching prop point called "smoke" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Model 'art/meshes/structural/ccs_catering_truck_01' has no UV1 set.
ShaderProgram.cpp(891): Assertion failed: "(m_StreamFlags & ~m_ValidStreams) == 0"
Assertion failed: "(m_StreamFlags & ~m_ValidStreams) == 0"
Location: ShaderProgram.cpp:891 (AssertPointersBound)

Call stack:

(0x562bf55b2265) ./pyrogenesis(+0x627265) [0x562bf55b2265]
(0x562bf554fd91) ./pyrogenesis(+0x5c4d91) [0x562bf554fd91]
(0x562bf55515e4) ./pyrogenesis(+0x5c65e4) [0x562bf55515e4]
(0x562bf5551cdb) ./pyrogenesis(+0x5c6cdb) [0x562bf5551cdb]
(0x562bf5379e76) ./pyrogenesis(+0x3eee76) [0x562bf5379e76]
(0x562bf545bafc) ./pyrogenesis(+0x4d0afc) [0x562bf545bafc]
(0x562bf53b0a85) ./pyrogenesis(+0x425a85) [0x562bf53b0a85]
(0x562bf53c5034) ./pyrogenesis(+0x43a034) [0x562bf53c5034]
(0x562bf53c8f1c) ./pyrogenesis(+0x43df1c) [0x562bf53c8f1c]
(0x562bf53c9a67) ./pyrogenesis(+0x43ea67) [0x562bf53c9a67]
(0x562bf52311b1) ./pyrogenesis(+0x2a61b1) [0x562bf52311b1]
(0x562bf5033e90) ./pyrogenesis(+0xa8e90) [0x562bf5033e90]
(0x562bf50387a5) ./pyrogenesis(+0xad7a5) [0x562bf50387a5]
(0x562bf5023b4e) ./pyrogenesis(+0x98b4e) [0x562bf5023b4e]
(0x7f8fd28ff1e3) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f8fd28ff1e3]
(0x562bf503217e) ./pyrogenesis(+0xa717e) [0x562bf503217e]

errno = 0 (Try again later)
OS error = ?

Do you have a suggestion?

Share this post


Link to post
Share on other sites

That's because the barracks expect to be able to shoot projectiles. Your new 3D model does not have that prop point. For more information about propppints i can give you a libk to one of my videos.

For the matter at hand (the crash) however I can think of multiple potential issues 

The 3Dmodel you want to import has more than one material.

You forgot to change the material to default.xml which made the game crash

For the other matter I guess one could remove the attack component

In binaries/data/mods/public/simulation/templates/structures/gauls_barracks.xml

Share this post


Link to post
Share on other sites

@Stan`

I did not know the barracks can shoot projectiles :)

However, i cannot find an attack component on them:

binaries/data/mods/public/simulation/templates/structures/gaul_barracks.xml:

<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
  <Cost>
    <PopulationBonus>4</PopulationBonus>
  </Cost>
  <Footprint>
    <Square width="22.0" depth="22.0"/>
    <Height>5.0</Height>
  </Footprint>
  <Health>
    <SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
  </Health>
  <Identity>
    <Civ>gaul</Civ>
    <SpecificName>Coriosedlon</SpecificName>
  </Identity>
  <Obstruction>
    <Static width="20.0" depth="20.0"/>
  </Obstruction>
  <ProductionQueue>
    <Entities datatype="tokens">
      units/{civ}_champion_infantry_barracks
      units/{civ}_champion_cavalry_barracks
    </Entities>
    <Technologies datatype="tokens">
      unlock_champion_units
    </Technologies>
  </ProductionQueue>
  <VisualActor>
    <Actor>structures/celts/barracks.xml</Actor>
    <FoundationActor>structures/fndn_6x6.xml</FoundationActor>
  </VisualActor>
</Entity>

 

Edited by crazy_Baboon

Share this post


Link to post
Share on other sites

See this line

<Entity parent="template_structure_military_barracks">

This means it's inheriting stuff from

binaries/data/mods/public/simulation/templates/template_structure_military_barracks.xml

In this case I believe it's Building AI

You can add

  <BuildingAI disable=""/>

in the template. I guess using a building template for a truck was not the greatest idea :D

Anyway it won't solve your issues. I would seem you didn't change the actor completely. If it complains about

ERROR: Failed to find matching prop point called "projectile" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Failed to find matching prop point called "smoke" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Failed to find matching prop point called "projectile" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"
ERROR: Failed to find matching prop point called "smoke" in model "art/meshes/structural/ccs_catering_truck_01.dae" for actor "barracks"

That means those are still referenced in the actor, and you didn't use the example I provided.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks @Stan`

i have used your example barracks.xml. The error I am getting now is:

GAME STARTED, ALL INIT COMPLETE
ERROR: Could not load mesh 'art/meshes/structural/css_catering_truck_01.dae'
ERROR: CObjectEntry::BuildVariation(): Model art/meshes/structural/css_catering_truck_01.dae failed to load
ERROR: Could not load mesh 'art/meshes/structural/css_catering_truck_01.dae'
ERROR: CObjectEntry::BuildVariation(): Model art/meshes/structural/css_catering_truck_01.dae failed to load
TIMER| common/modern/setup.xml: 229.607 us
TIMER| common/modern/styles.xml: 225.238 us
TIMER| common/modern/sprites.xml: 1.48907 ms
TIMER| msgbox/msgbox.xml: 13.2327 ms

I have checked and the file art/meshes/structural/css_catering_truck_01.dae does exit.

 

ps. I cannot figure out how to get the barracks to attack anything.

Edited by crazy_Baboon

Share this post


Link to post
Share on other sites

Barracks have 0 arrows by default, so they cannot attack.

In this case look for typos. did you make a mod or modify the game directly?

Share this post


Link to post
Share on other sites

Hi @Stan`,

Quote

In this case look for typos.

 

Is there a tool like gdb that could point to these "typos"?

 

Quote

did you make a mod or modify the game directly?

I am modifying the git master folder directly.

 

 

Also,

Quote

Barracks have 0 arrows by default, so they cannot attack.

but you mentioned

Quote

That's because the barracks expect to be able to shoot projectiles.

I'm confused.

 

ps: what does "prop point." stand for?

 

Share this post


Link to post
Share on other sites
1 minute ago, crazy_Baboon said:

Is there a tool like gdb that could point to these "typos"?

Maybe source/tools/entity/checkrefs.pl

2 minutes ago, crazy_Baboon said:

I am modifying the git master folder directly.

I think it would better for you to make a separate mod :) Let me know if I can help.

3 minutes ago, crazy_Baboon said:

I'm confused.

Sorry about that. I referred to the projectile error which can have two causes. Either the building is trying to shoot or there is no projectile prop point.

4 minutes ago, crazy_Baboon said:

ps: what does "prop point." stand for?

Prop points are blender empty objects parented to the mesh which allows one to make object pop randomly at certain spots. Like a barrel for instance.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
9 minutes ago, crazy_Baboon said:

BTW what is the advantage of creating a mod vs hacking the git folder?

No git conflict when getting latest version, easy to share the mod to figure issues, easy to put it on a versioning system such as Git and usually cleaner :)

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...