Voxels

Information and discussion for custom maps and mods.
User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

secret wrote: Another thing: I tried replacing the Tick Tank with a different voxel, but I got this weird bug.
You will need to adjust the Scale property on RenderVoxels. It defaults to 10, which is about right for the default TS and RA2 voxels. I guess that custom model has a weird scale defined internally.
Petrenko wrote:

Code: Select all

Exception of type `System.InvalidOperationException`: Unit `renart` does not have any voxels defined.
There may be an error in your voxels.yaml. I'd need to see that before I could say any more.

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

Heyho,

yeah the scale trait works. Just needs a bit of try-and-error.

Also i forgot to add the vpl oder whatever. the other file used for the voxel.

Everything is fine now!
Hail to the soviets!

User avatar
secret
Posts: 62
Joined: Fri Aug 03, 2007 1:53 pm

Post by secret »

So, yeah, I decided to go with scale 0.5, and it works pretty fine for me, even if it's not very normal. However, there are some issues:
1. The voxel also has a barrel and a turret, but these aren't loaded.
2. There's some weird clipping on other voxels (???)
Here's the code. I'm also attaching the voxel, maybe it's something weird in it's format.

Code: Select all

LTNK:
	-RenderUnit:
	-WithTurret:
	RenderSprites:
	RenderVoxels:
		Image:ttnk
		PlayerPalette:tibsun
		Scale:0.7
	WithVoxelBody:

Code: Select all

LTNK:
	Inherits: ^Tank
	Valued:
		Cost: 6
	Tooltip:
		Name: Light Tank
		Icon: ltnkicnh
		Description: Fast, light tank.\n  Strong vs Vehicles, Tanks\n  Weak vs Infantry, Aircraft
	Buildable:
		BuildPaletteOrder: 40
		Prerequisites: proc
		Owner: nod
	Mobile:
		ROT: 7	
		Speed: 8
	Health:
		HP: 300
	Armor:
		Type: Heavy
	RevealsShroud:
		Range: 6
	Turreted:
		ROT: 5
	Armament:
		Weapon: 70mm
		Recoil: 85
		RecoilRecovery: 17
		LocalOffset: -128,0,85
	AttackTurreted:
	RenderUnit:
	WithTurret:
	AutoTarget:
	LeavesHusk:
		HuskActor: LTNK.Husk
	Explodes:
		Weapon: UnitExplodeSmall
		EmptyWeapon: UnitExplodeSmall

Code: Select all

ttnk:
	idle:
Attachments
ttnktur.zip
(21.9 KiB) Downloaded 433 times

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

Heyho,

you need to define barrel and turret in your voxels.yaml!

Look:

Code: Select all

ctnk:
	idle:plasmatank
	turret:plasmatanktur
	barrel:mmchbarl
Hail to the soviets!

User avatar
secret
Posts: 62
Joined: Fri Aug 03, 2007 1:53 pm

Post by secret »

Doesn't work. I've put the voxel in local.mix, then I took care to have the modified local.mix in tibsun.mix. The HVA file is fine.

Don't really know what I screwed up.

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

You'll also need to add the WithVoxelTurret and WithVoxelBarrel traits.
The clipping is strange - it doesn't occur with any of the default WW voxels I have tested (which was most of the TS units and a few RA2).
I wouldn't be surprised if the custom editors are taking liberties with the voxel file format, and I also wouldn't be surprised if i missed something important in our loading/rendering code. I'll need to investigate this in more detail when I have some free time.

User avatar
secret
Posts: 62
Joined: Fri Aug 03, 2007 1:53 pm

Post by secret »

Sleipnir wrote: You'll also need to add the WithVoxelTurret and WithVoxelBarrel traits.
The clipping is strange - it doesn't occur with any of the default WW voxels I have tested (which was most of the TS units and a few RA2).
I wouldn't be surprised if the custom editors are taking liberties with the voxel file format, and I also wouldn't be surprised if i missed something important in our loading/rendering code. I'll need to investigate this in more detail when I have some free time.
It works now, however it doesn't load the HVA properly, even if the HVA is correct :|
The clipping occurs on the voxel (the selection box cuts the voxel graphic), but it also occurs as missing colors on other voxels, and sometimes the voxel disappears and it's replaced by 2 intersecting semi-translucent black planes. It's weird. Indeed, I've seen this clipping happening mostly to the CNC mod shellmap, so it might be due to the black and white effect, but I'm no C++/C# expert.

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

Funny,

i got about 12 voxels ingame and none are clipping!

Btw: How is the redalert2 pallette called?

A quick reference-table would be nice for:
RA2 Voxel
RA2 Shp
TS Shp
Hail to the soviets!

sillyflip
Posts: 5
Joined: Tue Mar 20, 2012 2:48 am

cncVoxels

Post by sillyflip »

With OpenRA supporting voxels now I was wondering what the CNC mod would look like if I replaced the shps with their voxel equivalent. So after taking a look at Sleipnir’s Voxeldemo, I quickly put this together. The game plays same except for a few changes to the MRLS and Artillery. I didn't change the MCV or Harvester since their TS voxels look nothing like TD counterparts. The Apache and Chinook remain the same since I can’t get their rotor animation to work.

For installing the mod, the instructions are the same as Sleipnirs Voxeldemo.
https://www.dropbox.com/s/odey7vmgmu0mvhg/cncVoxel.zip

Some screen shots.
http://imgur.com/Q7W3lOK
http://imgur.com/JYMkmZv
http://imgur.com/p1O8FQ5
Last edited by sillyflip on Fri Jul 19, 2013 6:34 am, edited 1 time in total.

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

That looks really cool sillyflip. Here's a few suggestions:
  • If you add unittem.pal to the bits directory you could remove the dependencies on the ts mix files which would make it much easier to install.
  • You can also change MHOW to use WithVoxelBarrel and define Recoil and RecoilRecovery on the armament to make the barrel recoil when it fires.
  • Everything in ts is about 33% bigger than C&C, so setting Scale: 7.5 should keep the units inside the cell boundary.
  • You can play with LightAmbientColor and LightDiffuseColor to improve the lighting. I would start with maybe LightAmbientColor: 0.5, 0.5, 0.5 to make everything a bit darker.

sillyflip
Posts: 5
Joined: Tue Mar 20, 2012 2:48 am

Post by sillyflip »

Ok I followed Slephnir's suggestions and did the following
  • Added unittem.pal.
  • Reduce the size of most of the units.
  • Nod's Artillery works like the original again, also the barrel will recoil now.
  • Applied LightAmbientColor and LightDiffuseColor to all voxels, though I still have to ticker a bit with the values more.
I also added the Orca, Apache, and Chinook. (using rotors.shp for the rotors). They look ok...
http://i.imgur.com/4naN240.png
Download
https://dl.dropboxusercontent.com/u/390 ... el0727.zip
Just unzip it to the OpenRA mods folder.

xan2622
Posts: 80
Joined: Fri Mar 15, 2013 9:27 pm

Post by xan2622 »

I tried to load the mod but it makes OpenRA (playtest 20130804) crash (I couldn't even start the mod).

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Better try latest bleed. It comes with a Tiberian Sun test mod.

sillyflip
Posts: 5
Joined: Tue Mar 20, 2012 2:48 am

Post by sillyflip »

Updated to work with the latest playtest.

https://dl.dropboxusercontent.com/u/390 ... el0806.zip

Post Reply