Voxels

Information and discussion for custom maps and mods.
User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Voxels

Post by Petrenko »

Heyho,

could anyone upload a voxel-example-mod for the currtent build?

Thanks in advance!
Hail to the soviets!

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

Post by Matt »

https://github.com/pchote/OpenRA/compar ... .voxeldemo

and

https://github.com/Mailaender/OpenRA/co ... berian-sun which will soon have Voxel vehicles once I finished infantry and building sequences.

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

Post by Petrenko »

What do i do with this?
Hail to the soviets!

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

Post by secret »

You check out the code, and try to replicate it.

Another thing I haven't seen, really: Will the voxel support include custom .VPL support? Would be really nice and useful.

http://www.ppmsite.com/forum/viewtopic. ... ls&t=30026

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

Post by Sleipnir »

Petrenko: You can download the yaml files into a mods/voxeldemo directory then run it or read it as an example.

secret: OpenRA doesn't use VPLs at all. If modenc is accurate, they are only used to resolve normal-resolved colors back to a palette entry. OpenRA does this calculation on the GPU and isn't constrained by mapping them back to the restricted palette.

That PPM thread requires an account to view, and apparently i'm a bot because despite my best efforts I couldn't get past their captcha code when trying to register a new account :(

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

Post by Petrenko »

Alright,

i worked everything in even found out that you got to extract cache.mix conquer.mix (and rename it to ts_conquer.mix) and local.mix. (i hope they will be soon autodownloadable)

now i get this exception. im running latest playtest:

Exception of type `System.Reflection.TargetInvocationException`: Ein Aufrufziel hat einen Ausnahmefehler verursacht.
Inner Exception of type `System.IO.InvalidDataException`: Cannot find widget with Id `LOBBY_PLAYER_BIN`
bei OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, String w)
bei OpenRA.Widgets.Ui.LoadWidget(String id, Widget parent, WidgetArgs args)
bei OpenRA.Widgets.Ui.LoadWidget[T](String id, Widget parent, WidgetArgs args)
bei OpenRA.Mods.RA.Widgets.Logic.LobbyLogic..ctor(Widget widget, World world, OrderManager orderManager, Action onExit, Action onStart, Boolean addBots)
bei System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
bei System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
bei System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei OpenRA.ObjectCreator.CreateUsingArgs(ConstructorInfo ctor, Dictionary`2 args)
bei OpenRA.ObjectCreator.CreateObject[T](String className, Dictionary`2 args)
bei OpenRA.Widgets.Widget.PostInit(WidgetArgs args)
bei OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
bei OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, String w)
bei OpenRA.Widgets.Ui.OpenWindow(String id, WidgetArgs args)
bei OpenRA.Game.OpenWindow(String widget, WidgetArgs args)
bei OpenRA.Mods.Cnc.Widgets.Logic.CncMenuLogic.OpenLobbyPanel(MenuType menu, Boolean addBots)
bei OpenRA.Mods.Cnc.Widgets.Logic.CncMenuLogic.<OpenGamePanel>m__D2()
bei OpenRA.Mods.RA.Widgets.Logic.ConnectionLogic.ConnectionStateChanged(OrderManager om)
bei System.Action`1.Invoke(T obj)
bei OpenRA.Game.Tick(OrderManager orderManager, Viewport viewPort)
bei OpenRA.Game.Run()
bei OpenRA.Program.Run(String[] args)
bei OpenRA.Program.Main(String[] args)
Hail to the soviets!

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

Post by Matt »

You are probably missing a lobby*.yaml listed in mod.yaml's Chrome section. Check the official mods. They are always up-to-date with the latest refactorings.

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

Post by secret »

Sleipnir wrote: secret: OpenRA doesn't use VPLs at all. If modenc is accurate, they are only used to resolve normal-resolved colors back to a palette entry. OpenRA does this calculation on the GPU and isn't constrained by mapping them back to the restricted palette.

That PPM thread requires an account to view, and apparently i'm a bot because despite my best efforts I couldn't get past their captcha code when trying to register a new account :(
If you want, I can PM you my PPM ID and password. Could you try one more time before I post a topic regarding this issue?

The thread features the main ideas, but also how some members created their own VPL files, and they render the voxels in quite a nice manner (one of them of Apollo).

The VPL acts like some sort of shader, if you're familiar with the term. The GPU may render the voxel, but the VPL file helps the game render the voxel in a particular manner, making some palette sections more bright, some of them darker, and so on.
Thing is, many voxels depend on normals, and to change the voxel philosophy of the entire community isn't too easy (this means that voxellers ought to create a new palette file, and each voxeller has a different style. Also, IIRC a .VPL file has more values (?) than a .PAL file.)
It's a big discussion.

EDIT: Another thing: is a TS mod in the works right now? Just out of curiosity.

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

Post by Matt »

secret wrote: EDIT: Another thing: is a TS mod in the works right now? Just out of curiosity.
I am currently setting up the infantry sequences.

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

Post by Sleipnir »

secret wrote: If you want, I can PM you my PPM ID and password. Could you try one more time before I post a topic regarding this issue?

The thread features the main ideas, but also how some members created their own VPL files, and they render the voxels in quite a nice manner (one of them of Apollo).
Nah, it's alright. Giving out your account details to people over the internet is generally a bad idea :)
secret wrote: The VPL acts like some sort of shader, if you're familiar with the term. The GPU may render the voxel, but the VPL file helps the game render the voxel in a particular manner, making some palette sections more bright, some of them darker, and so on.
Thing is, many voxels depend on normals, and to change the voxel philosophy of the entire community isn't too easy (this means that voxellers ought to create a new palette file, and each voxeller has a different style. Also, IIRC a .VPL file has more values (?) than a .PAL file.)
Yup, we do this in a fragment shader on the GPU (see vxl.frag). The difference is that we draw these modified colors directly to the screen instead of mapping them back into the palette entries defined by the vpl.
As long as people aren't abusing voxel.vpl to do non-normal calculations this should give us better looking results than RA2/TS.
secret wrote: EDIT: Another thing: is a TS mod in the works right now? Just out of curiosity.
That is the long term plan, but there is a lot more engine work to do before we will have something playable.

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

Post by secret »

Sleipnir wrote:
secret wrote: The VPL acts like some sort of shader, if you're familiar with the term. The GPU may render the voxel, but the VPL file helps the game render the voxel in a particular manner, making some palette sections more bright, some of them darker, and so on.
Thing is, many voxels depend on normals, and to change the voxel philosophy of the entire community isn't too easy (this means that voxellers ought to create a new palette file, and each voxeller has a different style. Also, IIRC a .VPL file has more values (?) than a .PAL file.)
Yup, we do this in a fragment shader on the GPU (see vxl.frag). The difference is that we draw these modified colors directly to the screen instead of mapping them back into the palette entries defined by the vpl.
As long as people aren't abusing voxel.vpl to do non-normal calculations this should give us better looking results than RA2/TS.
Thing is, some people profited of the modability the VPL came with, and got used with the system. Some voxels may not look as good as they do with vanilla RA2/TS.
But then, it's your project, not mine, and I respect that, you already have done a lot for the community. :)

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

Post by Sleipnir »

secret wrote: Thing is, some people profited of the modability the VPL came with, and got used with the system. Some voxels may not look as good as they do with vanilla RA2/TS.
You should test some of these ingame, and if the existing parameters (the ambient and diffuse light can be set per actor type) aren't sufficient we can look into adjusting the renderer to support them.

I have attached an updated voxeltest mod for playtest-20130713-2.
You will need to copy tibsun.mix to <content dir>/Content/ts/tibsun.mix, and extract cache.mix and conquer.mix to ts_cache.mix and ts_conquer.mix in the same directory.
Attachments
voxeltest.zip
(15.1 KiB) Downloaded 505 times

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

Post by secret »

Thanks!

I've attached an updated mod.yaml, so that the voxeltest mod would actually work and be playable in-game, for those who want to play a bit with the code. I've played with Nod, and didn't have issues.
Attachments
mod.zip
(1.11 KiB) Downloaded 514 times

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

Post by secret »

Another thing: I tried replacing the Tick Tank with a different voxel, but I got this weird bug. I really can't have a good grasp on what went wrong out of the code:

Code: Select all

LTNK&#58;
	-RenderUnit&#58;
	-WithTurret&#58;
	RenderSprites&#58;
	RenderVoxels&#58;
		Image&#58;ttnk
		PlayerPalette&#58;tibsun
	WithVoxelBody&#58;
Attachments
woops.PNG
woops.PNG (556.72 KiB) Viewed 16047 times

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

Post by Petrenko »

Heyho,

i wanted to add a new voxel.

I downloaded a TS-Voxel.

Put it into /voxeltest/bits

Told the mod.yaml to also look for "/voxeltest/bits"

I added the voxel to voxels.yaml

I got this errorlog:

Code: Select all

Exception of type `System.InvalidOperationException`&#58; Unit `renart` does not have any voxels defined.
   bei OpenRA.Graphics.VoxelProvider.GetVoxel&#40;String unitName, String voxelName&#41;
   bei OpenRA.Mods.RA.Render.WithVoxelBody..ctor&#40;Actor self&#41;
   bei OpenRA.Mods.RA.Render.WithVoxelBodyInfo.Create&#40;ActorInitializer init&#41;
   bei OpenRA.Actor..ctor&#40;World world, String name, TypeDictionary initDict&#41;
   bei OpenRA.World.CreateActor&#40;Boolean addToWorld, String name, TypeDictionary initDict&#41;
   bei OpenRA.World.CreateActor&#40;String name, TypeDictionary initDict&#41;
   bei OpenRA.Mods.RA.SpawnMapActors.WorldLoaded&#40;World world&#41;
   bei OpenRA.World..ctor&#40;Manifest manifest, Map map, OrderManager orderManager, Boolean isShellmap&#41;
   bei OpenRA.Game.StartGame&#40;String mapUID, Boolean isShellmap&#41;
   bei OpenRA.Game.LoadShellMap&#40;&#41;
   bei OpenRA.Mods.Cnc.CncLoadScreen.TestAndContinue&#40;&#41;
   bei OpenRA.Mods.Cnc.CncLoadScreen.StartGame&#40;&#41;
   bei OpenRA.Game.InitializeWithMods&#40;String&#91;&#93; mods&#41;
   bei OpenRA.Game.Initialize&#40;Arguments args&#41;
   bei OpenRA.Program.Run&#40;String&#91;&#93; args&#41;
   bei OpenRA.Program.Main&#40;String&#91;&#93; args&#41;
Hail to the soviets!

Post Reply